lecom-ui 4.1.8 → 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 -127
- 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,5 +1,5 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import * as React from 'react';
|
|
2
|
-
import { initializeI18n } from '../../i18n/index.js';
|
|
3
3
|
import { getCookie } from '../../utils/cookie.js';
|
|
4
4
|
import '../CustomIcon/Icons/CadastroFacil.js';
|
|
5
5
|
import '../CustomIcon/Icons/LogoLecom.js';
|
|
@@ -9,53 +9,70 @@ import { LogoLecomBrand } from '../CustomIcon/Icons/LogoLecomBrand.js';
|
|
|
9
9
|
import { Header } from '../Header/Header.js';
|
|
10
10
|
import { SidebarProvider, Sidebar, SidebarContent, SidebarGroup, SidebarGroupContent, SidebarMenu, SidebarMenuItem, SidebarMenuButton, SidebarFooter } from '../Sidebar/Sidebar.js';
|
|
11
11
|
import { Typography } from '../Typography/Typography.js';
|
|
12
|
+
import { useTranslation } from '../../node_modules/react-i18next/dist/es/useTranslation.js';
|
|
12
13
|
|
|
13
|
-
initializeI18n();
|
|
14
14
|
const Layout = ({ children, header, sideBar }) => {
|
|
15
|
+
const { t } = useTranslation();
|
|
15
16
|
const { items, info } = sideBar;
|
|
16
|
-
const sidebarState =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
17
|
+
const [sidebarState, setSidebarState] = React.useState(
|
|
18
|
+
void 0
|
|
19
|
+
);
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
const cookieState = getCookie("sidebar:state") === "true";
|
|
22
|
+
setSidebarState(cookieState);
|
|
23
|
+
}, []);
|
|
24
|
+
return /* @__PURE__ */ jsxs(SidebarProvider, { className: "flex-col", defaultOpen: sidebarState, children: [
|
|
25
|
+
/* @__PURE__ */ jsx(Header, { ...header }),
|
|
26
|
+
/* @__PURE__ */ jsxs("div", { className: "flex grow", children: [
|
|
27
|
+
/* @__PURE__ */ jsxs(Sidebar, { collapsible: "icon", variant: "sidebar", children: [
|
|
28
|
+
/* @__PURE__ */ jsx(SidebarContent, { children: /* @__PURE__ */ jsx(SidebarGroup, { children: /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsx(SidebarMenu, { children: items.map((item) => /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(
|
|
29
|
+
SidebarMenuButton,
|
|
30
|
+
{
|
|
31
|
+
asChild: true,
|
|
32
|
+
tooltip: item.title,
|
|
33
|
+
isActive: !!item.isActive,
|
|
34
|
+
children: item.url ? /* @__PURE__ */ jsxs("a", { href: item.url, children: [
|
|
35
|
+
item.icon,
|
|
36
|
+
/* @__PURE__ */ jsx("span", { children: item.title })
|
|
37
|
+
] }) : /* @__PURE__ */ jsxs("div", { onClick: item.onClick, children: [
|
|
38
|
+
item.icon,
|
|
39
|
+
/* @__PURE__ */ jsx("span", { children: item.title })
|
|
40
|
+
] })
|
|
41
|
+
}
|
|
42
|
+
) }, item.title)) }) }) }) }),
|
|
43
|
+
/* @__PURE__ */ jsxs(SidebarFooter, { className: "p-6 pt-0 gap-1", children: [
|
|
44
|
+
/* @__PURE__ */ jsxs(
|
|
45
|
+
Typography,
|
|
46
|
+
{
|
|
47
|
+
variant: "heading-xsmall-600",
|
|
48
|
+
textColor: "text-grey-800",
|
|
49
|
+
className: "flex items-center gap-2",
|
|
50
|
+
children: [
|
|
51
|
+
t("sidebar.platform"),
|
|
52
|
+
" ",
|
|
53
|
+
/* @__PURE__ */ jsx(LogoLecomBrand, { className: "w-16 shrink-0" })
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "body-medium-400", textColor: "text-grey-800", children: [
|
|
58
|
+
t("sidebar.version"),
|
|
59
|
+
" ",
|
|
60
|
+
info.version,
|
|
61
|
+
" - ",
|
|
62
|
+
info.cycle,
|
|
63
|
+
" ",
|
|
64
|
+
info.build
|
|
65
|
+
] }),
|
|
66
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "body-medium-400", textColor: "text-grey-800", children: [
|
|
67
|
+
t("sidebar.authorizedFor"),
|
|
68
|
+
" ",
|
|
69
|
+
info.authorizedFor
|
|
70
|
+
] })
|
|
71
|
+
] })
|
|
72
|
+
] }),
|
|
73
|
+
/* @__PURE__ */ jsx("main", { className: "grow", children })
|
|
74
|
+
] })
|
|
75
|
+
] });
|
|
59
76
|
};
|
|
60
77
|
Layout.displayName = "Layout";
|
|
61
78
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { 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
|
import { NotificationCallout } from './NotificationCallout.js';
|
|
5
6
|
import { NotificationInline } from './NotificationInline.js';
|
|
6
7
|
import { MemoizedNotificationToast } from './NotificationToast.js';
|
|
@@ -37,11 +38,11 @@ const posistionMap = {
|
|
|
37
38
|
const renderNotification = (props) => {
|
|
38
39
|
switch (props.type) {
|
|
39
40
|
case "toast":
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ jsx(MemoizedNotificationToast, { ...props });
|
|
41
42
|
case "inline":
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ jsx(NotificationInline, { ...props });
|
|
43
44
|
case "callout":
|
|
44
|
-
return /* @__PURE__ */
|
|
45
|
+
return /* @__PURE__ */ jsx(NotificationCallout, { ...props });
|
|
45
46
|
default:
|
|
46
47
|
return null;
|
|
47
48
|
}
|
|
@@ -58,7 +59,7 @@ const Notification = React.forwardRef(
|
|
|
58
59
|
const { shouldExpand } = props;
|
|
59
60
|
const widthStyle = shouldExpand ? "w-full" : "inline-block";
|
|
60
61
|
const positionClass = getPositionClass(type, placement);
|
|
61
|
-
return /* @__PURE__ */
|
|
62
|
+
return /* @__PURE__ */ jsx(
|
|
62
63
|
"main",
|
|
63
64
|
{
|
|
64
65
|
className: cn(
|
|
@@ -66,9 +67,9 @@ const Notification = React.forwardRef(
|
|
|
66
67
|
type === "toast" && "fixed z-50 p-4 space-y-2",
|
|
67
68
|
positionClass
|
|
68
69
|
),
|
|
69
|
-
ref
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
ref,
|
|
71
|
+
children: renderNotification(props)
|
|
72
|
+
}
|
|
72
73
|
);
|
|
73
74
|
}
|
|
74
75
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { cn } from '../../lib/utils.js';
|
|
3
3
|
import { notificationVariants } from './Notification.js';
|
|
4
4
|
|
|
@@ -9,16 +9,16 @@ const NotificationBase = ({
|
|
|
9
9
|
children,
|
|
10
10
|
className,
|
|
11
11
|
dataTestId
|
|
12
|
-
}) => /* @__PURE__ */
|
|
12
|
+
}) => /* @__PURE__ */ jsx(
|
|
13
13
|
"div",
|
|
14
14
|
{
|
|
15
15
|
className: cn(notificationVariants({ variant }), className),
|
|
16
16
|
onMouseEnter,
|
|
17
17
|
onMouseLeave,
|
|
18
18
|
"data-testid": dataTestId,
|
|
19
|
-
"aria-hidden": "true"
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
"aria-hidden": "true",
|
|
20
|
+
children
|
|
21
|
+
}
|
|
22
22
|
);
|
|
23
23
|
|
|
24
24
|
export { NotificationBase };
|
|
@@ -1,9 +1,10 @@
|
|
|
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 { ChevronUpIcon } from 'lucide-react';
|
|
4
4
|
import { NotificationBase } from './NotificationBase.js';
|
|
5
5
|
import { NotificationContent } from './NotificationContent.js';
|
|
6
6
|
import { NotificationIcon } from './NotificationIcon.js';
|
|
7
|
+
import ChevronUp from '../../node_modules/lucide-react/dist/esm/icons/chevron-up.js';
|
|
7
8
|
|
|
8
9
|
const NotificationCallout = ({ ...props }) => {
|
|
9
10
|
const [isCollapsed, setIsCollapsed] = React.useState(false);
|
|
@@ -46,37 +47,42 @@ const NotificationCallout = ({ ...props }) => {
|
|
|
46
47
|
if (isCollapsed && props.title) return "max-h-0 overflow-hidden";
|
|
47
48
|
return "no-collapse";
|
|
48
49
|
};
|
|
49
|
-
return /* @__PURE__ */
|
|
50
|
+
return /* @__PURE__ */ jsxs(
|
|
50
51
|
NotificationBase,
|
|
51
52
|
{
|
|
52
53
|
variant: defaultVariant,
|
|
53
54
|
className: cn(getGridColumns(), isCollapsed && "place-items-center"),
|
|
54
|
-
dataTestId: "notification-callout"
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
55
|
+
dataTestId: "notification-callout",
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ jsx(NotificationIcon, { variant: defaultVariant }),
|
|
58
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5", children: [
|
|
59
|
+
/* @__PURE__ */ jsx(
|
|
60
|
+
NotificationContent,
|
|
61
|
+
{
|
|
62
|
+
title: props.title,
|
|
63
|
+
content: props.content,
|
|
64
|
+
ref: contentRef,
|
|
65
|
+
className: cn(
|
|
66
|
+
"transition-all duration-300",
|
|
67
|
+
isCollapsed && getCollapseClass()
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
props.action
|
|
72
|
+
] }),
|
|
73
|
+
/* @__PURE__ */ jsx(
|
|
74
|
+
ChevronUp,
|
|
75
|
+
{
|
|
76
|
+
"data-testid": "collapse-icon",
|
|
77
|
+
onClick: handleCollapse,
|
|
78
|
+
ref: refCollapse,
|
|
79
|
+
className: cn(
|
|
80
|
+
shouldCollapse ? "opacity-100 size-5 text-grey-800 transition-transform duration-200 cursor-pointer hover:text-foreground group-hover:opacity-100" : "opacity-0 pointer-events-none h-0 w-0 absolute"
|
|
81
|
+
)
|
|
82
|
+
}
|
|
66
83
|
)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
/* @__PURE__ */ React.createElement(
|
|
70
|
-
ChevronUpIcon,
|
|
71
|
-
{
|
|
72
|
-
"data-testid": "collapse-icon",
|
|
73
|
-
onClick: handleCollapse,
|
|
74
|
-
ref: refCollapse,
|
|
75
|
-
className: cn(
|
|
76
|
-
shouldCollapse ? "opacity-100 size-5 text-grey-800 transition-transform duration-200 cursor-pointer hover:text-foreground group-hover:opacity-100" : "opacity-0 pointer-events-none h-0 w-0 absolute"
|
|
77
|
-
)
|
|
78
|
-
}
|
|
79
|
-
)
|
|
84
|
+
]
|
|
85
|
+
}
|
|
80
86
|
);
|
|
81
87
|
};
|
|
82
88
|
NotificationCallout.displayName = "NotificationCallout";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
1
2
|
import { cn } from '../../lib/utils.js';
|
|
2
|
-
import
|
|
3
|
+
import X from '../../node_modules/lucide-react/dist/esm/icons/x.js';
|
|
3
4
|
|
|
4
5
|
const NotificationCloseButton = ({
|
|
5
6
|
onClose,
|
|
6
7
|
enableClose
|
|
7
|
-
}) => /* @__PURE__ */
|
|
8
|
-
|
|
8
|
+
}) => /* @__PURE__ */ jsx(
|
|
9
|
+
X,
|
|
9
10
|
{
|
|
10
11
|
className: cn(
|
|
11
12
|
enableClose ? "opacity-100 size-5 text-grey-800 cursor-pointer hover:text-foreground group-hover:opacity-100" : "opacity-0 pointer-events-none h-0 w-0 absolute"
|
|
@@ -1,24 +1,30 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { Typography } from '../Typography/Typography.js';
|
|
3
4
|
|
|
4
|
-
const NotificationContent = React.forwardRef(({ title, content, className, children }, ref) => /* @__PURE__ */
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
5
|
+
const NotificationContent = React.forwardRef(({ title, content, className, children }, ref) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5 flex-1", children: [
|
|
6
|
+
title && /* @__PURE__ */ jsx(
|
|
7
|
+
Typography,
|
|
8
|
+
{
|
|
9
|
+
variant: "body-medium-500",
|
|
10
|
+
color: "grey-800",
|
|
11
|
+
"data-testid": "title",
|
|
12
|
+
children: title
|
|
13
|
+
}
|
|
14
|
+
),
|
|
15
|
+
/* @__PURE__ */ jsx("div", { ref, className, "data-testid": "collapse-content", children: /* @__PURE__ */ jsxs(
|
|
16
|
+
Typography,
|
|
17
|
+
{
|
|
18
|
+
variant: "body-medium-400",
|
|
19
|
+
color: "grey-800",
|
|
20
|
+
"data-testid": "content",
|
|
21
|
+
children: [
|
|
22
|
+
content,
|
|
23
|
+
children
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
) })
|
|
27
|
+
] }));
|
|
22
28
|
NotificationContent.displayName = "NotificationContent";
|
|
23
29
|
|
|
24
30
|
export { NotificationContent };
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import TriangleAlert from '../../node_modules/lucide-react/dist/esm/icons/triangle-alert.js';
|
|
3
|
+
import Info from '../../node_modules/lucide-react/dist/esm/icons/info.js';
|
|
4
|
+
import CircleAlert from '../../node_modules/lucide-react/dist/esm/icons/circle-alert.js';
|
|
5
|
+
import CircleCheck from '../../node_modules/lucide-react/dist/esm/icons/circle-check.js';
|
|
3
6
|
|
|
4
7
|
const iconMap = {
|
|
5
|
-
success: /* @__PURE__ */
|
|
6
|
-
error: /* @__PURE__ */
|
|
7
|
-
information: /* @__PURE__ */
|
|
8
|
-
warning: /* @__PURE__ */
|
|
8
|
+
success: /* @__PURE__ */ jsx(CircleCheck, { className: "text-green-600 size-5" }),
|
|
9
|
+
error: /* @__PURE__ */ jsx(CircleAlert, { className: "text-red-600 size-5" }),
|
|
10
|
+
information: /* @__PURE__ */ jsx(Info, { className: "text-blue-600 size-5" }),
|
|
11
|
+
warning: /* @__PURE__ */ jsx(TriangleAlert, { className: "size-5 text-yellow-600" })
|
|
9
12
|
};
|
|
10
13
|
const NotificationIcon = ({
|
|
11
14
|
variant
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { cn } from '../../lib/utils.js';
|
|
3
4
|
import { NotificationBase } from './NotificationBase.js';
|
|
@@ -45,30 +46,32 @@ const NotificationInline = ({
|
|
|
45
46
|
return getNonFullWidthColumns();
|
|
46
47
|
}
|
|
47
48
|
};
|
|
48
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ jsxs(
|
|
49
50
|
NotificationBase,
|
|
50
51
|
{
|
|
51
52
|
variant: defaultVariant,
|
|
52
53
|
className: cn(getGridColumns()),
|
|
53
|
-
dataTestId: "notification-inline"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
54
|
+
dataTestId: "notification-inline",
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsx(NotificationIcon, { variant: defaultVariant }),
|
|
57
|
+
/* @__PURE__ */ jsx(
|
|
58
|
+
NotificationContent,
|
|
59
|
+
{
|
|
60
|
+
title,
|
|
61
|
+
content,
|
|
62
|
+
className: "max-h-11 overflow-hidden"
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
action,
|
|
66
|
+
/* @__PURE__ */ jsx(
|
|
67
|
+
NotificationCloseButton,
|
|
68
|
+
{
|
|
69
|
+
enableClose: enableClose ?? false,
|
|
70
|
+
onClose: () => setIsVisible(false)
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
]
|
|
74
|
+
}
|
|
72
75
|
);
|
|
73
76
|
};
|
|
74
77
|
NotificationInline.displayName = "NotificationInline";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { cn } from '../../lib/utils.js';
|
|
3
4
|
import { NotificationBase } from './NotificationBase.js';
|
|
@@ -107,14 +108,13 @@ const NotificationToast = (props) => {
|
|
|
107
108
|
);
|
|
108
109
|
const renderAction = (action) => {
|
|
109
110
|
if (action) {
|
|
110
|
-
return /* @__PURE__ */
|
|
111
|
+
return /* @__PURE__ */ jsx("div", { className: cn(props.showProgress ? "py-2" : "pt-2"), children: action });
|
|
111
112
|
}
|
|
112
113
|
return null;
|
|
113
114
|
};
|
|
114
|
-
return /* @__PURE__ */
|
|
115
|
+
return /* @__PURE__ */ jsx(Fragment, { children: toasts.map((toast) => /* @__PURE__ */ jsxs(
|
|
115
116
|
NotificationBase,
|
|
116
117
|
{
|
|
117
|
-
key: toast.id,
|
|
118
118
|
variant: toast.variant,
|
|
119
119
|
className: cn(
|
|
120
120
|
"sm:w-[17.5rem] min-w-auto cursor-pointer",
|
|
@@ -122,29 +122,32 @@ const NotificationToast = (props) => {
|
|
|
122
122
|
),
|
|
123
123
|
onMouseEnter: () => handleMouseEnter(toast.id),
|
|
124
124
|
onMouseLeave: () => handleMouseLeave(toast.id),
|
|
125
|
-
dataTestId: "notification-toast"
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
),
|
|
136
|
-
props.showProgress && /* @__PURE__ */ React.createElement(
|
|
137
|
-
"div",
|
|
138
|
-
{
|
|
139
|
-
"data-testid": "progress-bar",
|
|
140
|
-
className: cn(
|
|
141
|
-
`absolute bottom-0 left-0 h-1 rounded-b-lg transition-all`,
|
|
142
|
-
colorMap[toast.variant]
|
|
125
|
+
dataTestId: "notification-toast",
|
|
126
|
+
children: [
|
|
127
|
+
/* @__PURE__ */ jsx(NotificationIcon, { variant: toast.variant }),
|
|
128
|
+
/* @__PURE__ */ jsx(NotificationContent, { title: toast.title, content: toast.content, children: renderAction(toast.action) }),
|
|
129
|
+
/* @__PURE__ */ jsx(
|
|
130
|
+
NotificationCloseButton,
|
|
131
|
+
{
|
|
132
|
+
enableClose: props.enableClose ?? false,
|
|
133
|
+
onClose: () => closeNotification(toast.id)
|
|
134
|
+
}
|
|
143
135
|
),
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
136
|
+
props.showProgress && /* @__PURE__ */ jsx(
|
|
137
|
+
"div",
|
|
138
|
+
{
|
|
139
|
+
"data-testid": "progress-bar",
|
|
140
|
+
className: cn(
|
|
141
|
+
`absolute bottom-0 left-0 h-1 rounded-b-lg transition-all`,
|
|
142
|
+
colorMap[toast.variant]
|
|
143
|
+
),
|
|
144
|
+
style: { width: `${progressMap[toast.id] ?? 100}%` }
|
|
145
|
+
}
|
|
146
|
+
)
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
toast.id
|
|
150
|
+
)) });
|
|
148
151
|
};
|
|
149
152
|
NotificationToast.displayName = "NotificationToast";
|
|
150
153
|
const MemoizedNotificationToast = React.memo(NotificationToast);
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { cn } from '../../lib/utils.js';
|
|
3
|
-
import
|
|
4
|
+
import { Portal, Content as Content2, Root as Root2, Trigger } from '../../node_modules/@radix-ui/react-popover/dist/index.js';
|
|
4
5
|
|
|
5
|
-
const Popover =
|
|
6
|
-
const PopoverTrigger =
|
|
7
|
-
const PopoverContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */
|
|
8
|
-
|
|
6
|
+
const Popover = Root2;
|
|
7
|
+
const PopoverTrigger = Trigger;
|
|
8
|
+
const PopoverContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(
|
|
9
|
+
Content2,
|
|
9
10
|
{
|
|
10
11
|
ref,
|
|
11
12
|
align,
|
|
@@ -16,7 +17,7 @@ const PopoverContent = React.forwardRef(({ className, align = "center", sideOffs
|
|
|
16
17
|
),
|
|
17
18
|
...props
|
|
18
19
|
}
|
|
19
|
-
)));
|
|
20
|
-
PopoverContent.displayName =
|
|
20
|
+
) }));
|
|
21
|
+
PopoverContent.displayName = Content2.displayName;
|
|
21
22
|
|
|
22
23
|
export { Popover, PopoverContent, PopoverTrigger };
|
|
@@ -1,21 +1,24 @@
|
|
|
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
|
|
4
|
+
import { Root, Viewport, Corner, ScrollAreaScrollbar, ScrollAreaThumb } from '../../node_modules/@radix-ui/react-scroll-area/dist/index.js';
|
|
4
5
|
|
|
5
|
-
const ScrollArea = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
6
|
-
|
|
6
|
+
const ScrollArea = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
7
|
+
Root,
|
|
7
8
|
{
|
|
8
9
|
ref,
|
|
9
10
|
className: cn("relative overflow-hidden", className),
|
|
10
|
-
...props
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
...props,
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ jsx(Viewport, { className: "h-full w-full rounded-[inherit]", children }),
|
|
14
|
+
/* @__PURE__ */ jsx(ScrollBar, {}),
|
|
15
|
+
/* @__PURE__ */ jsx(Corner, {})
|
|
16
|
+
]
|
|
17
|
+
}
|
|
15
18
|
));
|
|
16
|
-
ScrollArea.displayName =
|
|
17
|
-
const ScrollBar = React.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */
|
|
18
|
-
|
|
19
|
+
ScrollArea.displayName = Root.displayName;
|
|
20
|
+
const ScrollBar = React.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
21
|
+
ScrollAreaScrollbar,
|
|
19
22
|
{
|
|
20
23
|
ref,
|
|
21
24
|
orientation,
|
|
@@ -25,10 +28,10 @@ const ScrollBar = React.forwardRef(({ className, orientation = "vertical", ...pr
|
|
|
25
28
|
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
26
29
|
className
|
|
27
30
|
),
|
|
28
|
-
...props
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
...props,
|
|
32
|
+
children: /* @__PURE__ */ jsx(ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
|
|
33
|
+
}
|
|
31
34
|
));
|
|
32
|
-
ScrollBar.displayName =
|
|
35
|
+
ScrollBar.displayName = ScrollAreaScrollbar.displayName;
|
|
33
36
|
|
|
34
37
|
export { ScrollArea, ScrollBar };
|