@customafk/lunas-ui 0.0.2 → 0.0.3-a
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/Atoms/AspectRatio/index.js +2 -0
- package/dist/Atoms/Avatar/index.js +3 -3
- package/dist/Atoms/Badge/index.js +2 -0
- package/dist/Atoms/Breadcrumb/index.js +7 -23
- package/dist/Atoms/Button/index.d.ts +2 -2
- package/dist/Atoms/Button/index.js +2 -0
- package/dist/Atoms/Card/index.js +2 -0
- package/dist/Atoms/Checkbox/index.d.ts +6 -0
- package/dist/Atoms/Checkbox/index.js +276 -0
- package/dist/Atoms/Command/index.d.ts +7 -7
- package/dist/Atoms/Command/index.js +39 -50
- package/dist/Atoms/Dialog/index.js +16 -31
- package/dist/Atoms/DropdownMenu/index.js +2 -0
- package/dist/Atoms/Form/index.js +32 -21
- package/dist/Atoms/Input/index.d.ts +5 -1
- package/dist/Atoms/Input/index.js +45 -543
- package/dist/Atoms/Label/index.js +2 -0
- package/dist/Atoms/MenuItem/index.d.ts +14 -0
- package/dist/Atoms/MenuItem/index.js +287 -0
- package/dist/Atoms/Money/index.js +2 -0
- package/dist/Atoms/Navbar/index.js +2 -0
- package/dist/Atoms/NavigationMenu/index.js +2 -0
- package/dist/Atoms/NumberInput/index.d.ts +7 -0
- package/dist/Atoms/NumberInput/index.js +321 -0
- package/dist/Atoms/Popover/index.d.ts +8 -0
- package/dist/Atoms/Popover/index.js +286 -0
- package/dist/Atoms/Progress/index.js +2 -0
- package/dist/Atoms/QuantityBtn/index.js +2 -0
- package/dist/Atoms/RadioGroup/index.d.ts +7 -0
- package/dist/Atoms/RadioGroup/index.js +285 -0
- package/dist/Atoms/ScrollBar/index.js +4 -2
- package/dist/Atoms/Select/index.js +2 -0
- package/dist/Atoms/Sheet/index.d.ts +29 -0
- package/dist/Atoms/Sheet/index.js +422 -0
- package/dist/Atoms/Slider/index.d.ts +6 -0
- package/dist/Atoms/Slider/index.js +286 -0
- package/dist/Atoms/SmallQuantityBtn/index.d.ts +9 -0
- package/dist/Atoms/SmallQuantityBtn/index.js +110 -0
- package/dist/Atoms/Switch/index.d.ts +6 -0
- package/dist/Atoms/Switch/index.js +293 -0
- package/dist/Atoms/Tabs/index.d.ts +9 -0
- package/dist/Atoms/Tabs/index.js +304 -0
- package/dist/Atoms/Textarea/index.d.ts +5 -0
- package/dist/Atoms/Textarea/index.js +283 -0
- package/dist/Atoms/Tooltip/index.d.ts +10 -0
- package/dist/Atoms/Tooltip/index.js +289 -0
- package/dist/Atoms/UserAvatar/index.d.ts +2 -2
- package/dist/Atoms/UserAvatar/index.js +24 -28
- package/dist/Atoms/XButton/index.d.ts +10 -0
- package/dist/Atoms/XButton/index.js +309 -0
- package/dist/Authentication/SignIn/index.d.ts +1 -1
- package/dist/Authentication/SignIn/index.js +129 -74
- package/dist/Authentication/SignUp/index.d.ts +5 -5
- package/dist/Authentication/SignUp/index.js +181 -110
- package/dist/Authentication/ThankYou/index.js +13 -4
- package/dist/Ecommerce/Categories/index.d.ts +33 -0
- package/dist/Ecommerce/Categories/index.js +1426 -0
- package/dist/Icons/index.d.ts +5 -3
- package/dist/Icons/index.js +126 -97
- package/dist/Molecules/AuthenForm/index.js +30 -21
- package/dist/Molecules/Search/index.js +46 -57
- package/dist/Molecules/UserDropdown/index.js +42 -33
- package/dist/Organisms/Header/index.d.ts +25 -3
- package/dist/Organisms/Header/index.js +585 -324
- package/dist/hooks/index.d.ts +1 -54
- package/dist/hooks/index.js +3 -127
- package/dist/{types-BgHhiNa-.d.ts → types-BlE003QY.d.ts} +1 -1
- package/package.json +85 -41
|
@@ -931,9 +931,9 @@ var Button_default = Button;
|
|
|
931
931
|
// packages/Atoms/Form/index.tsx
|
|
932
932
|
import * as React2 from "react";
|
|
933
933
|
import {
|
|
934
|
-
Controller
|
|
935
|
-
FormProvider
|
|
936
|
-
useFormContext
|
|
934
|
+
Controller,
|
|
935
|
+
FormProvider,
|
|
936
|
+
useFormContext
|
|
937
937
|
} from "react-hook-form";
|
|
938
938
|
|
|
939
939
|
// packages/Atoms/Label/index.tsx
|
|
@@ -950,17 +950,17 @@ Label.displayName = LabelPrimitive.Root.displayName;
|
|
|
950
950
|
// packages/Atoms/Form/index.tsx
|
|
951
951
|
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
952
952
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
953
|
-
var Form =
|
|
953
|
+
var Form = FormProvider;
|
|
954
954
|
var FormFieldContext = React2.createContext({});
|
|
955
955
|
var FormField = ({
|
|
956
956
|
...props
|
|
957
957
|
}) => {
|
|
958
|
-
return /* @__PURE__ */ jsx12(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx12(
|
|
958
|
+
return /* @__PURE__ */ jsx12(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx12(Controller, { ...props }) });
|
|
959
959
|
};
|
|
960
960
|
var useFormField = () => {
|
|
961
961
|
const fieldContext = React2.useContext(FormFieldContext);
|
|
962
962
|
const itemContext = React2.useContext(FormItemContext);
|
|
963
|
-
const { getFieldState, formState } =
|
|
963
|
+
const { getFieldState, formState } = useFormContext();
|
|
964
964
|
const fieldState = getFieldState(fieldContext.name, formState);
|
|
965
965
|
if (!fieldContext) {
|
|
966
966
|
throw new Error("useFormField should be used within <FormField>");
|
|
@@ -977,55 +977,64 @@ var useFormField = () => {
|
|
|
977
977
|
};
|
|
978
978
|
var FormItemContext = React2.createContext({});
|
|
979
979
|
var FormItem = React2.forwardRef(
|
|
980
|
-
({ className, ...props },
|
|
980
|
+
({ className, ...props }, ref) => {
|
|
981
981
|
const id = React2.useId();
|
|
982
|
-
return /* @__PURE__ */ jsx12(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx12("div", { ref
|
|
982
|
+
return /* @__PURE__ */ jsx12(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx12("div", { ref, className: cn("space-y-2", className), ...props }) });
|
|
983
983
|
}
|
|
984
984
|
);
|
|
985
985
|
FormItem.displayName = "FormItem";
|
|
986
|
-
var FormLabel = React2.forwardRef(({ className, ...props },
|
|
986
|
+
var FormLabel = React2.forwardRef(({ className, ...props }, ref) => {
|
|
987
987
|
const { error, formItemId } = useFormField();
|
|
988
988
|
return /* @__PURE__ */ jsx12(
|
|
989
989
|
Label,
|
|
990
990
|
{
|
|
991
|
-
ref
|
|
992
|
-
className: cn(error && "text-destructive", className),
|
|
991
|
+
ref,
|
|
992
|
+
className: cn(error && "text-ui-destructive-500", className),
|
|
993
993
|
htmlFor: formItemId,
|
|
994
994
|
...props
|
|
995
995
|
}
|
|
996
996
|
);
|
|
997
997
|
});
|
|
998
998
|
FormLabel.displayName = "FormLabel";
|
|
999
|
-
var FormControl = React2.forwardRef(({ ...props },
|
|
1000
|
-
const { formItemId } = useFormField();
|
|
1001
|
-
return /* @__PURE__ */ jsx12(
|
|
999
|
+
var FormControl = React2.forwardRef(({ ...props }, ref) => {
|
|
1000
|
+
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
1001
|
+
return /* @__PURE__ */ jsx12(
|
|
1002
|
+
Slot2,
|
|
1003
|
+
{
|
|
1004
|
+
ref,
|
|
1005
|
+
id: formItemId,
|
|
1006
|
+
"aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
|
|
1007
|
+
"aria-invalid": !!error,
|
|
1008
|
+
...props
|
|
1009
|
+
}
|
|
1010
|
+
);
|
|
1002
1011
|
});
|
|
1003
1012
|
FormControl.displayName = "FormControl";
|
|
1004
|
-
var FormDescription = React2.forwardRef(({ className, ...props },
|
|
1013
|
+
var FormDescription = React2.forwardRef(({ className, ...props }, ref) => {
|
|
1005
1014
|
const { formDescriptionId } = useFormField();
|
|
1006
1015
|
return /* @__PURE__ */ jsx12(
|
|
1007
1016
|
"p",
|
|
1008
1017
|
{
|
|
1009
|
-
ref
|
|
1018
|
+
ref,
|
|
1010
1019
|
id: formDescriptionId,
|
|
1011
|
-
className: cn("text-
|
|
1020
|
+
className: cn("text-sm text-ui-text-500", className),
|
|
1012
1021
|
...props
|
|
1013
1022
|
}
|
|
1014
1023
|
);
|
|
1015
1024
|
});
|
|
1016
1025
|
FormDescription.displayName = "FormDescription";
|
|
1017
|
-
var FormMessage = React2.forwardRef(({ className, children, ...props },
|
|
1026
|
+
var FormMessage = React2.forwardRef(({ className, children, ...props }, ref) => {
|
|
1018
1027
|
const { error, formMessageId } = useFormField();
|
|
1019
1028
|
const body = error ? String(error?.message) : children;
|
|
1020
1029
|
if (!body) {
|
|
1021
|
-
return
|
|
1030
|
+
return null;
|
|
1022
1031
|
}
|
|
1023
1032
|
return /* @__PURE__ */ jsx12(
|
|
1024
1033
|
"p",
|
|
1025
1034
|
{
|
|
1026
|
-
ref
|
|
1035
|
+
ref,
|
|
1027
1036
|
id: formMessageId,
|
|
1028
|
-
className: cn("text-
|
|
1037
|
+
className: cn("text-sm font-medium text-ui-destructive-500", className),
|
|
1029
1038
|
...props,
|
|
1030
1039
|
children: body
|
|
1031
1040
|
}
|
|
@@ -253,7 +253,6 @@ var cn = (...inputs) => {
|
|
|
253
253
|
|
|
254
254
|
// packages/Atoms/Dialog/index.tsx
|
|
255
255
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
256
|
-
import { motion } from "framer-motion";
|
|
257
256
|
import { X } from "lucide-react";
|
|
258
257
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
259
258
|
var Dialog = DialogPrimitive.Root;
|
|
@@ -276,7 +275,7 @@ var DialogOverlay = React.forwardRef(({ className, ...props }, reference) => /*
|
|
|
276
275
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
277
276
|
var DialogContent = React.forwardRef(({ className, children, ...props }, reference) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
278
277
|
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
279
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ jsxs(
|
|
280
279
|
DialogPrimitive.Content,
|
|
281
280
|
{
|
|
282
281
|
ref: reference,
|
|
@@ -284,43 +283,29 @@ var DialogContent = React.forwardRef(({ className, children, ...props }, referen
|
|
|
284
283
|
"fixed",
|
|
285
284
|
"left-[50%] top-[50%] z-50",
|
|
286
285
|
"grid w-full max-w-lg",
|
|
286
|
+
"rounded bg-ui-surface-50",
|
|
287
287
|
"translate-x-[-50%] translate-y-[-50%]",
|
|
288
288
|
"transition-all duration-300",
|
|
289
|
+
"data-[state=open]:animate-in",
|
|
290
|
+
"data-[state=open]:fade-in-0",
|
|
291
|
+
"data-[state=open]:zoom-in-95",
|
|
292
|
+
"data-[state=open]:slide-in-from-left-1/2",
|
|
293
|
+
"data-[state=open]:slide-in-from-top-[48%]",
|
|
289
294
|
"data-[state=closed]:animate-out",
|
|
290
295
|
"data-[state=closed]:fade-out-0",
|
|
291
296
|
"data-[state=closed]:zoom-out-[0.8]",
|
|
292
297
|
"data-[state=closed]:slide-out-to-left-1/2",
|
|
293
|
-
"data-[state=closed]:slide-out-to-top-[80%]"
|
|
298
|
+
"data-[state=closed]:slide-out-to-top-[80%]",
|
|
299
|
+
className
|
|
294
300
|
),
|
|
295
301
|
...props,
|
|
296
|
-
children:
|
|
297
|
-
|
|
298
|
-
{
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
},
|
|
304
|
-
animate: {
|
|
305
|
-
opacity: 1,
|
|
306
|
-
scale: 1,
|
|
307
|
-
y: 0
|
|
308
|
-
},
|
|
309
|
-
transition: {
|
|
310
|
-
type: "spring",
|
|
311
|
-
damping: 20,
|
|
312
|
-
stiffness: 300
|
|
313
|
-
},
|
|
314
|
-
className: cn("w-full gap-4 bg-ui-surface-50 p-6 shadow-lg sm:rounded-lg", className),
|
|
315
|
-
children: [
|
|
316
|
-
children,
|
|
317
|
-
/* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none", children: [
|
|
318
|
-
/* @__PURE__ */ jsx(X, { className: "size-4" }),
|
|
319
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
320
|
-
] })
|
|
321
|
-
]
|
|
322
|
-
}
|
|
323
|
-
)
|
|
302
|
+
children: [
|
|
303
|
+
children,
|
|
304
|
+
/* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none", children: [
|
|
305
|
+
/* @__PURE__ */ jsx(X, { className: "size-4" }),
|
|
306
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
307
|
+
] })
|
|
308
|
+
]
|
|
324
309
|
}
|
|
325
310
|
)
|
|
326
311
|
] }));
|
|
@@ -355,6 +340,7 @@ var DialogDescription = React.forwardRef(({ className, ...props }, reference) =>
|
|
|
355
340
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
356
341
|
|
|
357
342
|
// packages/Atoms/Command/index.tsx
|
|
343
|
+
import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
|
|
358
344
|
import { Command as CommandPrimitive } from "cmdk";
|
|
359
345
|
import { Search } from "lucide-react";
|
|
360
346
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
@@ -371,25 +357,28 @@ var Command = React2.forwardRef(({ className, ...props }, reference) => /* @__PU
|
|
|
371
357
|
));
|
|
372
358
|
Command.displayName = CommandPrimitive.displayName;
|
|
373
359
|
var CommandDialog = ({ children, ...props }) => {
|
|
374
|
-
return /* @__PURE__ */
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
360
|
+
return /* @__PURE__ */ jsxs2(Dialog, { ...props, children: [
|
|
361
|
+
/* @__PURE__ */ jsx2(DialogContent, { className: "p-0 shadow-lg", children: /* @__PURE__ */ jsx2(
|
|
362
|
+
Command,
|
|
363
|
+
{
|
|
364
|
+
className: cn(
|
|
365
|
+
"bg-neutral-50",
|
|
366
|
+
"[&_[cmdk-group-heading]]:px-0",
|
|
367
|
+
"[&_[cmdk-group-heading]]:font-medium",
|
|
368
|
+
"[&_[cmdk-group-heading]]:text-ui-text-800",
|
|
369
|
+
"[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0",
|
|
370
|
+
"[&_[cmdk-group]]:px-2",
|
|
371
|
+
"[&_[cmdk-input-wrapper]_svg]:size-5",
|
|
372
|
+
"[&_[cmdk-input]]:h-12",
|
|
373
|
+
"[&_[cmdk-item]]:px-2",
|
|
374
|
+
"[&_[cmdk-item]]:py-3",
|
|
375
|
+
"[&_[cmdk-item]_svg]:size-5"
|
|
376
|
+
),
|
|
377
|
+
children
|
|
378
|
+
}
|
|
379
|
+
) }),
|
|
380
|
+
/* @__PURE__ */ jsx2(VisuallyHidden, { children: /* @__PURE__ */ jsx2(DialogTitle, {}) })
|
|
381
|
+
] });
|
|
393
382
|
};
|
|
394
383
|
var CommandInput = React2.forwardRef(({ className, ...props }, reference) => /* @__PURE__ */ jsxs2("div", { className: "flex items-center border-b px-3", children: [
|
|
395
384
|
/* @__PURE__ */ jsx2(Search, { className: "mr-2 size-4 shrink-0 opacity-50" }),
|
|
@@ -902,7 +891,7 @@ var Flex_default = Flex;
|
|
|
902
891
|
|
|
903
892
|
// packages/Molecules/Search/index.tsx
|
|
904
893
|
import { CommandLoading } from "cmdk";
|
|
905
|
-
import { motion
|
|
894
|
+
import { motion } from "framer-motion";
|
|
906
895
|
import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
907
896
|
var Search2 = ({ search = "", isLoading = false, items = [], onSearch }) => {
|
|
908
897
|
const [open, setOpen] = useState(false);
|
|
@@ -932,13 +921,13 @@ var Search2 = ({ search = "", isLoading = false, items = [], onSearch }) => {
|
|
|
932
921
|
py: "1",
|
|
933
922
|
width: "fit",
|
|
934
923
|
gapX: "2",
|
|
935
|
-
className: "mr-8
|
|
924
|
+
className: "mr-8 rounded-lg border border-neutral-200 bg-ui-surface-50 hover:cursor-pointer hover:bg-ui-surface-100",
|
|
936
925
|
onClick: handleOpen,
|
|
937
926
|
children: [
|
|
938
927
|
/* @__PURE__ */ jsx4("p", { className: "pt-0.5 text-ui-small-note font-medium text-ui-text-500", children: "T\xECm ki\u1EBFm s\u1EA3n ph\u1EA9m, th\u01B0\u01A1ng hi\u1EC7u,..." }),
|
|
939
928
|
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-x-1 rounded-md bg-ui-surface-200 px-2 py-0.5 text-ui-small-note", children: [
|
|
940
929
|
isMac ? /* @__PURE__ */ jsx4("kbd", { className: "mt-0.5 h-4", children: "\u2318" }) : /* @__PURE__ */ jsx4("kbd", { className: "mt-0.5 h-3 font-semibold", children: "^" }),
|
|
941
|
-
/* @__PURE__ */ jsx4("span", { className: "
|
|
930
|
+
/* @__PURE__ */ jsx4("span", { className: "text-ui-small-note font-medium", children: "K" })
|
|
942
931
|
] })
|
|
943
932
|
]
|
|
944
933
|
}
|
|
@@ -953,9 +942,9 @@ var Search2 = ({ search = "", isLoading = false, items = [], onSearch }) => {
|
|
|
953
942
|
}
|
|
954
943
|
),
|
|
955
944
|
/* @__PURE__ */ jsxs3(CommandList, { children: [
|
|
956
|
-
!isLoading && /* @__PURE__ */ jsx4(CommandEmpty, { className: "flex items-center justify-center px-4
|
|
957
|
-
isLoading ? /* @__PURE__ */ jsx4(CommandLoading, { className: "flex items-center justify-center
|
|
958
|
-
|
|
945
|
+
!isLoading && /* @__PURE__ */ jsx4(CommandEmpty, { className: "flex h-52 items-center justify-center px-4", children: /* @__PURE__ */ jsx4("span", { className: "font-medium text-ui-text-800", children: "Kh\xF4ng c\xF3 k\u1EBFt qu\u1EA3" }) }),
|
|
946
|
+
isLoading ? /* @__PURE__ */ jsx4(CommandLoading, { className: "flex h-52 items-center justify-center", children: /* @__PURE__ */ jsx4(
|
|
947
|
+
motion.div,
|
|
959
948
|
{
|
|
960
949
|
animate: {
|
|
961
950
|
scale: [1, 2, 2, 1, 1],
|
|
@@ -969,7 +958,7 @@ var Search2 = ({ search = "", isLoading = false, items = [], onSearch }) => {
|
|
|
969
958
|
repeat: Infinity,
|
|
970
959
|
repeatDelay: 1
|
|
971
960
|
},
|
|
972
|
-
className: "
|
|
961
|
+
className: "box size-16 rounded-full bg-neutral-200"
|
|
973
962
|
}
|
|
974
963
|
) }) : /* @__PURE__ */ jsx4(CommandGroup, { children: items.map((item, index) => /* @__PURE__ */ jsx4(CommandItem, { value: item.value, children: item.component }, index)) })
|
|
975
964
|
] })
|
|
@@ -289,9 +289,10 @@ var cn = (...inputs) => {
|
|
|
289
289
|
|
|
290
290
|
// packages/Atoms/XButton/index.tsx
|
|
291
291
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
292
|
-
var XButton = ({ isDisabled, onClick }) => {
|
|
292
|
+
var XButton = ({ isButton = true, isDisabled, onClick }) => {
|
|
293
|
+
const Comp = isButton ? "button" : "div";
|
|
293
294
|
return /* @__PURE__ */ jsx2(
|
|
294
|
-
|
|
295
|
+
Comp,
|
|
295
296
|
{
|
|
296
297
|
disabled: isDisabled,
|
|
297
298
|
className: cn(
|
|
@@ -363,7 +364,20 @@ var SheetContent = forwardRef(
|
|
|
363
364
|
...props,
|
|
364
365
|
children: [
|
|
365
366
|
children,
|
|
366
|
-
/* @__PURE__ */ jsx3(
|
|
367
|
+
/* @__PURE__ */ jsx3(
|
|
368
|
+
SheetPrimitive.Close,
|
|
369
|
+
{
|
|
370
|
+
className: cn(
|
|
371
|
+
"absolute right-4 top-4",
|
|
372
|
+
"rounded-full",
|
|
373
|
+
"enabled:hover:bg-ui-surface-100",
|
|
374
|
+
"enabled:hover:text-ui-text-700",
|
|
375
|
+
"enabled:active:bg-ui-surface-200",
|
|
376
|
+
"enabled:active:text-ui-text-900"
|
|
377
|
+
),
|
|
378
|
+
children: /* @__PURE__ */ jsx3(XButton_default, { isButton: false })
|
|
379
|
+
}
|
|
380
|
+
)
|
|
367
381
|
]
|
|
368
382
|
}
|
|
369
383
|
)
|
|
@@ -400,12 +414,11 @@ var SheetDescription = forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
400
414
|
SheetDescription.displayName = SheetPrimitive.Description.displayName;
|
|
401
415
|
|
|
402
416
|
// packages/Atoms/UserAvatar/index.tsx
|
|
403
|
-
import {
|
|
417
|
+
import { memo as memo2 } from "react";
|
|
404
418
|
|
|
405
419
|
// packages/Icons/AvatarIcon.tsx
|
|
406
420
|
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
407
|
-
var AvatarIcon = (
|
|
408
|
-
const { bgColor, color, size } = props;
|
|
421
|
+
var AvatarIcon = ({ bgColor, color, size, ...Props }) => {
|
|
409
422
|
return /* @__PURE__ */ jsxs2(
|
|
410
423
|
"svg",
|
|
411
424
|
{
|
|
@@ -414,7 +427,7 @@ var AvatarIcon = (props) => {
|
|
|
414
427
|
height: size ?? DEFAULT_ICON_SIZE,
|
|
415
428
|
viewBox: "0 0 96 96",
|
|
416
429
|
fill: "none",
|
|
417
|
-
...
|
|
430
|
+
...Props,
|
|
418
431
|
children: [
|
|
419
432
|
/* @__PURE__ */ jsx4(
|
|
420
433
|
"path",
|
|
@@ -583,38 +596,34 @@ var color_hash_default = colorHash;
|
|
|
583
596
|
|
|
584
597
|
// packages/Atoms/UserAvatar/index.tsx
|
|
585
598
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
586
|
-
var UserAvatar = memo2(
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
599
|
+
var UserAvatar = memo2(({ fullname, email, src: source, size, isButton = true }) => {
|
|
600
|
+
const Comp = isButton ? "button" : "div";
|
|
601
|
+
return /* @__PURE__ */ jsx5(
|
|
602
|
+
Comp,
|
|
603
|
+
{
|
|
604
|
+
disabled: !isButton,
|
|
605
|
+
className: cn(
|
|
606
|
+
"flex size-fit items-center justify-center rounded-full transition-all duration-300",
|
|
607
|
+
"enabled:hover:shadow-ui-flat",
|
|
608
|
+
"enabled:hover:scale-110"
|
|
609
|
+
),
|
|
610
|
+
children: source ? /* @__PURE__ */ jsx5(AvatarIcon_default, { bgColor: color_hash_default.hex(fullname + email), size }) : /* @__PURE__ */ jsx5(
|
|
611
|
+
"img",
|
|
591
612
|
{
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
"enabled:hover:shadow-ui-flat",
|
|
597
|
-
"enabled:hover:scale-110"
|
|
598
|
-
),
|
|
599
|
-
children: source ? /* @__PURE__ */ jsx5(
|
|
600
|
-
"img",
|
|
601
|
-
{
|
|
602
|
-
style: { width: size, height: size },
|
|
603
|
-
className: cn("rounded-full object-fill"),
|
|
604
|
-
src: source,
|
|
605
|
-
alt: fullname
|
|
606
|
-
}
|
|
607
|
-
) : /* @__PURE__ */ jsx5(AvatarIcon_default, { bgColor: color_hash_default.hex(fullname + email), size })
|
|
613
|
+
style: { width: size, height: size },
|
|
614
|
+
className: cn("rounded-full object-contain"),
|
|
615
|
+
src: source,
|
|
616
|
+
alt: fullname
|
|
608
617
|
}
|
|
609
|
-
)
|
|
618
|
+
)
|
|
610
619
|
}
|
|
611
|
-
)
|
|
612
|
-
);
|
|
620
|
+
);
|
|
621
|
+
});
|
|
613
622
|
UserAvatar.displayName = "UserAvatar";
|
|
614
623
|
var UserAvatar_default = UserAvatar;
|
|
615
624
|
|
|
616
625
|
// packages/Layout/Flex/index.tsx
|
|
617
|
-
import { forwardRef as
|
|
626
|
+
import { forwardRef as forwardRef2, memo as memo3, useMemo } from "react";
|
|
618
627
|
|
|
619
628
|
// packages/Layout/Flex/flexVariant.ts
|
|
620
629
|
import { cva as cva2 } from "class-variance-authority";
|
|
@@ -917,7 +926,7 @@ var commonLayout = cva3("", {
|
|
|
917
926
|
// packages/Layout/Flex/index.tsx
|
|
918
927
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
919
928
|
var Flex = memo3(
|
|
920
|
-
|
|
929
|
+
forwardRef2(
|
|
921
930
|
({
|
|
922
931
|
vertical = false,
|
|
923
932
|
wrap = "nowrap",
|
|
@@ -1,24 +1,46 @@
|
|
|
1
1
|
import { ReactNode, FC } from 'react';
|
|
2
|
-
import { T as TUser, a as TUserSettingSelect } from '../../types-
|
|
2
|
+
import { T as TUser, a as TUserSettingSelect } from '../../types-BlE003QY.js';
|
|
3
|
+
|
|
4
|
+
interface ICategory {
|
|
5
|
+
uuid: string;
|
|
6
|
+
name: string;
|
|
7
|
+
slug: string;
|
|
8
|
+
url?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
sub: {
|
|
11
|
+
uuid: string;
|
|
12
|
+
name: string;
|
|
13
|
+
slug: string;
|
|
14
|
+
url?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
}[];
|
|
17
|
+
}
|
|
3
18
|
|
|
4
19
|
type THeaderNav = 'CATEGORY' | 'SERIES' | 'GUIDE' | 'NEWS' | null;
|
|
5
20
|
interface IHeaderProps {
|
|
6
21
|
user?: TUser;
|
|
7
22
|
search?: string;
|
|
8
23
|
isLoading?: boolean;
|
|
24
|
+
hasNewCart?: boolean;
|
|
9
25
|
items?: {
|
|
10
26
|
value: string;
|
|
11
27
|
component: ReactNode;
|
|
12
28
|
}[];
|
|
13
|
-
|
|
14
|
-
|
|
29
|
+
cartOrder?: ReactNode;
|
|
30
|
+
cartInStock?: ReactNode;
|
|
31
|
+
activeUserNav?: 'PROFILE' | 'SECURITY' | 'NOTIFICATION' | 'RESERVATION' | 'ADDRESS' | 'LOGOUT';
|
|
32
|
+
categories: ICategory[];
|
|
33
|
+
cartsAmountTotal?: number;
|
|
15
34
|
className?: string;
|
|
16
35
|
onSignIn?: () => void;
|
|
17
36
|
onSignUp?: () => void;
|
|
18
37
|
onSearch?: (value: string) => void;
|
|
19
38
|
onSettingSelected?: (value: TUserSettingSelect) => void;
|
|
39
|
+
onShowAllProduct?: () => void;
|
|
20
40
|
onCartCheckout?: () => void;
|
|
21
41
|
onCartShowAll?: () => void;
|
|
42
|
+
onCartTypeSelected?: (value: 'ORDER' | 'IN_STOCK') => void;
|
|
43
|
+
onCategorySelected?: (slug: string) => void;
|
|
22
44
|
}
|
|
23
45
|
declare const Header: FC<IHeaderProps>;
|
|
24
46
|
|