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,151 +1,57 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
2
|
import * as React from 'react';
|
|
2
|
-
import { useReactTable,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Skeleton } from '../Skeleton/Skeleton.js';
|
|
6
|
-
import { buildColumns } from './DataTable.utils.js';
|
|
3
|
+
import { useReactTable, flexRender } from '../../node_modules/@tanstack/react-table/build/lib/index.js';
|
|
4
|
+
import { Table, TableHeader, TableRow, TableHead, TableBody, TableCell } from '../Table/Table.js';
|
|
5
|
+
import { getSortedRowModel, getCoreRowModel } from '../../node_modules/@tanstack/table-core/build/lib/index.js';
|
|
7
6
|
|
|
8
7
|
function DataTable({
|
|
9
|
-
isLoading,
|
|
10
8
|
columns,
|
|
11
9
|
data,
|
|
12
|
-
noResults
|
|
13
|
-
pagination,
|
|
14
|
-
vwDiff,
|
|
15
|
-
vhDiff,
|
|
16
|
-
onIsSelected
|
|
10
|
+
noResults
|
|
17
11
|
}) {
|
|
18
12
|
const [sorting, setSorting] = React.useState([]);
|
|
13
|
+
const [rowSelection, setRowSelection] = React.useState({});
|
|
19
14
|
const table = useReactTable({
|
|
20
15
|
data,
|
|
21
|
-
columns
|
|
16
|
+
columns,
|
|
22
17
|
getCoreRowModel: getCoreRowModel(),
|
|
23
18
|
onSortingChange: setSorting,
|
|
24
19
|
getSortedRowModel: getSortedRowModel(),
|
|
20
|
+
onRowSelectionChange: setRowSelection,
|
|
25
21
|
state: {
|
|
26
|
-
sorting
|
|
22
|
+
sorting,
|
|
23
|
+
rowSelection
|
|
27
24
|
}
|
|
28
25
|
});
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const hasPagination = () => {
|
|
34
|
-
if (!pagination) {
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
return /* @__PURE__ */ React.createElement(Pagination, { ...pagination });
|
|
38
|
-
};
|
|
39
|
-
const styleColumn = (meta, elem) => {
|
|
40
|
-
if (elem === "td" && meta.truncate) {
|
|
41
|
-
return {
|
|
42
|
-
width: meta.width,
|
|
43
|
-
overflow: "hidden",
|
|
44
|
-
maxWidth: "0",
|
|
45
|
-
textOverflow: "ellipsis",
|
|
46
|
-
whiteSpace: "nowrap"
|
|
47
|
-
};
|
|
26
|
+
const getMetaStyle = (header) => {
|
|
27
|
+
const meta = header.column.columnDef.meta;
|
|
28
|
+
if (!meta) {
|
|
29
|
+
return {};
|
|
48
30
|
}
|
|
49
|
-
return {
|
|
50
|
-
width: meta.width
|
|
51
|
-
};
|
|
31
|
+
return meta["style"] ?? {};
|
|
52
32
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (!isLoading) {
|
|
57
|
-
const listRows = document.querySelectorAll(`table#data-table tr`);
|
|
58
|
-
listRows.forEach((listRow, listRowIndex) => {
|
|
59
|
-
const rowsElem = listRow.querySelectorAll("[data-fixed]");
|
|
60
|
-
rowsElem.forEach((rowElem, rowElemIndex) => {
|
|
61
|
-
const beforeElem = rowsElem[rowElemIndex - 1];
|
|
62
|
-
const currentElem = rowElem;
|
|
63
|
-
const beforeElemWidth = beforeElem?.getBoundingClientRect()?.width ?? 0;
|
|
64
|
-
const beforeElemLeft = beforeElem?.style?.left ? Number(beforeElem.style.left.replace(/px/g, "")) : 0;
|
|
65
|
-
const lastColumnFixed = rowsElem.length - 1 === rowElemIndex;
|
|
66
|
-
const lastRow = listRows.length - 1 === listRowIndex;
|
|
67
|
-
const currentElemIsTh = currentElem.tagName === "TH";
|
|
68
|
-
const boxShadow = lastColumnFixed ? `#c9c9c9 -0.5px ${lastRow ? "0px" : currentElemIsTh ? "-1.5px" : "-0.5px"} 0px inset` : `#c9c9c9 0px ${lastRow ? "0px" : currentElemIsTh ? "-1.5px" : "-0.5px"} 0px inset`;
|
|
69
|
-
currentElem.style.position = "sticky";
|
|
70
|
-
currentElem.style.left = `${beforeElemWidth + beforeElemLeft}px`;
|
|
71
|
-
currentElem.style.boxShadow = boxShadow;
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
}, [isLoading]);
|
|
76
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
77
|
-
"div",
|
|
78
|
-
{
|
|
79
|
-
className: "bg-white rounded-[8px] p-2 transition-all duration-500",
|
|
80
|
-
style: { width: styleDataTableContainer().width }
|
|
81
|
-
},
|
|
82
|
-
/* @__PURE__ */ React.createElement(ScrollArea, { type: "always", className: "p-2" }, /* @__PURE__ */ React.createElement(
|
|
83
|
-
"div",
|
|
33
|
+
return /* @__PURE__ */ jsx("div", { className: "bg-white rounded-[8px] py-0 px-2 pb-2", children: /* @__PURE__ */ jsxs(Table, { children: [
|
|
34
|
+
/* @__PURE__ */ jsx(TableHeader, { className: "[&_tr]:border-b-[1.5px] [&_tr]:border-grey-400", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(TableRow, { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx(
|
|
35
|
+
TableHead,
|
|
84
36
|
{
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
isLoading ? /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-4" }, arrSkeleton.map((id) => /* @__PURE__ */ React.createElement(
|
|
89
|
-
Skeleton,
|
|
90
|
-
{
|
|
91
|
-
key: id,
|
|
92
|
-
className: "w-full h-[25px] rounded-lg bg-grey-200"
|
|
93
|
-
}
|
|
94
|
-
))) : /* @__PURE__ */ React.createElement("table", { id: "data-table", className: "w-full" }, /* @__PURE__ */ React.createElement("thead", { className: "sticky top-0 z-10" }, table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ React.createElement("tr", { key: headerGroup.id }, headerGroup.headers.map((header) => /* @__PURE__ */ React.createElement(
|
|
95
|
-
"th",
|
|
96
|
-
{
|
|
97
|
-
key: header.id,
|
|
98
|
-
className: "h-12 px-4 [&:has([role=checkbox])]:pr-0 bg-white shadow-[0_-1.5px_0px_0px_#c9c9c9_inset] text-left",
|
|
99
|
-
"data-header": header.id,
|
|
100
|
-
"data-fixed": getFixed(
|
|
101
|
-
header.column.columnDef.meta
|
|
102
|
-
),
|
|
103
|
-
style: styleColumn(
|
|
104
|
-
header.column.columnDef.meta,
|
|
105
|
-
"th"
|
|
106
|
-
)
|
|
107
|
-
},
|
|
108
|
-
header.isPlaceholder ? null : flexRender(
|
|
37
|
+
style: getMetaStyle(header),
|
|
38
|
+
children: header.isPlaceholder ? null : flexRender(
|
|
109
39
|
header.column.columnDef.header,
|
|
110
40
|
header.getContext()
|
|
111
41
|
)
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
"data-fixed": getFixed(
|
|
126
|
-
cell.column.columnDef.meta
|
|
127
|
-
),
|
|
128
|
-
style: styleColumn(
|
|
129
|
-
cell.column.columnDef.meta,
|
|
130
|
-
"td"
|
|
131
|
-
)
|
|
132
|
-
},
|
|
133
|
-
flexRender(
|
|
134
|
-
cell.column.columnDef.cell,
|
|
135
|
-
cell.getContext()
|
|
136
|
-
)
|
|
137
|
-
))
|
|
138
|
-
)) : /* @__PURE__ */ React.createElement("tr", { className: "border-b-[0.5px] [&_td]:hover:bg-grey-100 [&_td]:data-[state=selected]:bg-grey-100" }, /* @__PURE__ */ React.createElement(
|
|
139
|
-
"td",
|
|
140
|
-
{
|
|
141
|
-
colSpan: columns.length,
|
|
142
|
-
className: "p-4 py-0 h-10 align-middle [&:has([role=checkbox])]:pr-0 transition-colors bg-white"
|
|
143
|
-
},
|
|
144
|
-
noResults ?? /* @__PURE__ */ React.createElement("div", { className: "text-center" }, "-")
|
|
145
|
-
))))
|
|
146
|
-
), /* @__PURE__ */ React.createElement(ScrollBar, { orientation: "horizontal" }))
|
|
147
|
-
), hasPagination());
|
|
42
|
+
},
|
|
43
|
+
header.id
|
|
44
|
+
)) }, headerGroup.id)) }),
|
|
45
|
+
/* @__PURE__ */ jsx(TableBody, { children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx(
|
|
46
|
+
TableRow,
|
|
47
|
+
{
|
|
48
|
+
"data-state": row.getIsSelected() && "selected",
|
|
49
|
+
className: "border-b-[0.5px] border-grey-400",
|
|
50
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(TableCell, { className: "py-0 h-10", children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
|
|
51
|
+
},
|
|
52
|
+
row.id
|
|
53
|
+
)) : /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colSpan: columns.length, children: noResults ?? /* @__PURE__ */ jsx("div", { className: "text-center", children: "No results." }) }) }) })
|
|
54
|
+
] }) });
|
|
148
55
|
}
|
|
149
|
-
DataTable.displayName = "DataTable";
|
|
150
56
|
|
|
151
57
|
export { DataTable };
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { cn } from '../../lib/utils.js';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
4
|
+
import { Overlay, Portal, Content, Close, Title, Description, Root, Trigger } from '../../node_modules/@radix-ui/react-dialog/dist/index.js';
|
|
5
|
+
import X from '../../node_modules/lucide-react/dist/esm/icons/x.js';
|
|
5
6
|
|
|
6
|
-
const Dialog =
|
|
7
|
-
const DialogTrigger =
|
|
8
|
-
const DialogPortal =
|
|
9
|
-
const DialogClose =
|
|
10
|
-
const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
11
|
-
|
|
7
|
+
const Dialog = Root;
|
|
8
|
+
const DialogTrigger = Trigger;
|
|
9
|
+
const DialogPortal = Portal;
|
|
10
|
+
const DialogClose = Close;
|
|
11
|
+
const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
12
|
+
Overlay,
|
|
12
13
|
{
|
|
13
14
|
ref,
|
|
14
15
|
className: cn(
|
|
@@ -18,25 +19,33 @@ const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
18
19
|
...props
|
|
19
20
|
}
|
|
20
21
|
));
|
|
21
|
-
DialogOverlay.displayName =
|
|
22
|
-
const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
className
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
22
|
+
DialogOverlay.displayName = Overlay.displayName;
|
|
23
|
+
const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
24
|
+
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
25
|
+
/* @__PURE__ */ jsxs(
|
|
26
|
+
Content,
|
|
27
|
+
{
|
|
28
|
+
ref,
|
|
29
|
+
className: cn(
|
|
30
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
31
|
+
className
|
|
32
|
+
),
|
|
33
|
+
...props,
|
|
34
|
+
children: [
|
|
35
|
+
children,
|
|
36
|
+
/* @__PURE__ */ jsxs(Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
37
|
+
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
38
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
39
|
+
] })
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
] }));
|
|
44
|
+
DialogContent.displayName = Content.displayName;
|
|
36
45
|
const DialogHeader = ({
|
|
37
46
|
className,
|
|
38
47
|
...props
|
|
39
|
-
}) => /* @__PURE__ */
|
|
48
|
+
}) => /* @__PURE__ */ jsx(
|
|
40
49
|
"div",
|
|
41
50
|
{
|
|
42
51
|
className: cn(
|
|
@@ -50,7 +59,7 @@ DialogHeader.displayName = "DialogHeader";
|
|
|
50
59
|
const DialogFooter = ({
|
|
51
60
|
className,
|
|
52
61
|
...props
|
|
53
|
-
}) => /* @__PURE__ */
|
|
62
|
+
}) => /* @__PURE__ */ jsx(
|
|
54
63
|
"div",
|
|
55
64
|
{
|
|
56
65
|
className: cn(
|
|
@@ -61,8 +70,8 @@ const DialogFooter = ({
|
|
|
61
70
|
}
|
|
62
71
|
);
|
|
63
72
|
DialogFooter.displayName = "DialogFooter";
|
|
64
|
-
const DialogTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
65
|
-
|
|
73
|
+
const DialogTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
74
|
+
Title,
|
|
66
75
|
{
|
|
67
76
|
ref,
|
|
68
77
|
className: cn(
|
|
@@ -72,15 +81,15 @@ const DialogTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
72
81
|
...props
|
|
73
82
|
}
|
|
74
83
|
));
|
|
75
|
-
DialogTitle.displayName =
|
|
76
|
-
const DialogDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
77
|
-
|
|
84
|
+
DialogTitle.displayName = Title.displayName;
|
|
85
|
+
const DialogDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
86
|
+
Description,
|
|
78
87
|
{
|
|
79
88
|
ref,
|
|
80
89
|
className: cn("text-sm text-muted-foreground", className),
|
|
81
90
|
...props
|
|
82
91
|
}
|
|
83
92
|
));
|
|
84
|
-
DialogDescription.displayName =
|
|
93
|
+
DialogDescription.displayName = Description.displayName;
|
|
85
94
|
|
|
86
95
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
|
|
@@ -1,16 +1,19 @@
|
|
|
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
|
|
4
|
+
import { SubTrigger as SubTrigger2, SubContent as SubContent2, Portal as Portal2, Content as Content2, Item as Item2, CheckboxItem as CheckboxItem2, ItemIndicator as ItemIndicator2, RadioItem as RadioItem2, Label as Label2, Separator as Separator2, Root as Root2, Trigger, Group as Group2, Sub as Sub2, RadioGroup as RadioGroup2 } from '../../node_modules/@radix-ui/react-dropdown-menu/dist/index.js';
|
|
5
|
+
import ChevronRight from '../../node_modules/lucide-react/dist/esm/icons/chevron-right.js';
|
|
6
|
+
import Check from '../../node_modules/lucide-react/dist/esm/icons/check.js';
|
|
7
|
+
import Circle from '../../node_modules/lucide-react/dist/esm/icons/circle.js';
|
|
5
8
|
|
|
6
|
-
const DropdownMenu =
|
|
7
|
-
const DropdownMenuTrigger =
|
|
8
|
-
const DropdownMenuGroup =
|
|
9
|
-
const DropdownMenuPortal =
|
|
10
|
-
const DropdownMenuSub =
|
|
11
|
-
const DropdownMenuRadioGroup =
|
|
12
|
-
const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */
|
|
13
|
-
|
|
9
|
+
const DropdownMenu = Root2;
|
|
10
|
+
const DropdownMenuTrigger = Trigger;
|
|
11
|
+
const DropdownMenuGroup = Group2;
|
|
12
|
+
const DropdownMenuPortal = Portal2;
|
|
13
|
+
const DropdownMenuSub = Sub2;
|
|
14
|
+
const DropdownMenuRadioGroup = RadioGroup2;
|
|
15
|
+
const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
16
|
+
SubTrigger2,
|
|
14
17
|
{
|
|
15
18
|
ref,
|
|
16
19
|
className: cn(
|
|
@@ -18,14 +21,16 @@ const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, .
|
|
|
18
21
|
inset && "pl-8",
|
|
19
22
|
className
|
|
20
23
|
),
|
|
21
|
-
...props
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
...props,
|
|
25
|
+
children: [
|
|
26
|
+
children,
|
|
27
|
+
/* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto" })
|
|
28
|
+
]
|
|
29
|
+
}
|
|
25
30
|
));
|
|
26
|
-
DropdownMenuSubTrigger.displayName =
|
|
27
|
-
const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
28
|
-
|
|
31
|
+
DropdownMenuSubTrigger.displayName = SubTrigger2.displayName;
|
|
32
|
+
const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
33
|
+
SubContent2,
|
|
29
34
|
{
|
|
30
35
|
ref,
|
|
31
36
|
className: cn(
|
|
@@ -35,9 +40,9 @@ const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) =
|
|
|
35
40
|
...props
|
|
36
41
|
}
|
|
37
42
|
));
|
|
38
|
-
DropdownMenuSubContent.displayName =
|
|
39
|
-
const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */
|
|
40
|
-
|
|
43
|
+
DropdownMenuSubContent.displayName = SubContent2.displayName;
|
|
44
|
+
const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(Portal2, { children: /* @__PURE__ */ jsx(
|
|
45
|
+
Content2,
|
|
41
46
|
{
|
|
42
47
|
ref,
|
|
43
48
|
sideOffset,
|
|
@@ -47,10 +52,10 @@ const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...pr
|
|
|
47
52
|
),
|
|
48
53
|
...props
|
|
49
54
|
}
|
|
50
|
-
)));
|
|
51
|
-
DropdownMenuContent.displayName =
|
|
52
|
-
const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */
|
|
53
|
-
|
|
55
|
+
) }));
|
|
56
|
+
DropdownMenuContent.displayName = Content2.displayName;
|
|
57
|
+
const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
58
|
+
Item2,
|
|
54
59
|
{
|
|
55
60
|
ref,
|
|
56
61
|
className: cn(
|
|
@@ -61,9 +66,9 @@ const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref)
|
|
|
61
66
|
...props
|
|
62
67
|
}
|
|
63
68
|
));
|
|
64
|
-
DropdownMenuItem.displayName =
|
|
65
|
-
const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */
|
|
66
|
-
|
|
69
|
+
DropdownMenuItem.displayName = Item2.displayName;
|
|
70
|
+
const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
71
|
+
CheckboxItem2,
|
|
67
72
|
{
|
|
68
73
|
ref,
|
|
69
74
|
className: cn(
|
|
@@ -71,28 +76,32 @@ const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checke
|
|
|
71
76
|
className
|
|
72
77
|
),
|
|
73
78
|
checked,
|
|
74
|
-
...props
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
...props,
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(ItemIndicator2, { children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }) }),
|
|
82
|
+
children
|
|
83
|
+
]
|
|
84
|
+
}
|
|
78
85
|
));
|
|
79
|
-
DropdownMenuCheckboxItem.displayName =
|
|
80
|
-
const DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
81
|
-
|
|
86
|
+
DropdownMenuCheckboxItem.displayName = CheckboxItem2.displayName;
|
|
87
|
+
const DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
88
|
+
RadioItem2,
|
|
82
89
|
{
|
|
83
90
|
ref,
|
|
84
91
|
className: cn(
|
|
85
92
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
86
93
|
className
|
|
87
94
|
),
|
|
88
|
-
...props
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
95
|
+
...props,
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(ItemIndicator2, { children: /* @__PURE__ */ jsx(Circle, { className: "h-2 w-2 fill-current" }) }) }),
|
|
98
|
+
children
|
|
99
|
+
]
|
|
100
|
+
}
|
|
92
101
|
));
|
|
93
|
-
DropdownMenuRadioItem.displayName =
|
|
94
|
-
const DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */
|
|
95
|
-
|
|
102
|
+
DropdownMenuRadioItem.displayName = RadioItem2.displayName;
|
|
103
|
+
const DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
104
|
+
Label2,
|
|
96
105
|
{
|
|
97
106
|
ref,
|
|
98
107
|
className: cn(
|
|
@@ -103,20 +112,20 @@ const DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref)
|
|
|
103
112
|
...props
|
|
104
113
|
}
|
|
105
114
|
));
|
|
106
|
-
DropdownMenuLabel.displayName =
|
|
107
|
-
const DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
108
|
-
|
|
115
|
+
DropdownMenuLabel.displayName = Label2.displayName;
|
|
116
|
+
const DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
117
|
+
Separator2,
|
|
109
118
|
{
|
|
110
119
|
ref,
|
|
111
120
|
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
112
121
|
...props
|
|
113
122
|
}
|
|
114
123
|
));
|
|
115
|
-
DropdownMenuSeparator.displayName =
|
|
124
|
+
DropdownMenuSeparator.displayName = Separator2.displayName;
|
|
116
125
|
const DropdownMenuShortcut = ({
|
|
117
126
|
className,
|
|
118
127
|
...props
|
|
119
|
-
}) => /* @__PURE__ */
|
|
128
|
+
}) => /* @__PURE__ */ jsx(
|
|
120
129
|
"span",
|
|
121
130
|
{
|
|
122
131
|
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { Typography } from '../Typography/Typography.js';
|
|
4
3
|
import { cn } from '../../lib/utils.js';
|
|
5
|
-
import { cva } from 'class-variance-authority';
|
|
6
|
-
import {
|
|
7
|
-
import { colorLuminance } from 'use-color-luminance';
|
|
4
|
+
import { cva } from '../../node_modules/class-variance-authority/dist/index.js';
|
|
5
|
+
import { colorLuminance } from '../../node_modules/use-color-luminance/index.es.js';
|
|
8
6
|
import { useSidebar } from '../Sidebar/Sidebar.js';
|
|
9
|
-
import { Tooltip, TooltipTrigger, TooltipContent } from '../Tooltip/Tooltip.js';
|
|
7
|
+
import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from '../Tooltip/Tooltip.js';
|
|
10
8
|
import { HelpMenu } from './HelpMenu.js';
|
|
11
9
|
import { ImgBrand } from './ImgBrand.js';
|
|
12
10
|
import { ModulesMenu } from './ModulesMenu.js';
|
|
13
11
|
import { SocialMenu } from './SocialMenu.js';
|
|
14
12
|
import { UserMenu } from './UserMenu.js';
|
|
13
|
+
import { useTranslation } from '../../node_modules/react-i18next/dist/es/useTranslation.js';
|
|
14
|
+
import Menu from '../../node_modules/lucide-react/dist/esm/icons/menu.js';
|
|
15
15
|
|
|
16
16
|
const headerVariants = cva(
|
|
17
17
|
"w-full h-12 bg-blue-800 flex items-center justify-center gap-4 px-4",
|
|
@@ -54,39 +54,55 @@ const Header = ({
|
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
|
-
return /* @__PURE__ */
|
|
57
|
+
return /* @__PURE__ */ jsxs(
|
|
58
58
|
"header",
|
|
59
59
|
{
|
|
60
60
|
className: cn(headerVariants({ className }), ""),
|
|
61
61
|
style: { backgroundColor: customStyles.bgColor },
|
|
62
|
-
...props
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
62
|
+
...props,
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
65
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
66
|
+
Menu,
|
|
67
|
+
{
|
|
68
|
+
className: "text-white transition-all duration-300 hover:cursor-pointer hover:opacity-70 shrink-0",
|
|
69
|
+
size: 32,
|
|
70
|
+
onClick: () => {
|
|
71
|
+
onOpenMenuChange?.();
|
|
72
|
+
toggleSidebar();
|
|
73
|
+
},
|
|
74
|
+
style: { color: customStyles.textColor }
|
|
75
|
+
}
|
|
76
|
+
) }),
|
|
77
|
+
/* @__PURE__ */ jsx(TooltipContent, { color: "black", align: "start", side: "bottom", children: open ? t("header.collapseMenu") : t("header.expandMenu") })
|
|
78
|
+
] }) }),
|
|
79
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center grow gap-24", children: [
|
|
80
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-12", children: [
|
|
81
|
+
/* @__PURE__ */ jsx(ImgBrand, { src: customImgSrc }),
|
|
82
|
+
module && /* @__PURE__ */ jsx(
|
|
83
|
+
Typography,
|
|
84
|
+
{
|
|
85
|
+
variant: "heading-medium-600",
|
|
86
|
+
textColor: "text-white",
|
|
87
|
+
className: "border-l-2 border-white pl-2 max-md:hidden",
|
|
88
|
+
style: {
|
|
89
|
+
color: customStyles.textColor,
|
|
90
|
+
borderColor: customStyles.textColor
|
|
91
|
+
},
|
|
92
|
+
children: module
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
] }),
|
|
96
|
+
/* @__PURE__ */ jsx("div", { className: "max-md:hidden", children: extraContent && extraContent })
|
|
97
|
+
] }),
|
|
98
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
|
|
99
|
+
/* @__PURE__ */ jsx(SocialMenu, { customStyles: getCustomStyles(), ...socialMenu }),
|
|
100
|
+
/* @__PURE__ */ jsx(UserMenu, { customStyles: getCustomStyles(), ...userMenu }),
|
|
101
|
+
/* @__PURE__ */ jsx(HelpMenu, { customStyles: getCustomStyles(), ...helpMenu }),
|
|
102
|
+
/* @__PURE__ */ jsx(ModulesMenu, { customStyles: getCustomStyles(), ...modulesMenu })
|
|
103
|
+
] })
|
|
104
|
+
]
|
|
105
|
+
}
|
|
90
106
|
);
|
|
91
107
|
};
|
|
92
108
|
Header.displayName = "Header";
|