@tecsinapse/cortex-react 1.7.0-beta.3 → 1.7.2
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/Menubar/Category.js +1 -1
- package/dist/cjs/components/Menubar/Item.js +32 -2
- package/dist/cjs/components/Menubar/ItemLink.js +8 -27
- package/dist/cjs/components/Menubar/SubItem.js +15 -1
- package/dist/cjs/styles/menubar.js +3 -3
- package/dist/esm/components/Menubar/Category.js +1 -1
- package/dist/esm/components/Menubar/Item.js +32 -2
- package/dist/esm/components/Menubar/ItemLink.js +8 -27
- package/dist/esm/components/Menubar/SubItem.js +15 -1
- package/dist/esm/styles/menubar.js +3 -3
- package/dist/types/styles/menubar.d.ts +8 -8
- package/package.json +3 -3
|
@@ -5,7 +5,7 @@ var menubar = require('../../styles/menubar.js');
|
|
|
5
5
|
|
|
6
6
|
const Category = ({ title, options, render }) => {
|
|
7
7
|
const { text, hr, container } = menubar.category();
|
|
8
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", { className: text() }, title), /* @__PURE__ */ React.createElement("
|
|
8
|
+
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))));
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
module.exports = Category;
|
|
@@ -4,8 +4,19 @@ var React = require('react');
|
|
|
4
4
|
var menubar = require('../../styles/menubar.js');
|
|
5
5
|
var IconControlSubItem = require('./IconControlSubItem.js');
|
|
6
6
|
var ItemLink = require('./ItemLink.js');
|
|
7
|
+
var clsx = require('clsx');
|
|
8
|
+
require('@internationalized/date');
|
|
9
|
+
require('react-aria');
|
|
10
|
+
require('react-stately');
|
|
11
|
+
require('@floating-ui/react');
|
|
12
|
+
require('currency.js');
|
|
13
|
+
require('react-dropzone');
|
|
14
|
+
require('uuid');
|
|
15
|
+
require('../../provider/MenubarContext.js');
|
|
16
|
+
require('../../provider/SnackbarProvider.js');
|
|
17
|
+
var useMenubar = require('../../provider/useMenubar.js');
|
|
7
18
|
|
|
8
|
-
const { container,
|
|
19
|
+
const { container, textBehavior } = menubar.item();
|
|
9
20
|
const Item = ({
|
|
10
21
|
children,
|
|
11
22
|
subItems,
|
|
@@ -16,7 +27,26 @@ const Item = ({
|
|
|
16
27
|
}) => {
|
|
17
28
|
const [showSubItem, setShowSubItem] = React.useState(false);
|
|
18
29
|
const hasSubItems = (subItems ?? []).length > 0;
|
|
19
|
-
|
|
30
|
+
const [, setShow] = useMenubar.useMenubar();
|
|
31
|
+
return /* @__PURE__ */ React.createElement(ItemLink, { anchorProps }, /* @__PURE__ */ React.createElement(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
"data-testid": "item-menubar",
|
|
35
|
+
...rest,
|
|
36
|
+
onClick: (e) => {
|
|
37
|
+
if (hasSubItems) e.stopPropagation();
|
|
38
|
+
else {
|
|
39
|
+
setShow(false);
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
className: clsx(
|
|
43
|
+
container({ className }),
|
|
44
|
+
!hasSubItems && textBehavior()
|
|
45
|
+
)
|
|
46
|
+
},
|
|
47
|
+
children,
|
|
48
|
+
hasSubItems ? /* @__PURE__ */ React.createElement(IconControlSubItem, { show: showSubItem, setShow: setShowSubItem }) : /* @__PURE__ */ React.createElement(React.Fragment, null)
|
|
49
|
+
), showSubItem ? /* @__PURE__ */ React.createElement(React.Fragment, null, subItems?.map((subItem) => renderSubItems?.(subItem))) : /* @__PURE__ */ React.createElement(React.Fragment, null));
|
|
20
50
|
};
|
|
21
51
|
|
|
22
52
|
module.exports = Item;
|
|
@@ -2,37 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var clsx = require('clsx');
|
|
5
|
-
require('@internationalized/date');
|
|
6
|
-
require('react-aria');
|
|
7
|
-
require('react-stately');
|
|
8
|
-
require('@floating-ui/react');
|
|
9
|
-
require('currency.js');
|
|
10
|
-
require('react-dropzone');
|
|
11
|
-
require('uuid');
|
|
12
|
-
require('../../provider/MenubarContext.js');
|
|
13
|
-
require('../../provider/SnackbarProvider.js');
|
|
14
|
-
var useMenubar = require('../../provider/useMenubar.js');
|
|
15
5
|
|
|
16
6
|
const ItemLink = ({ anchorProps, children }) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"div",
|
|
7
|
+
return /* @__PURE__ */ React.createElement("div", null, anchorProps ? /* @__PURE__ */ React.createElement(
|
|
8
|
+
"a",
|
|
20
9
|
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
target: "_blank",
|
|
11
|
+
rel: "noopener noreferrer",
|
|
12
|
+
...anchorProps,
|
|
13
|
+
className: clsx("w-full", anchorProps?.className)
|
|
24
14
|
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
{
|
|
28
|
-
...anchorProps,
|
|
29
|
-
target: "_blank",
|
|
30
|
-
rel: "noopener noreferrer",
|
|
31
|
-
className: clsx("w-full", anchorProps?.className)
|
|
32
|
-
},
|
|
33
|
-
children
|
|
34
|
-
) : children
|
|
35
|
-
);
|
|
15
|
+
children
|
|
16
|
+
) : children);
|
|
36
17
|
};
|
|
37
18
|
|
|
38
19
|
module.exports = ItemLink;
|
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var menubar = require('../../styles/menubar.js');
|
|
5
5
|
var ItemLink = require('./ItemLink.js');
|
|
6
|
+
require('@internationalized/date');
|
|
7
|
+
require('react-aria');
|
|
8
|
+
require('react-stately');
|
|
9
|
+
require('@floating-ui/react');
|
|
10
|
+
require('currency.js');
|
|
11
|
+
require('react-dropzone');
|
|
12
|
+
require('uuid');
|
|
13
|
+
require('../../provider/MenubarContext.js');
|
|
14
|
+
require('../../provider/SnackbarProvider.js');
|
|
15
|
+
var useMenubar = require('../../provider/useMenubar.js');
|
|
6
16
|
|
|
7
17
|
const { container } = menubar.subItem();
|
|
8
18
|
const SubItem = ({
|
|
@@ -11,12 +21,16 @@ const SubItem = ({
|
|
|
11
21
|
className,
|
|
12
22
|
...rest
|
|
13
23
|
}) => {
|
|
24
|
+
const [, setShow] = useMenubar.useMenubar();
|
|
14
25
|
return /* @__PURE__ */ React.createElement(ItemLink, { anchorProps }, /* @__PURE__ */ React.createElement(
|
|
15
26
|
"div",
|
|
16
27
|
{
|
|
17
28
|
...rest,
|
|
18
29
|
"data-testid": "sub-item-menubar",
|
|
19
|
-
className: container({ className })
|
|
30
|
+
className: container({ className }),
|
|
31
|
+
onClick: () => {
|
|
32
|
+
setShow(false);
|
|
33
|
+
}
|
|
20
34
|
},
|
|
21
35
|
children
|
|
22
36
|
));
|
|
@@ -34,15 +34,15 @@ const mostUsedItem = tailwindVariants.tv({
|
|
|
34
34
|
});
|
|
35
35
|
const item = tailwindVariants.tv({
|
|
36
36
|
slots: {
|
|
37
|
-
container: "flex flex-row gap-x-deca items-center",
|
|
38
|
-
|
|
37
|
+
container: "flex flex-row gap-x-deca items-center text-secondary-dark text-base",
|
|
38
|
+
textBehavior: "hover:text-primary-medium hover:cursor-pointer text-base",
|
|
39
39
|
icon: "text-primary-medium hover:cursor-pointer"
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
const category = tailwindVariants.tv({
|
|
43
43
|
slots: {
|
|
44
44
|
text: "mb-mili font-bold",
|
|
45
|
-
hr: "mb-mili",
|
|
45
|
+
hr: "mb-mili border-secondary-light",
|
|
46
46
|
container: "flex flex-col gap-y-mili"
|
|
47
47
|
}
|
|
48
48
|
});
|
|
@@ -3,7 +3,7 @@ import { category } from '../../styles/menubar.js';
|
|
|
3
3
|
|
|
4
4
|
const Category = ({ title, options, render }) => {
|
|
5
5
|
const { text, hr, container } = category();
|
|
6
|
-
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("p", { className: text() }, title), /* @__PURE__ */ React__default.createElement("
|
|
6
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("p", { className: text() }, title), /* @__PURE__ */ React__default.createElement("hr", { className: hr() }), /* @__PURE__ */ React__default.createElement("div", { className: container() }, options.map((i) => render(i))));
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
export { Category as default };
|
|
@@ -2,8 +2,19 @@ import React__default, { useState } from 'react';
|
|
|
2
2
|
import { item } from '../../styles/menubar.js';
|
|
3
3
|
import IconControlSubItem from './IconControlSubItem.js';
|
|
4
4
|
import ItemLink from './ItemLink.js';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import '@internationalized/date';
|
|
7
|
+
import 'react-aria';
|
|
8
|
+
import 'react-stately';
|
|
9
|
+
import '@floating-ui/react';
|
|
10
|
+
import 'currency.js';
|
|
11
|
+
import 'react-dropzone';
|
|
12
|
+
import 'uuid';
|
|
13
|
+
import '../../provider/MenubarContext.js';
|
|
14
|
+
import '../../provider/SnackbarProvider.js';
|
|
15
|
+
import { useMenubar } from '../../provider/useMenubar.js';
|
|
5
16
|
|
|
6
|
-
const { container,
|
|
17
|
+
const { container, textBehavior } = item();
|
|
7
18
|
const Item = ({
|
|
8
19
|
children,
|
|
9
20
|
subItems,
|
|
@@ -14,7 +25,26 @@ const Item = ({
|
|
|
14
25
|
}) => {
|
|
15
26
|
const [showSubItem, setShowSubItem] = useState(false);
|
|
16
27
|
const hasSubItems = (subItems ?? []).length > 0;
|
|
17
|
-
|
|
28
|
+
const [, setShow] = useMenubar();
|
|
29
|
+
return /* @__PURE__ */ React__default.createElement(ItemLink, { anchorProps }, /* @__PURE__ */ React__default.createElement(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
"data-testid": "item-menubar",
|
|
33
|
+
...rest,
|
|
34
|
+
onClick: (e) => {
|
|
35
|
+
if (hasSubItems) e.stopPropagation();
|
|
36
|
+
else {
|
|
37
|
+
setShow(false);
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
className: clsx(
|
|
41
|
+
container({ className }),
|
|
42
|
+
!hasSubItems && textBehavior()
|
|
43
|
+
)
|
|
44
|
+
},
|
|
45
|
+
children,
|
|
46
|
+
hasSubItems ? /* @__PURE__ */ React__default.createElement(IconControlSubItem, { show: showSubItem, setShow: setShowSubItem }) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null)
|
|
47
|
+
), showSubItem ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, subItems?.map((subItem) => renderSubItems?.(subItem))) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null));
|
|
18
48
|
};
|
|
19
49
|
|
|
20
50
|
export { Item as default };
|
|
@@ -1,36 +1,17 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import '@internationalized/date';
|
|
4
|
-
import 'react-aria';
|
|
5
|
-
import 'react-stately';
|
|
6
|
-
import '@floating-ui/react';
|
|
7
|
-
import 'currency.js';
|
|
8
|
-
import 'react-dropzone';
|
|
9
|
-
import 'uuid';
|
|
10
|
-
import '../../provider/MenubarContext.js';
|
|
11
|
-
import '../../provider/SnackbarProvider.js';
|
|
12
|
-
import { useMenubar } from '../../provider/useMenubar.js';
|
|
13
3
|
|
|
14
4
|
const ItemLink = ({ anchorProps, children }) => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"div",
|
|
5
|
+
return /* @__PURE__ */ React__default.createElement("div", null, anchorProps ? /* @__PURE__ */ React__default.createElement(
|
|
6
|
+
"a",
|
|
18
7
|
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
8
|
+
target: "_blank",
|
|
9
|
+
rel: "noopener noreferrer",
|
|
10
|
+
...anchorProps,
|
|
11
|
+
className: clsx("w-full", anchorProps?.className)
|
|
22
12
|
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
{
|
|
26
|
-
...anchorProps,
|
|
27
|
-
target: "_blank",
|
|
28
|
-
rel: "noopener noreferrer",
|
|
29
|
-
className: clsx("w-full", anchorProps?.className)
|
|
30
|
-
},
|
|
31
|
-
children
|
|
32
|
-
) : children
|
|
33
|
-
);
|
|
13
|
+
children
|
|
14
|
+
) : children);
|
|
34
15
|
};
|
|
35
16
|
|
|
36
17
|
export { ItemLink as default };
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
import { subItem } from '../../styles/menubar.js';
|
|
3
3
|
import ItemLink from './ItemLink.js';
|
|
4
|
+
import '@internationalized/date';
|
|
5
|
+
import 'react-aria';
|
|
6
|
+
import 'react-stately';
|
|
7
|
+
import '@floating-ui/react';
|
|
8
|
+
import 'currency.js';
|
|
9
|
+
import 'react-dropzone';
|
|
10
|
+
import 'uuid';
|
|
11
|
+
import '../../provider/MenubarContext.js';
|
|
12
|
+
import '../../provider/SnackbarProvider.js';
|
|
13
|
+
import { useMenubar } from '../../provider/useMenubar.js';
|
|
4
14
|
|
|
5
15
|
const { container } = subItem();
|
|
6
16
|
const SubItem = ({
|
|
@@ -9,12 +19,16 @@ const SubItem = ({
|
|
|
9
19
|
className,
|
|
10
20
|
...rest
|
|
11
21
|
}) => {
|
|
22
|
+
const [, setShow] = useMenubar();
|
|
12
23
|
return /* @__PURE__ */ React__default.createElement(ItemLink, { anchorProps }, /* @__PURE__ */ React__default.createElement(
|
|
13
24
|
"div",
|
|
14
25
|
{
|
|
15
26
|
...rest,
|
|
16
27
|
"data-testid": "sub-item-menubar",
|
|
17
|
-
className: container({ className })
|
|
28
|
+
className: container({ className }),
|
|
29
|
+
onClick: () => {
|
|
30
|
+
setShow(false);
|
|
31
|
+
}
|
|
18
32
|
},
|
|
19
33
|
children
|
|
20
34
|
));
|
|
@@ -32,15 +32,15 @@ const mostUsedItem = tv({
|
|
|
32
32
|
});
|
|
33
33
|
const item = tv({
|
|
34
34
|
slots: {
|
|
35
|
-
container: "flex flex-row gap-x-deca items-center",
|
|
36
|
-
|
|
35
|
+
container: "flex flex-row gap-x-deca items-center text-secondary-dark text-base",
|
|
36
|
+
textBehavior: "hover:text-primary-medium hover:cursor-pointer text-base",
|
|
37
37
|
icon: "text-primary-medium hover:cursor-pointer"
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
const category = tv({
|
|
41
41
|
slots: {
|
|
42
42
|
text: "mb-mili font-bold",
|
|
43
|
-
hr: "mb-mili",
|
|
43
|
+
hr: "mb-mili border-secondary-light",
|
|
44
44
|
container: "flex flex-col gap-y-mili"
|
|
45
45
|
}
|
|
46
46
|
});
|
|
@@ -172,53 +172,53 @@ export declare const mostUsedItem: import("tailwind-variants").TVReturnType<{
|
|
|
172
172
|
export declare const item: import("tailwind-variants").TVReturnType<{
|
|
173
173
|
[key: string]: {
|
|
174
174
|
[key: string]: import("tailwind-merge").ClassNameValue | {
|
|
175
|
-
text?: import("tailwind-merge").ClassNameValue;
|
|
176
175
|
container?: import("tailwind-merge").ClassNameValue;
|
|
177
176
|
icon?: import("tailwind-merge").ClassNameValue;
|
|
177
|
+
textBehavior?: import("tailwind-merge").ClassNameValue;
|
|
178
178
|
};
|
|
179
179
|
};
|
|
180
180
|
} | {
|
|
181
181
|
[x: string]: {
|
|
182
182
|
[x: string]: import("tailwind-merge").ClassNameValue | {
|
|
183
|
-
text?: import("tailwind-merge").ClassNameValue;
|
|
184
183
|
container?: import("tailwind-merge").ClassNameValue;
|
|
185
184
|
icon?: import("tailwind-merge").ClassNameValue;
|
|
185
|
+
textBehavior?: import("tailwind-merge").ClassNameValue;
|
|
186
186
|
};
|
|
187
187
|
};
|
|
188
188
|
} | {}, {
|
|
189
189
|
container: string;
|
|
190
|
-
|
|
190
|
+
textBehavior: string;
|
|
191
191
|
icon: string;
|
|
192
192
|
}, undefined, import("tailwind-variants/dist/config").TVConfig<unknown, {
|
|
193
193
|
[key: string]: {
|
|
194
194
|
[key: string]: import("tailwind-merge").ClassNameValue | {
|
|
195
|
-
text?: import("tailwind-merge").ClassNameValue;
|
|
196
195
|
container?: import("tailwind-merge").ClassNameValue;
|
|
197
196
|
icon?: import("tailwind-merge").ClassNameValue;
|
|
197
|
+
textBehavior?: import("tailwind-merge").ClassNameValue;
|
|
198
198
|
};
|
|
199
199
|
};
|
|
200
200
|
} | {}>, {
|
|
201
201
|
[key: string]: {
|
|
202
202
|
[key: string]: import("tailwind-merge").ClassNameValue | {
|
|
203
|
-
text?: import("tailwind-merge").ClassNameValue;
|
|
204
203
|
container?: import("tailwind-merge").ClassNameValue;
|
|
205
204
|
icon?: import("tailwind-merge").ClassNameValue;
|
|
205
|
+
textBehavior?: import("tailwind-merge").ClassNameValue;
|
|
206
206
|
};
|
|
207
207
|
};
|
|
208
208
|
} | {}, {
|
|
209
209
|
container: string;
|
|
210
|
-
|
|
210
|
+
textBehavior: string;
|
|
211
211
|
icon: string;
|
|
212
212
|
}, import("tailwind-variants").TVReturnType<unknown, {
|
|
213
213
|
container: string;
|
|
214
|
-
|
|
214
|
+
textBehavior: string;
|
|
215
215
|
icon: string;
|
|
216
216
|
}, undefined, import("tailwind-variants/dist/config").TVConfig<unknown, {
|
|
217
217
|
[key: string]: {
|
|
218
218
|
[key: string]: import("tailwind-merge").ClassNameValue | {
|
|
219
|
-
text?: import("tailwind-merge").ClassNameValue;
|
|
220
219
|
container?: import("tailwind-merge").ClassNameValue;
|
|
221
220
|
icon?: import("tailwind-merge").ClassNameValue;
|
|
221
|
+
textBehavior?: import("tailwind-merge").ClassNameValue;
|
|
222
222
|
};
|
|
223
223
|
};
|
|
224
224
|
} | {}>, unknown, unknown, undefined>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tecsinapse/cortex-react",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.2",
|
|
4
4
|
"description": "React components based in @tecsinapse/cortex-core",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@floating-ui/react": "^0.26.18",
|
|
22
22
|
"@internationalized/date": "*",
|
|
23
|
-
"@tecsinapse/cortex-core": "0.4.
|
|
23
|
+
"@tecsinapse/cortex-core": "0.4.2",
|
|
24
24
|
"clsx": "*",
|
|
25
25
|
"currency.js": "~2.0.4",
|
|
26
26
|
"react-aria": "^3.33.1",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"react-dom": ">=18.0.0",
|
|
49
49
|
"tailwind": ">=3.3.0"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "fb996885720a8dd48df19d794fa1e15317a6cf08"
|
|
52
52
|
}
|