@sikka/hawa 0.42.5-next → 0.42.7-next
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/{Chip-Cato49ar.d.ts → Chip-Cw1twk4G.d.ts} +6 -6
- package/dist/{Chip-CGl24Kd9.d.mts → Chip-KG1_ZmCL.d.mts} +6 -6
- package/dist/{DropdownMenu-DgV8PvW3.d.ts → DropdownMenu-CDnFCzfc.d.ts} +5 -5
- package/dist/{DropdownMenu-dvd9brmT.d.mts → DropdownMenu-mK9EvfKp.d.mts} +5 -5
- package/dist/{Toast-fy9tBz19.d.ts → Toast-BaXp3G7y.d.ts} +1 -1
- package/dist/{Toast-BcFD9aeQ.d.mts → Toast-CKWr23kg.d.mts} +1 -1
- package/dist/accordion/index.d.mts +3 -3
- package/dist/accordion/index.d.ts +3 -3
- package/dist/alert/index.js.map +1 -1
- package/dist/alert/index.mjs.map +1 -1
- package/dist/appLayout/index.js.map +1 -1
- package/dist/appLayout/index.mjs.map +1 -1
- package/dist/appMenubar/index.d.mts +8 -11
- package/dist/appMenubar/index.d.ts +8 -11
- package/dist/appMenubar/index.js.map +1 -1
- package/dist/appMenubar/index.mjs.map +1 -1
- package/dist/backToTop/index.js.map +1 -1
- package/dist/backToTop/index.mjs.map +1 -1
- package/dist/blocks/auth/index.d.mts +4 -2
- package/dist/blocks/auth/index.d.ts +4 -2
- package/dist/blocks/auth/index.js +37 -29
- package/dist/blocks/auth/index.mjs +37 -29
- package/dist/blocks/index.d.mts +5 -3
- package/dist/blocks/index.d.ts +5 -3
- package/dist/blocks/index.js +37 -29
- package/dist/blocks/index.mjs +15 -12
- package/dist/button/index.js.map +1 -1
- package/dist/button/index.mjs.map +1 -1
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/index.mjs.map +1 -1
- package/dist/card/index.d.mts +3 -3
- package/dist/card/index.d.ts +3 -3
- package/dist/checkbox/index.d.mts +2 -2
- package/dist/checkbox/index.d.ts +2 -2
- package/dist/chip/index.d.mts +6 -6
- package/dist/chip/index.d.ts +6 -6
- package/dist/{chunk-DBOKFWWD.mjs → chunk-3DT2KQXP.mjs} +12 -7
- package/dist/{chunk-G7JRS64F.mjs → chunk-RIZBMJNK.mjs} +15 -15
- package/dist/{chunk-OXZBK6KQ.mjs → chunk-UZD7PSQG.mjs} +1 -1
- package/dist/{chunk-MA7CACEB.mjs → chunk-WL7C2A5D.mjs} +1 -6
- package/dist/codeBlock/index.js.map +1 -1
- package/dist/codeBlock/index.mjs.map +1 -1
- package/dist/colorPicker/index.js.map +1 -1
- package/dist/colorPicker/index.mjs.map +1 -1
- package/dist/combobox/index.js.map +1 -1
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/dataTable/index.js.map +1 -1
- package/dist/dataTable/index.mjs.map +1 -1
- package/dist/datePicker/index.js.map +1 -1
- package/dist/datePicker/index.mjs.map +1 -1
- package/dist/dialog/index.d.mts +17 -16
- package/dist/dialog/index.d.ts +17 -16
- package/dist/docsLayout/index.js +12 -7
- package/dist/docsLayout/index.js.map +1 -1
- package/dist/docsLayout/index.mjs +12 -7
- package/dist/docsLayout/index.mjs.map +1 -1
- package/dist/dropdownMenu/index.d.mts +5 -5
- package/dist/dropdownMenu/index.d.ts +5 -5
- package/dist/elements/index.d.mts +77 -76
- package/dist/elements/index.d.ts +77 -76
- package/dist/elements/index.js +25 -20
- package/dist/elements/index.mjs +4 -4
- package/dist/fileDropzone/index.js.map +1 -1
- package/dist/fileDropzone/index.mjs.map +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +1 -6
- package/dist/hooks/index.mjs +1 -1
- package/dist/index.d.mts +96 -96
- package/dist/index.d.ts +96 -96
- package/dist/index.js +38 -35
- package/dist/index.mjs +38 -35
- package/dist/input/index.d.mts +16 -16
- package/dist/input/index.d.ts +16 -16
- package/dist/input/index.js.map +1 -1
- package/dist/input/index.mjs.map +1 -1
- package/dist/interfaceSettings/index.js.map +1 -1
- package/dist/interfaceSettings/index.mjs.map +1 -1
- package/dist/label/index.js.map +1 -1
- package/dist/label/index.mjs.map +1 -1
- package/dist/layout/index.d.mts +10 -13
- package/dist/layout/index.d.ts +10 -13
- package/dist/layout/index.js +12 -7
- package/dist/layout/index.mjs +2 -2
- package/dist/logos/index.js +12 -7
- package/dist/logos/index.js.map +1 -1
- package/dist/logos/index.mjs +12 -7
- package/dist/logos/index.mjs.map +1 -1
- package/dist/navigationMenu/index.d.mts +1 -1
- package/dist/navigationMenu/index.d.ts +1 -1
- package/dist/passwordInput/index.js.map +1 -1
- package/dist/passwordInput/index.mjs.map +1 -1
- package/dist/phoneInput/index.js.map +1 -1
- package/dist/phoneInput/index.mjs.map +1 -1
- package/dist/pinInput/index.d.mts +16 -16
- package/dist/pinInput/index.d.ts +16 -16
- package/dist/pinInput/index.js +13 -13
- package/dist/pinInput/index.js.map +1 -1
- package/dist/pinInput/index.mjs +13 -13
- package/dist/pinInput/index.mjs.map +1 -1
- package/dist/popover/index.d.mts +1 -1
- package/dist/popover/index.d.ts +1 -1
- package/dist/progress/index.d.mts +2 -2
- package/dist/progress/index.d.ts +2 -2
- package/dist/progress/index.js.map +1 -1
- package/dist/progress/index.mjs.map +1 -1
- package/dist/radio/index.js.map +1 -1
- package/dist/radio/index.mjs.map +1 -1
- package/dist/scrollArea/index.d.mts +1 -1
- package/dist/scrollArea/index.d.ts +1 -1
- package/dist/select/index.js.map +1 -1
- package/dist/select/index.mjs.map +1 -1
- package/dist/signature/index.js.map +1 -1
- package/dist/signature/index.mjs.map +1 -1
- package/dist/sortButton/index.js.map +1 -1
- package/dist/sortButton/index.mjs.map +1 -1
- package/dist/splitButton/index.js.map +1 -1
- package/dist/splitButton/index.mjs.map +1 -1
- package/dist/tabs/index.d.mts +9 -9
- package/dist/tabs/index.d.ts +9 -9
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/index.mjs.map +1 -1
- package/dist/textarea/index.js.map +1 -1
- package/dist/textarea/index.mjs.map +1 -1
- package/dist/toast/index.d.mts +1 -1
- package/dist/toast/index.d.ts +1 -1
- package/dist/tooltip/index.d.mts +1 -1
- package/dist/tooltip/index.d.ts +1 -1
- package/dist/tooltip/index.js.map +1 -1
- package/dist/tooltip/index.mjs.map +1 -1
- package/package.json +28 -28
@@ -1,28 +1,25 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import * as MenubarPrimitive from '@radix-ui/react-menubar';
|
3
3
|
|
4
|
-
declare const MenubarMenu:
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
declare const
|
9
|
-
declare const MenubarPortal: React.FC<MenubarPrimitive.MenubarPortalProps>;
|
10
|
-
declare const MenubarSub: React.FC<MenubarPrimitive.MenubarSubProps>;
|
11
|
-
declare const MenubarRadioGroup: React.ForwardRefExoticComponent<MenubarPrimitive.MenubarRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
4
|
+
declare const MenubarMenu: React.FC<React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Menu>>;
|
5
|
+
declare const MenubarGroup: React.FC<React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Group>>;
|
6
|
+
declare const MenubarPortal: React.FC<React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Portal>>;
|
7
|
+
declare const MenubarSub: React.FC<React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Sub>>;
|
8
|
+
declare const MenubarRadioGroup: React.FC<React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioGroup>>;
|
12
9
|
declare const Menubar: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
13
10
|
declare const MenubarTrigger: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
14
11
|
declare const MenubarSubTrigger: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
15
|
-
inset?: boolean
|
12
|
+
inset?: boolean;
|
16
13
|
} & React.RefAttributes<HTMLDivElement>>;
|
17
14
|
declare const MenubarSubContent: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
18
15
|
declare const MenubarContent: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
19
16
|
declare const MenubarItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
20
|
-
inset?: boolean
|
17
|
+
inset?: boolean;
|
21
18
|
} & React.RefAttributes<HTMLDivElement>>;
|
22
19
|
declare const MenubarCheckboxItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
23
20
|
declare const MenubarRadioItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
24
21
|
declare const MenubarLabel: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
25
|
-
inset?: boolean
|
22
|
+
inset?: boolean;
|
26
23
|
} & React.RefAttributes<HTMLDivElement>>;
|
27
24
|
declare const MenubarSeparator: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
28
25
|
declare const MenubarShortcut: {
|
@@ -1,28 +1,25 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import * as MenubarPrimitive from '@radix-ui/react-menubar';
|
3
3
|
|
4
|
-
declare const MenubarMenu:
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
declare const
|
9
|
-
declare const MenubarPortal: React.FC<MenubarPrimitive.MenubarPortalProps>;
|
10
|
-
declare const MenubarSub: React.FC<MenubarPrimitive.MenubarSubProps>;
|
11
|
-
declare const MenubarRadioGroup: React.ForwardRefExoticComponent<MenubarPrimitive.MenubarRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
4
|
+
declare const MenubarMenu: React.FC<React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Menu>>;
|
5
|
+
declare const MenubarGroup: React.FC<React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Group>>;
|
6
|
+
declare const MenubarPortal: React.FC<React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Portal>>;
|
7
|
+
declare const MenubarSub: React.FC<React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Sub>>;
|
8
|
+
declare const MenubarRadioGroup: React.FC<React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioGroup>>;
|
12
9
|
declare const Menubar: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
13
10
|
declare const MenubarTrigger: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
14
11
|
declare const MenubarSubTrigger: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
15
|
-
inset?: boolean
|
12
|
+
inset?: boolean;
|
16
13
|
} & React.RefAttributes<HTMLDivElement>>;
|
17
14
|
declare const MenubarSubContent: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
18
15
|
declare const MenubarContent: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
19
16
|
declare const MenubarItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
20
|
-
inset?: boolean
|
17
|
+
inset?: boolean;
|
21
18
|
} & React.RefAttributes<HTMLDivElement>>;
|
22
19
|
declare const MenubarCheckboxItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
23
20
|
declare const MenubarRadioItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
24
21
|
declare const MenubarLabel: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
25
|
-
inset?: boolean
|
22
|
+
inset?: boolean;
|
26
23
|
} & React.RefAttributes<HTMLDivElement>>;
|
27
24
|
declare const MenubarSeparator: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
28
25
|
declare const MenubarShortcut: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../layout/appMenubar/index.ts","../../layout/appMenubar/AppMenubar.tsx","../../util/index.ts"],"sourcesContent":["export * from \"./AppMenubar\";\n","import * as React from \"react\";\n\nimport * as MenubarPrimitive from \"@radix-ui/react-menubar\";\nimport { cn } from \"@util/index\";\n\nconst MenubarMenu = MenubarPrimitive.Menu;\nconst MenubarGroup = MenubarPrimitive.Group;\nconst MenubarPortal = MenubarPrimitive.Portal;\nconst MenubarSub = MenubarPrimitive.Sub;\nconst MenubarRadioGroup = MenubarPrimitive.RadioGroup;\n\nconst Menubar = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Root\n ref={ref}\n className={cn(\n \"hawa-flex hawa-h-10 hawa-items-center hawa-space-x-1 hawa-rounded-md hawa-border hawa-bg-background hawa-p-1\",\n className,\n )}\n {...props}\n />\n));\nMenubar.displayName = MenubarPrimitive.Root.displayName;\n\nconst MenubarTrigger = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Trigger\n ref={ref}\n className={cn(\n \"hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-font-medium hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-accent-foreground\",\n className,\n )}\n {...props}\n />\n));\nMenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;\n\nconst MenubarSubTrigger = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <MenubarPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-accent-foreground\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n\n <svg\n aria-label=\"Chevron Right Icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"hawa-icon hawa-ml-auto\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n </MenubarPrimitive.SubTrigger>\n));\nMenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;\n\nconst MenubarSubContent = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.SubContent\n ref={ref}\n className={cn(\n \"hawa-z-50 hawa-min-w-[8rem] hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-p-1 hawa-text-popover-foreground data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n className,\n )}\n {...props}\n />\n));\nMenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;\n\nconst MenubarContent = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>\n>(\n (\n { className, align = \"start\", alignOffset = -4, sideOffset = 8, ...props },\n ref,\n ) => (\n <MenubarPrimitive.Portal>\n <MenubarPrimitive.Content\n ref={ref}\n align={align}\n alignOffset={alignOffset}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-min-w-[12rem] hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-p-1 hawa-text-popover-foreground hawa-shadow-md data-[state=open]:hawa-animate-in data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n className,\n )}\n {...props}\n />\n </MenubarPrimitive.Portal>\n ),\n);\nMenubarContent.displayName = MenubarPrimitive.Content.displayName;\n\nconst MenubarItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <MenubarPrimitive.Item\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nMenubarItem.displayName = MenubarPrimitive.Item.displayName;\n\nconst MenubarCheckboxItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <MenubarPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center\">\n <MenubarPrimitive.ItemIndicator>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"hawa-icon\"\n >\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n </MenubarPrimitive.ItemIndicator>\n </span>\n {children}\n </MenubarPrimitive.CheckboxItem>\n));\nMenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;\n\nconst MenubarRadioItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <MenubarPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center\">\n <MenubarPrimitive.ItemIndicator>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"hawa-h-2 hawa-w-2 hawa-fill-current\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n </svg>\n </MenubarPrimitive.ItemIndicator>\n </span>\n {children}\n </MenubarPrimitive.RadioItem>\n));\nMenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;\n\nconst MenubarLabel = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <MenubarPrimitive.Label\n ref={ref}\n className={cn(\n \"hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-font-semibold\",\n inset && \"hawa-pl-8\",\n className,\n )}\n {...props}\n />\n));\nMenubarLabel.displayName = MenubarPrimitive.Label.displayName;\n\nconst MenubarSeparator = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Separator\n ref={ref}\n className={cn(\"hawa--mx-1 hawa-my-1 hawa-h-px hawa-bg-muted\", className)}\n {...props}\n />\n));\nMenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;\n\nconst MenubarShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n \"hawa-ml-auto hawa-text-xs hawa-tracking-widest hawa-text-muted-foreground\",\n className,\n )}\n {...props}\n />\n );\n};\nMenubarShortcut.displayname = \"MenubarShortcut\";\n\nexport {\n Menubar,\n MenubarMenu,\n MenubarTrigger,\n MenubarContent,\n MenubarItem,\n MenubarSeparator,\n MenubarLabel,\n MenubarCheckboxItem,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarPortal,\n MenubarSubContent,\n MenubarSubTrigger,\n MenubarGroup,\n MenubarSub,\n MenubarShortcut,\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AAEvB,uBAAkC;;;ACFlC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,k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|
1
|
+
{"version":3,"sources":["../../layout/appMenubar/index.ts","../../layout/appMenubar/AppMenubar.tsx","../../util/index.ts"],"sourcesContent":["export * from \"./AppMenubar\";\n","import * as React from \"react\";\n\nimport * as MenubarPrimitive from \"@radix-ui/react-menubar\";\nimport { cn } from \"@util/index\";\n\nconst MenubarMenu: React.FC<\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Menu>\n> = MenubarPrimitive.Menu;\nconst MenubarGroup: React.FC<\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Group>\n> = MenubarPrimitive.Group;\nconst MenubarPortal: React.FC<\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Portal>\n> = MenubarPrimitive.Portal;\nconst MenubarSub: React.FC<\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Sub>\n> = MenubarPrimitive.Sub;\nconst MenubarRadioGroup: React.FC<\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioGroup>\n> = MenubarPrimitive.RadioGroup;\n\nconst Menubar = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Root\n ref={ref}\n className={cn(\n \"hawa-flex hawa-h-10 hawa-items-center hawa-space-x-1 hawa-rounded-md hawa-border hawa-bg-background hawa-p-1\",\n className,\n )}\n {...props}\n />\n));\nMenubar.displayName = MenubarPrimitive.Root.displayName;\n\nconst MenubarTrigger = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Trigger\n ref={ref}\n className={cn(\n \"hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-font-medium hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-accent-foreground\",\n className,\n )}\n {...props}\n />\n));\nMenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;\n\nconst MenubarSubTrigger = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <MenubarPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-accent-foreground\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n\n <svg\n aria-label=\"Chevron Right Icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"hawa-icon hawa-ml-auto\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n </MenubarPrimitive.SubTrigger>\n));\nMenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;\n\nconst MenubarSubContent = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.SubContent\n ref={ref}\n className={cn(\n \"hawa-z-50 hawa-min-w-[8rem] hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-p-1 hawa-text-popover-foreground data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n className,\n )}\n {...props}\n />\n));\nMenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;\n\nconst MenubarContent = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>\n>(\n (\n { className, align = \"start\", alignOffset = -4, sideOffset = 8, ...props },\n ref,\n ) => (\n <MenubarPrimitive.Portal>\n <MenubarPrimitive.Content\n ref={ref}\n align={align}\n alignOffset={alignOffset}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-min-w-[12rem] hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-p-1 hawa-text-popover-foreground hawa-shadow-md data-[state=open]:hawa-animate-in data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n className,\n )}\n {...props}\n />\n </MenubarPrimitive.Portal>\n ),\n);\nMenubarContent.displayName = MenubarPrimitive.Content.displayName;\n\nconst MenubarItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <MenubarPrimitive.Item\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nMenubarItem.displayName = MenubarPrimitive.Item.displayName;\n\nconst MenubarCheckboxItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <MenubarPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center\">\n <MenubarPrimitive.ItemIndicator>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"hawa-icon\"\n >\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n </MenubarPrimitive.ItemIndicator>\n </span>\n {children}\n </MenubarPrimitive.CheckboxItem>\n));\nMenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;\n\nconst MenubarRadioItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <MenubarPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center\">\n <MenubarPrimitive.ItemIndicator>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"hawa-h-2 hawa-w-2 hawa-fill-current\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n </svg>\n </MenubarPrimitive.ItemIndicator>\n </span>\n {children}\n </MenubarPrimitive.RadioItem>\n));\nMenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;\n\nconst MenubarLabel = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <MenubarPrimitive.Label\n ref={ref}\n className={cn(\n \"hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-font-semibold\",\n inset && \"hawa-pl-8\",\n className,\n )}\n {...props}\n />\n));\nMenubarLabel.displayName = MenubarPrimitive.Label.displayName;\n\nconst MenubarSeparator = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Separator\n ref={ref}\n className={cn(\"hawa--mx-1 hawa-my-1 hawa-h-px hawa-bg-muted\", className)}\n {...props}\n />\n));\nMenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;\n\nconst MenubarShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n \"hawa-ml-auto hawa-text-xs hawa-tracking-widest hawa-text-muted-foreground\",\n className,\n )}\n {...props}\n />\n );\n};\nMenubarShortcut.displayname = \"MenubarShortcut\";\n\nexport {\n Menubar,\n MenubarMenu,\n MenubarTrigger,\n MenubarContent,\n MenubarItem,\n MenubarSeparator,\n MenubarLabel,\n MenubarCheckboxItem,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarPortal,\n MenubarSubContent,\n MenubarSubTrigger,\n MenubarGroup,\n MenubarSub,\n MenubarShortcut,\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AAEvB,uBAAkC;;;ACFlC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADAA,IAAM,cAEe;AACrB,IAAM,eAEe;AACrB,IAAM,gBAEe;AACrB,IAAM,aAEe;AACrB,IAAM,oBAEe;AAErB,IAAM,UAAgB,iBAGpB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,QAAQ,cAA+B,sBAAK;AAE5C,IAAM,iBAAuB,iBAG3B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,eAAe,cAA+B,yBAAQ;AAEtD,IAAM,oBAA0B,iBAK9B,CAAC,EAAE,WAAW,OAAO,UAAU,GAAG,MAAM,GAAG,QAC3C;AAAA,E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kB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA,SAAS;AAAA,MACT;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,aAAa,cAA+B,uBAAM;AAElD,IAAM,mBAAyB,iBAG7B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,gDAAgD,SAAS;AAAA,IACtE,GAAG;AAAA;AACN,CACD;AACD,iBAAiB,cAA+B,2BAAU;AAE1D,IAAM,kBAAkB,CAAC;AAAA,EACvB;AAAA,EACA,GAAG;AACL,MAA6C;AAC3C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,gBAAgB,cAAc;","names":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../layout/appMenubar/AppMenubar.tsx","../../util/index.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport * as MenubarPrimitive from \"@radix-ui/react-menubar\";\nimport { cn } from \"@util/index\";\n\nconst MenubarMenu = MenubarPrimitive.Menu;\nconst MenubarGroup = MenubarPrimitive.Group;\nconst MenubarPortal = MenubarPrimitive.Portal;\nconst MenubarSub = MenubarPrimitive.Sub;\nconst MenubarRadioGroup = MenubarPrimitive.RadioGroup;\n\nconst Menubar = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Root\n ref={ref}\n className={cn(\n \"hawa-flex hawa-h-10 hawa-items-center hawa-space-x-1 hawa-rounded-md hawa-border hawa-bg-background hawa-p-1\",\n className,\n )}\n {...props}\n />\n));\nMenubar.displayName = MenubarPrimitive.Root.displayName;\n\nconst MenubarTrigger = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Trigger\n ref={ref}\n className={cn(\n \"hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-font-medium hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-accent-foreground\",\n className,\n )}\n {...props}\n />\n));\nMenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;\n\nconst MenubarSubTrigger = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <MenubarPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-accent-foreground\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n\n <svg\n aria-label=\"Chevron Right Icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"hawa-icon hawa-ml-auto\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n </MenubarPrimitive.SubTrigger>\n));\nMenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;\n\nconst MenubarSubContent = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.SubContent\n ref={ref}\n className={cn(\n \"hawa-z-50 hawa-min-w-[8rem] hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-p-1 hawa-text-popover-foreground data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n className,\n )}\n {...props}\n />\n));\nMenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;\n\nconst MenubarContent = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>\n>(\n (\n { className, align = \"start\", alignOffset = -4, sideOffset = 8, ...props },\n ref,\n ) => (\n <MenubarPrimitive.Portal>\n <MenubarPrimitive.Content\n ref={ref}\n align={align}\n alignOffset={alignOffset}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-min-w-[12rem] hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-p-1 hawa-text-popover-foreground hawa-shadow-md data-[state=open]:hawa-animate-in data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n className,\n )}\n {...props}\n />\n </MenubarPrimitive.Portal>\n ),\n);\nMenubarContent.displayName = MenubarPrimitive.Content.displayName;\n\nconst MenubarItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <MenubarPrimitive.Item\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nMenubarItem.displayName = MenubarPrimitive.Item.displayName;\n\nconst MenubarCheckboxItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <MenubarPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center\">\n <MenubarPrimitive.ItemIndicator>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"hawa-icon\"\n >\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n </MenubarPrimitive.ItemIndicator>\n </span>\n {children}\n </MenubarPrimitive.CheckboxItem>\n));\nMenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;\n\nconst MenubarRadioItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <MenubarPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center\">\n <MenubarPrimitive.ItemIndicator>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"hawa-h-2 hawa-w-2 hawa-fill-current\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n </svg>\n </MenubarPrimitive.ItemIndicator>\n </span>\n {children}\n </MenubarPrimitive.RadioItem>\n));\nMenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;\n\nconst MenubarLabel = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <MenubarPrimitive.Label\n ref={ref}\n className={cn(\n \"hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-font-semibold\",\n inset && \"hawa-pl-8\",\n className,\n )}\n {...props}\n />\n));\nMenubarLabel.displayName = MenubarPrimitive.Label.displayName;\n\nconst MenubarSeparator = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Separator\n ref={ref}\n className={cn(\"hawa--mx-1 hawa-my-1 hawa-h-px hawa-bg-muted\", className)}\n {...props}\n />\n));\nMenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;\n\nconst MenubarShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n \"hawa-ml-auto hawa-text-xs hawa-tracking-widest hawa-text-muted-foreground\",\n className,\n )}\n {...props}\n />\n );\n};\nMenubarShortcut.displayname = \"MenubarShortcut\";\n\nexport {\n Menubar,\n MenubarMenu,\n MenubarTrigger,\n MenubarContent,\n MenubarItem,\n MenubarSeparator,\n MenubarLabel,\n MenubarCheckboxItem,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarPortal,\n MenubarSubContent,\n MenubarSubTrigger,\n MenubarGroup,\n MenubarSub,\n MenubarShortcut,\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n"],"mappings":";;;AAAA,YAAY,WAAW;AAEvB,YAAY,sBAAsB;;;ACFlC,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADAA,IAAM,cAA+B;AACrC,IAAM,eAAgC;AACtC,IAAM,gBAAiC;AACvC,IAAM,aAA8B;AACpC,IAAM,oBAAqC;AAE3C,IAAM,UAAgB,iBAGpB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,QAAQ,cAA+B,sBAAK;AAE5C,IAAM,iBAAuB,iBAG3B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,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AAAA,EACjC,CACF,CACF;AAAA,EACC;AACH,CACD;AACD,iBAAiB,cAA+B,2BAAU;AAE1D,IAAM,eAAqB,iBAKzB,CAAC,EAAE,WAAW,OAAO,GAAG,MAAM,GAAG,QACjC;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA,SAAS;AAAA,MACT;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,aAAa,cAA+B,uBAAM;AAElD,IAAM,mBAAyB,iBAG7B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,gDAAgD,SAAS;AAAA,IACtE,GAAG;AAAA;AACN,CACD;AACD,iBAAiB,cAA+B,2BAAU;AAE1D,IAAM,kBAAkB,CAAC;AAAA,EACvB;AAAA,EACA,GAAG;AACL,MAA6C;AAC3C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,gBAAgB,cAAc;","names":[]}
|
1
|
+
{"version":3,"sources":["../../layout/appMenubar/AppMenubar.tsx","../../util/index.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport * as MenubarPrimitive from \"@radix-ui/react-menubar\";\nimport { cn } from \"@util/index\";\n\nconst MenubarMenu: React.FC<\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Menu>\n> = MenubarPrimitive.Menu;\nconst MenubarGroup: React.FC<\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Group>\n> = MenubarPrimitive.Group;\nconst MenubarPortal: React.FC<\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Portal>\n> = MenubarPrimitive.Portal;\nconst MenubarSub: React.FC<\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Sub>\n> = MenubarPrimitive.Sub;\nconst MenubarRadioGroup: React.FC<\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioGroup>\n> = MenubarPrimitive.RadioGroup;\n\nconst Menubar = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Root\n ref={ref}\n className={cn(\n \"hawa-flex hawa-h-10 hawa-items-center hawa-space-x-1 hawa-rounded-md hawa-border hawa-bg-background hawa-p-1\",\n className,\n )}\n {...props}\n />\n));\nMenubar.displayName = MenubarPrimitive.Root.displayName;\n\nconst MenubarTrigger = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Trigger\n ref={ref}\n className={cn(\n \"hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-font-medium hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-accent-foreground\",\n className,\n )}\n {...props}\n />\n));\nMenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;\n\nconst MenubarSubTrigger = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <MenubarPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-accent-foreground\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n\n <svg\n aria-label=\"Chevron Right Icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"hawa-icon hawa-ml-auto\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n </MenubarPrimitive.SubTrigger>\n));\nMenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;\n\nconst MenubarSubContent = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.SubContent\n ref={ref}\n className={cn(\n \"hawa-z-50 hawa-min-w-[8rem] hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-p-1 hawa-text-popover-foreground data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n className,\n )}\n {...props}\n />\n));\nMenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;\n\nconst MenubarContent = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>\n>(\n (\n { className, align = \"start\", alignOffset = -4, sideOffset = 8, ...props },\n ref,\n ) => (\n <MenubarPrimitive.Portal>\n <MenubarPrimitive.Content\n ref={ref}\n align={align}\n alignOffset={alignOffset}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-min-w-[12rem] hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-p-1 hawa-text-popover-foreground hawa-shadow-md data-[state=open]:hawa-animate-in data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n className,\n )}\n {...props}\n />\n </MenubarPrimitive.Portal>\n ),\n);\nMenubarContent.displayName = MenubarPrimitive.Content.displayName;\n\nconst MenubarItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <MenubarPrimitive.Item\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nMenubarItem.displayName = MenubarPrimitive.Item.displayName;\n\nconst MenubarCheckboxItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <MenubarPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center\">\n <MenubarPrimitive.ItemIndicator>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"hawa-icon\"\n >\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n </MenubarPrimitive.ItemIndicator>\n </span>\n {children}\n </MenubarPrimitive.CheckboxItem>\n));\nMenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;\n\nconst MenubarRadioItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <MenubarPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center\">\n <MenubarPrimitive.ItemIndicator>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"hawa-h-2 hawa-w-2 hawa-fill-current\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n </svg>\n </MenubarPrimitive.ItemIndicator>\n </span>\n {children}\n </MenubarPrimitive.RadioItem>\n));\nMenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;\n\nconst MenubarLabel = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <MenubarPrimitive.Label\n ref={ref}\n className={cn(\n \"hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-font-semibold\",\n inset && \"hawa-pl-8\",\n className,\n )}\n {...props}\n />\n));\nMenubarLabel.displayName = MenubarPrimitive.Label.displayName;\n\nconst MenubarSeparator = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Separator\n ref={ref}\n className={cn(\"hawa--mx-1 hawa-my-1 hawa-h-px hawa-bg-muted\", className)}\n {...props}\n />\n));\nMenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;\n\nconst MenubarShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n \"hawa-ml-auto hawa-text-xs hawa-tracking-widest hawa-text-muted-foreground\",\n className,\n )}\n {...props}\n />\n );\n};\nMenubarShortcut.displayname = \"MenubarShortcut\";\n\nexport {\n Menubar,\n MenubarMenu,\n MenubarTrigger,\n MenubarContent,\n MenubarItem,\n MenubarSeparator,\n MenubarLabel,\n MenubarCheckboxItem,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarPortal,\n MenubarSubContent,\n MenubarSubTrigger,\n MenubarGroup,\n MenubarSub,\n MenubarShortcut,\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n"],"mappings":";;;AAAA,YAAY,WAAW;AAEvB,YAAY,sBAAsB;;;ACFlC,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADAA,IAAM,cAEe;AACrB,IAAM,eAEe;AACrB,IAAM,gBAEe;AACrB,IAAM,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A,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AAAA,EAEJ,oCAAC,UAAK,WAAU,qGACd,oCAAkB,gCAAjB,MACC;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,OAAM;AAAA,MACN,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,QAAO;AAAA,MACP,aAAY;AAAA,MACZ,eAAc;AAAA,MACd,gBAAe;AAAA,MACf,WAAU;AAAA;AAAA,IAEV,oCAAC,YAAO,IAAG,MAAK,IAAG,MAAK,GAAE,MAAK;AAAA,EACjC,CACF,CACF;AAAA,EACC;AACH,CACD;AACD,iBAAiB,cAA+B,2BAAU;AAE1D,IAAM,eAAqB,iBAKzB,CAAC,EAAE,WAAW,OAAO,GAAG,MAAM,GAAG,QACjC;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA,SAAS;AAAA,MACT;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,aAAa,cAA+B,uBAAM;AAElD,IAAM,mBAAyB,iBAG7B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,gDAAgD,SAAS;AAAA,IACtE,GAAG;AAAA;AACN,CACD;AACD,iBAAiB,cAA+B,2BAAU;AAE1D,IAAM,kBAAkB,CAAC;AAAA,EACvB;AAAA,EACA,GAAG;AACL,MAA6C;AAC3C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,gBAAgB,cAAc;","names":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../elements/backToTop/index.ts","../../elements/backToTop/BackToTop.tsx","../../util/index.ts","../../elements/button/Button.tsx","../../elements/helperText/HelperText.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx","../../elements/loading/Loading.tsx"],"sourcesContent":["export * from \"./BackToTop\";\n","import React, { FC, RefObject, useState, useEffect, useRef } from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { Button } from \"../button\";\n\ntype BackToTopTypes = {\n /** Horizontal padding relative to the attached corner */\n paddingX?: number;\n /** Vertical padding relative to the attached corner */\n paddingY?: number;\n /** Increase to the threshold of the scroll value that has to be passed for the button to appear */\n paddingThreshold?: number;\n corner?: \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\";\n anchor: RefObject<HTMLInputElement>;\n};\n\nexport const BackToTop: FC<BackToTopTypes> = ({ ...props }) => {\n const [visible, setVisible] = useState<boolean>(false);\n const [rect, _setRect] = useState<DOMRect | null>(null);\n const self = useRef<HTMLButtonElement>(null);\n const _rect = useRef(rect);\n const setRect = (data: any) => {\n _rect.current = data;\n _setRect(data);\n };\n\n const getCoords = () => {\n let anchor = props.anchor.current;\n if (anchor) {\n return [anchor.scrollTop, anchor.scrollLeft];\n }\n return [0, 0];\n };\n\n const onScroll = () => {\n let [scrollTop, scrollLeft] = getCoords();\n let rect = props.anchor.current?.getBoundingClientRect();\n if (rect) {\n setVisible(scrollTop >= rect.height + (props.paddingThreshold || 100));\n }\n };\n\n const backToTop = () => {\n if (props.anchor.current) {\n props.anchor.current.scrollTo({ top: 0, behavior: \"smooth\" });\n }\n };\n\n // FIXME: Observers and listeners run twice\n useEffect(() => {\n if (!props.anchor.current) return;\n\n props.anchor.current.addEventListener(\"scroll\", onScroll);\n\n // Listens to rect changes. Alternatives like ResizeObserver & IntersectionObserver fail to detect positional changes consistently\n let interval = setInterval(() => {\n if (!props.anchor.current) return;\n\n let newRect = props.anchor.current.getBoundingClientRect();\n if (_rect.current == null) return setRect(newRect);\n\n if (\n !(\n _rect.current.top == newRect.top &&\n _rect.current.left == newRect.left &&\n _rect.current.width == newRect.width &&\n _rect.current.height == newRect.height\n )\n ) {\n setRect(newRect);\n }\n }, 1);\n\n return () => {\n props.anchor.current?.removeEventListener(\"scroll\", onScroll);\n clearInterval(interval);\n };\n }, [onScroll, props.anchor]);\n\n const getStyles = () => {\n if (!props.anchor.current || !self.current) return {};\n\n let corner = props.corner || \"bottom-right\";\n let [vertical, horizontal] = corner.split(\"-\");\n\n let anchorRect = props.anchor.current.getBoundingClientRect();\n let selfRect = self.current?.getBoundingClientRect();\n\n let width = horizontal == \"right\" ? anchorRect.width - selfRect.width : 0;\n let height = vertical == \"bottom\" ? anchorRect.height - selfRect.height : 0;\n\n let style = {\n top:\n anchorRect.y +\n height +\n (vertical == \"bottom\" ? -1 : 1) * (props.paddingX || 10),\n left:\n anchorRect.x +\n width +\n (horizontal == \"right\" ? -1 : 1) * (props.paddingX || 25),\n };\n\n return style;\n };\n\n return (\n <Button\n className={cn(\n \"hawa-fixed hawa-cursor-pointer hawa-rounded hawa-transition-all\",\n visible\n ? \"hawa-pointer-events-all hawa-opacity-100\"\n : \"hawa-pointer-events-none hawa-opacity-0\",\n )}\n onClick={backToTop}\n style={{\n ...getStyles(),\n transitionProperty: \"opacity, background-color\",\n }}\n ref={self}\n size=\"icon\"\n >\n <svg\n className={cn(\n \"hawa-h-6 hawa-w-6 hawa-shrink-0 hawa-rotate-180 hawa-transition-all disabled:hawa-bg-gray-200\",\n )}\n aria-label=\"Arrow Icon\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n >\n <path d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\"></path>\n </svg>\n </Button>\n );\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { HelperText } from \"../helperText\";\nimport { Label, LabelProps } from \"../label\";\nimport { Loading } from \"../loading/Loading\";\n\nconst buttonVariants = cva(\n \"hawa-inline-flex hawa-items-center hawa-select-none hawa-rounded-md hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-colors focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50\",\n {\n variants: {\n variant: {\n default:\n \"hawa-bg-primary hawa-text-primary-foreground hover:hawa-bg-primary/90\",\n light: \"hawa-bg-primary/20 hawa-text-primary hover:hawa-bg-primary/40\",\n destructive:\n \"hawa-bg-destructive hawa-text-destructive-foreground hover:hawa-bg-destructive/90\",\n outline:\n \"hawa-border hawa-border-input hawa-bg-transparent hover:hawa-bg-accent hover:hawa-text-accent-foreground\",\n secondary:\n \"hawa-bg-secondary hawa-text-secondary-foreground hover:hawa-bg-secondary/80\",\n ghost: \"hover:hawa-bg-accent hover:hawa-text-accent-foreground\",\n link: \"hawa-text-primary hawa-underline-offset-4 hover:hawa-underline\",\n combobox: \"hawa-bg-background hawa-border\",\n neoBrutalism: \"neo-brutalism\",\n // \"hawa-cursor-pointer hawa-transition-all hawa-uppercase hawa-font-mono dark:hawa-bg-black hawa-font-bold hawa-py-2 hawa-px-4 hawa-rounded hawa-border-2 hawa-border-primary hawa-shadow-color-primary hawa-transition-[hawa-transform_50ms, hawa-box-shadow_50ms] active:hawa-translate-x-0.5 active:hawa-translate-y-0.5 active:hawa-shadow-color-primary-active shadow-color-primary active:shadow-color-primary-active\",\n },\n size: {\n default: \"hawa-h-10 hawa-px-4 hawa-py-2\",\n heightless: \"hawa-px-4 hawa-py-4\",\n xs: \"hawa-h-fit hawa-min-h-[25px] hawa-py-1 hawa-text-[10px] hawa-px-2 \",\n sm: \"hawa-h-9 hawa-text-[11px] hawa-rounded-md hawa-px-3\",\n lg: \"hawa-h-11 hawa-rounded-md hawa-px-8\",\n xl: \"hawa-h-14 hawa-rounded-md hawa-px-10\",\n icon: \"hawa-h-10 hawa-w-10\",\n smallIcon: \"hawa-h-7 hawa-w-7\",\n },\n },\n defaultVariants: { variant: \"default\", size: \"default\" },\n },\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n centered?: boolean;\n isLoading?: boolean;\n label?: string;\n labelProps?: LabelProps;\n /** The small red text under the input field to show validation. */\n helperText?: any;\n showHelperText?: boolean;\n /**\n * If true, the button will include a label and helper text. This is useful for forms where the button is part of the form.\n */\n asInput?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n label,\n variant,\n size,\n asChild = false,\n centered = true,\n isLoading,\n children,\n labelProps,\n showHelperText = false,\n asInput = false,\n ...props\n },\n ref,\n ) => {\n const Comp = \"button\";\n\n // Determine the color for the Loading component based on the variant\n const loadingColor =\n variant === \"outline\" || variant === \"ghost\" || variant === \"neoBrutalism\"\n ? \"hawa-bg-primary\"\n : \"hawa-bg-primary-foreground\";\n\n if (asInput) {\n return (\n <div className=\"hawa-flex hawa-flex-col hawa-gap-2\">\n {label && <Label {...labelProps}>{label}</Label>}\n <Comp\n className={cn(\n buttonVariants({ variant, size, className }),\n centered && \"hawa-justify-center\",\n )}\n ref={ref}\n {...props}\n >\n {isLoading ? (\n <Loading\n design={\n size === \"icon\" || size === \"smallIcon\"\n ? \"spinner\"\n : \"dots-pulse\"\n }\n themeMode={variant === \"outline\" ? \"light\" : \"dark\"}\n color={loadingColor}\n size={size === \"sm\" || size === \"xs\" ? \"xs\" : \"button\"}\n />\n ) : (\n children\n )}\n </Comp>\n {showHelperText && <HelperText helperText={props.helperText} />}\n </div>\n );\n } else {\n return (\n <Comp\n className={cn(\n buttonVariants({ variant, size, className }),\n centered && \"hawa-justify-center\",\n )}\n ref={ref}\n {...props}\n >\n {isLoading ? (\n <Loading\n design={\n size === \"icon\" || size === \"smallIcon\"\n ? \"spinner\"\n : \"dots-pulse\"\n }\n themeMode={variant === \"outline\" ? \"light\" : \"dark\"}\n color={loadingColor}\n size={size === \"sm\" || size === \"xs\" ? \"xs\" : \"button\"}\n />\n ) : (\n children\n )}\n </Comp>\n );\n }\n },\n);\n\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport const HelperText = ({ helperText }: { helperText?: any }) => (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all\",\n helperText ? \"hawa-h-4 hawa-opacity-100\" : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {helperText}\n </p>\n);\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { Tooltip } from \"../tooltip\";\n\nexport type LabelProps = {\n hint?: React.ReactNode;\n hintSide?: PositionType;\n htmlFor?: string;\n required?: boolean;\n};\n\nconst Label = React.forwardRef<\n HTMLLabelElement,\n React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps\n>(({ className, hint, hintSide, required, children, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all\">\n <label\n ref={ref}\n className={cn(\n \"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70\",\n className,\n )}\n {...props}\n >\n {children}\n {required && <span className=\"hawa-mx-0.5 hawa-text-red-500\">*</span>}\n </label>\n {hint && (\n <Tooltip\n content={hint}\n side={hintSide}\n triggerProps={{\n tabIndex: -1,\n onClick: (event) => event.preventDefault(),\n }}\n >\n <div>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"hawa-h-[14px] hawa-w-[14px] hawa-cursor-help\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n </div>\n </Tooltip>\n )}\n </div>\n));\n\nLabel.displayName = \"Label\";\n\nexport { Label };\n","import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\",\n },\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProviderProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider\n delayDuration={delayDuration}\n {...providerProps}\n >\n <TooltipPrimitive.Root\n open={!disabled && open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipContent\n size={size}\n side={side}\n align=\"center\"\n {...contentProps}\n style={{\n ...contentProps?.style,\n maxWidth: \"var(--radix-tooltip-content-available-width)\",\n maxHeight: \"var(--radix-tooltip-content-available-height)\",\n }}\n >\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n","import React, { FC } from \"react\";\n\nimport { cn } from \"@util/index\";\n\ntype LoadingTypes = {\n /** Specifies the size of the loading component.*/\n size?: \"button\" | \"xs\" | \"sm\" | \"normal\" | \"lg\" | \"xl\";\n /** Determines the design of the loading animation.*/\n design?:\n | \"spinner\"\n | \"dots-bounce\"\n | \"dots-pulse\"\n | \"pulse\"\n | \"spinner-dots\"\n | \"squircle\"\n | \"square\"\n | \"progress\"\n | \"orbit\";\n /** Specifies the color of the loading component. By default it will inherit the value of --primary global CSS variable*/\n color?: string;\n classNames?: {\n container?: string;\n track?: string;\n car?: string;\n };\n themeMode?: \"dark\" | \"light\";\n};\n\nexport const Loading: FC<LoadingTypes> = ({\n design = \"spinner\",\n size = \"normal\",\n themeMode = \"light\",\n classNames,\n color,\n ...props\n}) => {\n let sizeStyles = {\n button: \"hawa-h-4 hawa-w-4\",\n xs: \"hawa-h-1 hawa-w-1\",\n sm: \"hawa-h-6 hawa-w-6\",\n normal: \"hawa-h-8 hawa-w-8\",\n lg: \"hawa-h-14 hawa-w-14\",\n xl: \"hawa-h-24 hawa-w-24\",\n };\n let progressSizes = {\n button: \"hawa-h-1\",\n xs: \"hawa-h-1 hawa-w-1\",\n sm: \"hawa-h-6 hawa-w-6\",\n normal: \"\",\n lg: \"hawa-h-6\",\n xl: \"hawa-h-10 hawa-w-64\",\n };\n\n let animationStyles: any = {\n pulse: \"hawa-animate-in hawa-fade-in hawa-duration-1000\",\n bounce: \"hawa-animate-bounce\",\n };\n switch (design.split(\"-\")[0]) {\n case \"dots\":\n return (\n <div\n className={cn(\n \"hawa-flex hawa-flex-row hawa-gap-2\",\n classNames?.container,\n )}\n >\n <div\n className={cn(\n \"hawa-animate-bounce hawa-rounded-full hawa-delay-100 hawa-repeat-infinite\",\n size === \"button\" ? \"hawa-h-2 hawa-w-2\" : sizeStyles[size],\n animationStyles[design.split(\"-\")[1]],\n color ? color : \"hawa-bg-primary\",\n )}\n ></div>\n <div\n className={cn(\n \"hawa-animate-bounce hawa-rounded-full hawa-delay-200 hawa-repeat-infinite\",\n size === \"button\" ? \"hawa-h-2 hawa-w-2\" : sizeStyles[size],\n animationStyles[design.split(\"-\")[1]],\n color ? color : \"hawa-bg-primary\",\n )}\n ></div>\n <div\n className={cn(\n \"hawa-animate-bounce hawa-rounded-full hawa-delay-300 hawa-repeat-infinite\",\n size === \"button\" ? \"hawa-h-2 hawa-w-2\" : sizeStyles[size],\n animationStyles[design.split(\"-\")[1]],\n color ? color : \"hawa-bg-primary\",\n )}\n ></div>\n </div>\n );\n case \"square\":\n return (\n <svg\n className={cn(\n \"squircle-container\",\n sizeStyles[size],\n classNames?.container,\n )}\n viewBox=\"0 0 35 35\"\n height=\"35\"\n width=\"35\"\n >\n <rect\n className=\"squircle-track\"\n x=\"2.5\"\n y=\"2.5\"\n fill=\"none\"\n strokeWidth=\"5px\"\n width=\"32.5\"\n height=\"32.5\"\n />\n <rect\n className=\"square-car\"\n x=\"2.5\"\n y=\"2.5\"\n fill=\"none\"\n strokeWidth=\"5px\"\n width=\"32.5\"\n height=\"32.5\"\n pathLength=\"100\"\n />\n </svg>\n );\n case \"squircle\":\n return (\n <svg\n x=\"0px\"\n y=\"0px\"\n viewBox=\"0 0 37 37\"\n height=\"37\"\n width=\"37\"\n preserveAspectRatio=\"xMidYMid meet\"\n className={cn(\n \"squircle-container\",\n sizeStyles[size],\n classNames?.container,\n )}\n >\n <path\n className={cn(\"squircle-track\", classNames?.track)}\n fill=\"none\"\n strokeWidth=\"5\"\n pathLength=\"100\"\n d=\"M0.37 18.5 C0.37 5.772 5.772 0.37 18.5 0.37 S36.63 5.772 36.63 18.5 S31.228 36.63 18.5 36.63 S0.37 31.228 0.37 18.5\"\n ></path>\n <path\n className={cn(\"squircle-car\", classNames?.car)}\n fill=\"none\"\n strokeWidth=\"5\"\n pathLength=\"100\"\n d=\"M0.37 18.5 C0.37 5.772 5.772 0.37 18.5 0.37 S36.63 5.772 36.63 18.5 S31.228 36.63 18.5 36.63 S0.37 31.228 0.37 18.5\"\n ></path>\n </svg>\n );\n case \"progress\":\n return (\n <div\n className={cn(\n \"progress-loading after:hawa-rounded hawa-rounded\",\n progressSizes[size],\n classNames?.container,\n )}\n ></div>\n );\n case \"orbit\":\n return (\n <div className={cn(\"orbit-container\", classNames?.container)}></div>\n );\n\n default:\n return (\n <svg\n viewBox=\"0 0 40 40\"\n height=\"40\"\n width=\"40\"\n className={cn(\n \"circle-container\",\n sizeStyles[size],\n classNames?.container,\n )}\n >\n <circle\n className={cn(\n \"circle-track\",\n {\n \"hawa-stroke-primary-foreground\": themeMode === \"dark\",\n \"hawa-stroke-primary\": themeMode === \"light\",\n },\n classNames?.track,\n )}\n cx=\"20\"\n cy=\"20\"\n r=\"17.5\"\n fill=\"none\"\n strokeWidth=\"5px\"\n pathLength=\"100\"\n />\n <circle\n className={cn(\n \"circle-car\",\n {\n \"hawa-stroke-primary-foreground\": themeMode === \"dark\",\n \"hawa-stroke-primary\": themeMode === \"light\",\n },\n classNames?.car,\n )}\n cx=\"20\"\n cy=\"20\"\n r=\"17.5\"\n fill=\"none\"\n pathLength=\"100\"\n strokeWidth=\"5px\"\n />\n </svg>\n );\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAAkE;;;ACAlE,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACLA,IAAAC,SAAuB;AAGvB,sCAAuC;;;ACHvC,mBAAkB;AAIX,IAAM,aAAa,CAAC,EAAE,WAAW,MACtC,6BAAAC,QAAA;AAAA,EAAC;AAAA;AAAA,IACC,WAAW;AAAA,MACT;AAAA,MACA,aAAa,8BAA8B;AAAA,IAC7C;AAAA;AAAA,EAEC;AACH;;;ACZF,IAAAC,SAAuB;;;ACAvB,IAAAC,gBAAkB;AAElB,uBAAkC;AAKlC,IAAM,iBAAiB,cAAAC,QAAM,WAK3B,CAAC,EAAE,WAAW,aAAa,GAAG,OAAO,WAAW,GAAG,MAAM,GAAG,QAC5D,8BAAAA,QAAA;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,QACE,gBAAgB,SAAS;AAAA,QACzB,gBAAgB,SAAS;AAAA,MAC3B;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;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B,QAAM,YAAY,MAAM;AAhF1B;AAiFI,QAAI,CAAC,MAAM,OAAO,WAAW,CAAC,KAAK,QAAS,QAAO,CAAC;AAEpD,QAAI,SAAS,MAAM,UAAU;AAC7B,QAAI,CAAC,UAAU,UAAU,IAAI,OAAO,MAAM,GAAG;AAE7C,QAAI,aAAa,MAAM,OAAO,QAAQ,sBAAsB;AAC5D,QAAI,YAAW,UAAK,YAAL,mBAAc;AAE7B,QAAI,QAAQ,cAAc,UAAU,WAAW,QAAQ,SAAS,QAAQ;AACxE,QAAI,SAAS,YAAY,WAAW,WAAW,SAAS,SAAS,SAAS;AAE1E,QAAI,QAAQ;AAAA,MACV,KACE,WAAW,IACX,UACC,YAAY,WAAW,KAAK,MAAM,MAAM,YAAY;AAAA,MACvD,MACE,WAAW,IACX,SACC,cAAc,UAAU,KAAK,MAAM,MAAM,YAAY;AAAA,IAC1D;AAEA,WAAO;AAAA,EACT;AAEA,SACE,8BAAAC,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,UACI,6CACA;AAAA,MACN;AAAA,MACA,SAAS;AAAA,MACT,OAAO;AAAA,QACL,GAAG,UAAU;AAAA,QACb,oBAAoB;AAAA,MACtB;AAAA,MACA,KAAK;AAAA,MACL,MAAK;AAAA;AAAA,IAEL,8BAAAA,QAAA;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,UACT;AAAA,QACF;AAAA,QACA,cAAW;AAAA,QACX,SAAQ;AAAA,QACR,MAAK;AAAA;AAAA,MAEL,8BAAAA,QAAA,cAAC,UAAK,GAAE,sHAAqH;AAAA,IAC/H;AAAA,EACF;AAEJ;","names":["import_react","React","React","React","import_react","React","import_react","React","rect","React"]}
|
1
|
+
{"version":3,"sources":["../../elements/backToTop/index.ts","../../elements/backToTop/BackToTop.tsx","../../util/index.ts","../../elements/button/Button.tsx","../../elements/helperText/HelperText.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx","../../elements/loading/Loading.tsx"],"sourcesContent":["export * from \"./BackToTop\";\n","import React, { FC, RefObject, useState, useEffect, useRef } from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { Button } from \"../button\";\n\ntype BackToTopTypes = {\n /** Horizontal padding relative to the attached corner */\n paddingX?: number;\n /** Vertical padding relative to the attached corner */\n paddingY?: number;\n /** Increase to the threshold of the scroll value that has to be passed for the button to appear */\n paddingThreshold?: number;\n corner?: \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\";\n anchor: RefObject<HTMLInputElement>;\n};\n\nexport const BackToTop: FC<BackToTopTypes> = ({ ...props }) => {\n const [visible, setVisible] = useState<boolean>(false);\n const [rect, _setRect] = useState<DOMRect | null>(null);\n const self = useRef<HTMLButtonElement>(null);\n const _rect = useRef(rect);\n const setRect = (data: any) => {\n _rect.current = data;\n _setRect(data);\n };\n\n const getCoords = () => {\n let anchor = props.anchor.current;\n if (anchor) {\n return [anchor.scrollTop, anchor.scrollLeft];\n }\n return [0, 0];\n };\n\n const onScroll = () => {\n let [scrollTop, scrollLeft] = getCoords();\n let rect = props.anchor.current?.getBoundingClientRect();\n if (rect) {\n setVisible(scrollTop >= rect.height + (props.paddingThreshold || 100));\n }\n };\n\n const backToTop = () => {\n if (props.anchor.current) {\n props.anchor.current.scrollTo({ top: 0, behavior: \"smooth\" });\n }\n };\n\n // FIXME: Observers and listeners run twice\n useEffect(() => {\n if (!props.anchor.current) return;\n\n props.anchor.current.addEventListener(\"scroll\", onScroll);\n\n // Listens to rect changes. Alternatives like ResizeObserver & IntersectionObserver fail to detect positional changes consistently\n let interval = setInterval(() => {\n if (!props.anchor.current) return;\n\n let newRect = props.anchor.current.getBoundingClientRect();\n if (_rect.current == null) return setRect(newRect);\n\n if (\n !(\n _rect.current.top == newRect.top &&\n _rect.current.left == newRect.left &&\n _rect.current.width == newRect.width &&\n _rect.current.height == newRect.height\n )\n ) {\n setRect(newRect);\n }\n }, 1);\n\n return () => {\n props.anchor.current?.removeEventListener(\"scroll\", onScroll);\n clearInterval(interval);\n };\n }, [onScroll, props.anchor]);\n\n const getStyles = () => {\n if (!props.anchor.current || !self.current) return {};\n\n let corner = props.corner || \"bottom-right\";\n let [vertical, horizontal] = corner.split(\"-\");\n\n let anchorRect = props.anchor.current.getBoundingClientRect();\n let selfRect = self.current?.getBoundingClientRect();\n\n let width = horizontal == \"right\" ? anchorRect.width - selfRect.width : 0;\n let height = vertical == \"bottom\" ? anchorRect.height - selfRect.height : 0;\n\n let style = {\n top:\n anchorRect.y +\n height +\n (vertical == \"bottom\" ? -1 : 1) * (props.paddingX || 10),\n left:\n anchorRect.x +\n width +\n (horizontal == \"right\" ? -1 : 1) * (props.paddingX || 25),\n };\n\n return style;\n };\n\n return (\n <Button\n className={cn(\n \"hawa-fixed hawa-cursor-pointer hawa-rounded hawa-transition-all\",\n visible\n ? \"hawa-pointer-events-all hawa-opacity-100\"\n : \"hawa-pointer-events-none hawa-opacity-0\",\n )}\n onClick={backToTop}\n style={{\n ...getStyles(),\n transitionProperty: \"opacity, background-color\",\n }}\n ref={self}\n size=\"icon\"\n >\n <svg\n className={cn(\n \"hawa-h-6 hawa-w-6 hawa-shrink-0 hawa-rotate-180 hawa-transition-all disabled:hawa-bg-gray-200\",\n )}\n aria-label=\"Arrow Icon\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n >\n <path d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\"></path>\n </svg>\n </Button>\n );\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { HelperText } from \"../helperText\";\nimport { Label, LabelProps } from \"../label\";\nimport { Loading } from \"../loading/Loading\";\n\nconst buttonVariants = cva(\n \"hawa-inline-flex hawa-items-center hawa-select-none hawa-rounded-md hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-colors focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50\",\n {\n variants: {\n variant: {\n default:\n \"hawa-bg-primary hawa-text-primary-foreground hover:hawa-bg-primary/90\",\n light: \"hawa-bg-primary/20 hawa-text-primary hover:hawa-bg-primary/40\",\n destructive:\n \"hawa-bg-destructive hawa-text-destructive-foreground hover:hawa-bg-destructive/90\",\n outline:\n \"hawa-border hawa-border-input hawa-bg-transparent hover:hawa-bg-accent hover:hawa-text-accent-foreground\",\n secondary:\n \"hawa-bg-secondary hawa-text-secondary-foreground hover:hawa-bg-secondary/80\",\n ghost: \"hover:hawa-bg-accent hover:hawa-text-accent-foreground\",\n link: \"hawa-text-primary hawa-underline-offset-4 hover:hawa-underline\",\n combobox: \"hawa-bg-background hawa-border\",\n neoBrutalism: \"neo-brutalism\",\n // \"hawa-cursor-pointer hawa-transition-all hawa-uppercase hawa-font-mono dark:hawa-bg-black hawa-font-bold hawa-py-2 hawa-px-4 hawa-rounded hawa-border-2 hawa-border-primary hawa-shadow-color-primary hawa-transition-[hawa-transform_50ms, hawa-box-shadow_50ms] active:hawa-translate-x-0.5 active:hawa-translate-y-0.5 active:hawa-shadow-color-primary-active shadow-color-primary active:shadow-color-primary-active\",\n },\n size: {\n default: \"hawa-h-10 hawa-px-4 hawa-py-2\",\n heightless: \"hawa-px-4 hawa-py-4\",\n xs: \"hawa-h-fit hawa-min-h-[25px] hawa-py-1 hawa-text-[10px] hawa-px-2 \",\n sm: \"hawa-h-9 hawa-text-[11px] hawa-rounded-md hawa-px-3\",\n lg: \"hawa-h-11 hawa-rounded-md hawa-px-8\",\n xl: \"hawa-h-14 hawa-rounded-md hawa-px-10\",\n icon: \"hawa-h-10 hawa-w-10\",\n smallIcon: \"hawa-h-7 hawa-w-7\",\n },\n },\n defaultVariants: { variant: \"default\", size: \"default\" },\n },\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n centered?: boolean;\n isLoading?: boolean;\n label?: string;\n labelProps?: LabelProps;\n /** The small red text under the input field to show validation. */\n helperText?: any;\n showHelperText?: boolean;\n /**\n * If true, the button will include a label and helper text. This is useful for forms where the button is part of the form.\n */\n asInput?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n label,\n variant,\n size,\n asChild = false,\n centered = true,\n isLoading,\n children,\n labelProps,\n showHelperText = false,\n asInput = false,\n ...props\n },\n ref,\n ) => {\n const Comp = \"button\";\n\n // Determine the color for the Loading component based on the variant\n const loadingColor =\n variant === \"outline\" || variant === \"ghost\" || variant === \"neoBrutalism\"\n ? \"hawa-bg-primary\"\n : \"hawa-bg-primary-foreground\";\n\n if (asInput) {\n return (\n <div className=\"hawa-flex hawa-flex-col hawa-gap-2\">\n {label && <Label {...labelProps}>{label}</Label>}\n <Comp\n className={cn(\n buttonVariants({ variant, size, className }),\n centered && \"hawa-justify-center\",\n )}\n ref={ref}\n {...props}\n >\n {isLoading ? (\n <Loading\n design={\n size === \"icon\" || size === \"smallIcon\"\n ? \"spinner\"\n : \"dots-pulse\"\n }\n themeMode={variant === \"outline\" ? \"light\" : \"dark\"}\n color={loadingColor}\n size={size === \"sm\" || size === \"xs\" ? \"xs\" : \"button\"}\n />\n ) : (\n children\n )}\n </Comp>\n {showHelperText && <HelperText helperText={props.helperText} />}\n </div>\n );\n } else {\n return (\n <Comp\n className={cn(\n buttonVariants({ variant, size, className }),\n centered && \"hawa-justify-center\",\n )}\n ref={ref}\n {...props}\n >\n {isLoading ? (\n <Loading\n design={\n size === \"icon\" || size === \"smallIcon\"\n ? \"spinner\"\n : \"dots-pulse\"\n }\n themeMode={variant === \"outline\" ? \"light\" : \"dark\"}\n color={loadingColor}\n size={size === \"sm\" || size === \"xs\" ? \"xs\" : \"button\"}\n />\n ) : (\n children\n )}\n </Comp>\n );\n }\n },\n);\n\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport const HelperText = ({ helperText }: { helperText?: any }) => (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all\",\n helperText ? \"hawa-h-4 hawa-opacity-100\" : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {helperText}\n </p>\n);\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { Tooltip } from \"../tooltip\";\n\nexport type LabelProps = {\n hint?: React.ReactNode;\n hintSide?: PositionType;\n htmlFor?: string;\n required?: boolean;\n};\n\nconst Label = React.forwardRef<\n HTMLLabelElement,\n React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps\n>(({ className, hint, hintSide, required, children, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all\">\n <label\n ref={ref}\n className={cn(\n \"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70\",\n className,\n )}\n {...props}\n >\n {children}\n {required && <span className=\"hawa-mx-0.5 hawa-text-red-500\">*</span>}\n </label>\n {hint && (\n <Tooltip\n content={hint}\n side={hintSide}\n triggerProps={{\n tabIndex: -1,\n onClick: (event) => event.preventDefault(),\n }}\n >\n <div>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"hawa-h-[14px] hawa-w-[14px] hawa-cursor-help\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n </div>\n </Tooltip>\n )}\n </div>\n));\n\nLabel.displayName = \"Label\";\n\nexport { Label };\n","import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\",\n },\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider\n delayDuration={delayDuration}\n {...providerProps}\n >\n <TooltipPrimitive.Root\n open={!disabled && open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipContent\n size={size}\n side={side}\n align=\"center\"\n {...contentProps}\n style={{\n ...contentProps?.style,\n maxWidth: \"var(--radix-tooltip-content-available-width)\",\n maxHeight: \"var(--radix-tooltip-content-available-height)\",\n }}\n >\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n","import React, { FC } from \"react\";\n\nimport { cn } from \"@util/index\";\n\ntype LoadingTypes = {\n /** Specifies the size of the loading component.*/\n size?: \"button\" | \"xs\" | \"sm\" | \"normal\" | \"lg\" | \"xl\";\n /** Determines the design of the loading animation.*/\n design?:\n | \"spinner\"\n | \"dots-bounce\"\n | \"dots-pulse\"\n | \"pulse\"\n | \"spinner-dots\"\n | \"squircle\"\n | \"square\"\n | \"progress\"\n | \"orbit\";\n /** Specifies the color of the loading component. By default it will inherit the value of --primary global CSS variable*/\n color?: string;\n classNames?: {\n container?: string;\n track?: string;\n car?: string;\n };\n themeMode?: \"dark\" | \"light\";\n};\n\nexport const Loading: FC<LoadingTypes> = ({\n design = \"spinner\",\n size = \"normal\",\n themeMode = \"light\",\n classNames,\n color,\n ...props\n}) => {\n let sizeStyles = {\n button: \"hawa-h-4 hawa-w-4\",\n xs: \"hawa-h-1 hawa-w-1\",\n sm: \"hawa-h-6 hawa-w-6\",\n normal: \"hawa-h-8 hawa-w-8\",\n lg: \"hawa-h-14 hawa-w-14\",\n xl: \"hawa-h-24 hawa-w-24\",\n };\n let progressSizes = {\n button: \"hawa-h-1\",\n xs: \"hawa-h-1 hawa-w-1\",\n sm: \"hawa-h-6 hawa-w-6\",\n normal: \"\",\n lg: \"hawa-h-6\",\n xl: \"hawa-h-10 hawa-w-64\",\n };\n\n let animationStyles: any = {\n pulse: \"hawa-animate-in hawa-fade-in hawa-duration-1000\",\n bounce: \"hawa-animate-bounce\",\n };\n switch (design.split(\"-\")[0]) {\n case \"dots\":\n return (\n <div\n className={cn(\n \"hawa-flex hawa-flex-row hawa-gap-2\",\n classNames?.container,\n )}\n >\n <div\n className={cn(\n \"hawa-animate-bounce hawa-rounded-full hawa-delay-100 hawa-repeat-infinite\",\n size === \"button\" ? \"hawa-h-2 hawa-w-2\" : sizeStyles[size],\n animationStyles[design.split(\"-\")[1]],\n color ? color : \"hawa-bg-primary\",\n )}\n ></div>\n <div\n className={cn(\n \"hawa-animate-bounce hawa-rounded-full hawa-delay-200 hawa-repeat-infinite\",\n size === \"button\" ? \"hawa-h-2 hawa-w-2\" : sizeStyles[size],\n animationStyles[design.split(\"-\")[1]],\n color ? color : \"hawa-bg-primary\",\n )}\n ></div>\n <div\n className={cn(\n \"hawa-animate-bounce hawa-rounded-full hawa-delay-300 hawa-repeat-infinite\",\n size === \"button\" ? \"hawa-h-2 hawa-w-2\" : sizeStyles[size],\n animationStyles[design.split(\"-\")[1]],\n color ? color : \"hawa-bg-primary\",\n )}\n ></div>\n </div>\n );\n case \"square\":\n return (\n <svg\n className={cn(\n \"squircle-container\",\n sizeStyles[size],\n classNames?.container,\n )}\n viewBox=\"0 0 35 35\"\n height=\"35\"\n width=\"35\"\n >\n <rect\n className=\"squircle-track\"\n x=\"2.5\"\n y=\"2.5\"\n fill=\"none\"\n strokeWidth=\"5px\"\n width=\"32.5\"\n height=\"32.5\"\n />\n <rect\n className=\"square-car\"\n x=\"2.5\"\n y=\"2.5\"\n fill=\"none\"\n strokeWidth=\"5px\"\n width=\"32.5\"\n height=\"32.5\"\n pathLength=\"100\"\n />\n </svg>\n );\n case \"squircle\":\n return (\n <svg\n x=\"0px\"\n y=\"0px\"\n viewBox=\"0 0 37 37\"\n height=\"37\"\n width=\"37\"\n preserveAspectRatio=\"xMidYMid meet\"\n className={cn(\n \"squircle-container\",\n sizeStyles[size],\n classNames?.container,\n )}\n >\n <path\n className={cn(\"squircle-track\", classNames?.track)}\n fill=\"none\"\n strokeWidth=\"5\"\n pathLength=\"100\"\n d=\"M0.37 18.5 C0.37 5.772 5.772 0.37 18.5 0.37 S36.63 5.772 36.63 18.5 S31.228 36.63 18.5 36.63 S0.37 31.228 0.37 18.5\"\n ></path>\n <path\n className={cn(\"squircle-car\", classNames?.car)}\n fill=\"none\"\n strokeWidth=\"5\"\n pathLength=\"100\"\n d=\"M0.37 18.5 C0.37 5.772 5.772 0.37 18.5 0.37 S36.63 5.772 36.63 18.5 S31.228 36.63 18.5 36.63 S0.37 31.228 0.37 18.5\"\n ></path>\n </svg>\n );\n case \"progress\":\n return (\n <div\n className={cn(\n \"progress-loading after:hawa-rounded hawa-rounded\",\n progressSizes[size],\n classNames?.container,\n )}\n ></div>\n );\n case \"orbit\":\n return (\n <div className={cn(\"orbit-container\", classNames?.container)}></div>\n );\n\n default:\n return (\n <svg\n viewBox=\"0 0 40 40\"\n height=\"40\"\n width=\"40\"\n className={cn(\n \"circle-container\",\n sizeStyles[size],\n classNames?.container,\n )}\n >\n <circle\n className={cn(\n \"circle-track\",\n {\n \"hawa-stroke-primary-foreground\": themeMode === \"dark\",\n \"hawa-stroke-primary\": themeMode === \"light\",\n },\n classNames?.track,\n )}\n cx=\"20\"\n cy=\"20\"\n r=\"17.5\"\n fill=\"none\"\n strokeWidth=\"5px\"\n pathLength=\"100\"\n />\n <circle\n className={cn(\n \"circle-car\",\n {\n \"hawa-stroke-primary-foreground\": themeMode === \"dark\",\n \"hawa-stroke-primary\": themeMode === \"light\",\n },\n classNames?.car,\n )}\n cx=\"20\"\n cy=\"20\"\n r=\"17.5\"\n fill=\"none\"\n pathLength=\"100\"\n strokeWidth=\"5px\"\n />\n </svg>\n );\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAAkE;;;ACAlE,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACLA,IAAAC,SAAuB;AAGvB,sCAAuC;;;ACHvC,mBAAkB;AAIX,IAAM,aAAa,CAAC,EAAE,WAAW,MACtC,6BAAAC,QAAA;AAAA,EAAC;AAAA;AAAA,IACC,WAAW;AAAA,MACT;AAAA,MACA,aAAa,8BAA8B;AAAA,IAC7C;AAAA;AAAA,EAEC;AACH;;;ACZF,IAAAC,SAAuB;;;ACAvB,IAAAC,gBAAkB;AAElB,uBAAkC;AAKlC,IAAM,iBAAiB,cAAAC,QAAM,WAK3B,CAAC,EAAE,WAAW,aAAa,GAAG,OAAO,WAAW,GAAG,MAAM,GAAG,QAC5D,8BAAAA,QAAA;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,QACE,gBAAgB,SAAS;AAAA,QACzB,gBAAgB,SAAS;AAAA,MAC3B;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,eAAe,cAA+B,yBAAQ;AAEtD,IAAM,eAAe,cAAAA,QAAM,WAGzB,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S,QAAO,CAAC;AAEpD,QAAI,SAAS,MAAM,UAAU;AAC7B,QAAI,CAAC,UAAU,UAAU,IAAI,OAAO,MAAM,GAAG;AAE7C,QAAI,aAAa,MAAM,OAAO,QAAQ,sBAAsB;AAC5D,QAAI,YAAW,UAAK,YAAL,mBAAc;AAE7B,QAAI,QAAQ,cAAc,UAAU,WAAW,QAAQ,SAAS,QAAQ;AACxE,QAAI,SAAS,YAAY,WAAW,WAAW,SAAS,SAAS,SAAS;AAE1E,QAAI,QAAQ;AAAA,MACV,KACE,WAAW,IACX,UACC,YAAY,WAAW,KAAK,MAAM,MAAM,YAAY;AAAA,MACvD,MACE,WAAW,IACX,SACC,cAAc,UAAU,KAAK,MAAM,MAAM,YAAY;AAAA,IAC1D;AAEA,WAAO;AAAA,EACT;AAEA,SACE,8BAAAC,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,UACI,6CACA;AAAA,MACN;AAAA,MACA,SAAS;AAAA,MACT,OAAO;AAAA,QACL,GAAG,UAAU;AAAA,QACb,oBAAoB;AAAA,MACtB;AAAA,MACA,KAAK;AAAA,MACL,MAAK;AAAA;AAAA,IAEL,8BAAAA,QAAA;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,UACT;AAAA,QACF;AAAA,QACA,cAAW;AAAA,QACX,SAAQ;AAAA,QACR,MAAK;AAAA;AAAA,MAEL,8BAAAA,QAAA,cAAC,UAAK,GAAE,sHAAqH;AAAA,IAC/H;AAAA,EACF;AAEJ;","names":["import_react","React","React","React","import_react","React","import_react","React","rect","React"]}
|