@tecsinapse/cortex-react 1.3.0-beta.3 → 1.3.0-beta.4
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/cjs/components/Masonry.js +48 -0
- package/dist/cjs/components/Menubar/Categories.js +10 -0
- package/dist/cjs/components/Menubar/Category.js +11 -0
- package/dist/cjs/components/Menubar/Dropdown.js +23 -0
- package/dist/cjs/components/Menubar/DropdownRoot.js +38 -0
- package/dist/cjs/components/Menubar/Header.js +26 -0
- package/dist/cjs/components/Menubar/IconControlSubItem.js +19 -0
- package/dist/cjs/components/Menubar/Item.js +22 -0
- package/dist/cjs/components/Menubar/ItemLink.js +18 -0
- package/dist/cjs/components/Menubar/Left.js +11 -0
- package/dist/cjs/components/Menubar/MostUsed.js +11 -0
- package/dist/cjs/components/Menubar/MostUsedItem.js +31 -0
- package/dist/cjs/components/Menubar/MostUsedList.js +58 -0
- package/dist/cjs/components/Menubar/Right.js +11 -0
- package/dist/cjs/components/Menubar/Root.js +11 -0
- package/dist/cjs/components/Menubar/Search.js +21 -0
- package/dist/cjs/components/Menubar/SubItem.js +20 -0
- package/dist/cjs/components/Menubar/index.js +33 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/provider/MenubarProvider.js +22 -0
- package/dist/cjs/provider/SnackbarProvider.js +51 -0
- package/dist/cjs/service/SnackbarSonner.js +10 -0
- package/dist/cjs/styles/menubar.js +62 -0
- package/dist/esm/components/Masonry.js +46 -0
- package/dist/esm/components/Menubar/Categories.js +8 -0
- package/dist/esm/components/Menubar/Category.js +9 -0
- package/dist/esm/components/Menubar/Dropdown.js +21 -0
- package/dist/esm/components/Menubar/DropdownRoot.js +36 -0
- package/dist/esm/components/Menubar/Header.js +24 -0
- package/dist/esm/components/Menubar/IconControlSubItem.js +17 -0
- package/dist/esm/components/Menubar/Item.js +20 -0
- package/dist/esm/components/Menubar/ItemLink.js +16 -0
- package/dist/esm/components/Menubar/Left.js +9 -0
- package/dist/esm/components/Menubar/MostUsed.js +9 -0
- package/dist/esm/components/Menubar/MostUsedItem.js +29 -0
- package/dist/esm/components/Menubar/MostUsedList.js +56 -0
- package/dist/esm/components/Menubar/Right.js +9 -0
- package/dist/esm/components/Menubar/Root.js +9 -0
- package/dist/esm/components/Menubar/Search.js +19 -0
- package/dist/esm/components/Menubar/SubItem.js +18 -0
- package/dist/esm/components/Menubar/index.js +31 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/provider/MenubarProvider.js +19 -0
- package/dist/esm/provider/SnackbarProvider.js +49 -0
- package/dist/esm/service/SnackbarSonner.js +10 -0
- package/dist/esm/styles/menubar.js +54 -0
- package/dist/types/components/Card.d.ts +3 -4
- package/dist/types/components/Masonry.d.ts +7 -0
- package/dist/types/components/Menubar/Categories.d.ts +3 -0
- package/dist/types/components/Menubar/Category.d.ts +8 -0
- package/dist/types/components/Menubar/Dropdown.d.ts +3 -0
- package/dist/types/components/Menubar/DropdownRoot.d.ts +17 -0
- package/dist/types/components/Menubar/Header.d.ts +6 -0
- package/dist/types/components/Menubar/IconControlSubItem.d.ts +6 -0
- package/dist/types/components/Menubar/Item.d.ts +10 -0
- package/dist/types/components/Menubar/ItemLink.d.ts +8 -0
- package/dist/types/components/Menubar/Left.d.ts +3 -0
- package/dist/types/components/Menubar/MostUsed.d.ts +8 -0
- package/dist/types/components/Menubar/MostUsedItem.d.ts +8 -0
- package/dist/types/components/Menubar/MostUsedList.d.ts +3 -0
- package/dist/types/components/Menubar/Right.d.ts +3 -0
- package/dist/types/components/Menubar/Root.d.ts +6 -0
- package/dist/types/components/Menubar/Search.d.ts +3 -0
- package/dist/types/components/Menubar/SubItem.d.ts +6 -0
- package/dist/types/components/Menubar/index.d.ts +15 -0
- package/dist/types/components/Menubar/interface.d.ts +4 -0
- package/dist/types/components/SearchInput.d.ts +0 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/provider/MenubarProvider.d.ts +8 -0
- package/dist/types/provider/index.d.ts +2 -0
- package/dist/types/styles/menubar.d.ts +346 -0
- package/dist/types/tests/Menubar/Categories.test.d.ts +1 -0
- package/dist/types/tests/Menubar/Category.test.d.ts +1 -0
- package/dist/types/tests/Menubar/Dropdown.test.d.ts +1 -0
- package/dist/types/tests/Menubar/DropdownRoot.test.d.ts +1 -0
- package/dist/types/tests/Menubar/Header.test.d.ts +1 -0
- package/dist/types/tests/Menubar/HeaderLeft.test.d.ts +1 -0
- package/dist/types/tests/Menubar/HeaderRigth.test.d.ts +1 -0
- package/dist/types/tests/Menubar/Item.test.d.ts +1 -0
- package/dist/types/tests/Menubar/MostUsed.test.d.ts +1 -0
- package/dist/types/tests/Menubar/MostUsedItem.test.d.ts +1 -0
- package/dist/types/tests/Menubar/MostUsedList.test.d.ts +1 -0
- package/dist/types/tests/Menubar/Root.test.d.ts +1 -0
- package/dist/types/tests/Menubar/SubItem.test.d.ts +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { category } from '../../styles/menubar.js';
|
|
3
|
+
|
|
4
|
+
const Category = ({ title, options, render }) => {
|
|
5
|
+
const { text, hr, container } = category();
|
|
6
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", { className: text() }, title), /* @__PURE__ */ React.createElement("hr", { className: hr() }), /* @__PURE__ */ React.createElement("div", { className: container() }, options.map((i) => render(i))));
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export { Category as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { menubar, animate } from '../../styles/menubar.js';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { useMenubar } from '../../provider/MenubarProvider.js';
|
|
5
|
+
import '../../provider/SnackbarProvider.js';
|
|
6
|
+
|
|
7
|
+
const Dropdown = ({ children, ...rest }) => {
|
|
8
|
+
const { dropdown } = menubar();
|
|
9
|
+
const [show] = useMenubar();
|
|
10
|
+
return /* @__PURE__ */ React.createElement(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
className: clsx(dropdown(), animate({ show })),
|
|
14
|
+
"data-testid": "dropdown-menubar",
|
|
15
|
+
...rest
|
|
16
|
+
},
|
|
17
|
+
children
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { Dropdown as default };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Menubar } from './index.js';
|
|
3
|
+
import MostUsedList from './MostUsedList.js';
|
|
4
|
+
|
|
5
|
+
const DropdownRoot = ({
|
|
6
|
+
mostUsed,
|
|
7
|
+
options,
|
|
8
|
+
labelMostUsed
|
|
9
|
+
}) => {
|
|
10
|
+
const hasMostUsed = mostUsed && (mostUsed ?? []).length > 0;
|
|
11
|
+
return /* @__PURE__ */ React.createElement(Menubar.Dropdown, null, hasMostUsed ? /* @__PURE__ */ React.createElement(Menubar.MostUsed, { label: labelMostUsed }, /* @__PURE__ */ React.createElement(MostUsedList, { mostUsed })) : /* @__PURE__ */ React.createElement(React.Fragment, null), /* @__PURE__ */ React.createElement(Menubar.Categories, null, options.map((item, index) => /* @__PURE__ */ React.createElement(
|
|
12
|
+
Menubar.Category,
|
|
13
|
+
{
|
|
14
|
+
key: `${item.title}-${index}`,
|
|
15
|
+
title: item.title,
|
|
16
|
+
options: item.items,
|
|
17
|
+
render: (prop) => {
|
|
18
|
+
const { title, items, ...rest } = prop;
|
|
19
|
+
return /* @__PURE__ */ React.createElement(
|
|
20
|
+
Menubar.Item,
|
|
21
|
+
{
|
|
22
|
+
key: prop.title,
|
|
23
|
+
...rest,
|
|
24
|
+
subItems: items ?? [],
|
|
25
|
+
renderSubItems: ({ title: title2, ...rest2 }) => {
|
|
26
|
+
return /* @__PURE__ */ React.createElement(Menubar.SubItem, { key: title2, ...rest2 }, title2);
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
title
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
))));
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export { DropdownRoot as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import { menubar } from '../../styles/menubar.js';
|
|
4
|
+
import { Button } from '../Button.js';
|
|
5
|
+
import { IoMenu } from 'react-icons/io5';
|
|
6
|
+
import { useMenubar } from '../../provider/MenubarProvider.js';
|
|
7
|
+
import '../../provider/SnackbarProvider.js';
|
|
8
|
+
|
|
9
|
+
const { root } = menubar();
|
|
10
|
+
const Header = ({ children, className, ...rest }) => {
|
|
11
|
+
const [show, setShow] = useMenubar();
|
|
12
|
+
return /* @__PURE__ */ React.createElement(
|
|
13
|
+
"div",
|
|
14
|
+
{
|
|
15
|
+
className: clsx(root(), className),
|
|
16
|
+
"data-testid": "header-menubar",
|
|
17
|
+
...rest
|
|
18
|
+
},
|
|
19
|
+
/* @__PURE__ */ React.createElement(Button, { variants: { size: "square" }, onClick: () => setShow(!show) }, /* @__PURE__ */ React.createElement(IoMenu, { size: 16 })),
|
|
20
|
+
children
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export { Header as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { item } from '../../styles/menubar.js';
|
|
3
|
+
import { IoCaretUpCircleOutline, IoCaretDownCircleOutline } from 'react-icons/io5';
|
|
4
|
+
|
|
5
|
+
const { icon } = item();
|
|
6
|
+
const IconControlSubItem = ({
|
|
7
|
+
show,
|
|
8
|
+
setShow
|
|
9
|
+
}) => {
|
|
10
|
+
const handleClick = (e) => {
|
|
11
|
+
e.stopPropagation();
|
|
12
|
+
setShow(!show);
|
|
13
|
+
};
|
|
14
|
+
return /* @__PURE__ */ React.createElement("div", { onClick: handleClick, "data-testid": "icon-sub-item-menubar" }, show ? /* @__PURE__ */ React.createElement(IoCaretUpCircleOutline, { className: icon() }) : /* @__PURE__ */ React.createElement(IoCaretDownCircleOutline, { className: icon() }));
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { IconControlSubItem as default };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import IconControlSubItem from './IconControlSubItem.js';
|
|
3
|
+
import { item } from '../../styles/menubar.js';
|
|
4
|
+
import ItemLink from './ItemLink.js';
|
|
5
|
+
|
|
6
|
+
const { container, text } = item();
|
|
7
|
+
const Item = ({
|
|
8
|
+
children,
|
|
9
|
+
subItems,
|
|
10
|
+
renderSubItems,
|
|
11
|
+
className,
|
|
12
|
+
href,
|
|
13
|
+
...rest
|
|
14
|
+
}) => {
|
|
15
|
+
const [showSubItem, setShowSubItem] = useState(false);
|
|
16
|
+
const hasSubItems = (subItems ?? []).length > 0;
|
|
17
|
+
return /* @__PURE__ */ React.createElement(ItemLink, { href }, /* @__PURE__ */ React.createElement("div", { "data-testid": "item-menubar", ...rest, className: container() }, /* @__PURE__ */ React.createElement("div", { className: text({ className }) }, children), hasSubItems ? /* @__PURE__ */ React.createElement(IconControlSubItem, { show: showSubItem, setShow: setShowSubItem }) : /* @__PURE__ */ React.createElement(React.Fragment, null)), showSubItem ? /* @__PURE__ */ React.createElement(React.Fragment, null, subItems?.map((subItem) => renderSubItems?.(subItem))) : /* @__PURE__ */ React.createElement(React.Fragment, null));
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { Item as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
const ItemLink = ({ href, children, classNameAnchor }) => {
|
|
4
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, href ? /* @__PURE__ */ React.createElement(
|
|
5
|
+
"a",
|
|
6
|
+
{
|
|
7
|
+
href,
|
|
8
|
+
target: "_blank",
|
|
9
|
+
rel: "noreferrer",
|
|
10
|
+
className: classNameAnchor
|
|
11
|
+
},
|
|
12
|
+
children
|
|
13
|
+
) : children);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { ItemLink as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { menubar } from '../../styles/menubar.js';
|
|
3
|
+
|
|
4
|
+
const { left } = menubar();
|
|
5
|
+
const Left = ({ children, ...rest }) => {
|
|
6
|
+
return /* @__PURE__ */ React.createElement("div", { className: left(), "data-testid": "header-left-menubar", ...rest }, children);
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export { Left as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mostUsed } from '../../styles/menubar.js';
|
|
3
|
+
|
|
4
|
+
const { container, label: labelClass, containerList } = mostUsed();
|
|
5
|
+
const MostUsed = ({ label, children, ...rest }) => {
|
|
6
|
+
return /* @__PURE__ */ React.createElement("div", { className: container(), "data-testid": "most-used-menubar", ...rest }, /* @__PURE__ */ React.createElement("p", { className: labelClass() }, label), /* @__PURE__ */ React.createElement("div", { className: containerList() }, children));
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export { MostUsed as default };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mostUsedItem } from '../../styles/menubar.js';
|
|
3
|
+
import { Card } from '../Card.js';
|
|
4
|
+
import ItemLink from './ItemLink.js';
|
|
5
|
+
|
|
6
|
+
const {
|
|
7
|
+
title: titleClass,
|
|
8
|
+
category: categoryClass,
|
|
9
|
+
container
|
|
10
|
+
} = mostUsedItem();
|
|
11
|
+
const MostUsedItem = ({
|
|
12
|
+
title,
|
|
13
|
+
category,
|
|
14
|
+
href,
|
|
15
|
+
...rest
|
|
16
|
+
}) => {
|
|
17
|
+
return /* @__PURE__ */ React.createElement(ItemLink, { href, classNameAnchor: "w-full" }, /* @__PURE__ */ React.createElement(
|
|
18
|
+
Card,
|
|
19
|
+
{
|
|
20
|
+
...rest,
|
|
21
|
+
"data-testid": "most-used-item-menubar",
|
|
22
|
+
className: container()
|
|
23
|
+
},
|
|
24
|
+
/* @__PURE__ */ React.createElement("p", { className: titleClass() }, title),
|
|
25
|
+
/* @__PURE__ */ React.createElement("p", { className: categoryClass() }, category)
|
|
26
|
+
));
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { MostUsedItem as default };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import 'clsx';
|
|
3
|
+
import '@internationalized/date';
|
|
4
|
+
import '../Badge.js';
|
|
5
|
+
import '../BaseSnackbar.js';
|
|
6
|
+
import 'react-icons/md';
|
|
7
|
+
import '../Card.js';
|
|
8
|
+
import '../Button.js';
|
|
9
|
+
import 'react-aria';
|
|
10
|
+
import 'react-stately';
|
|
11
|
+
import '@floating-ui/react';
|
|
12
|
+
import '../CalendarCell.js';
|
|
13
|
+
import '@tecsinapse/cortex-core';
|
|
14
|
+
import 'react-icons/fa';
|
|
15
|
+
import 'react-icons/lia';
|
|
16
|
+
import '../Input/Box.js';
|
|
17
|
+
import '../Input/Face.js';
|
|
18
|
+
import '../Input/Left.js';
|
|
19
|
+
import '../Input/Right.js';
|
|
20
|
+
import '../Input/Root.js';
|
|
21
|
+
import '../Input/Search.js';
|
|
22
|
+
import 'react-icons/io';
|
|
23
|
+
import '../GroupButton.js';
|
|
24
|
+
import '../Hint.js';
|
|
25
|
+
import '../Modal.js';
|
|
26
|
+
import '../../styles/calendar-cell.js';
|
|
27
|
+
import '../../styles/groupButton.js';
|
|
28
|
+
import '../../styles/progressBar.js';
|
|
29
|
+
import '../Select/GroupedOptions.js';
|
|
30
|
+
import '../Select/context.js';
|
|
31
|
+
import '../Select/Popover.js';
|
|
32
|
+
import '../Select/Trigger.js';
|
|
33
|
+
import '../Tag.js';
|
|
34
|
+
import '../TextArea.js';
|
|
35
|
+
import '../Toggle.js';
|
|
36
|
+
import '../Tooltip.js';
|
|
37
|
+
import '../Popover/PopoverContext.js';
|
|
38
|
+
import { Menubar } from './index.js';
|
|
39
|
+
|
|
40
|
+
const MostUsedList = ({ mostUsed }) => {
|
|
41
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, (mostUsed ?? []).map((item, index) => {
|
|
42
|
+
const { title, category, ...rest } = item;
|
|
43
|
+
if (index > 3) return /* @__PURE__ */ React.createElement(React.Fragment, null);
|
|
44
|
+
return /* @__PURE__ */ React.createElement(
|
|
45
|
+
Menubar.MostUsedItem,
|
|
46
|
+
{
|
|
47
|
+
key: title,
|
|
48
|
+
title,
|
|
49
|
+
category,
|
|
50
|
+
...rest
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}));
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export { MostUsedList as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { menubar } from '../../styles/menubar.js';
|
|
3
|
+
|
|
4
|
+
const { right } = menubar();
|
|
5
|
+
const Right = ({ children, ...rest }) => {
|
|
6
|
+
return /* @__PURE__ */ React.createElement("div", { className: right(), "data-testid": "header-right-menubar", ...rest }, children);
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export { Right as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MenubarProvider } from '../../provider/MenubarProvider.js';
|
|
3
|
+
import '../../provider/SnackbarProvider.js';
|
|
4
|
+
|
|
5
|
+
const Root = ({ children, ...rest }) => {
|
|
6
|
+
return /* @__PURE__ */ React.createElement(MenubarProvider, null, /* @__PURE__ */ React.createElement("div", { ...rest }, children));
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export { Root as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Input } from '../Input/index.js';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { animate } from '../../styles/menubar.js';
|
|
5
|
+
import { useMenubar } from '../../provider/MenubarProvider.js';
|
|
6
|
+
import '../../provider/SnackbarProvider.js';
|
|
7
|
+
|
|
8
|
+
const Search = (props) => {
|
|
9
|
+
const [show] = useMenubar();
|
|
10
|
+
return /* @__PURE__ */ React.createElement(
|
|
11
|
+
Input.Search,
|
|
12
|
+
{
|
|
13
|
+
...props,
|
|
14
|
+
className: clsx("mr-tera flex-1", animate({ show }))
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { Search as default };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { subItem } from '../../styles/menubar.js';
|
|
3
|
+
import ItemLink from './ItemLink.js';
|
|
4
|
+
|
|
5
|
+
const { container } = subItem();
|
|
6
|
+
const SubItem = ({ children, href, className, ...rest }) => {
|
|
7
|
+
return /* @__PURE__ */ React.createElement(ItemLink, { href }, /* @__PURE__ */ React.createElement(
|
|
8
|
+
"div",
|
|
9
|
+
{
|
|
10
|
+
...rest,
|
|
11
|
+
"data-testid": "sub-item-menubar",
|
|
12
|
+
className: container({ className })
|
|
13
|
+
},
|
|
14
|
+
children
|
|
15
|
+
));
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { SubItem as default };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import Root from './Root.js';
|
|
2
|
+
import Left from './Left.js';
|
|
3
|
+
import Search from './Search.js';
|
|
4
|
+
import Right from './Right.js';
|
|
5
|
+
import Dropdown from './Dropdown.js';
|
|
6
|
+
import MostUsed from './MostUsed.js';
|
|
7
|
+
import MostUsedItem from './MostUsedItem.js';
|
|
8
|
+
import Header from './Header.js';
|
|
9
|
+
import Category from './Category.js';
|
|
10
|
+
import Item from './Item.js';
|
|
11
|
+
import Categories from './Categories.js';
|
|
12
|
+
import SubItem from './SubItem.js';
|
|
13
|
+
import DropdownRoot from './DropdownRoot.js';
|
|
14
|
+
|
|
15
|
+
const Menubar = {
|
|
16
|
+
Root,
|
|
17
|
+
Header,
|
|
18
|
+
HeaderLeft: Left,
|
|
19
|
+
Search,
|
|
20
|
+
HeaderRight: Right,
|
|
21
|
+
Dropdown,
|
|
22
|
+
MostUsed,
|
|
23
|
+
MostUsedItem,
|
|
24
|
+
Category,
|
|
25
|
+
Categories,
|
|
26
|
+
Item,
|
|
27
|
+
SubItem,
|
|
28
|
+
DropdownRoot
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { Menubar };
|
package/dist/esm/index.js
CHANGED
|
@@ -24,6 +24,7 @@ export { TimeFieldInput } from './components/TimeFieldInput.js';
|
|
|
24
24
|
export { Toggle } from './components/Toggle.js';
|
|
25
25
|
import './components/Tooltip.js';
|
|
26
26
|
export { Popover } from './components/Popover/Popover.js';
|
|
27
|
+
export { Menubar } from './components/Menubar/index.js';
|
|
27
28
|
export { useCalendar } from './hooks/useCalendar.js';
|
|
28
29
|
export { useCalendarCell } from './hooks/useCalendarCell.js';
|
|
29
30
|
export { useCalendarGrid } from './hooks/useCalendarGrid.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { createContext, useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
const MenubarContext = createContext({
|
|
4
|
+
show: false,
|
|
5
|
+
setShow: () => void 0
|
|
6
|
+
});
|
|
7
|
+
const MenubarProvider = ({ children }) => {
|
|
8
|
+
const [show, setShow] = React.useState(false);
|
|
9
|
+
return /* @__PURE__ */ React.createElement(MenubarContext.Provider, { value: { show, setShow } }, children);
|
|
10
|
+
};
|
|
11
|
+
const useMenubar = () => {
|
|
12
|
+
const context = useContext(MenubarContext);
|
|
13
|
+
if (!context) {
|
|
14
|
+
throw new Error("useSnackbar must be used within a SnackbarProvider");
|
|
15
|
+
}
|
|
16
|
+
return [context.show, context.setShow];
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { MenubarProvider, useMenubar };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
import 'sonner';
|
|
3
|
+
import 'clsx';
|
|
4
|
+
import '@internationalized/date';
|
|
5
|
+
import '../components/Badge.js';
|
|
6
|
+
import '../components/BaseSnackbar.js';
|
|
7
|
+
import 'react-icons/md';
|
|
8
|
+
import '../components/Card.js';
|
|
9
|
+
import '../components/Button.js';
|
|
10
|
+
import 'react-aria';
|
|
11
|
+
import 'react-stately';
|
|
12
|
+
import '@floating-ui/react';
|
|
13
|
+
import '../components/CalendarCell.js';
|
|
14
|
+
import '@tecsinapse/cortex-core';
|
|
15
|
+
import 'react-icons/fa';
|
|
16
|
+
import 'react-icons/lia';
|
|
17
|
+
import '../components/Input/Box.js';
|
|
18
|
+
import '../components/Input/Face.js';
|
|
19
|
+
import '../components/Input/Left.js';
|
|
20
|
+
import '../components/Input/Right.js';
|
|
21
|
+
import '../components/Input/Root.js';
|
|
22
|
+
import '../components/Input/Search.js';
|
|
23
|
+
import 'react-icons/io';
|
|
24
|
+
import '../components/GroupButton.js';
|
|
25
|
+
import '../components/Hint.js';
|
|
26
|
+
import '../components/Modal.js';
|
|
27
|
+
import '../styles/calendar-cell.js';
|
|
28
|
+
import '../styles/groupButton.js';
|
|
29
|
+
import '../styles/progressBar.js';
|
|
30
|
+
import '../components/Select/GroupedOptions.js';
|
|
31
|
+
import '../components/Select/context.js';
|
|
32
|
+
import '../components/Select/Popover.js';
|
|
33
|
+
import '../components/Select/Trigger.js';
|
|
34
|
+
import '../components/Tag.js';
|
|
35
|
+
import '../components/TextArea.js';
|
|
36
|
+
import '../components/Toggle.js';
|
|
37
|
+
import '../components/Tooltip.js';
|
|
38
|
+
import '../components/Popover/PopoverContext.js';
|
|
39
|
+
import './MenubarProvider.js';
|
|
40
|
+
import '../components/Menubar/Left.js';
|
|
41
|
+
import '../styles/menubar.js';
|
|
42
|
+
import '../components/Menubar/Right.js';
|
|
43
|
+
import '../components/Menubar/MostUsed.js';
|
|
44
|
+
import '../components/Menubar/MostUsedItem.js';
|
|
45
|
+
import '../components/Menubar/Header.js';
|
|
46
|
+
import '../components/Menubar/Item.js';
|
|
47
|
+
import '../components/Menubar/SubItem.js';
|
|
48
|
+
|
|
49
|
+
createContext(null);
|
|
@@ -36,6 +36,16 @@ import '../components/TextArea.js';
|
|
|
36
36
|
import '../components/Toggle.js';
|
|
37
37
|
import '../components/Tooltip.js';
|
|
38
38
|
import '../components/Popover/PopoverContext.js';
|
|
39
|
+
import '../provider/MenubarProvider.js';
|
|
40
|
+
import '../provider/SnackbarProvider.js';
|
|
41
|
+
import '../components/Menubar/Left.js';
|
|
42
|
+
import '../styles/menubar.js';
|
|
43
|
+
import '../components/Menubar/Right.js';
|
|
44
|
+
import '../components/Menubar/MostUsed.js';
|
|
45
|
+
import '../components/Menubar/MostUsedItem.js';
|
|
46
|
+
import '../components/Menubar/Header.js';
|
|
47
|
+
import '../components/Menubar/Item.js';
|
|
48
|
+
import '../components/Menubar/SubItem.js';
|
|
39
49
|
|
|
40
50
|
class SnackbarSonner {
|
|
41
51
|
custom(Component, options) {
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
|
|
3
|
+
const menubar = tv({
|
|
4
|
+
slots: {
|
|
5
|
+
root: "w-screen px-kilo py-deca flex flex-row justify-between bg-white z-[100]",
|
|
6
|
+
left: "flex items-center w-fit",
|
|
7
|
+
right: "flex items-center gap-x-deca",
|
|
8
|
+
dropdown: "w-full bg-white flex-1 pt-kilo pb-mega shadow-default px-[8vw] z-[100]"
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const mostUsed = tv({
|
|
12
|
+
slots: {
|
|
13
|
+
container: "mb-kilo",
|
|
14
|
+
label: "font-bold mb-centi",
|
|
15
|
+
containerList: "gap-x-kilo flex flex-row"
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
const mostUsedItem = tv({
|
|
19
|
+
slots: {
|
|
20
|
+
container: "flex-1 py-mili",
|
|
21
|
+
title: "text-primary-medium font-bold",
|
|
22
|
+
category: "text-secondary-medium"
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
const item = tv({
|
|
26
|
+
slots: {
|
|
27
|
+
container: "flex flex-row gap-x-deca items-center",
|
|
28
|
+
text: "text-secondary-dark hover:text-primary-medium hover:cursor-pointer text-base",
|
|
29
|
+
icon: "text-primary-medium hover:cursor-pointer"
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
const category = tv({
|
|
33
|
+
slots: {
|
|
34
|
+
text: "mb-mili font-bold",
|
|
35
|
+
hr: "mb-mili",
|
|
36
|
+
container: "flex flex-col gap-y-mili"
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
const subItem = tv({
|
|
40
|
+
slots: {
|
|
41
|
+
container: "pl-deca text-sub border-l-[1px] border-primary-medium text-secondary-dark hover:text-primary-medium cursor-pointer"
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const animate = tv({
|
|
45
|
+
base: "transition-all ease-in-out duration-250",
|
|
46
|
+
variants: {
|
|
47
|
+
show: {
|
|
48
|
+
true: "translate-y-0 opacity-1 visible",
|
|
49
|
+
false: "-translate-y-[120%] opacity-0 invisible"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
export { animate, category, item, menubar, mostUsed, mostUsedItem, subItem };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface CardProps {
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
|
+
export interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
3
|
children?: React.ReactNode;
|
|
4
4
|
}
|
|
5
|
-
export declare const Card: React.ForwardRefExoticComponent<
|
|
6
|
-
export {};
|
|
5
|
+
export declare const Card: React.ForwardRefExoticComponent<CardProps & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MostUsedItemProps } from './MostUsedItem';
|
|
2
|
+
import { DefaultProps } from './interface';
|
|
3
|
+
interface MenuItem extends DefaultProps {
|
|
4
|
+
title: string;
|
|
5
|
+
items?: MenuItem[];
|
|
6
|
+
}
|
|
7
|
+
interface MenuCategory {
|
|
8
|
+
title: string;
|
|
9
|
+
items: MenuItem[];
|
|
10
|
+
}
|
|
11
|
+
export interface DropdownRootProps {
|
|
12
|
+
labelMostUsed?: string;
|
|
13
|
+
mostUsed?: MostUsedItemProps[];
|
|
14
|
+
options: MenuCategory[];
|
|
15
|
+
}
|
|
16
|
+
declare const DropdownRoot: ({ mostUsed, options, labelMostUsed, }: DropdownRootProps) => JSX.Element;
|
|
17
|
+
export default DropdownRoot;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DefaultProps } from './interface';
|
|
3
|
+
export interface ItemProps<T> extends DefaultProps {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
subItems?: T[];
|
|
6
|
+
renderSubItems?: (prop: T) => React.ReactNode;
|
|
7
|
+
href?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const Item: <T>({ children, subItems, renderSubItems, className, href, ...rest }: ItemProps<T>) => JSX.Element;
|
|
10
|
+
export default Item;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DefaultProps } from './interface';
|
|
3
|
+
export interface MostUsedProps extends DefaultProps {
|
|
4
|
+
label?: string;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
declare const MostUsed: ({ label, children, ...rest }: MostUsedProps) => JSX.Element;
|
|
8
|
+
export default MostUsed;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CardProps } from '../Card';
|
|
2
|
+
export interface MostUsedItemProps extends CardProps {
|
|
3
|
+
title: string;
|
|
4
|
+
category: string;
|
|
5
|
+
href?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const MostUsedItem: ({ title, category, href, ...rest }: MostUsedItemProps) => JSX.Element;
|
|
8
|
+
export default MostUsedItem;
|