lecom-ui 4.1.9 → 4.2.0
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/_virtual/_commonjsHelpers.js +5 -0
- package/dist/_virtual/index.js +7 -0
- package/dist/components/Accordion/Accordion.js +40 -37
- package/dist/components/Button/Button.js +10 -9
- package/dist/components/Button/CustomButton.js +6 -5
- package/dist/components/Card/Card.js +7 -6
- package/dist/components/Checkbox/Checkbox.js +35 -30
- package/dist/components/CustomIcon/Icons/CadastroFacil.js +15 -5
- package/dist/components/CustomIcon/Icons/LogoLecom.js +15 -12
- package/dist/components/CustomIcon/Icons/LogoLecomBrand.js +8 -5
- package/dist/components/CustomIcon/Icons/ModoTeste.js +13 -5
- package/dist/components/CustomIcon/Icons/Rpa.js +17 -5
- package/dist/components/DataTable/DataTable.js +33 -158
- package/dist/components/Dialog/Dialog.js +40 -31
- package/dist/components/DropdownMenu/DropdownMenu.js +55 -46
- package/dist/components/Header/Header.js +51 -35
- package/dist/components/Header/HelpMenu.js +52 -41
- package/dist/components/Header/ImgBrand.js +5 -8
- package/dist/components/Header/ModulesMenu.js +63 -50
- package/dist/components/Header/SocialMenu.js +5 -6
- package/dist/components/Header/UserMenu.js +81 -51
- package/dist/components/Input/Input.js +11 -2
- package/dist/components/Layout/Layout.js +62 -45
- package/dist/components/Notification/Notification.js +9 -8
- package/dist/components/Notification/NotificationBase.js +5 -5
- package/dist/components/Notification/NotificationCallout.js +33 -27
- package/dist/components/Notification/NotificationCloseButton.js +4 -3
- package/dist/components/Notification/NotificationContent.js +24 -18
- package/dist/components/Notification/NotificationIcon.js +9 -6
- package/dist/components/Notification/NotificationInline.js +23 -20
- package/dist/components/Notification/NotificationToast.js +28 -25
- package/dist/components/Notification/useNotificationToast.js +0 -1
- package/dist/components/Popover/Popover.js +8 -7
- package/dist/components/ScrollArea/ScrollArea.js +18 -15
- package/dist/components/Select/Select.js +63 -54
- package/dist/components/Separator/Separator.js +5 -4
- package/dist/components/Sheet/Sheet.js +35 -26
- package/dist/components/Sidebar/Sidebar.js +112 -95
- package/dist/components/Skeleton/Skeleton.js +2 -2
- package/dist/components/Table/Table.js +15 -26
- package/dist/components/Tag/Tag.js +6 -5
- package/dist/components/Tooltip/Tooltip.js +17 -15
- package/dist/components/Typography/Typography.js +6 -7
- package/dist/hooks/use-mobile.js +1 -1
- package/dist/i18n/index.js +4 -53
- package/dist/i18n/locales/en_us.js +4 -3
- package/dist/i18n/locales/es_es.js +4 -3
- package/dist/i18n/locales/index.js +4 -4
- package/dist/i18n/locales/pt_br.js +4 -3
- package/dist/index.d.ts +108 -304
- package/dist/index.js +1 -12
- package/dist/lib/utils.js +2 -2
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +806 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +726 -0
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +347 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +154 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +136 -0
- package/dist/node_modules/@radix-ui/number/dist/index.js +6 -0
- package/dist/node_modules/@radix-ui/primitive/dist/index.js +11 -0
- package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +303 -0
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +25 -0
- package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +157 -0
- package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +144 -0
- package/dist/node_modules/@radix-ui/react-collection/dist/index.js +68 -0
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +39 -0
- package/dist/node_modules/@radix-ui/react-context/dist/index.js +79 -0
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +319 -0
- package/dist/node_modules/@radix-ui/react-direction/dist/index.js +11 -0
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +211 -0
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +265 -0
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +29 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +207 -0
- package/dist/node_modules/@radix-ui/react-id/dist/index.js +15 -0
- package/dist/node_modules/@radix-ui/react-menu/dist/index.js +831 -0
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js +296 -0
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +278 -0
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js +17 -0
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +130 -0
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +41 -0
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +220 -0
- package/dist/node_modules/@radix-ui/react-scroll-area/dist/index.js +718 -0
- package/dist/node_modules/@radix-ui/react-select/dist/index.js +1143 -0
- package/dist/node_modules/@radix-ui/react-separator/dist/index.js +30 -0
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +81 -0
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +476 -0
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +12 -0
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +46 -0
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +18 -0
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +7 -0
- package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +15 -0
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +40 -0
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +35 -0
- package/dist/node_modules/@tanstack/react-table/build/lib/index.js +74 -0
- package/dist/node_modules/@tanstack/table-core/build/lib/index.js +3023 -0
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +136 -0
- package/dist/node_modules/class-variance-authority/dist/index.js +44 -0
- package/dist/node_modules/clsx/dist/clsx.js +3 -0
- package/dist/node_modules/get-nonce/dist/es2015/index.js +8 -0
- package/dist/node_modules/hex-color-opacity/lib/index.js +22 -0
- package/dist/node_modules/i18next/dist/esm/i18next.js +2228 -0
- package/dist/node_modules/lucide-react/dist/esm/Icon.js +44 -0
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +26 -0
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +20 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/check.js +13 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +13 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-alert.js +17 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.js +16 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-help.js +17 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/info.js +17 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/menu.js +17 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/message-square.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/minus.js +13 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/panel-left.js +16 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/triangle-alert.js +23 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/user.js +16 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/x.js +16 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +13 -0
- package/dist/node_modules/react-i18next/dist/es/context.js +18 -0
- package/dist/node_modules/react-i18next/dist/es/defaults.js +21 -0
- package/dist/node_modules/react-i18next/dist/es/i18nInstance.js +7 -0
- package/dist/node_modules/react-i18next/dist/es/initReactI18next.js +12 -0
- package/dist/node_modules/react-i18next/dist/es/unescape.js +27 -0
- package/dist/node_modules/react-i18next/dist/es/useTranslation.js +112 -0
- package/dist/node_modules/react-i18next/dist/es/utils.js +63 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +9 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +160 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +38 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +21 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +109 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +5 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +7 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +56 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +10 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +31 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/component.js +19 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +25 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +51 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +2493 -0
- package/dist/node_modules/tslib/tslib.es6.js +56 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +24 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +48 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +42 -0
- package/dist/node_modules/use-color-luminance/index.es.js +105 -0
- package/dist/node_modules/use-sidecar/dist/es2015/exports.js +21 -0
- package/dist/node_modules/use-sidecar/dist/es2015/medium.js +77 -0
- package/dist/plugin/typographies.ts +146 -152
- package/dist/style.min.css +1 -1
- package/dist/utils/cookie.js +9 -6
- package/package.json +11 -3
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import * as React from 'react';
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { Button } from '../Button/Button.js';
|
|
4
4
|
import { Popover, PopoverContent, PopoverTrigger } from '../Popover/Popover.js';
|
|
5
5
|
import { ScrollArea } from '../ScrollArea/ScrollArea.js';
|
|
6
6
|
import { cn } from '../../lib/utils.js';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from '../Tooltip/Tooltip.js';
|
|
8
|
+
import { useTranslation } from '../../node_modules/react-i18next/dist/es/useTranslation.js';
|
|
9
|
+
import CircleHelp from '../../node_modules/lucide-react/dist/esm/icons/circle-help.js';
|
|
9
10
|
|
|
10
11
|
const Item = ({
|
|
11
12
|
description,
|
|
@@ -23,17 +24,19 @@ const Item = ({
|
|
|
23
24
|
}
|
|
24
25
|
onClick?.();
|
|
25
26
|
};
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ jsxs(
|
|
27
28
|
"div",
|
|
28
29
|
{
|
|
29
30
|
onClick: handleClickItem,
|
|
30
31
|
className: cn(
|
|
31
32
|
"flex gap-4 items-center justify-center p-2 rounded-md hover:bg-grey-200/70 hover:cursor-pointer transition-all duration-300",
|
|
32
33
|
!!disabled && "opacity-50 hover:cursor-not-allowed"
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
),
|
|
35
|
+
children: [
|
|
36
|
+
icon && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center [&>svg]:!w-5 [&>svg]:!h-5", children: icon }),
|
|
37
|
+
description && /* @__PURE__ */ jsx("div", { className: "grow", children: /* @__PURE__ */ jsx("span", { className: "body-large-400", children: description }) })
|
|
38
|
+
]
|
|
39
|
+
}
|
|
37
40
|
);
|
|
38
41
|
};
|
|
39
42
|
const HelpMenu = ({
|
|
@@ -47,40 +50,48 @@ const HelpMenu = ({
|
|
|
47
50
|
if (!title && !items) {
|
|
48
51
|
return null;
|
|
49
52
|
}
|
|
50
|
-
const renderButtonTrigger = () => /* @__PURE__ */
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
53
|
+
const renderButtonTrigger = () => /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
54
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
55
|
+
Button,
|
|
56
|
+
{
|
|
57
|
+
size: "small",
|
|
58
|
+
iconButton: true,
|
|
59
|
+
customStyles,
|
|
60
|
+
className: "max-md:hidden",
|
|
61
|
+
isActive: isOpen,
|
|
62
|
+
children: /* @__PURE__ */ jsx(CircleHelp, {})
|
|
63
|
+
}
|
|
64
|
+
) }) }),
|
|
65
|
+
/* @__PURE__ */ jsx(
|
|
66
|
+
TooltipContent,
|
|
67
|
+
{
|
|
68
|
+
color: "black",
|
|
69
|
+
align: "center",
|
|
70
|
+
side: "bottom",
|
|
71
|
+
hidden: isOpen,
|
|
72
|
+
children: t("header.help")
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
] }) });
|
|
76
|
+
return /* @__PURE__ */ jsxs(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
|
|
77
|
+
renderButtonTrigger(),
|
|
78
|
+
/* @__PURE__ */ jsxs(
|
|
79
|
+
PopoverContent,
|
|
80
|
+
{
|
|
81
|
+
side: "bottom",
|
|
82
|
+
align: "end",
|
|
83
|
+
className: "w-[200x] p-2",
|
|
84
|
+
sideOffset: 16,
|
|
85
|
+
onOpenAutoFocus: (e) => {
|
|
86
|
+
e.preventDefault();
|
|
87
|
+
},
|
|
88
|
+
children: [
|
|
89
|
+
title && /* @__PURE__ */ jsx("span", { className: "body-large-400 p-2 block", children: title }),
|
|
90
|
+
/* @__PURE__ */ jsx(ScrollArea, { style: { height: scrollAreaHeight }, children: items?.map((item, i) => /* @__PURE__ */ jsx(Item, { ...item }, i)) })
|
|
91
|
+
]
|
|
79
92
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
/* @__PURE__ */ React.createElement(ScrollArea, { style: { height: scrollAreaHeight } }, items?.map((item, i) => /* @__PURE__ */ React.createElement(Item, { key: i, ...item })))
|
|
83
|
-
));
|
|
93
|
+
)
|
|
94
|
+
] });
|
|
84
95
|
};
|
|
85
96
|
HelpMenu.displayName = "HelpMenu";
|
|
86
97
|
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Image from 'next/image';
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
2
|
import img from '../../public/imgs/logo-lecom.png.js';
|
|
4
3
|
|
|
5
|
-
const ImgBrand = ({ src }) => /* @__PURE__ */
|
|
6
|
-
|
|
4
|
+
const ImgBrand = ({ src }) => /* @__PURE__ */ jsx(
|
|
5
|
+
"img",
|
|
7
6
|
{
|
|
8
|
-
|
|
9
|
-
src: src ?? img,
|
|
10
|
-
width: 0,
|
|
11
|
-
height: 0,
|
|
7
|
+
loading: "lazy",
|
|
8
|
+
src: src ?? img.src,
|
|
12
9
|
alt: "Logo",
|
|
13
10
|
className: "w-auto h-auto max-w-[102px] max-h-[32px]"
|
|
14
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import * as React from 'react';
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { Button } from '../Button/Button.js';
|
|
4
4
|
import '../CustomIcon/Icons/CadastroFacil.js';
|
|
5
5
|
import { LogoLecom } from '../CustomIcon/Icons/LogoLecom.js';
|
|
@@ -9,7 +9,8 @@ import '../CustomIcon/Icons/LogoLecomBrand.js';
|
|
|
9
9
|
import { Popover, PopoverContent, PopoverTrigger } from '../Popover/Popover.js';
|
|
10
10
|
import { ScrollArea } from '../ScrollArea/ScrollArea.js';
|
|
11
11
|
import { cn } from '../../lib/utils.js';
|
|
12
|
-
import { Tooltip, TooltipTrigger,
|
|
12
|
+
import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from '../Tooltip/Tooltip.js';
|
|
13
|
+
import { useTranslation } from '../../node_modules/react-i18next/dist/es/useTranslation.js';
|
|
13
14
|
|
|
14
15
|
const Icon = ({
|
|
15
16
|
icon,
|
|
@@ -21,7 +22,7 @@ const Icon = ({
|
|
|
21
22
|
return null;
|
|
22
23
|
}
|
|
23
24
|
const containerIconStyles = !containerIconBgColor ? { style: { backgroundColor: bgColor, color: textColor } } : {};
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
25
26
|
"div",
|
|
26
27
|
{
|
|
27
28
|
className: cn(
|
|
@@ -29,9 +30,9 @@ const Icon = ({
|
|
|
29
30
|
containerIconBgColor,
|
|
30
31
|
containerIconBgColor && "text-white"
|
|
31
32
|
),
|
|
32
|
-
...containerIconStyles
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
...containerIconStyles,
|
|
34
|
+
children: icon
|
|
35
|
+
}
|
|
35
36
|
);
|
|
36
37
|
};
|
|
37
38
|
const Item = ({
|
|
@@ -61,26 +62,31 @@ const Item = ({
|
|
|
61
62
|
}
|
|
62
63
|
return highlight;
|
|
63
64
|
};
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
+
return /* @__PURE__ */ jsxs(
|
|
65
66
|
"div",
|
|
66
67
|
{
|
|
67
68
|
onClick: handleClickItem,
|
|
68
69
|
className: cn(
|
|
69
70
|
"flex gap-4 items-center p-2 rounded-md hover:bg-grey-200/70 hover:cursor-pointer transition-all duration-300",
|
|
70
71
|
!!disabled && "opacity-50 hover:cursor-not-allowed"
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
72
|
+
),
|
|
73
|
+
children: [
|
|
74
|
+
/* @__PURE__ */ jsx(
|
|
75
|
+
Icon,
|
|
76
|
+
{
|
|
77
|
+
icon,
|
|
78
|
+
containerIconBgColor,
|
|
79
|
+
bgColor,
|
|
80
|
+
textColor
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
/* @__PURE__ */ jsxs("div", { className: "grow", children: [
|
|
84
|
+
title && /* @__PURE__ */ jsx("span", { className: "body-large-500 block", children: title }),
|
|
85
|
+
description && /* @__PURE__ */ jsx("span", { className: "body-medium-400 block", children: description })
|
|
86
|
+
] }),
|
|
87
|
+
renderHighlight()
|
|
88
|
+
]
|
|
89
|
+
}
|
|
84
90
|
);
|
|
85
91
|
};
|
|
86
92
|
const ModulesMenu = ({
|
|
@@ -94,39 +100,46 @@ const ModulesMenu = ({
|
|
|
94
100
|
if (!title && !items) {
|
|
95
101
|
return null;
|
|
96
102
|
}
|
|
97
|
-
const renderButtonTrigger = () => /* @__PURE__ */
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
/* @__PURE__ */ React.createElement(LogoLecom, null)
|
|
107
|
-
))), /* @__PURE__ */ React.createElement(TooltipPortal, null, /* @__PURE__ */ React.createElement(TooltipContent, { color: "black", align: "end", side: "bottom", hidden: isOpen }, t("header.modules"))));
|
|
108
|
-
return /* @__PURE__ */ React.createElement(Popover, { open: isOpen, onOpenChange: setIsOpen }, renderButtonTrigger(), /* @__PURE__ */ React.createElement(
|
|
109
|
-
PopoverContent,
|
|
110
|
-
{
|
|
111
|
-
side: "bottom",
|
|
112
|
-
align: "end",
|
|
113
|
-
className: "w-[424px] p-2 max-md:w-full",
|
|
114
|
-
sideOffset: 16,
|
|
115
|
-
onOpenAutoFocus: (e) => {
|
|
116
|
-
e.preventDefault();
|
|
103
|
+
const renderButtonTrigger = () => /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
104
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
105
|
+
Button,
|
|
106
|
+
{
|
|
107
|
+
size: "small",
|
|
108
|
+
iconButton: true,
|
|
109
|
+
customStyles,
|
|
110
|
+
isActive: isOpen,
|
|
111
|
+
children: /* @__PURE__ */ jsx(LogoLecom, {})
|
|
117
112
|
}
|
|
118
|
-
},
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
113
|
+
) }) }),
|
|
114
|
+
/* @__PURE__ */ jsx(TooltipContent, { color: "black", align: "end", side: "bottom", hidden: isOpen, children: t("header.modules") })
|
|
115
|
+
] }) });
|
|
116
|
+
return /* @__PURE__ */ jsxs(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
|
|
117
|
+
renderButtonTrigger(),
|
|
118
|
+
/* @__PURE__ */ jsxs(
|
|
119
|
+
PopoverContent,
|
|
122
120
|
{
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
121
|
+
side: "bottom",
|
|
122
|
+
align: "end",
|
|
123
|
+
className: "w-[424px] p-2 max-md:w-full",
|
|
124
|
+
sideOffset: 16,
|
|
125
|
+
onOpenAutoFocus: (e) => {
|
|
126
|
+
e.preventDefault();
|
|
127
|
+
},
|
|
128
|
+
children: [
|
|
129
|
+
title && /* @__PURE__ */ jsx("span", { className: "body-large-400 p-2 block", children: title }),
|
|
130
|
+
/* @__PURE__ */ jsx(ScrollArea, { style: { height: scrollAreaHeight }, children: items?.map((item, i) => /* @__PURE__ */ jsx(
|
|
131
|
+
Item,
|
|
132
|
+
{
|
|
133
|
+
bgColor: customStyles.focus.textColor,
|
|
134
|
+
textColor: customStyles.normal.textColor,
|
|
135
|
+
...item
|
|
136
|
+
},
|
|
137
|
+
i
|
|
138
|
+
)) })
|
|
139
|
+
]
|
|
127
140
|
}
|
|
128
|
-
)
|
|
129
|
-
)
|
|
141
|
+
)
|
|
142
|
+
] });
|
|
130
143
|
};
|
|
131
144
|
ModulesMenu.displayName = "ModulesMenu";
|
|
132
145
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Button } from '../Button/Button.js';
|
|
3
|
-
import
|
|
3
|
+
import MessageSquare from '../../node_modules/lucide-react/dist/esm/icons/message-square.js';
|
|
4
4
|
|
|
5
5
|
const SocialMenu = ({
|
|
6
6
|
customStyles,
|
|
@@ -9,16 +9,15 @@ const SocialMenu = ({
|
|
|
9
9
|
if (!onOpenSocialMenuChange) {
|
|
10
10
|
return null;
|
|
11
11
|
}
|
|
12
|
-
return /* @__PURE__ */
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
13
|
Button,
|
|
14
14
|
{
|
|
15
15
|
size: "small",
|
|
16
16
|
iconButton: true,
|
|
17
17
|
customStyles,
|
|
18
18
|
onClick: onOpenSocialMenuChange,
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
/* @__PURE__ */ React.createElement(MessageSquare, null)
|
|
19
|
+
children: /* @__PURE__ */ jsx(MessageSquare, {})
|
|
20
|
+
}
|
|
22
21
|
);
|
|
23
22
|
};
|
|
24
23
|
SocialMenu.displayName = "SocialMenu";
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import * as React from 'react';
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { Button } from '../Button/Button.js';
|
|
4
4
|
import { Popover, PopoverContent, PopoverTrigger } from '../Popover/Popover.js';
|
|
5
5
|
import { ScrollArea } from '../ScrollArea/ScrollArea.js';
|
|
6
6
|
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from '../Select/Select.js';
|
|
7
|
-
import { useIsMobile } from '../../hooks/
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
7
|
+
import { useIsMobile } from '../../hooks/use-mobile.js';
|
|
8
|
+
import '../../i18n/index.js';
|
|
9
|
+
import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from '../Tooltip/Tooltip.js';
|
|
10
|
+
import { useTranslation } from '../../node_modules/react-i18next/dist/es/useTranslation.js';
|
|
11
|
+
import User from '../../node_modules/lucide-react/dist/esm/icons/user.js';
|
|
12
|
+
import instance from '../../node_modules/i18next/dist/esm/i18next.js';
|
|
11
13
|
|
|
12
14
|
const UserMenu = ({
|
|
13
15
|
customStyles,
|
|
@@ -27,18 +29,26 @@ const UserMenu = ({
|
|
|
27
29
|
return language.render;
|
|
28
30
|
}
|
|
29
31
|
const handleValueChange = (value) => {
|
|
30
|
-
|
|
32
|
+
instance.changeLanguage(value);
|
|
31
33
|
language.select?.onChange?.(value);
|
|
32
34
|
};
|
|
33
|
-
return /* @__PURE__ */
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 p-2 rounded-md hover:bg-grey-200/70 hover:cursor-pointer transition-all duration-300", children: [
|
|
36
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 body-large-400 [&>svg]:!w-5 [&>svg]:!h-5", children: [
|
|
37
|
+
language.icon,
|
|
38
|
+
language.label
|
|
39
|
+
] }),
|
|
40
|
+
/* @__PURE__ */ jsxs(
|
|
41
|
+
Select,
|
|
42
|
+
{
|
|
43
|
+
value: language.select?.value,
|
|
44
|
+
onValueChange: handleValueChange,
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: "h-7", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
47
|
+
/* @__PURE__ */ jsx(SelectContent, { children: language.select?.options.map((option) => /* @__PURE__ */ jsx(SelectItem, { value: option.id, children: option.name }, option.id)) })
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
] });
|
|
42
52
|
};
|
|
43
53
|
const renderLogout = () => {
|
|
44
54
|
if (!logout) {
|
|
@@ -47,48 +57,68 @@ const UserMenu = ({
|
|
|
47
57
|
if (logout.render) {
|
|
48
58
|
return logout.render;
|
|
49
59
|
}
|
|
50
|
-
return /* @__PURE__ */
|
|
60
|
+
return /* @__PURE__ */ jsxs(
|
|
51
61
|
"div",
|
|
52
62
|
{
|
|
53
63
|
className: "flex items-center gap-2 body-large-400 p-2 rounded-md hover:bg-grey-200/70 hover:cursor-pointer transition-all duration-300 [&>svg]:!w-5 [&>svg]:!h-5",
|
|
54
|
-
onClick: logout.onClick
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
64
|
+
onClick: logout.onClick,
|
|
65
|
+
children: [
|
|
66
|
+
logout.icon,
|
|
67
|
+
logout.label
|
|
68
|
+
]
|
|
69
|
+
}
|
|
58
70
|
);
|
|
59
71
|
};
|
|
60
|
-
const renderButtonTrigger = () => /* @__PURE__ */
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
72
|
+
const renderButtonTrigger = () => /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
73
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
74
|
+
Button,
|
|
75
|
+
{
|
|
76
|
+
size: "small",
|
|
77
|
+
iconButton: isMobile,
|
|
78
|
+
customStyles,
|
|
79
|
+
isActive: isOpen,
|
|
80
|
+
children: isMobile ? /* @__PURE__ */ jsx(User, {}) : user?.name
|
|
81
|
+
}
|
|
82
|
+
) }) }),
|
|
83
|
+
/* @__PURE__ */ jsx(
|
|
84
|
+
TooltipContent,
|
|
85
|
+
{
|
|
86
|
+
color: "black",
|
|
87
|
+
align: "center",
|
|
88
|
+
side: "bottom",
|
|
89
|
+
hidden: isOpen,
|
|
90
|
+
children: t("header.settings")
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
] }) });
|
|
94
|
+
return /* @__PURE__ */ jsxs(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
|
|
95
|
+
renderButtonTrigger(),
|
|
96
|
+
/* @__PURE__ */ jsx(
|
|
97
|
+
PopoverContent,
|
|
98
|
+
{
|
|
99
|
+
side: "bottom",
|
|
100
|
+
align: "end",
|
|
101
|
+
className: "w-[274px] p-2",
|
|
102
|
+
sideOffset: 16,
|
|
103
|
+
onOpenAutoFocus: (e) => {
|
|
104
|
+
e.preventDefault();
|
|
105
|
+
},
|
|
106
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col justify-center", children: [
|
|
107
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 p-2", children: [
|
|
108
|
+
/* @__PURE__ */ jsx("div", { className: "bg-grey-400/30 rounded-full w-9 h-9 flex items-center justify-center [&>svg]:!w-6 [&>svg]:!h-6 shrink-0", children: /* @__PURE__ */ jsx(User, { className: "text-grey-600" }) }),
|
|
109
|
+
/* @__PURE__ */ jsxs("div", { className: "grow", children: [
|
|
110
|
+
/* @__PURE__ */ jsx("span", { className: "block body-large-400 break-all", children: user?.name }),
|
|
111
|
+
/* @__PURE__ */ jsx("span", { className: "block body-medium-400 break-all", children: user?.email })
|
|
112
|
+
] })
|
|
113
|
+
] }),
|
|
114
|
+
/* @__PURE__ */ jsx(ScrollArea, { style: { height: scrollAreaHeight }, children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col justify-center", children: [
|
|
115
|
+
renderLanguage(),
|
|
116
|
+
renderLogout()
|
|
117
|
+
] }) })
|
|
118
|
+
] })
|
|
88
119
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
));
|
|
120
|
+
)
|
|
121
|
+
] });
|
|
92
122
|
};
|
|
93
123
|
UserMenu.displayName = "UserMenu";
|
|
94
124
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { cn } from '../../lib/utils.js';
|
|
3
|
-
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { cva } from '../../node_modules/class-variance-authority/dist/index.js';
|
|
4
5
|
|
|
5
6
|
const inputVariants = cva(
|
|
6
7
|
`flex h-8 w-full rounded-md border border-input bg-background px-3 py-2
|
|
@@ -71,7 +72,15 @@ const Input = React.forwardRef(
|
|
|
71
72
|
}
|
|
72
73
|
return sufix;
|
|
73
74
|
};
|
|
74
|
-
return /* @__PURE__ */
|
|
75
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex justify-center", children: [
|
|
76
|
+
renderPrefix(),
|
|
77
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center relative", children: [
|
|
78
|
+
/* @__PURE__ */ jsx("div", { className: "shrink-0 absolute left-3", children: /* @__PURE__ */ jsx(Icon, { icon: iconBefore }) }),
|
|
79
|
+
/* @__PURE__ */ jsx("input", { type, className: inputStyles(), ref, ...props }),
|
|
80
|
+
/* @__PURE__ */ jsx("div", { className: "shrink-0 absolute right-3", children: /* @__PURE__ */ jsx(Icon, { icon: iconAfter }) })
|
|
81
|
+
] }),
|
|
82
|
+
renderSufix()
|
|
83
|
+
] });
|
|
75
84
|
}
|
|
76
85
|
);
|
|
77
86
|
Input.displayName = "Input";
|