@customafk/lunas-ui 0.0.2-w → 0.0.2-y

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.
@@ -4,8 +4,8 @@ import * as class_variance_authority_dist_types from 'class-variance-authority/d
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const buttonVariants: (props?: ({
7
- variant?: "normal" | "default" | "secondary" | "outline" | "destructive" | "destructive-secondary" | "destructive-outline" | "sort-outline" | null | undefined;
8
- size?: "small" | "default" | "large" | "base" | null | undefined;
7
+ variant?: "default" | "secondary" | "outline" | "destructive" | "destructive-secondary" | "destructive-outline" | "sort-outline" | "normal" | null | undefined;
8
+ size?: "base" | "small" | "default" | "large" | null | undefined;
9
9
  } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
10
10
 
11
11
  interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
@@ -8,7 +8,7 @@ declare const Command: React.ForwardRefExoticComponent<Omit<{
8
8
  ref?: React.Ref<HTMLDivElement>;
9
9
  } & {
10
10
  asChild?: boolean;
11
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
11
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
12
12
  label?: string;
13
13
  shouldFilter?: boolean;
14
14
  filter?: (value: string, search: string, keywords?: string[]) => number;
@@ -26,7 +26,7 @@ declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<
26
26
  ref?: React.Ref<HTMLInputElement>;
27
27
  } & {
28
28
  asChild?: boolean;
29
- }, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "value" | "type"> & {
29
+ }, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
30
30
  value?: string;
31
31
  onValueChange?: (search: string) => void;
32
32
  } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -36,7 +36,7 @@ declare const CommandList: React.ForwardRefExoticComponent<Omit<{
36
36
  ref?: React.Ref<HTMLDivElement>;
37
37
  } & {
38
38
  asChild?: boolean;
39
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
39
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
40
40
  label?: string;
41
41
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
42
42
  declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
@@ -45,14 +45,14 @@ declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
45
45
  ref?: React.Ref<HTMLDivElement>;
46
46
  } & {
47
47
  asChild?: boolean;
48
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
48
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
49
49
  declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
50
50
  children?: React.ReactNode;
51
51
  } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
52
52
  ref?: React.Ref<HTMLDivElement>;
53
53
  } & {
54
54
  asChild?: boolean;
55
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "heading" | "value"> & {
55
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "value" | "heading"> & {
56
56
  heading?: React.ReactNode;
57
57
  value?: string;
58
58
  forceMount?: boolean;
@@ -61,7 +61,7 @@ declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<Pick<Pick<R
61
61
  ref?: React.Ref<HTMLDivElement>;
62
62
  } & {
63
63
  asChild?: boolean;
64
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
64
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
65
65
  alwaysRender?: boolean;
66
66
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
67
67
  declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
@@ -70,7 +70,7 @@ declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
70
70
  ref?: React.Ref<HTMLDivElement>;
71
71
  } & {
72
72
  asChild?: boolean;
73
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "onSelect" | "disabled" | "value"> & {
73
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "onSelect" | "disabled" | "value"> & {
74
74
  disabled?: boolean;
75
75
  onSelect?: (value: string) => void;
76
76
  value?: string;
@@ -1,13 +1,13 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
- import * as SheetPrimitive from '@radix-ui/react-dialog';
3
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
4
4
 
5
- declare const Dialog: React.FC<SheetPrimitive.DialogProps>;
6
- declare const DialogTrigger: React.ForwardRefExoticComponent<SheetPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
7
- declare const DialogPortal: React.FC<SheetPrimitive.DialogPortalProps>;
8
- declare const DialogClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
9
- declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
10
- declare const DialogContent: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
+ declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
6
+ declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
7
+ declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
8
+ declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
9
+ declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
10
+ declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
11
11
  declare const DialogHeader: {
12
12
  ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
13
13
  displayName: string;
@@ -16,7 +16,7 @@ declare const DialogFooter: {
16
16
  ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
17
17
  displayName: string;
18
18
  };
19
- declare const DialogTitle: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
20
- declare const DialogDescription: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
19
+ declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
20
+ declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
21
21
 
22
22
  export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
@@ -1,18 +1,18 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
3
3
  import React__default, { ComponentPropsWithoutRef } from 'react';
4
- import * as SheetPrimitive from '@radix-ui/react-dialog';
4
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
5
5
  import { VariantProps } from 'class-variance-authority';
6
6
 
7
- declare const Sheet: React__default.FC<SheetPrimitive.DialogProps>;
8
- declare const SheetTrigger: React__default.ForwardRefExoticComponent<SheetPrimitive.DialogTriggerProps & React__default.RefAttributes<HTMLButtonElement>>;
9
- declare const SheetClose: React__default.ForwardRefExoticComponent<SheetPrimitive.DialogCloseProps & React__default.RefAttributes<HTMLButtonElement>>;
10
- declare const SheetPortal: React__default.FC<SheetPrimitive.DialogPortalProps>;
11
- declare const SheetOverlay: React__default.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React__default.RefAttributes<HTMLDivElement>, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
7
+ declare const Sheet: React__default.FC<DialogPrimitive.DialogProps>;
8
+ declare const SheetTrigger: React__default.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React__default.RefAttributes<HTMLButtonElement>>;
9
+ declare const SheetClose: React__default.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React__default.RefAttributes<HTMLButtonElement>>;
10
+ declare const SheetPortal: React__default.FC<DialogPrimitive.DialogPortalProps>;
11
+ declare const SheetOverlay: React__default.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React__default.RefAttributes<HTMLDivElement>, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
12
12
  declare const sheetVariants: (props?: ({
13
- side?: "top" | "right" | "bottom" | "left" | null | undefined;
13
+ side?: "top" | "bottom" | "left" | "right" | null | undefined;
14
14
  } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
15
- interface SheetContentProps extends ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
15
+ interface SheetContentProps extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, VariantProps<typeof sheetVariants> {
16
16
  }
17
17
  declare const SheetContent: React__default.ForwardRefExoticComponent<SheetContentProps & React__default.RefAttributes<HTMLDivElement>>;
18
18
  declare const SheetHeader: {
@@ -23,7 +23,7 @@ declare const SheetFooter: {
23
23
  ({ className, ...props }: React__default.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
24
24
  displayName: string;
25
25
  };
26
- declare const SheetTitle: React__default.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogTitleProps & React__default.RefAttributes<HTMLHeadingElement>, "ref"> & React__default.RefAttributes<HTMLHeadingElement>>;
27
- declare const SheetDescription: React__default.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogDescriptionProps & React__default.RefAttributes<HTMLParagraphElement>, "ref"> & React__default.RefAttributes<HTMLParagraphElement>>;
26
+ declare const SheetTitle: React__default.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React__default.RefAttributes<HTMLHeadingElement>, "ref"> & React__default.RefAttributes<HTMLHeadingElement>>;
27
+ declare const SheetDescription: React__default.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React__default.RefAttributes<HTMLParagraphElement>, "ref"> & React__default.RefAttributes<HTMLParagraphElement>>;
28
28
 
29
29
  export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger };
@@ -444,7 +444,7 @@ var UserAvatar = memo(({ fullname, email, src: source, size, isButton = true })
444
444
  "enabled:hover:shadow-ui-flat",
445
445
  "enabled:hover:scale-110"
446
446
  ),
447
- children: source ? /* @__PURE__ */ jsx2(
447
+ children: source ? /* @__PURE__ */ jsx2(AvatarIcon_default, { bgColor: color_hash_default.hex(fullname + email), size }) : /* @__PURE__ */ jsx2(
448
448
  "img",
449
449
  {
450
450
  style: { width: size, height: size },
@@ -452,7 +452,7 @@ var UserAvatar = memo(({ fullname, email, src: source, size, isButton = true })
452
452
  src: source,
453
453
  alt: fullname
454
454
  }
455
- ) : /* @__PURE__ */ jsx2(AvatarIcon_default, { bgColor: color_hash_default.hex(fullname + email), size })
455
+ )
456
456
  }
457
457
  );
458
458
  });
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { I as IIconProps } from '../types-BgHhiNa-.js';
2
+ import { I as IIconProps } from '../types-BlE003QY.js';
3
3
  import { FC } from 'react';
4
4
 
5
5
  declare const AvatarIcon: {
@@ -607,7 +607,7 @@ var UserAvatar = memo2(({ fullname, email, src: source, size, isButton = true })
607
607
  "enabled:hover:shadow-ui-flat",
608
608
  "enabled:hover:scale-110"
609
609
  ),
610
- children: source ? /* @__PURE__ */ jsx5(
610
+ children: source ? /* @__PURE__ */ jsx5(AvatarIcon_default, { bgColor: color_hash_default.hex(fullname + email), size }) : /* @__PURE__ */ jsx5(
611
611
  "img",
612
612
  {
613
613
  style: { width: size, height: size },
@@ -615,7 +615,7 @@ var UserAvatar = memo2(({ fullname, email, src: source, size, isButton = true })
615
615
  src: source,
616
616
  alt: fullname
617
617
  }
618
- ) : /* @__PURE__ */ jsx5(AvatarIcon_default, { bgColor: color_hash_default.hex(fullname + email), size })
618
+ )
619
619
  }
620
620
  );
621
621
  });
@@ -1,5 +1,5 @@
1
1
  import { ReactNode, FC } from 'react';
2
- import { T as TUser, a as TUserSettingSelect } from '../../types-BgHhiNa-.js';
2
+ import { T as TUser, a as TUserSettingSelect } from '../../types-BlE003QY.js';
3
3
 
4
4
  interface ICategory {
5
5
  uuid: string;
@@ -39,6 +39,7 @@ interface IHeaderProps {
39
39
  onShowAllProduct?: () => void;
40
40
  onCartCheckout?: () => void;
41
41
  onCartShowAll?: () => void;
42
+ onCartTypeSelected?: (value: 'ORDER' | 'IN_STOCK') => void;
42
43
  onCategorySelected?: (slug: string) => void;
43
44
  }
44
45
  declare const Header: FC<IHeaderProps>;
@@ -1467,7 +1467,8 @@ var CartSheet = ({
1467
1467
  inStock,
1468
1468
  order,
1469
1469
  onCheckout,
1470
- onShowAll
1470
+ onShowAll,
1471
+ onTypeSelected
1471
1472
  }) => {
1472
1473
  const formattedMoney = new Intl.NumberFormat("vi-VN").format(moneyTotal ?? 0);
1473
1474
  const formattedQuantity = new Intl.NumberFormat("vi-VN").format(quantityTotal ?? 0);
@@ -1489,8 +1490,8 @@ var CartSheet = ({
1489
1490
  className: "relative flex w-full flex-col items-center overflow-auto",
1490
1491
  children: [
1491
1492
  /* @__PURE__ */ jsxs9(TabsList, { className: "h-fit w-[90%] *:w-1/2", children: [
1492
- /* @__PURE__ */ jsx18(TabsTrigger, { value: "order", children: "H\xE0ng \u0111\u1EB7t tr\u01B0\u1EDBc" }),
1493
- /* @__PURE__ */ jsx18(TabsTrigger, { value: "in_stock", children: "H\xE0ng c\xF3 s\u1EB5n" })
1493
+ /* @__PURE__ */ jsx18(TabsTrigger, { value: "order", onClick: () => onTypeSelected?.("ORDER"), children: "H\xE0ng \u0111\u1EB7t tr\u01B0\u1EDBc" }),
1494
+ /* @__PURE__ */ jsx18(TabsTrigger, { value: "in_stock", onClick: () => onTypeSelected?.("IN_STOCK"), children: "H\xE0ng c\xF3 s\u1EB5n" })
1494
1495
  ] }),
1495
1496
  /* @__PURE__ */ jsxs9(ScrollArea, { className: "relative w-full", children: [
1496
1497
  /* @__PURE__ */ jsx18(TabsContent, { value: "order", className: "w-full overflow-auto px-2", children: order }),
@@ -2061,7 +2062,7 @@ var UserAvatar = memo7(({ fullname, email, src: source, size, isButton = true })
2061
2062
  "enabled:hover:shadow-ui-flat",
2062
2063
  "enabled:hover:scale-110"
2063
2064
  ),
2064
- children: source ? /* @__PURE__ */ jsx24(
2065
+ children: source ? /* @__PURE__ */ jsx24(AvatarIcon_default, { bgColor: color_hash_default.hex(fullname + email), size }) : /* @__PURE__ */ jsx24(
2065
2066
  "img",
2066
2067
  {
2067
2068
  style: { width: size, height: size },
@@ -2069,7 +2070,7 @@ var UserAvatar = memo7(({ fullname, email, src: source, size, isButton = true })
2069
2070
  src: source,
2070
2071
  alt: fullname
2071
2072
  }
2072
- ) : /* @__PURE__ */ jsx24(AvatarIcon_default, { bgColor: color_hash_default.hex(fullname + email), size })
2073
+ )
2073
2074
  }
2074
2075
  );
2075
2076
  });
@@ -2391,6 +2392,7 @@ var Header = memo9((props) => {
2391
2392
  onCartCheckout,
2392
2393
  onCartShowAll,
2393
2394
  onShowAllProduct,
2395
+ onCartTypeSelected,
2394
2396
  onCategorySelected
2395
2397
  } = props;
2396
2398
  return /* @__PURE__ */ jsxs17(
@@ -2444,7 +2446,7 @@ var Header = memo9((props) => {
2444
2446
  initialActiveItem: activeUserNav,
2445
2447
  fullname: user.fullname,
2446
2448
  email: user.email,
2447
- avatar: user.avatar,
2449
+ avatar: user.avatar ?? "",
2448
2450
  onSelectItem: onSettingSelected
2449
2451
  }
2450
2452
  ) : /* @__PURE__ */ jsxs17(Fragment3, { children: [
@@ -2475,7 +2477,8 @@ var Header = memo9((props) => {
2475
2477
  inStock: cartInStock,
2476
2478
  moneyTotal: cartsAmountTotal,
2477
2479
  onCheckout: onCartCheckout,
2478
- onShowAll: onCartShowAll
2480
+ onShowAll: onCartShowAll,
2481
+ onTypeSelected: onCartTypeSelected
2479
2482
  }
2480
2483
  )
2481
2484
  ]
@@ -11,7 +11,7 @@ type TUser = {
11
11
  fullname: string;
12
12
  username: string;
13
13
  email: string;
14
- avatar: string;
14
+ avatar: string | null;
15
15
  };
16
16
  type TUserSettingSelect = 'PROFILE' | 'SECURITY' | 'NOTIFICATION' | 'RESERVATION' | 'ADDRESS' | 'LOGOUT';
17
17
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@customafk/lunas-ui",
4
4
  "private": false,
5
- "version": "0.0.2-w",
5
+ "version": "0.0.2-y",
6
6
  "type": "module",
7
7
  "homepage": "https://docs.customafk.com",
8
8
  "repository": {