@customafk/lunas-ui 0.0.87 → 0.0.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{button-zbSZ1PXx.d.cts → button-BcvUtvUx.d.cts} +6 -6
- package/dist/{button-DXD8syDx.d.ts → button-C15dJ7DD.d.ts} +6 -6
- package/dist/cards/simple-card.d.cts +2 -2
- package/dist/{command-BptWQgxm.d.cts → command-CjM13Tvj.d.cts} +12 -12
- package/dist/{command-Bl2Bn5Xm.d.ts → command-DSoZmOak.d.ts} +12 -12
- package/dist/data-display/empty.d.cts +2 -2
- package/dist/data-display/empty.d.ts +2 -2
- package/dist/data-display/statistic.d.cts +2 -2
- package/dist/data-display/statistic.d.ts +2 -2
- package/dist/{dialog-CIrv1yaX.d.cts → dialog-FTlFnjJF.d.cts} +12 -12
- package/dist/{dialog-CR4RsiTw.d.ts → dialog-l2nFk0v1.d.ts} +12 -12
- package/dist/dialogs/detail-dialog/component/sidebar.d.cts +4 -4
- package/dist/dialogs/detail-dialog/component/sidebar.d.ts +4 -4
- package/dist/dialogs/form-dialog.d.ts +2 -2
- package/dist/forms/combobox-field.d.cts +2 -2
- package/dist/forms/combobox-field.d.ts +2 -2
- package/dist/forms/date-field.d.cts +2 -2
- package/dist/forms/date-field.d.ts +2 -2
- package/dist/forms/form-wrapper.d.cts +2 -2
- package/dist/forms/form-wrapper.d.ts +2 -2
- package/dist/forms/multi-select-field.d.cts +2 -2
- package/dist/forms/multi-select-field.d.ts +2 -2
- package/dist/forms/number-field.d.cts +2 -2
- package/dist/forms/number-field.d.ts +2 -2
- package/dist/forms/password-field.d.cts +2 -2
- package/dist/forms/password-field.d.ts +2 -2
- package/dist/forms/select-field.d.cts +2 -2
- package/dist/forms/select-field.d.ts +2 -2
- package/dist/forms/switch-field.d.cts +2 -2
- package/dist/forms/switch-field.d.ts +2 -2
- package/dist/forms/text-field.d.cts +2 -2
- package/dist/forms/text-field.d.ts +2 -2
- package/dist/forms/textarea-field.d.cts +2 -2
- package/dist/forms/textarea-field.d.ts +2 -2
- package/dist/{input-CS7_55O1.d.ts → input-BFZu6Cb8.d.cts} +3 -3
- package/dist/{input-DLDrpv_G.d.cts → input-C3yhFrhm.d.ts} +3 -3
- package/dist/label-BaRuPui8.d.cts +11 -0
- package/dist/label-DSlGeKZK.d.ts +11 -0
- package/dist/layouts/app-layout/index.d.cts +5 -5
- package/dist/layouts/app-layout/index.d.ts +5 -5
- package/dist/layouts/flex.d.cts +3 -3
- package/dist/layouts/flex.d.ts +3 -3
- package/dist/layouts/service-layout/index.cjs +1 -1
- package/dist/layouts/service-layout/index.cjs.map +1 -1
- package/dist/layouts/service-layout/index.d.cts +6 -5
- package/dist/layouts/service-layout/index.d.ts +6 -5
- package/dist/layouts/service-layout/index.js +1 -1
- package/dist/layouts/service-layout/index.js.map +1 -1
- package/dist/pages/FeatureDeveloping.d.ts +2 -2
- package/dist/pages/FeatureFixing.d.ts +2 -2
- package/dist/pages/NotAuthorized.d.cts +2 -2
- package/dist/pages/NotAuthorized.d.ts +2 -2
- package/dist/pages/NotFound.d.cts +2 -2
- package/dist/pages/NotFound.d.ts +2 -2
- package/dist/products/product-quantity-control.d.cts +2 -2
- package/dist/products/product-quantity-control.d.ts +2 -2
- package/dist/{separator-D2SRPIPb.d.ts → separator-37DVXMoq.d.ts} +3 -3
- package/dist/{separator-DT79vOG-.d.cts → separator-CM1kQQxq.d.cts} +3 -3
- package/dist/table/index.d.cts +2 -2
- package/dist/table/index.d.ts +2 -2
- package/dist/{toggle-yj_7u1YA.d.ts → toggle-CIqx9KlR.d.ts} +5 -5
- package/dist/{toggle-BvgvHcLZ.d.cts → toggle-DTyO_oae.d.cts} +3 -3
- package/dist/{tooltip-COc6T2mf.d.ts → tooltip-C5kKsbnD.d.ts} +6 -6
- package/dist/{tooltip-DZhGbm64.d.cts → tooltip-etV38FoO.d.cts} +6 -6
- package/dist/typography/paragraph.d.cts +2 -2
- package/dist/typography/paragraph.d.ts +2 -2
- package/dist/typography/title.d.cts +2 -2
- package/dist/typography/title.d.ts +2 -2
- package/dist/ui/alert-dialog.d.cts +12 -12
- package/dist/ui/alert-dialog.d.ts +12 -12
- package/dist/ui/alert.d.cts +7 -7
- package/dist/ui/alert.d.ts +7 -7
- package/dist/ui/aspect-ratio.d.cts +2 -2
- package/dist/ui/aspect-ratio.d.ts +2 -2
- package/dist/ui/avatar.d.cts +4 -4
- package/dist/ui/avatar.d.ts +4 -4
- package/dist/ui/badge.d.cts +5 -5
- package/dist/ui/badge.d.ts +5 -5
- package/dist/ui/breadcrumb.d.cts +8 -8
- package/dist/ui/breadcrumb.d.ts +8 -8
- package/dist/ui/button-group.d.cts +7 -7
- package/dist/ui/button-group.d.ts +7 -7
- package/dist/ui/button.d.cts +1 -1
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/calendar.d.cts +4 -4
- package/dist/ui/calendar.d.ts +4 -4
- package/dist/ui/card.d.cts +8 -8
- package/dist/ui/card.d.ts +8 -8
- package/dist/ui/carousel.d.cts +7 -7
- package/dist/ui/carousel.d.ts +7 -7
- package/dist/ui/collapsible.d.cts +4 -4
- package/dist/ui/collapsible.d.ts +4 -4
- package/dist/ui/command.d.cts +2 -2
- package/dist/ui/command.d.ts +2 -2
- package/dist/ui/context-menu.d.cts +16 -16
- package/dist/ui/context-menu.d.ts +16 -16
- package/dist/ui/dialog.d.cts +1 -1
- package/dist/ui/dialog.d.ts +1 -1
- package/dist/ui/drawer.d.cts +11 -11
- package/dist/ui/drawer.d.ts +11 -11
- package/dist/ui/dropdown-menu.d.cts +16 -16
- package/dist/ui/dropdown-menu.d.ts +16 -16
- package/dist/ui/empty.d.cts +9 -9
- package/dist/ui/empty.d.ts +9 -9
- package/dist/ui/field.d.cts +14 -14
- package/dist/ui/field.d.ts +14 -14
- package/dist/ui/file-uploader.d.cts +2 -2
- package/dist/ui/file-uploader.d.ts +2 -2
- package/dist/ui/form.d.cts +7 -7
- package/dist/ui/form.d.ts +7 -7
- package/dist/ui/hover-card.d.cts +4 -4
- package/dist/ui/hover-card.d.ts +4 -4
- package/dist/ui/input-otp.d.cts +5 -5
- package/dist/ui/input-otp.d.ts +5 -5
- package/dist/ui/input.d.cts +1 -1
- package/dist/ui/input.d.ts +1 -1
- package/dist/ui/inputs/search-input.d.cts +3 -3
- package/dist/ui/inputs/search-input.d.ts +3 -3
- package/dist/ui/item.d.cts +15 -15
- package/dist/ui/item.d.ts +15 -15
- package/dist/ui/label.d.cts +1 -1
- package/dist/ui/label.d.ts +1 -1
- package/dist/ui/menubar.d.cts +17 -17
- package/dist/ui/menubar.d.ts +17 -17
- package/dist/ui/multi-select.d.cts +2 -2
- package/dist/ui/multi-select.d.ts +2 -2
- package/dist/ui/navigation-menu.d.cts +9 -9
- package/dist/ui/navigation-menu.d.ts +11 -11
- package/dist/ui/pagination.d.cts +9 -9
- package/dist/ui/pagination.d.ts +9 -9
- package/dist/ui/popover.d.cts +5 -5
- package/dist/ui/popover.d.ts +5 -5
- package/dist/ui/progress.d.cts +2 -2
- package/dist/ui/progress.d.ts +2 -2
- package/dist/ui/radio-group.d.cts +3 -3
- package/dist/ui/radio-group.d.ts +3 -3
- package/dist/ui/resizable.d.cts +4 -4
- package/dist/ui/resizable.d.ts +4 -4
- package/dist/ui/scroll-area.d.ts +3 -3
- package/dist/ui/select.d.cts +11 -11
- package/dist/ui/select.d.ts +11 -11
- package/dist/ui/separator.d.cts +1 -1
- package/dist/ui/separator.d.ts +1 -1
- package/dist/ui/sheet.d.cts +9 -9
- package/dist/ui/sheet.d.ts +9 -9
- package/dist/ui/sidebar.d.cts +28 -28
- package/dist/ui/sidebar.d.ts +30 -30
- package/dist/ui/skeleton.d.cts +2 -2
- package/dist/ui/skeleton.d.ts +2 -2
- package/dist/ui/slider.d.cts +2 -2
- package/dist/ui/slider.d.ts +2 -2
- package/dist/ui/sonner.d.cts +2 -2
- package/dist/ui/sonner.d.ts +2 -2
- package/dist/ui/spinner.d.cts +2 -2
- package/dist/ui/spinner.d.ts +2 -2
- package/dist/ui/switch.d.cts +2 -2
- package/dist/ui/switch.d.ts +2 -2
- package/dist/ui/table.d.cts +9 -9
- package/dist/ui/table.d.ts +9 -9
- package/dist/ui/tabs.d.cts +5 -5
- package/dist/ui/tabs.d.ts +5 -5
- package/dist/ui/textarea.d.cts +2 -2
- package/dist/ui/textarea.d.ts +2 -2
- package/dist/ui/toggle-group.d.cts +4 -4
- package/dist/ui/toggle-group.d.ts +4 -4
- package/dist/ui/toggle.d.cts +1 -1
- package/dist/ui/toggle.d.ts +1 -1
- package/dist/ui/tooltip.d.cts +1 -1
- package/dist/ui/tooltip.d.ts +1 -1
- package/package.json +1 -1
- package/dist/label--TdJBouf.d.ts +0 -11
- package/dist/label-SHy8Jh_r.d.cts +0 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime9 from "react/jsx-runtime";
|
|
2
2
|
import { FieldPath, FieldValues } from "react-hook-form";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/forms/switch-field.d.ts
|
|
@@ -15,7 +15,7 @@ declare const SwitchField: <TFieldValues extends FieldValues = FieldValues>({
|
|
|
15
15
|
className,
|
|
16
16
|
description,
|
|
17
17
|
isShowErrorMsg
|
|
18
|
-
}: Props<TFieldValues>) =>
|
|
18
|
+
}: Props<TFieldValues>) => react_jsx_runtime9.JSX.Element;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { SwitchField };
|
|
21
21
|
//# sourceMappingURL=switch-field.d.cts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime87 from "react/jsx-runtime";
|
|
2
2
|
import { FieldPath, FieldValues } from "react-hook-form";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/forms/switch-field.d.ts
|
|
@@ -15,7 +15,7 @@ declare const SwitchField: <TFieldValues extends FieldValues = FieldValues>({
|
|
|
15
15
|
className,
|
|
16
16
|
description,
|
|
17
17
|
isShowErrorMsg
|
|
18
|
-
}: Props<TFieldValues>) =>
|
|
18
|
+
}: Props<TFieldValues>) => react_jsx_runtime87.JSX.Element;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { SwitchField };
|
|
21
21
|
//# sourceMappingURL=switch-field.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime7 from "react/jsx-runtime";
|
|
2
2
|
import { FieldPath, FieldValues } from "react-hook-form";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/forms/text-field.d.ts
|
|
@@ -25,7 +25,7 @@ declare const TextField: <TFieldValues extends FieldValues = FieldValues>({
|
|
|
25
25
|
description,
|
|
26
26
|
className,
|
|
27
27
|
onValueChange
|
|
28
|
-
}: Props<TFieldValues>) =>
|
|
28
|
+
}: Props<TFieldValues>) => react_jsx_runtime7.JSX.Element;
|
|
29
29
|
//#endregion
|
|
30
30
|
export { TextField };
|
|
31
31
|
//# sourceMappingURL=text-field.d.cts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime108 from "react/jsx-runtime";
|
|
2
2
|
import { FieldPath, FieldValues } from "react-hook-form";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/forms/text-field.d.ts
|
|
@@ -25,7 +25,7 @@ declare const TextField: <TFieldValues extends FieldValues = FieldValues>({
|
|
|
25
25
|
description,
|
|
26
26
|
className,
|
|
27
27
|
onValueChange
|
|
28
|
-
}: Props<TFieldValues>) =>
|
|
28
|
+
}: Props<TFieldValues>) => react_jsx_runtime108.JSX.Element;
|
|
29
29
|
//#endregion
|
|
30
30
|
export { TextField };
|
|
31
31
|
//# sourceMappingURL=text-field.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime12 from "react/jsx-runtime";
|
|
2
2
|
import { FieldPath, FieldValues } from "react-hook-form";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/forms/textarea-field.d.ts
|
|
@@ -21,7 +21,7 @@ declare const TextareaField: <TFieldValues extends FieldValues = FieldValues>({
|
|
|
21
21
|
description,
|
|
22
22
|
rows,
|
|
23
23
|
onValueChange
|
|
24
|
-
}: Props<TFieldValues>) =>
|
|
24
|
+
}: Props<TFieldValues>) => react_jsx_runtime12.JSX.Element;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { TextareaField };
|
|
27
27
|
//# sourceMappingURL=textarea-field.d.cts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime107 from "react/jsx-runtime";
|
|
2
2
|
import { FieldPath, FieldValues } from "react-hook-form";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/forms/textarea-field.d.ts
|
|
@@ -21,7 +21,7 @@ declare const TextareaField: <TFieldValues extends FieldValues = FieldValues>({
|
|
|
21
21
|
description,
|
|
22
22
|
rows,
|
|
23
23
|
onValueChange
|
|
24
|
-
}: Props<TFieldValues>) =>
|
|
24
|
+
}: Props<TFieldValues>) => react_jsx_runtime107.JSX.Element;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { TextareaField };
|
|
27
27
|
//# sourceMappingURL=textarea-field.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime85 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region packages/components/ui/input.d.ts
|
|
4
4
|
declare function Input({
|
|
@@ -8,7 +8,7 @@ declare function Input({
|
|
|
8
8
|
...props
|
|
9
9
|
}: React.ComponentProps<'input'> & {
|
|
10
10
|
onValueChange?: (value: string) => void;
|
|
11
|
-
}):
|
|
11
|
+
}): react_jsx_runtime85.JSX.Element;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { Input };
|
|
14
|
-
//# sourceMappingURL=input-
|
|
14
|
+
//# sourceMappingURL=input-BFZu6Cb8.d.cts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime242 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region packages/components/ui/input.d.ts
|
|
4
4
|
declare function Input({
|
|
@@ -8,7 +8,7 @@ declare function Input({
|
|
|
8
8
|
...props
|
|
9
9
|
}: React.ComponentProps<'input'> & {
|
|
10
10
|
onValueChange?: (value: string) => void;
|
|
11
|
-
}):
|
|
11
|
+
}): react_jsx_runtime242.JSX.Element;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { Input };
|
|
14
|
-
//# sourceMappingURL=input-
|
|
14
|
+
//# sourceMappingURL=input-C3yhFrhm.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react_jsx_runtime100 from "react/jsx-runtime";
|
|
2
|
+
import { Label } from "radix-ui";
|
|
3
|
+
|
|
4
|
+
//#region packages/components/ui/label.d.ts
|
|
5
|
+
declare function Label$1({
|
|
6
|
+
className,
|
|
7
|
+
...props
|
|
8
|
+
}: React.ComponentProps<typeof Label.Root>): react_jsx_runtime100.JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Label$1 as Label };
|
|
11
|
+
//# sourceMappingURL=label-BaRuPui8.d.cts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react_jsx_runtime265 from "react/jsx-runtime";
|
|
2
|
+
import { Label } from "radix-ui";
|
|
3
|
+
|
|
4
|
+
//#region packages/components/ui/label.d.ts
|
|
5
|
+
declare function Label$1({
|
|
6
|
+
className,
|
|
7
|
+
...props
|
|
8
|
+
}: React.ComponentProps<typeof Label.Root>): react_jsx_runtime265.JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Label$1 as Label };
|
|
11
|
+
//# sourceMappingURL=label-DSlGeKZK.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Button } from "../../button-
|
|
2
|
-
import { Separator } from "../../separator-
|
|
3
|
-
import { TooltipContent } from "../../tooltip-
|
|
1
|
+
import { Button } from "../../button-BcvUtvUx.cjs";
|
|
2
|
+
import { Separator } from "../../separator-CM1kQQxq.cjs";
|
|
3
|
+
import { TooltipContent } from "../../tooltip-etV38FoO.cjs";
|
|
4
4
|
import * as react_jsx_runtime326 from "react/jsx-runtime";
|
|
5
|
-
import * as
|
|
5
|
+
import * as class_variance_authority_types13 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
|
|
@@ -104,7 +104,7 @@ declare function AppLayoutSidebarMenuItem({
|
|
|
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_types13.ClassProp) | undefined) => string;
|
|
108
108
|
declare function AppLayoutSidebarMenuButton({
|
|
109
109
|
asChild,
|
|
110
110
|
isActive,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Button } from "../../button-
|
|
2
|
-
import { Separator } from "../../separator-
|
|
3
|
-
import { TooltipContent } from "../../tooltip-
|
|
1
|
+
import { Button } from "../../button-C15dJ7DD.js";
|
|
2
|
+
import { Separator } from "../../separator-37DVXMoq.js";
|
|
3
|
+
import { TooltipContent } from "../../tooltip-C5kKsbnD.js";
|
|
4
4
|
import * as react_jsx_runtime304 from "react/jsx-runtime";
|
|
5
5
|
import { VariantProps } from "class-variance-authority";
|
|
6
|
-
import * as
|
|
6
|
+
import * as class_variance_authority_types12 from "class-variance-authority/types";
|
|
7
7
|
|
|
8
8
|
//#region packages/components/layouts/app-layout/sidebar.d.ts
|
|
9
9
|
type SidebarContextProps = {
|
|
@@ -104,7 +104,7 @@ declare function AppLayoutSidebarMenuItem({
|
|
|
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_types12.ClassProp) | undefined) => string;
|
|
108
108
|
declare function AppLayoutSidebarMenuButton({
|
|
109
109
|
asChild,
|
|
110
110
|
isActive,
|
package/dist/layouts/flex.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime14 from "react/jsx-runtime";
|
|
2
2
|
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
3
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
|
|
@@ -9,7 +9,7 @@ declare const flexVariants: (props?: ({
|
|
|
9
9
|
wrap?: boolean | null | undefined;
|
|
10
10
|
margin?: "sm" | "md" | "lg" | "xl" | "none" | null | undefined;
|
|
11
11
|
padding?: "sm" | "md" | "lg" | "xl" | "none" | null | undefined;
|
|
12
|
-
gap?: "
|
|
12
|
+
gap?: "sm" | "md" | "lg" | "xl" | "none" | "xs" | null | undefined;
|
|
13
13
|
justify?: "start" | "center" | "end" | "between" | "around" | "evenly" | "stretch" | null | undefined;
|
|
14
14
|
align?: "start" | "center" | "end" | "stretch" | "baseline" | null | undefined;
|
|
15
15
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
@@ -27,7 +27,7 @@ declare const Flex: ({
|
|
|
27
27
|
align,
|
|
28
28
|
className,
|
|
29
29
|
children
|
|
30
|
-
}: React.PropsWithChildren<Props>) =>
|
|
30
|
+
}: React.PropsWithChildren<Props>) => react_jsx_runtime14.JSX.Element;
|
|
31
31
|
//#endregion
|
|
32
32
|
export { Flex };
|
|
33
33
|
//# sourceMappingURL=flex.d.cts.map
|
package/dist/layouts/flex.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
4
4
|
|
|
@@ -9,7 +9,7 @@ declare const flexVariants: (props?: ({
|
|
|
9
9
|
wrap?: boolean | null | undefined;
|
|
10
10
|
margin?: "sm" | "md" | "lg" | "xl" | "none" | null | undefined;
|
|
11
11
|
padding?: "sm" | "md" | "lg" | "xl" | "none" | null | undefined;
|
|
12
|
-
gap?: "
|
|
12
|
+
gap?: "sm" | "md" | "lg" | "xl" | "none" | "xs" | null | undefined;
|
|
13
13
|
justify?: "start" | "center" | "end" | "between" | "around" | "evenly" | "stretch" | null | undefined;
|
|
14
14
|
align?: "start" | "center" | "end" | "stretch" | "baseline" | null | undefined;
|
|
15
15
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
@@ -27,7 +27,7 @@ declare const Flex: ({
|
|
|
27
27
|
align,
|
|
28
28
|
className,
|
|
29
29
|
children
|
|
30
|
-
}: React.PropsWithChildren<Props>) =>
|
|
30
|
+
}: React.PropsWithChildren<Props>) => react_jsx_runtime0.JSX.Element;
|
|
31
31
|
//#endregion
|
|
32
32
|
export { Flex };
|
|
33
33
|
//# sourceMappingURL=flex.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(`../../chunk-CUT6urMc.cjs`);require(`../../dist-CAevLI5t.cjs`),require(`../../button-variants-BHDyMRNh.cjs`);const t=require(`../../button-BCahPWI8.cjs`),n=require(`../../card-CkKO-0o0.cjs`);require(`../../skeleton-BC2E_ohw.cjs`);const r=require(`../../image-C0mClPAY.cjs`),i=require(`../../tooltip-uaF-pxx8.cjs`),a=require(`../../avatar-DmMCBvb6.cjs`),o=require(`../../separator-DMMoR-d2.cjs`),s=require(`../../dialog-BBODhbxh.cjs`),c=require(`../../drawer-C3vvvU_D.cjs`),l=require(`../../input-D_tClptL.cjs`),u=require(`../../tabs-CtTEY1sg.cjs`),d=require(`../../dropdown-menu-C3SGlEd2.cjs`),f=require(`../../scroll-area-CcLtG_m0.cjs`),p=require(`../../sheet-DueP7VvE.cjs`);let m=require(`lucide-react`);m=e.__toESM(m);let h=require(`@customafk/react-toolkit/utils`);h=e.__toESM(h);let g=require(`react`);g=e.__toESM(g);let _=require(`react/jsx-runtime`);_=e.__toESM(_);let v=require(`class-variance-authority`);v=e.__toESM(v);let y=require(`radix-ui`);y=e.__toESM(y);let b=require(`@customafk/react-toolkit/hooks/useMediaQuery`);b=e.__toESM(b);let x=require(`@customafk/react-toolkit/hooks/useDebounceCallback`);x=e.__toESM(x);let S=require(`@react-oauth/google`);S=e.__toESM(S);let C=require(`@customafk/react-toolkit/hooks/useMobile`);C=e.__toESM(C);const w=(0,g.createContext)(null),T=()=>{let e=(0,g.useContext)(w);if(!e)throw Error(`useServiceLayoutContext must be used within a ServiceLayoutProvider`);return e},E=({type:e,productUuid:i,variantUuid:a,productName:o,variantName:s,imageUrl:c,optionValue:u,optionTitle:d,quantity:f,price:p})=>{let{onDeletingCart:h,onUpdatingCart:v}=T(),[y,b]=(0,g.useState)(f),[S,C]=(0,g.useState)(!1),w=(0,g.useCallback)(()=>{v?.(a,y,e)},[v,a,y,e]),E=(0,x.useDebounceCallback)(w,500),D=(0,g.useCallback)(e=>{e<1&&(e=1),e>99&&(e=99),b(e)},[]),O=(0,g.useCallback)(async()=>{C(!0),await h?.(i),C(!1)},[i,h]);return(0,g.useEffect)(()=>(y!==f&&E(),()=>{E.cancel()}),[y,f,E]),(0,_.jsxs)(n.Card,{className:`border-border-weak relative mb-3 overflow-x-auto border p-4 shadow-none`,children:[S&&(0,_.jsx)(`div`,{className:`bg-muted-muted/80 absolute inset-0 z-10 flex items-center justify-center`,children:(0,_.jsx)(`div`,{className:`loader-dots`})}),(0,_.jsxs)(n.CardContent,{className:`p-0`,children:[(0,_.jsxs)(t.Button,{variant:`ghost`,size:`icon`,color:`muted`,disabled:S,className:`text-text-positive-weak absolute top-2 right-2 z-10`,onClick:O,children:[(0,_.jsx)(m.Trash2,{className:`h-4 w-4`}),(0,_.jsx)(`span`,{className:`sr-only`,children:`Remove item`})]}),(0,_.jsxs)(`div`,{className:`flex gap-3`,children:[(0,_.jsx)(`div`,{className:`relative size-20 flex-shrink-0`,children:c?(0,_.jsx)(r.Image,{src:c,alt:o,className:`rounded-md border-none shadow-xs`,width:80,height:80}):(0,_.jsx)(`div`,{className:`bg-muted text-muted-foreground flex size-full items-center justify-center text-xs`,children:`No image`})}),(0,_.jsxs)(`div`,{className:`flex flex-1 flex-col`,children:[(0,_.jsx)(`div`,{className:`flex justify-between`,children:(0,_.jsx)(`h3`,{className:`text-text-positive line-clamp-1 text-sm font-medium`,children:o})}),(0,_.jsxs)(`p`,{className:`text-text-positive-weak mb-1 text-xs`,children:[s,d&&` - ${d}: ${u}`]}),(0,_.jsxs)(`div`,{className:`mt-auto flex items-center justify-between`,children:[(0,_.jsxs)(`div`,{className:`flex items-center space-x-1`,children:[(0,_.jsx)(`button`,{disabled:y<=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:()=>D(y-1),children:(0,_.jsx)(m.Minus,{size:12})}),(0,_.jsx)(l.Input,{value:y,onChange:e=>D(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,_.jsx)(`button`,{disabled:y>=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:()=>D(y+1),children:(0,_.jsx)(m.Plus,{size:12})})]}),(0,_.jsxs)(`div`,{className:`text-sm font-semibold`,children:[(p*y).toLocaleString(),` ₫`]})]})]})]})]})]})},D=({items:e=[],cartType:n,className:r})=>{let i=e.reduce((e,t)=>e+t.price*t.quantity,0);return e.length===0?(0,_.jsxs)(`div`,{className:(0,h.cn)(`bg-muted-muted flex size-full max-h-80 flex-col items-center justify-center rounded-lg p-8`,r),children:[(0,_.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,_.jsx)(m.ShoppingBasketIcon,{size:42,strokeWidth:1})}),(0,_.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,_.jsx)(`p`,{className:`text-text-positive text-center text-base font-semibold`,children:`Giỏ hàng trống`}),(0,_.jsx)(`p`,{className:`text-text-positive-weak mb-4 text-center text-sm`,children:n===`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,_.jsxs)(`div`,{className:(0,h.cn)(`flex h-full flex-col space-y-4 overflow-y-auto`,r),children:[(0,_.jsx)(f.ScrollArea,{className:`h-full flex-1`,children:e.map(e=>(0,_.jsx)(E,{...e,type:n},`${e.productUuid}-${e.variantUuid}`))}),(0,_.jsxs)(`div`,{className:`flex-0 space-y-3`,children:[(0,_.jsxs)(`div`,{className:`flex justify-between`,children:[(0,_.jsx)(`span`,{className:`text-text-positive-weak text-sm`,children:`Tạm tính:`}),(0,_.jsxs)(`span`,{className:`text-sm`,children:[i.toLocaleString(),` ₫`]})]}),(0,_.jsx)(o.Separator,{}),(0,_.jsxs)(`div`,{className:`flex justify-between`,children:[(0,_.jsx)(`span`,{className:`text-text-positive font-medium`,children:`Tổng cộng:`}),(0,_.jsxs)(`span`,{className:`text-lg font-semibold`,children:[i.toLocaleString(),` ₫`]})]}),(0,_.jsx)(t.Button,{className:`mt-2 w-full`,children:`Thanh toán ngay`}),n===`pre_order`&&(0,_.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,g.createContext)(null),k=()=>{let e=(0,g.useContext)(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,C.useIsMobile)(),[l,u]=(0,g.useState)(!1),[d,f]=(0,g.useState)(e),p=t??d,m=(0,g.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,g.useCallback)(()=>c?u(e=>!e):m(e=>!e),[c,m]);(0,g.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`,b=(0,g.useMemo)(()=>({state:y,isMobile:c,toggleSidebar:v,open:p,setOpen:m,openMobile:l,setOpenMobile:u}),[y,p,m,c,l,v]);return(0,_.jsx)(O.Provider,{value:b,children:(0,_.jsx)(i.TooltipProvider,{delayDuration:0,children:(0,_.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...a},className:(0,h.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:l,setOpenMobile:u}=k();return n===`none`?(0,_.jsx)(`aside`,{"data-slot":`sidebar`,className:(0,h.cn)(`bg-sidebar`,`text-sidebar-foreground`,`flex h-full w-(--sidebar-width) flex-col`,r),...a,children:i}):o?(0,_.jsx)(c.Drawer,{direction:`left`,open:l,onOpenChange:u,children:(0,_.jsxs)(c.DrawerContent,{"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 data-[vaul-drawer-direction=left]:w-3xs data-[vaul-drawer-direction=left]:sm:max-w-3xs [&>button]:hidden`,style:{"--sidebar-width":`16rem`},children:[(0,_.jsxs)(c.DrawerHeader,{className:`sr-only`,children:[(0,_.jsx)(c.DrawerTitle,{children:`Sidebar`}),(0,_.jsx)(c.DrawerDescription,{children:`Displays the mobile sidebar.`})]}),(0,_.jsxs)(`div`,{className:`flex size-full flex-col`,children:[(0,_.jsxs)(`div`,{className:`border-border-weak flex flex-0 items-center gap-x-2 border-b p-2 pr-4`,children:[(0,_.jsx)(M,{}),(0,_.jsx)(`div`,{className:`bg-sidebar-primary text-sidebar-primary-foreground ml-2 flex aspect-square size-8 items-center justify-center rounded-lg`,children:(0,_.jsx)(m.ShoppingCartIcon,{size:20})}),(0,_.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,_.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),(0,_.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),(0,_.jsx)(`div`,{className:`flex flex-1 flex-col p-2`,children:i})]})]})}):(0,_.jsxs)(`aside`,{className:`group peer text-sidebar-foreground bg-card hidden md:block`,"data-state":s,"data-collapsible":s===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,_.jsx)(`div`,{"data-slot":`sidebar-gap`,className:(0,h.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,_.jsx)(`div`,{"data-slot":`sidebar-container`,className:(0,h.cn)(`hidden md:flex`,`shadow-nav fixed inset-y-0 top-14 z-10`,`h-[calc(100dvh-3.5rem)] w-(--sidebar-width)`,`transition-[left,right,width] duration-200 ease-linear`,e===`left`&&`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`,e===`right`&&`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...a,children:(0,_.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:(0,h.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:n,...r}){let{toggleSidebar:i}=k();return(0,_.jsxs)(t.Button,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:(0,h.cn)(`size-10 rounded-full`,e),onClick:e=>{n?.(e),i()},...r,children:[(0,_.jsx)(m.MenuIcon,{className:`!size-6`}),(0,_.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function N({className:e,children:t,...n}){return(0,_.jsxs)(`main`,{"data-slot":`sidebar-inset`,className:(0,h.cn)(`relative flex w-full flex-1 flex-col`,e),...n,children:[(0,_.jsx)(`div`,{className:`h-(--header-height) w-full sm:h-[calc(var(--header-height)_+_0.5rem)]`}),(0,_.jsx)(`div`,{className:(0,h.cn)(`flex-1 inset-shadow-sm`),children:t})]})}function P({className:e,children:t,...n}){let{open:r}=k(),{onLogout:i}=T();return(0,_.jsxs)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:(0,h.cn)(`flex flex-col gap-2`,e),...n,children:[t,(0,_.jsxs)(z,{children:[(0,_.jsx)(B,{children:(0,_.jsxs)(H,{className:`border-border border`,onClick:i,children:[(0,_.jsx)(m.LogOutIcon,{className:`text-text-positive-weak`}),`Đăng xuất`]})}),r&&(0,_.jsx)(B,{className:`border-t-border mt-2 border-t`,children:(0,_.jsx)(`p`,{className:`text-muted-foreground pt-2 text-center text-xs`,children:`Copyright © 2025, Lunas.`})})]})]})}function F({className:e,...t}){return(0,_.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:(0,h.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,_.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:(0,h.cn)(`relative flex w-full min-w-0 flex-col`,e),...t})}function L({className:e,asChild:t=!1,...n}){let r=t?y.Slot.Slot:`div`;return(0,_.jsx)(r,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:(0,h.cn)(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2`,`text-sidebar-foreground/70`,`ring-sidebar-ring`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8`,`group-data-[collapsible=icon]:opacity-0`,e),...n})}function R({className:e,...t}){return(0,_.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:(0,h.cn)(`w-full text-sm`,e),...t})}function z({className:e,...t}){return(0,_.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:(0,h.cn)(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function B({className:e,...t}){return(0,_.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:(0,h.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.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-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,_.jsx)(c,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:(0,h.cn)(V({variant:n,size:r}),o),...s});return a?(typeof a==`string`&&(a={children:a}),(0,_.jsxs)(i.Tooltip,{children:[(0,_.jsx)(i.TooltipTrigger,{asChild:!0,children:d}),(0,_.jsx)(i.TooltipContent,{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,_.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,_.jsx)(A,{children:e}),G=({userName:e=`Keith Kennedy`,userEmail:n=`k.kennedy@originui.com`,onLogout:r})=>(0,_.jsxs)(d.DropdownMenu,{children:[(0,_.jsx)(d.DropdownMenuTrigger,{asChild:!0,children:(0,_.jsx)(t.Button,{size:`icon`,variant:`ghost`,color:`secondary`,className:`size-10 rounded-full`,children:(0,_.jsxs)(a.Avatar,{className:`size-10`,children:[(0,_.jsx)(a.AvatarImage,{}),(0,_.jsx)(a.AvatarFallback,{className:`bg-muted-muted size-full`,children:(0,_.jsx)(m.UserIcon,{})})]})})}),(0,_.jsxs)(d.DropdownMenuContent,{align:`end`,className:`max-w-64`,children:[(0,_.jsxs)(d.DropdownMenuLabel,{className:`flex min-w-0 flex-col`,children:[(0,_.jsx)(`span`,{className:`text-text-positive truncate text-sm font-medium`,children:e}),(0,_.jsx)(`span`,{className:`text-text-positive-weak truncate text-xs font-normal`,children:n})]}),(0,_.jsx)(d.DropdownMenuSeparator,{}),(0,_.jsxs)(d.DropdownMenuItem,{onClick:r,children:[(0,_.jsx)(m.LogOutIcon,{size:16,"aria-hidden":`true`}),(0,_.jsx)(`span`,{className:`text-text-positive`,children:`Logout`})]})]})]}),K=()=>{let{inStockCarts:e=[],orderedCarts:n=[]}=T(),r=e.length,i=n.length,a=r+i;return(0,_.jsxs)(p.Sheet,{children:[(0,_.jsx)(p.SheetTrigger,{asChild:!0,children:(0,_.jsxs)(t.Button,{size:`icon`,variant:`ghost`,color:`secondary`,className:`relative size-10 rounded-full`,children:[(0,_.jsx)(m.ShoppingCartIcon,{}),a>0&&(0,_.jsx)(`span`,{className:`bg-primary text-primary-foreground absolute -top-1 -right-1 flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-xs font-bold`,children:a})]})}),(0,_.jsxs)(p.SheetContent,{className:`w-[95vw] sm:max-w-md`,children:[(0,_.jsx)(p.SheetHeader,{className:`border-border-weak flex-0 border-b pb-3`,children:(0,_.jsxs)(p.SheetTitle,{className:`flex items-center gap-2`,children:[(0,_.jsx)(m.ShoppingBag,{className:`h-5 w-5`}),(0,_.jsx)(`span`,{children:`Giỏ hàng của bạn`}),a>0&&(0,_.jsxs)(`span`,{className:`text-text-positive-weak text-sm font-normal`,children:[`(`,a,` sản phẩm)`]})]})}),(0,_.jsxs)(u.Tabs,{defaultValue:i>0?`pre_order`:`in_stock`,className:`h-full flex-1 overflow-y-auto p-4 pt-0`,children:[(0,_.jsxs)(u.TabsList,{className:`w-full flex-0`,children:[(0,_.jsxs)(u.TabsTrigger,{value:`in_stock`,className:`relative`,children:[`Có sẵn`,r>0&&(0,_.jsxs)(`span`,{children:[`(`,r,`)`]})]}),(0,_.jsxs)(u.TabsTrigger,{value:`pre_order`,className:`relative`,children:[`Đặt trước`,i>0&&(0,_.jsxs)(`span`,{children:[`(`,i,`)`]})]})]}),(0,_.jsx)(u.TabsContent,{value:`pre_order`,className:`flex-1 overflow-y-auto`,children:(0,_.jsx)(D,{items:n,cartType:`pre_order`})}),(0,_.jsx)(u.TabsContent,{value:`in_stock`,className:`flex-1 overflow-y-auto`,children:(0,_.jsx)(D,{items:e,cartType:`in_stock`})})]})]})]})},q=()=>{let{isLoggedIn:e,username:n,email:r,onGoogleLoginSuccess:i,onLogout:a}=T(),l=(0,b.useMediaQuery)(`(min-width: 640px)`),[u,d]=(0,g.useState)(!1);return(0,_.jsxs)(`header`,{className:(0,h.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`,`shadow-nav flex items-center`,`transition-[width,height] ease-linear`),children:[e&&(0,_.jsx)(M,{}),(0,_.jsxs)(`div`,{className:`flex gap-x-2 sm:ml-2.5`,children:[(0,_.jsx)(`div`,{className:`bg-sidebar-primary text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-lg`,children:(0,_.jsx)(m.ShoppingCartIcon,{size:20})}),(0,_.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,_.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),(0,_.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),(0,_.jsxs)(`div`,{className:`flex flex-1 items-center justify-end gap-x-2`,children:[!e&&(0,_.jsxs)(t.Button,{className:`w-8 sm:w-fit`,onClick:()=>d(!0),children:[(0,_.jsx)(m.LogInIcon,{}),(0,_.jsx)(`span`,{className:`sr-only sm:not-sr-only`,children:`Đăng nhập`})]}),e&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(G,{userName:n,userEmail:r,onLogout:a}),(0,_.jsx)(o.Separator,{orientation:`vertical`,className:`min-h-6 w-px`}),(0,_.jsx)(K,{})]})]}),l&&(0,_.jsx)(s.Dialog,{open:u,onOpenChange:d,children:(0,_.jsxs)(s.DialogContent,{showCloseButton:!1,className:`flex flex-col gap-0 border-none p-0 sm:max-w-sm`,children:[(0,_.jsx)(s.DialogHeader,{className:`flex-0 gap-2 p-6`,children:(0,_.jsx)(s.DialogTitle,{className:`text-center`,children:`Chào mừng bạn đến với Lunas Store!`})}),(0,_.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,_.jsx)(`main`,{className:`bg-card size-full flex-1 p-4 pt-0`,children:(0,_.jsxs)(`div`,{className:`flex flex-col items-center gap-y-1`,children:[(0,_.jsx)(`p`,{className:`text-text-positive-weak text-sm`,children:`Đăng nhập với Google`}),(0,_.jsx)(S.GoogleLogin,{size:`large`,theme:`outline`,width:240,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||await i?.(e)}})]})})}),(0,_.jsx)(s.DialogFooter,{className:`p-2`})]})}),!l&&(0,_.jsx)(c.Drawer,{open:u,onOpenChange:d,children:(0,_.jsxs)(c.DrawerContent,{children:[(0,_.jsx)(c.DrawerHeader,{className:`text-left`,children:(0,_.jsx)(c.DrawerTitle,{children:`Chào mừng bạn đến với Lunas Store!`})}),(0,_.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,_.jsx)(`main`,{className:`flex size-full flex-1 flex-col p-4 pt-0`,children:(0,_.jsxs)(`div`,{className:`flex flex-col items-center gap-y-1`,children:[(0,_.jsx)(`p`,{className:`text-text-positive-weak text-sm`,children:`Đăng nhập với Google`}),(0,_.jsx)(S.GoogleLogin,{size:`large`,theme:`outline`,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||await i?.(e)}})]})})}),(0,_.jsx)(c.DrawerFooter,{})]})})]})},J=({children:e,...t})=>{let{isLoggedIn:n}=T();return n?(0,_.jsx)(j,{variant:`inset`,collapsible:`icon`,...t,children:e}):null},Y=({children:e})=>{let{isLoggedIn:n,onGoogleLoginSuccess:r}=T(),i=(0,b.useMediaQuery)(`(min-width: 640px)`),[a,o]=(0,g.useState)(!1);return n?(0,_.jsx)(N,{children:(0,_.jsx)(`section`,{className:`relative size-full`,children:(0,_.jsx)(`div`,{className:`absolute inset-0 flex flex-col`,children:e})})}):(0,_.jsx)(`div`,{className:`size-full p-4 pt-[calc(var(--header-height)+1.5rem)]`,children:(0,_.jsxs)(`div`,{className:`bg-card shadow-card flex size-full flex-col items-center justify-center gap-6 rounded-lg p-8 text-center`,children:[(0,_.jsx)(`div`,{className:`bg-muted-foreground/10 flex size-20 items-center justify-center rounded-full`,children:(0,_.jsx)(m.LockIcon,{className:`text-primary size-10`})}),(0,_.jsxs)(`div`,{className:`flex max-w-md flex-col gap-2`,children:[(0,_.jsx)(`h2`,{className:`text-2xl font-semibold`,children:`Bạn chưa đăng nhập`}),(0,_.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,_.jsxs)(t.Button,{size:`lg`,className:`gap-2`,onClick:()=>o(!0),children:[(0,_.jsx)(m.LogInIcon,{size:18}),(0,_.jsx)(`span`,{children:`Đăng nhập ngay`})]}),i&&(0,_.jsx)(s.Dialog,{open:a,onOpenChange:o,children:(0,_.jsxs)(s.DialogContent,{showCloseButton:!1,className:`flex flex-col gap-0 border-none p-0 sm:max-w-sm`,children:[(0,_.jsx)(s.DialogHeader,{className:`flex-0 gap-2 p-6`,children:(0,_.jsx)(s.DialogTitle,{className:`text-center`,children:`Chào mừng bạn đến với Lunas Store!`})}),(0,_.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,_.jsx)(`main`,{className:`bg-card size-full flex-1 p-4 pt-0`,children:(0,_.jsxs)(`div`,{className:`flex flex-col items-center gap-y-1`,children:[(0,_.jsx)(`p`,{className:`text-text-positive-weak text-sm`,children:`Đăng nhập với Google`}),(0,_.jsx)(S.GoogleLogin,{size:`large`,theme:`outline`,width:240,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||(await r?.(e),o(!1))}})]})})}),(0,_.jsx)(s.DialogFooter,{className:`p-2`})]})}),!i&&(0,_.jsx)(c.Drawer,{open:a,onOpenChange:o,children:(0,_.jsxs)(c.DrawerContent,{children:[(0,_.jsx)(c.DrawerHeader,{className:`text-left`,children:(0,_.jsx)(c.DrawerTitle,{children:`Chào mừng bạn đến với Lunas Store!`})}),(0,_.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,_.jsx)(`main`,{className:`flex size-full flex-1 flex-col p-4 pt-0`,children:(0,_.jsxs)(`div`,{className:`flex flex-col items-center gap-y-1`,children:[(0,_.jsx)(`p`,{className:`text-text-positive-weak text-sm`,children:`Đăng nhập với Google`}),(0,_.jsx)(S.GoogleLogin,{size:`large`,theme:`outline`,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||(await r?.(e),o(!1))}})]})})}),(0,_.jsx)(c.DrawerFooter,{})]})})]})})},X=({className:e,children:t})=>(0,_.jsx)(`div`,{"data-slot":`main-header`,className:(0,h.cn)(`flex-0 snap-start`,e),children:t}),Z=({className:e,children:t})=>(0,_.jsx)(`div`,{"data-slot":`main-content`,className:(0,h.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,_.jsx)(`div`,{"data-slot":`main-footer`,className:(0,h.cn)(`border-border-weak hidden w-full flex-0 border-t pt-2 sm:flex`,e),children:t}),$=({children:e,className:t})=>(0,_.jsx)(`div`,{"data-slot":`main-group`,className:(0,h.cn)(`flex size-full flex-col gap-4`,t),children:e}),oe=({className:e,children:t})=>(0,_.jsx)(`div`,{"data-slot":`main-group-content`,className:(0,h.cn)(`bg-card shadow-card max-w-8xl size-full flex-1 rounded-md p-4`,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-CUT6urMc.cjs`);require(`../../dist-CAevLI5t.cjs`),require(`../../button-variants-BHDyMRNh.cjs`);const t=require(`../../button-BCahPWI8.cjs`),n=require(`../../card-CkKO-0o0.cjs`);require(`../../skeleton-BC2E_ohw.cjs`);const r=require(`../../image-C0mClPAY.cjs`),i=require(`../../tooltip-uaF-pxx8.cjs`),a=require(`../../avatar-DmMCBvb6.cjs`),o=require(`../../separator-DMMoR-d2.cjs`),s=require(`../../dialog-BBODhbxh.cjs`),c=require(`../../drawer-C3vvvU_D.cjs`),l=require(`../../input-D_tClptL.cjs`),u=require(`../../tabs-CtTEY1sg.cjs`),d=require(`../../dropdown-menu-C3SGlEd2.cjs`),f=require(`../../scroll-area-CcLtG_m0.cjs`),p=require(`../../sheet-DueP7VvE.cjs`);let m=require(`lucide-react`);m=e.__toESM(m);let h=require(`@customafk/react-toolkit/utils`);h=e.__toESM(h);let g=require(`react`);g=e.__toESM(g);let _=require(`react/jsx-runtime`);_=e.__toESM(_);let v=require(`class-variance-authority`);v=e.__toESM(v);let y=require(`radix-ui`);y=e.__toESM(y);let b=require(`@customafk/react-toolkit/hooks/useMediaQuery`);b=e.__toESM(b);let x=require(`@customafk/react-toolkit/hooks/useDebounceCallback`);x=e.__toESM(x);let S=require(`@react-oauth/google`);S=e.__toESM(S);let C=require(`@customafk/react-toolkit/hooks/useMobile`);C=e.__toESM(C);const w=(0,g.createContext)(null),T=()=>{let e=(0,g.useContext)(w);if(!e)throw Error(`useServiceLayoutContext must be used within a ServiceLayoutProvider`);return e},E=({id:e,type:i,productUuid:a,variantUuid:o,productName:s,variantName:c,imageUrl:u,optionValue:d,optionTitle:f,quantity:p,price:h})=>{let{onDeletingCart:v,onUpdatingCart:y}=T(),[b,S]=(0,g.useState)(p),[C,w]=(0,g.useState)(!1),E=(0,g.useCallback)(()=>{y?.(e,b,i)},[y,e,b,i]),D=(0,x.useDebounceCallback)(E,500),O=(0,g.useCallback)(e=>{e<1&&(e=1),e>99&&(e=99),S(e)},[]),k=(0,g.useCallback)(async()=>{w(!0),await v?.(e),w(!1)},[a,v]);return(0,g.useEffect)(()=>(b!==p&&D(),()=>{D.cancel()}),[b,p,D]),(0,_.jsxs)(n.Card,{className:`border-border-weak relative mb-3 overflow-x-auto border p-4 shadow-none`,children:[C&&(0,_.jsx)(`div`,{className:`bg-muted-muted/80 absolute inset-0 z-10 flex items-center justify-center`,children:(0,_.jsx)(`div`,{className:`loader-dots`})}),(0,_.jsxs)(n.CardContent,{className:`p-0`,children:[(0,_.jsxs)(t.Button,{variant:`ghost`,size:`icon`,color:`muted`,disabled:C,className:`text-text-positive-weak absolute top-2 right-2 z-10`,onClick:k,children:[(0,_.jsx)(m.Trash2,{className:`h-4 w-4`}),(0,_.jsx)(`span`,{className:`sr-only`,children:`Remove item`})]}),(0,_.jsxs)(`div`,{className:`flex gap-3`,children:[(0,_.jsx)(`div`,{className:`relative size-20 flex-shrink-0`,children:u?(0,_.jsx)(r.Image,{src:u,alt:s,className:`rounded-md border-none shadow-xs`,width:80,height:80}):(0,_.jsx)(`div`,{className:`bg-muted text-muted-foreground flex size-full items-center justify-center text-xs`,children:`No image`})}),(0,_.jsxs)(`div`,{className:`flex flex-1 flex-col`,children:[(0,_.jsx)(`div`,{className:`flex justify-between`,children:(0,_.jsx)(`h3`,{className:`text-text-positive line-clamp-1 text-sm font-medium`,children:s})}),(0,_.jsxs)(`p`,{className:`text-text-positive-weak mb-1 text-xs`,children:[c,f&&` - ${f}: ${d}`]}),(0,_.jsxs)(`div`,{className:`mt-auto flex items-center justify-between`,children:[(0,_.jsxs)(`div`,{className:`flex items-center space-x-1`,children:[(0,_.jsx)(`button`,{disabled:b<=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:()=>O(b-1),children:(0,_.jsx)(m.Minus,{size:12})}),(0,_.jsx)(l.Input,{value:b,onChange:e=>O(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,_.jsx)(`button`,{disabled:b>=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:()=>O(b+1),children:(0,_.jsx)(m.Plus,{size:12})})]}),(0,_.jsxs)(`div`,{className:`text-sm font-semibold`,children:[(h*b).toLocaleString(),` ₫`]})]})]})]})]})]})},D=({items:e=[],cartType:n,className:r})=>{let i=e.reduce((e,t)=>e+t.price*t.quantity,0);return e.length===0?(0,_.jsxs)(`div`,{className:(0,h.cn)(`bg-muted-muted flex size-full max-h-80 flex-col items-center justify-center rounded-lg p-8`,r),children:[(0,_.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,_.jsx)(m.ShoppingBasketIcon,{size:42,strokeWidth:1})}),(0,_.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,_.jsx)(`p`,{className:`text-text-positive text-center text-base font-semibold`,children:`Giỏ hàng trống`}),(0,_.jsx)(`p`,{className:`text-text-positive-weak mb-4 text-center text-sm`,children:n===`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,_.jsxs)(`div`,{className:(0,h.cn)(`flex h-full flex-col space-y-4 overflow-y-auto`,r),children:[(0,_.jsx)(f.ScrollArea,{className:`h-full flex-1`,children:e.map(e=>(0,_.jsx)(E,{...e,type:n},e.id))}),(0,_.jsxs)(`div`,{className:`flex-0 space-y-3`,children:[(0,_.jsxs)(`div`,{className:`flex justify-between`,children:[(0,_.jsx)(`span`,{className:`text-text-positive-weak text-sm`,children:`Tạm tính:`}),(0,_.jsxs)(`span`,{className:`text-sm`,children:[i.toLocaleString(),` ₫`]})]}),(0,_.jsx)(o.Separator,{}),(0,_.jsxs)(`div`,{className:`flex justify-between`,children:[(0,_.jsx)(`span`,{className:`text-text-positive font-medium`,children:`Tổng cộng:`}),(0,_.jsxs)(`span`,{className:`text-lg font-semibold`,children:[i.toLocaleString(),` ₫`]})]}),(0,_.jsx)(t.Button,{className:`mt-2 w-full`,children:`Thanh toán ngay`}),n===`pre_order`&&(0,_.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,g.createContext)(null),k=()=>{let e=(0,g.useContext)(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,C.useIsMobile)(),[l,u]=(0,g.useState)(!1),[d,f]=(0,g.useState)(e),p=t??d,m=(0,g.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,g.useCallback)(()=>c?u(e=>!e):m(e=>!e),[c,m]);(0,g.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`,b=(0,g.useMemo)(()=>({state:y,isMobile:c,toggleSidebar:v,open:p,setOpen:m,openMobile:l,setOpenMobile:u}),[y,p,m,c,l,v]);return(0,_.jsx)(O.Provider,{value:b,children:(0,_.jsx)(i.TooltipProvider,{delayDuration:0,children:(0,_.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...a},className:(0,h.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:l,setOpenMobile:u}=k();return n===`none`?(0,_.jsx)(`aside`,{"data-slot":`sidebar`,className:(0,h.cn)(`bg-sidebar`,`text-sidebar-foreground`,`flex h-full w-(--sidebar-width) flex-col`,r),...a,children:i}):o?(0,_.jsx)(c.Drawer,{direction:`left`,open:l,onOpenChange:u,children:(0,_.jsxs)(c.DrawerContent,{"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 data-[vaul-drawer-direction=left]:w-3xs data-[vaul-drawer-direction=left]:sm:max-w-3xs [&>button]:hidden`,style:{"--sidebar-width":`16rem`},children:[(0,_.jsxs)(c.DrawerHeader,{className:`sr-only`,children:[(0,_.jsx)(c.DrawerTitle,{children:`Sidebar`}),(0,_.jsx)(c.DrawerDescription,{children:`Displays the mobile sidebar.`})]}),(0,_.jsxs)(`div`,{className:`flex size-full flex-col`,children:[(0,_.jsxs)(`div`,{className:`border-border-weak flex flex-0 items-center gap-x-2 border-b p-2 pr-4`,children:[(0,_.jsx)(M,{}),(0,_.jsx)(`div`,{className:`bg-sidebar-primary text-sidebar-primary-foreground ml-2 flex aspect-square size-8 items-center justify-center rounded-lg`,children:(0,_.jsx)(m.ShoppingCartIcon,{size:20})}),(0,_.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,_.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),(0,_.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),(0,_.jsx)(`div`,{className:`flex flex-1 flex-col p-2`,children:i})]})]})}):(0,_.jsxs)(`aside`,{className:`group peer text-sidebar-foreground bg-card hidden md:block`,"data-state":s,"data-collapsible":s===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,_.jsx)(`div`,{"data-slot":`sidebar-gap`,className:(0,h.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,_.jsx)(`div`,{"data-slot":`sidebar-container`,className:(0,h.cn)(`hidden md:flex`,`shadow-nav fixed inset-y-0 top-14 z-10`,`h-[calc(100dvh-3.5rem)] w-(--sidebar-width)`,`transition-[left,right,width] duration-200 ease-linear`,e===`left`&&`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`,e===`right`&&`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...a,children:(0,_.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:(0,h.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:n,...r}){let{toggleSidebar:i}=k();return(0,_.jsxs)(t.Button,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:(0,h.cn)(`size-10 rounded-full`,e),onClick:e=>{n?.(e),i()},...r,children:[(0,_.jsx)(m.MenuIcon,{className:`!size-6`}),(0,_.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function N({className:e,children:t,...n}){return(0,_.jsxs)(`main`,{"data-slot":`sidebar-inset`,className:(0,h.cn)(`relative flex w-full flex-1 flex-col`,e),...n,children:[(0,_.jsx)(`div`,{className:`h-(--header-height) w-full sm:h-[calc(var(--header-height)_+_0.5rem)]`}),(0,_.jsx)(`div`,{className:(0,h.cn)(`flex-1 inset-shadow-sm`),children:t})]})}function P({className:e,children:t,...n}){let{open:r}=k(),{onLogout:i}=T();return(0,_.jsxs)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:(0,h.cn)(`flex flex-col gap-2`,e),...n,children:[t,(0,_.jsxs)(z,{children:[(0,_.jsx)(B,{children:(0,_.jsxs)(H,{className:`border-border border`,onClick:i,children:[(0,_.jsx)(m.LogOutIcon,{className:`text-text-positive-weak`}),`Đăng xuất`]})}),r&&(0,_.jsx)(B,{className:`border-t-border mt-2 border-t`,children:(0,_.jsx)(`p`,{className:`text-muted-foreground pt-2 text-center text-xs`,children:`Copyright © 2025, Lunas.`})})]})]})}function F({className:e,...t}){return(0,_.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:(0,h.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,_.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:(0,h.cn)(`relative flex w-full min-w-0 flex-col`,e),...t})}function L({className:e,asChild:t=!1,...n}){let r=t?y.Slot.Slot:`div`;return(0,_.jsx)(r,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:(0,h.cn)(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2`,`text-sidebar-foreground/70`,`ring-sidebar-ring`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8`,`group-data-[collapsible=icon]:opacity-0`,e),...n})}function R({className:e,...t}){return(0,_.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:(0,h.cn)(`w-full text-sm`,e),...t})}function z({className:e,...t}){return(0,_.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:(0,h.cn)(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function B({className:e,...t}){return(0,_.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:(0,h.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.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-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,_.jsx)(c,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:(0,h.cn)(V({variant:n,size:r}),o),...s});return a?(typeof a==`string`&&(a={children:a}),(0,_.jsxs)(i.Tooltip,{children:[(0,_.jsx)(i.TooltipTrigger,{asChild:!0,children:d}),(0,_.jsx)(i.TooltipContent,{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,_.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,_.jsx)(A,{children:e}),G=({userName:e=`Keith Kennedy`,userEmail:n=`k.kennedy@originui.com`,onLogout:r})=>(0,_.jsxs)(d.DropdownMenu,{children:[(0,_.jsx)(d.DropdownMenuTrigger,{asChild:!0,children:(0,_.jsx)(t.Button,{size:`icon`,variant:`ghost`,color:`secondary`,className:`size-10 rounded-full`,children:(0,_.jsxs)(a.Avatar,{className:`size-10`,children:[(0,_.jsx)(a.AvatarImage,{}),(0,_.jsx)(a.AvatarFallback,{className:`bg-muted-muted size-full`,children:(0,_.jsx)(m.UserIcon,{})})]})})}),(0,_.jsxs)(d.DropdownMenuContent,{align:`end`,className:`max-w-64`,children:[(0,_.jsxs)(d.DropdownMenuLabel,{className:`flex min-w-0 flex-col`,children:[(0,_.jsx)(`span`,{className:`text-text-positive truncate text-sm font-medium`,children:e}),(0,_.jsx)(`span`,{className:`text-text-positive-weak truncate text-xs font-normal`,children:n})]}),(0,_.jsx)(d.DropdownMenuSeparator,{}),(0,_.jsxs)(d.DropdownMenuItem,{onClick:r,children:[(0,_.jsx)(m.LogOutIcon,{size:16,"aria-hidden":`true`}),(0,_.jsx)(`span`,{className:`text-text-positive`,children:`Logout`})]})]})]}),K=()=>{let{inStockCarts:e=[],orderedCarts:n=[]}=T(),r=e.length,i=n.length,a=r+i;return(0,_.jsxs)(p.Sheet,{children:[(0,_.jsx)(p.SheetTrigger,{asChild:!0,children:(0,_.jsxs)(t.Button,{size:`icon`,variant:`ghost`,color:`secondary`,className:`relative size-10 rounded-full`,children:[(0,_.jsx)(m.ShoppingCartIcon,{}),a>0&&(0,_.jsx)(`span`,{className:`bg-primary text-primary-foreground absolute -top-1 -right-1 flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-xs font-bold`,children:a})]})}),(0,_.jsxs)(p.SheetContent,{className:`w-[95vw] sm:max-w-md`,children:[(0,_.jsx)(p.SheetHeader,{className:`border-border-weak flex-0 border-b pb-3`,children:(0,_.jsxs)(p.SheetTitle,{className:`flex items-center gap-2`,children:[(0,_.jsx)(m.ShoppingBag,{className:`h-5 w-5`}),(0,_.jsx)(`span`,{children:`Giỏ hàng của bạn`}),a>0&&(0,_.jsxs)(`span`,{className:`text-text-positive-weak text-sm font-normal`,children:[`(`,a,` sản phẩm)`]})]})}),(0,_.jsxs)(u.Tabs,{defaultValue:i>0?`pre_order`:`in_stock`,className:`h-full flex-1 overflow-y-auto p-4 pt-0`,children:[(0,_.jsxs)(u.TabsList,{className:`w-full flex-0`,children:[(0,_.jsxs)(u.TabsTrigger,{value:`in_stock`,className:`relative`,children:[`Có sẵn`,r>0&&(0,_.jsxs)(`span`,{children:[`(`,r,`)`]})]}),(0,_.jsxs)(u.TabsTrigger,{value:`pre_order`,className:`relative`,children:[`Đặt trước`,i>0&&(0,_.jsxs)(`span`,{children:[`(`,i,`)`]})]})]}),(0,_.jsx)(u.TabsContent,{value:`pre_order`,className:`flex-1 overflow-y-auto`,children:(0,_.jsx)(D,{items:n,cartType:`pre_order`})}),(0,_.jsx)(u.TabsContent,{value:`in_stock`,className:`flex-1 overflow-y-auto`,children:(0,_.jsx)(D,{items:e,cartType:`in_stock`})})]})]})]})},q=()=>{let{isLoggedIn:e,username:n,email:r,onGoogleLoginSuccess:i,onLogout:a}=T(),l=(0,b.useMediaQuery)(`(min-width: 640px)`),[u,d]=(0,g.useState)(!1);return(0,_.jsxs)(`header`,{className:(0,h.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`,`shadow-nav flex items-center`,`transition-[width,height] ease-linear`),children:[e&&(0,_.jsx)(M,{}),(0,_.jsxs)(`div`,{className:`flex gap-x-2 sm:ml-2.5`,children:[(0,_.jsx)(`div`,{className:`bg-sidebar-primary text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-lg`,children:(0,_.jsx)(m.ShoppingCartIcon,{size:20})}),(0,_.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,_.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),(0,_.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),(0,_.jsxs)(`div`,{className:`flex flex-1 items-center justify-end gap-x-2`,children:[!e&&(0,_.jsxs)(t.Button,{className:`w-8 sm:w-fit`,onClick:()=>d(!0),children:[(0,_.jsx)(m.LogInIcon,{}),(0,_.jsx)(`span`,{className:`sr-only sm:not-sr-only`,children:`Đăng nhập`})]}),e&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(G,{userName:n,userEmail:r,onLogout:a}),(0,_.jsx)(o.Separator,{orientation:`vertical`,className:`min-h-6 w-px`}),(0,_.jsx)(K,{})]})]}),l&&(0,_.jsx)(s.Dialog,{open:u,onOpenChange:d,children:(0,_.jsxs)(s.DialogContent,{showCloseButton:!1,className:`flex flex-col gap-0 border-none p-0 sm:max-w-sm`,children:[(0,_.jsx)(s.DialogHeader,{className:`flex-0 gap-2 p-6`,children:(0,_.jsx)(s.DialogTitle,{className:`text-center`,children:`Chào mừng bạn đến với Lunas Store!`})}),(0,_.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,_.jsx)(`main`,{className:`bg-card size-full flex-1 p-4 pt-0`,children:(0,_.jsxs)(`div`,{className:`flex flex-col items-center gap-y-1`,children:[(0,_.jsx)(`p`,{className:`text-text-positive-weak text-sm`,children:`Đăng nhập với Google`}),(0,_.jsx)(S.GoogleLogin,{size:`large`,theme:`outline`,width:240,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||await i?.(e)}})]})})}),(0,_.jsx)(s.DialogFooter,{className:`p-2`})]})}),!l&&(0,_.jsx)(c.Drawer,{open:u,onOpenChange:d,children:(0,_.jsxs)(c.DrawerContent,{children:[(0,_.jsx)(c.DrawerHeader,{className:`text-left`,children:(0,_.jsx)(c.DrawerTitle,{children:`Chào mừng bạn đến với Lunas Store!`})}),(0,_.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,_.jsx)(`main`,{className:`flex size-full flex-1 flex-col p-4 pt-0`,children:(0,_.jsxs)(`div`,{className:`flex flex-col items-center gap-y-1`,children:[(0,_.jsx)(`p`,{className:`text-text-positive-weak text-sm`,children:`Đăng nhập với Google`}),(0,_.jsx)(S.GoogleLogin,{size:`large`,theme:`outline`,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||await i?.(e)}})]})})}),(0,_.jsx)(c.DrawerFooter,{})]})})]})},J=({children:e,...t})=>{let{isLoggedIn:n}=T();return n?(0,_.jsx)(j,{variant:`inset`,collapsible:`icon`,...t,children:e}):null},Y=({children:e})=>{let{isLoggedIn:n,onGoogleLoginSuccess:r}=T(),i=(0,b.useMediaQuery)(`(min-width: 640px)`),[a,o]=(0,g.useState)(!1);return n?(0,_.jsx)(N,{children:(0,_.jsx)(`section`,{className:`relative size-full`,children:(0,_.jsx)(`div`,{className:`absolute inset-0 flex flex-col`,children:e})})}):(0,_.jsx)(`div`,{className:`size-full p-4 pt-[calc(var(--header-height)+1.5rem)]`,children:(0,_.jsxs)(`div`,{className:`bg-card shadow-card flex size-full flex-col items-center justify-center gap-6 rounded-lg p-8 text-center`,children:[(0,_.jsx)(`div`,{className:`bg-muted-foreground/10 flex size-20 items-center justify-center rounded-full`,children:(0,_.jsx)(m.LockIcon,{className:`text-primary size-10`})}),(0,_.jsxs)(`div`,{className:`flex max-w-md flex-col gap-2`,children:[(0,_.jsx)(`h2`,{className:`text-2xl font-semibold`,children:`Bạn chưa đăng nhập`}),(0,_.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,_.jsxs)(t.Button,{size:`lg`,className:`gap-2`,onClick:()=>o(!0),children:[(0,_.jsx)(m.LogInIcon,{size:18}),(0,_.jsx)(`span`,{children:`Đăng nhập ngay`})]}),i&&(0,_.jsx)(s.Dialog,{open:a,onOpenChange:o,children:(0,_.jsxs)(s.DialogContent,{showCloseButton:!1,className:`flex flex-col gap-0 border-none p-0 sm:max-w-sm`,children:[(0,_.jsx)(s.DialogHeader,{className:`flex-0 gap-2 p-6`,children:(0,_.jsx)(s.DialogTitle,{className:`text-center`,children:`Chào mừng bạn đến với Lunas Store!`})}),(0,_.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,_.jsx)(`main`,{className:`bg-card size-full flex-1 p-4 pt-0`,children:(0,_.jsxs)(`div`,{className:`flex flex-col items-center gap-y-1`,children:[(0,_.jsx)(`p`,{className:`text-text-positive-weak text-sm`,children:`Đăng nhập với Google`}),(0,_.jsx)(S.GoogleLogin,{size:`large`,theme:`outline`,width:240,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||(await r?.(e),o(!1))}})]})})}),(0,_.jsx)(s.DialogFooter,{className:`p-2`})]})}),!i&&(0,_.jsx)(c.Drawer,{open:a,onOpenChange:o,children:(0,_.jsxs)(c.DrawerContent,{children:[(0,_.jsx)(c.DrawerHeader,{className:`text-left`,children:(0,_.jsx)(c.DrawerTitle,{children:`Chào mừng bạn đến với Lunas Store!`})}),(0,_.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,_.jsx)(`main`,{className:`flex size-full flex-1 flex-col p-4 pt-0`,children:(0,_.jsxs)(`div`,{className:`flex flex-col items-center gap-y-1`,children:[(0,_.jsx)(`p`,{className:`text-text-positive-weak text-sm`,children:`Đăng nhập với Google`}),(0,_.jsx)(S.GoogleLogin,{size:`large`,theme:`outline`,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||(await r?.(e),o(!1))}})]})})}),(0,_.jsx)(c.DrawerFooter,{})]})})]})})},X=({className:e,children:t})=>(0,_.jsx)(`div`,{"data-slot":`main-header`,className:(0,h.cn)(`flex-0 snap-start`,e),children:t}),Z=({className:e,children:t})=>(0,_.jsx)(`div`,{"data-slot":`main-content`,className:(0,h.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,_.jsx)(`div`,{"data-slot":`main-footer`,className:(0,h.cn)(`border-border-weak hidden w-full flex-0 border-t pt-2 sm:flex`,e),children:t}),$=({children:e,className:t})=>(0,_.jsx)(`div`,{"data-slot":`main-group`,className:(0,h.cn)(`flex size-full flex-col gap-4`,t),children:e}),oe=({className:e,children:t})=>(0,_.jsx)(`div`,{"data-slot":`main-group-content`,className:(0,h.cn)(`bg-card shadow-card max-w-8xl size-full flex-1 rounded-md p-4`,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
|