@tecsinapse/cortex-react 1.5.0 → 1.5.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/Input/Box.js +1 -2
- package/dist/cjs/components/Menubar/DropdownRoot.js +11 -6
- package/dist/cjs/components/Menubar/MostUsedList.js +4 -51
- package/dist/cjs/components/Menubar/Root.js +0 -1
- package/dist/cjs/components/Select/MultiCheckAllOptions.js +13 -10
- package/dist/cjs/components/Tag.js +32 -3
- package/dist/cjs/components/Tooltip.js +0 -3
- package/dist/cjs/index.js +6 -6
- package/dist/cjs/provider/SnackbarProvider.js +1 -1
- package/dist/cjs/service/SnackbarSonner.js +1 -59
- package/dist/esm/components/Input/Box.js +1 -2
- package/dist/esm/components/Menubar/DropdownRoot.js +10 -5
- package/dist/esm/components/Menubar/MostUsedList.js +2 -49
- package/dist/esm/components/Menubar/Root.js +0 -1
- package/dist/esm/components/Select/MultiCheckAllOptions.js +13 -10
- package/dist/esm/components/Tag.js +32 -3
- package/dist/esm/components/Tooltip.js +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/provider/SnackbarProvider.js +1 -1
- package/dist/esm/service/SnackbarSonner.js +1 -59
- package/dist/types/components/Menubar/DropdownRoot.d.ts +1 -1
- package/dist/types/components/Tag.d.ts +9 -4
- package/dist/types/components/Tooltip.d.ts +1 -1
- package/dist/types/components/index.d.ts +3 -3
- package/dist/types/provider/SnackbarProvider.d.ts +1 -1
- package/dist/types/service/SnackbarSonner.d.ts +1 -1
- package/package.json +4 -4
|
@@ -14,8 +14,7 @@ const InputBox = React.forwardRef(
|
|
|
14
14
|
placeholder: placeholder ?? " ",
|
|
15
15
|
className: clsx(cortexCore.inputBox(placeholder, label, className)),
|
|
16
16
|
...rest,
|
|
17
|
-
ref
|
|
18
|
-
"data-testid": "input-box"
|
|
17
|
+
ref
|
|
19
18
|
}
|
|
20
19
|
), /* @__PURE__ */ React.createElement(
|
|
21
20
|
"label",
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
-
var
|
|
4
|
+
var Categories = require('./Categories.js');
|
|
5
|
+
var Category = require('./Category.js');
|
|
6
|
+
var Dropdown = require('./Dropdown.js');
|
|
7
|
+
var Item = require('./Item.js');
|
|
8
|
+
var MostUsed = require('./MostUsed.js');
|
|
5
9
|
var MostUsedList = require('./MostUsedList.js');
|
|
10
|
+
var SubItem = require('./SubItem.js');
|
|
6
11
|
|
|
7
12
|
const DropdownRoot = ({
|
|
8
13
|
mostUsed,
|
|
@@ -10,22 +15,22 @@ const DropdownRoot = ({
|
|
|
10
15
|
labelMostUsed
|
|
11
16
|
}) => {
|
|
12
17
|
const hasMostUsed = mostUsed && (mostUsed ?? []).length > 0;
|
|
13
|
-
return /* @__PURE__ */ React.createElement(
|
|
14
|
-
|
|
18
|
+
return /* @__PURE__ */ React.createElement(Dropdown, null, hasMostUsed ? /* @__PURE__ */ React.createElement(MostUsed, { label: labelMostUsed }, /* @__PURE__ */ React.createElement(MostUsedList, { mostUsed })) : /* @__PURE__ */ React.createElement(React.Fragment, null), /* @__PURE__ */ React.createElement(Categories, null, options.map((item, index) => /* @__PURE__ */ React.createElement(
|
|
19
|
+
Category,
|
|
15
20
|
{
|
|
16
|
-
key: `${item.title}-${index
|
|
21
|
+
key: `${item.title}-${index}`,
|
|
17
22
|
title: item.title,
|
|
18
23
|
options: item.items,
|
|
19
24
|
render: (prop) => {
|
|
20
25
|
const { title, items, ...rest } = prop;
|
|
21
26
|
return /* @__PURE__ */ React.createElement(
|
|
22
|
-
|
|
27
|
+
Item,
|
|
23
28
|
{
|
|
24
29
|
key: prop.title,
|
|
25
30
|
...rest,
|
|
26
31
|
subItems: items ?? [],
|
|
27
32
|
renderSubItems: ({ title: title2, ...rest2 }) => {
|
|
28
|
-
return /* @__PURE__ */ React.createElement(
|
|
33
|
+
return /* @__PURE__ */ React.createElement(SubItem, { key: title2, ...rest2 }, title2);
|
|
29
34
|
}
|
|
30
35
|
},
|
|
31
36
|
title
|
|
@@ -1,62 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
-
require('
|
|
5
|
-
require('clsx');
|
|
6
|
-
require('@internationalized/date');
|
|
7
|
-
require('../Badge.js');
|
|
8
|
-
require('react-icons/md');
|
|
9
|
-
require('../Card.js');
|
|
10
|
-
require('../Button.js');
|
|
11
|
-
require('react-aria');
|
|
12
|
-
require('react-stately');
|
|
13
|
-
require('@floating-ui/react');
|
|
14
|
-
require('currency.js');
|
|
15
|
-
require('../Calendar/CalendarCell.js');
|
|
16
|
-
require('@tecsinapse/cortex-core');
|
|
17
|
-
require('react-icons/fa');
|
|
18
|
-
require('react-icons/lia');
|
|
19
|
-
require('../Input/Box.js');
|
|
20
|
-
require('../Input/Face.js');
|
|
21
|
-
require('../Input/Left.js');
|
|
22
|
-
require('../Input/Mask.js');
|
|
23
|
-
require('../Input/Right.js');
|
|
24
|
-
require('../Input/Root.js');
|
|
25
|
-
require('../Input/Search.js');
|
|
26
|
-
require('../Popover/Context.js');
|
|
27
|
-
require('../GroupButton.js');
|
|
28
|
-
require('../Hint.js');
|
|
29
|
-
var index = require('./index.js');
|
|
30
|
-
require('../Modal.js');
|
|
31
|
-
require('../../styles/calendar-cell.js');
|
|
32
|
-
require('../../styles/groupButton.js');
|
|
33
|
-
require('../../styles/progressBar.js');
|
|
34
|
-
require('../RadioButton.js');
|
|
35
|
-
require('../Select/GroupedOptions.js');
|
|
36
|
-
require('../Select/context.js');
|
|
37
|
-
require('../Select/MultiGroupedOptions.js');
|
|
38
|
-
require('../Select/MultiOptions.js');
|
|
39
|
-
require('../Select/Options.js');
|
|
40
|
-
require('../Select/Trigger.js');
|
|
41
|
-
require('../Snackbar/BaseSnackbar.js');
|
|
42
|
-
require('react-icons/io');
|
|
43
|
-
require('../Tag.js');
|
|
44
|
-
require('../TextArea/Box.js');
|
|
45
|
-
require('../TextArea/Face.js');
|
|
46
|
-
require('../TextArea/Left.js');
|
|
47
|
-
require('../TextArea/Right.js');
|
|
48
|
-
require('../TextArea/Root.js');
|
|
49
|
-
require('../Toggle.js');
|
|
50
|
-
require('../Tooltip.js');
|
|
51
|
-
require('react-spring-carousel');
|
|
4
|
+
var MostUsedItem = require('./MostUsedItem.js');
|
|
52
5
|
|
|
53
6
|
const MostUsedList = ({ mostUsed }) => {
|
|
54
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, (mostUsed ?? []).map((item, index
|
|
7
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, (mostUsed ?? []).map((item, index) => {
|
|
55
8
|
const { title, category, ...rest } = item;
|
|
56
|
-
if (index
|
|
9
|
+
if (index > 3)
|
|
57
10
|
return /* @__PURE__ */ React.createElement(React.Fragment, { key: `${title}-${category}` });
|
|
58
11
|
return /* @__PURE__ */ React.createElement(
|
|
59
|
-
|
|
12
|
+
MostUsedItem,
|
|
60
13
|
{
|
|
61
14
|
key: `${title}-${category}`,
|
|
62
15
|
title,
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var MenubarProvider = require('../../provider/MenubarProvider.js');
|
|
5
|
-
require('../../provider/SnackbarProvider.js');
|
|
6
5
|
|
|
7
6
|
const Root = ({ children, ...rest }) => {
|
|
8
7
|
return /* @__PURE__ */ React.createElement(MenubarProvider.MenubarProvider, null, /* @__PURE__ */ React.createElement("div", { ...rest }, children));
|
|
@@ -17,18 +17,21 @@ const SelectMultiCheckAllOptions = ({
|
|
|
17
17
|
);
|
|
18
18
|
const checkAll = React.useCallback(() => {
|
|
19
19
|
{
|
|
20
|
-
|
|
20
|
+
const updateSelected = Array.from(currentValue);
|
|
21
21
|
if (!isChecked) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const optionKeys = new Set(
|
|
27
|
-
options?.map((option2) => keyExtractor(option2))
|
|
28
|
-
);
|
|
29
|
-
updateSelected = updateSelected.filter(
|
|
30
|
-
(item) => !optionKeys.has(keyExtractor(item))
|
|
22
|
+
const notSelected = options?.filter(
|
|
23
|
+
(option2) => !updateSelected.find(
|
|
24
|
+
(it) => keyExtractor(it) === keyExtractor(option2)
|
|
25
|
+
)
|
|
31
26
|
);
|
|
27
|
+
updateSelected.push(...notSelected ?? []);
|
|
28
|
+
} else {
|
|
29
|
+
const elementsToDelete = updateSelected.map(
|
|
30
|
+
(it) => options?.find((option2) => keyExtractor(option2) === keyExtractor(it))
|
|
31
|
+
).filter((it) => it);
|
|
32
|
+
elementsToDelete.map((it) => {
|
|
33
|
+
updateSelected.splice(updateSelected.indexOf(it), 1);
|
|
34
|
+
});
|
|
32
35
|
}
|
|
33
36
|
onSelect(updateSelected);
|
|
34
37
|
}
|
|
@@ -2,10 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
var cortexCore = require('@tecsinapse/cortex-core');
|
|
4
4
|
var React = require('react');
|
|
5
|
+
var lia = require('react-icons/lia');
|
|
5
6
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
const Close = ({ onClick, className }) => {
|
|
8
|
+
return /* @__PURE__ */ React.createElement("button", { onClick, "data-testid": "tag-close-button" }, /* @__PURE__ */ React.createElement(lia.LiaTimesSolid, { className }));
|
|
9
|
+
};
|
|
10
|
+
const Label = ({ children, className }) => {
|
|
11
|
+
return /* @__PURE__ */ React.createElement("p", { className }, children);
|
|
12
|
+
};
|
|
13
|
+
const Face = React.forwardRef((props, ref) => {
|
|
14
|
+
const { variants, className, children } = props;
|
|
15
|
+
return /* @__PURE__ */ React.createElement(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
className: cortexCore.tag({
|
|
19
|
+
...variants,
|
|
20
|
+
className
|
|
21
|
+
}),
|
|
22
|
+
ref
|
|
23
|
+
},
|
|
24
|
+
children
|
|
25
|
+
);
|
|
9
26
|
});
|
|
27
|
+
const Root = React.forwardRef(
|
|
28
|
+
(props, ref) => {
|
|
29
|
+
const { label, variants, className, onDismiss } = props;
|
|
30
|
+
return /* @__PURE__ */ React.createElement(Face, { variants, className, ref }, /* @__PURE__ */ React.createElement(Label, null, label), onDismiss ? /* @__PURE__ */ React.createElement(Close, { onClick: onDismiss }) : null);
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
const Tag = {
|
|
34
|
+
Root,
|
|
35
|
+
Close,
|
|
36
|
+
Label,
|
|
37
|
+
Face
|
|
38
|
+
};
|
|
10
39
|
|
|
11
40
|
exports.Tag = Tag;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var react = require('@floating-ui/react');
|
|
6
4
|
var React = require('react');
|
|
7
5
|
require('@internationalized/date');
|
|
@@ -53,4 +51,3 @@ const Tooltip = React.forwardRef(
|
|
|
53
51
|
);
|
|
54
52
|
|
|
55
53
|
exports.Tooltip = Tooltip;
|
|
56
|
-
exports.default = Tooltip;
|
package/dist/cjs/index.js
CHANGED
|
@@ -9,6 +9,7 @@ var Button = require('./components/Button.js');
|
|
|
9
9
|
var Calendar = require('./components/Calendar/Calendar.js');
|
|
10
10
|
var RangeCalendar = require('./components/Calendar/RangeCalendar.js');
|
|
11
11
|
var Card = require('./components/Card.js');
|
|
12
|
+
var Carousel = require('./components/Carousel/Carousel.js');
|
|
12
13
|
var DateField = require('./components/DatePicker/DateField.js');
|
|
13
14
|
var DatePickerInput = require('./components/DatePicker/DatePickerInput.js');
|
|
14
15
|
var DatePickerInputBase = require('./components/DatePicker/DatePickerInputBase.js');
|
|
@@ -19,6 +20,8 @@ var Drawer = require('./components/Drawer.js');
|
|
|
19
20
|
var GroupButton = require('./components/GroupButton.js');
|
|
20
21
|
var Hint = require('./components/Hint.js');
|
|
21
22
|
var index = require('./components/Input/index.js');
|
|
23
|
+
var Kanban = require('./components/Kanban.js');
|
|
24
|
+
var Loading = require('./components/Loading.js');
|
|
22
25
|
var index$1 = require('./components/Menubar/index.js');
|
|
23
26
|
var Modal = require('./components/Modal.js');
|
|
24
27
|
var index$2 = require('./components/Popover/index.js');
|
|
@@ -35,9 +38,6 @@ var TimeField = require('./components/TimeField/TimeField.js');
|
|
|
35
38
|
var TimeFieldInput = require('./components/TimeField/TimeFieldInput.js');
|
|
36
39
|
var Toggle = require('./components/Toggle.js');
|
|
37
40
|
var Tooltip = require('./components/Tooltip.js');
|
|
38
|
-
var Kanban = require('./components/Kanban.js');
|
|
39
|
-
var Loading = require('./components/Loading.js');
|
|
40
|
-
var Carousel = require('./components/Carousel/Carousel.js');
|
|
41
41
|
var useCalendar = require('./hooks/useCalendar.js');
|
|
42
42
|
var useCalendarCell = require('./hooks/useCalendarCell.js');
|
|
43
43
|
var useCalendarGrid = require('./hooks/useCalendarGrid.js');
|
|
@@ -69,6 +69,7 @@ exports.Button = Button.Button;
|
|
|
69
69
|
exports.Calendar = Calendar.Calendar;
|
|
70
70
|
exports.RangeCalendar = RangeCalendar.RangeCalendar;
|
|
71
71
|
exports.Card = Card.Card;
|
|
72
|
+
exports.Carousel = Carousel.Carousel;
|
|
72
73
|
exports.DateField = DateField.DateField;
|
|
73
74
|
exports.DatePickerInput = DatePickerInput.DatePickerInput;
|
|
74
75
|
exports.DatePickerInputBase = DatePickerInputBase.DatePickerInputBase;
|
|
@@ -79,6 +80,8 @@ exports.Drawer = Drawer.Drawer;
|
|
|
79
80
|
exports.GroupButton = GroupButton.GroupButton;
|
|
80
81
|
exports.Hint = Hint.Hint;
|
|
81
82
|
exports.Input = index.Input;
|
|
83
|
+
exports.Kanban = Kanban.Kanban;
|
|
84
|
+
exports.Loading = Loading.Loading;
|
|
82
85
|
exports.Menubar = index$1.Menubar;
|
|
83
86
|
exports.Modal = Modal.Modal;
|
|
84
87
|
exports.Popover = index$2.Popover;
|
|
@@ -102,9 +105,6 @@ exports.TimeField = TimeField.TimeField;
|
|
|
102
105
|
exports.TimeFieldInput = TimeFieldInput.TimeFieldInput;
|
|
103
106
|
exports.Toggle = Toggle.Toggle;
|
|
104
107
|
exports.Tooltip = Tooltip.Tooltip;
|
|
105
|
-
exports.Kanban = Kanban.Kanban;
|
|
106
|
-
exports.Loading = Loading.Loading;
|
|
107
|
-
exports.Carousel = Carousel.Carousel;
|
|
108
108
|
exports.useCalendar = useCalendar.useCalendar;
|
|
109
109
|
exports.useCalendarCell = useCalendarCell.useCalendarCell;
|
|
110
110
|
exports.useCalendarGrid = useCalendarGrid.useCalendarGrid;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
-
var SnackbarSonner = require('../service/SnackbarSonner.js');
|
|
5
4
|
var sonner = require('sonner');
|
|
5
|
+
var SnackbarSonner = require('../service/SnackbarSonner.js');
|
|
6
6
|
|
|
7
7
|
const SnackbarContext = React.createContext(null);
|
|
8
8
|
const SnackbarProvider = ({ children }) => {
|
|
@@ -1,66 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var sonner = require('sonner');
|
|
4
3
|
var React = require('react');
|
|
5
|
-
require('
|
|
6
|
-
require('clsx');
|
|
7
|
-
require('@internationalized/date');
|
|
8
|
-
require('../components/Badge.js');
|
|
9
|
-
require('react-icons/md');
|
|
10
|
-
require('../components/Card.js');
|
|
11
|
-
require('../components/Button.js');
|
|
12
|
-
require('react-aria');
|
|
13
|
-
require('react-stately');
|
|
14
|
-
require('@floating-ui/react');
|
|
15
|
-
require('currency.js');
|
|
16
|
-
require('../components/Calendar/CalendarCell.js');
|
|
17
|
-
require('@tecsinapse/cortex-core');
|
|
18
|
-
require('react-icons/fa');
|
|
19
|
-
require('react-icons/lia');
|
|
20
|
-
require('../components/Input/Box.js');
|
|
21
|
-
require('../components/Input/Face.js');
|
|
22
|
-
require('../components/Input/Left.js');
|
|
23
|
-
require('../components/Input/Mask.js');
|
|
24
|
-
require('../components/Input/Right.js');
|
|
25
|
-
require('../components/Input/Root.js');
|
|
26
|
-
require('../components/Input/Search.js');
|
|
27
|
-
require('../components/Popover/Context.js');
|
|
28
|
-
require('../components/GroupButton.js');
|
|
29
|
-
require('../components/Hint.js');
|
|
30
|
-
require('../provider/MenubarProvider.js');
|
|
31
|
-
require('../provider/SnackbarProvider.js');
|
|
32
|
-
require('../components/Menubar/Left.js');
|
|
33
|
-
require('../styles/menubar.js');
|
|
34
|
-
require('../components/Menubar/Right.js');
|
|
35
|
-
require('../components/Menubar/Dropdown.js');
|
|
36
|
-
require('../components/Menubar/MostUsed.js');
|
|
37
|
-
require('../components/Menubar/MostUsedItem.js');
|
|
38
|
-
require('../components/Menubar/Header.js');
|
|
39
|
-
require('../components/Menubar/Item.js');
|
|
40
|
-
require('../components/Menubar/SubItem.js');
|
|
41
|
-
require('../components/Modal.js');
|
|
42
|
-
require('../styles/calendar-cell.js');
|
|
43
|
-
require('../styles/groupButton.js');
|
|
44
|
-
require('../styles/progressBar.js');
|
|
45
|
-
require('../components/RadioButton.js');
|
|
46
|
-
require('../components/Select/GroupedOptions.js');
|
|
47
|
-
require('../components/Select/context.js');
|
|
48
|
-
require('../components/Select/MultiGroupedOptions.js');
|
|
49
|
-
require('../components/Select/MultiOptions.js');
|
|
50
|
-
require('../components/Select/Options.js');
|
|
51
|
-
require('../components/Select/Trigger.js');
|
|
52
|
-
require('../components/Snackbar/BaseSnackbar.js');
|
|
4
|
+
var sonner = require('sonner');
|
|
53
5
|
var DefaultSnack = require('../components/Snackbar/DefaultSnack.js');
|
|
54
|
-
require('../components/Tag.js');
|
|
55
|
-
require('../components/TextArea/Box.js');
|
|
56
|
-
require('../components/TextArea/Face.js');
|
|
57
|
-
require('../components/TextArea/Left.js');
|
|
58
|
-
require('../components/TextArea/Right.js');
|
|
59
|
-
require('../components/TextArea/Root.js');
|
|
60
|
-
require('../components/Toggle.js');
|
|
61
|
-
require('../components/Tooltip.js');
|
|
62
|
-
require('react-spring-carousel');
|
|
63
|
-
require('react-icons/io');
|
|
64
6
|
|
|
65
7
|
class SnackbarSonner {
|
|
66
8
|
custom(Component, options) {
|
|
@@ -12,8 +12,7 @@ const InputBox = React__default.forwardRef(
|
|
|
12
12
|
placeholder: placeholder ?? " ",
|
|
13
13
|
className: clsx(inputBox(placeholder, label, className)),
|
|
14
14
|
...rest,
|
|
15
|
-
ref
|
|
16
|
-
"data-testid": "input-box"
|
|
15
|
+
ref
|
|
17
16
|
}
|
|
18
17
|
), /* @__PURE__ */ React__default.createElement(
|
|
19
18
|
"label",
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
|
-
import
|
|
2
|
+
import Categories from './Categories.js';
|
|
3
|
+
import Category from './Category.js';
|
|
4
|
+
import Dropdown from './Dropdown.js';
|
|
5
|
+
import Item from './Item.js';
|
|
6
|
+
import MostUsed from './MostUsed.js';
|
|
3
7
|
import MostUsedList from './MostUsedList.js';
|
|
8
|
+
import SubItem from './SubItem.js';
|
|
4
9
|
|
|
5
10
|
const DropdownRoot = ({
|
|
6
11
|
mostUsed,
|
|
@@ -8,8 +13,8 @@ const DropdownRoot = ({
|
|
|
8
13
|
labelMostUsed
|
|
9
14
|
}) => {
|
|
10
15
|
const hasMostUsed = mostUsed && (mostUsed ?? []).length > 0;
|
|
11
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
12
|
-
|
|
16
|
+
return /* @__PURE__ */ React__default.createElement(Dropdown, null, hasMostUsed ? /* @__PURE__ */ React__default.createElement(MostUsed, { label: labelMostUsed }, /* @__PURE__ */ React__default.createElement(MostUsedList, { mostUsed })) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null), /* @__PURE__ */ React__default.createElement(Categories, null, options.map((item, index) => /* @__PURE__ */ React__default.createElement(
|
|
17
|
+
Category,
|
|
13
18
|
{
|
|
14
19
|
key: `${item.title}-${index}`,
|
|
15
20
|
title: item.title,
|
|
@@ -17,13 +22,13 @@ const DropdownRoot = ({
|
|
|
17
22
|
render: (prop) => {
|
|
18
23
|
const { title, items, ...rest } = prop;
|
|
19
24
|
return /* @__PURE__ */ React__default.createElement(
|
|
20
|
-
|
|
25
|
+
Item,
|
|
21
26
|
{
|
|
22
27
|
key: prop.title,
|
|
23
28
|
...rest,
|
|
24
29
|
subItems: items ?? [],
|
|
25
30
|
renderSubItems: ({ title: title2, ...rest2 }) => {
|
|
26
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
31
|
+
return /* @__PURE__ */ React__default.createElement(SubItem, { key: title2, ...rest2 }, title2);
|
|
27
32
|
}
|
|
28
33
|
},
|
|
29
34
|
title
|
|
@@ -1,52 +1,5 @@
|
|
|
1
1
|
import React__default, { Fragment } from 'react';
|
|
2
|
-
import '
|
|
3
|
-
import 'clsx';
|
|
4
|
-
import '@internationalized/date';
|
|
5
|
-
import '../Badge.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 'currency.js';
|
|
13
|
-
import '../Calendar/CalendarCell.js';
|
|
14
|
-
import '@tecsinapse/cortex-core';
|
|
15
|
-
import 'react-icons/fa';
|
|
16
|
-
import 'react-icons/lia';
|
|
17
|
-
import '../Input/Box.js';
|
|
18
|
-
import '../Input/Face.js';
|
|
19
|
-
import '../Input/Left.js';
|
|
20
|
-
import '../Input/Mask.js';
|
|
21
|
-
import '../Input/Right.js';
|
|
22
|
-
import '../Input/Root.js';
|
|
23
|
-
import '../Input/Search.js';
|
|
24
|
-
import '../Popover/Context.js';
|
|
25
|
-
import '../GroupButton.js';
|
|
26
|
-
import '../Hint.js';
|
|
27
|
-
import { Menubar } from './index.js';
|
|
28
|
-
import '../Modal.js';
|
|
29
|
-
import '../../styles/calendar-cell.js';
|
|
30
|
-
import '../../styles/groupButton.js';
|
|
31
|
-
import '../../styles/progressBar.js';
|
|
32
|
-
import '../RadioButton.js';
|
|
33
|
-
import '../Select/GroupedOptions.js';
|
|
34
|
-
import '../Select/context.js';
|
|
35
|
-
import '../Select/MultiGroupedOptions.js';
|
|
36
|
-
import '../Select/MultiOptions.js';
|
|
37
|
-
import '../Select/Options.js';
|
|
38
|
-
import '../Select/Trigger.js';
|
|
39
|
-
import '../Snackbar/BaseSnackbar.js';
|
|
40
|
-
import 'react-icons/io';
|
|
41
|
-
import '../Tag.js';
|
|
42
|
-
import '../TextArea/Box.js';
|
|
43
|
-
import '../TextArea/Face.js';
|
|
44
|
-
import '../TextArea/Left.js';
|
|
45
|
-
import '../TextArea/Right.js';
|
|
46
|
-
import '../TextArea/Root.js';
|
|
47
|
-
import '../Toggle.js';
|
|
48
|
-
import '../Tooltip.js';
|
|
49
|
-
import 'react-spring-carousel';
|
|
2
|
+
import MostUsedItem from './MostUsedItem.js';
|
|
50
3
|
|
|
51
4
|
const MostUsedList = ({ mostUsed }) => {
|
|
52
5
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, (mostUsed ?? []).map((item, index) => {
|
|
@@ -54,7 +7,7 @@ const MostUsedList = ({ mostUsed }) => {
|
|
|
54
7
|
if (index > 3)
|
|
55
8
|
return /* @__PURE__ */ React__default.createElement(Fragment, { key: `${title}-${category}` });
|
|
56
9
|
return /* @__PURE__ */ React__default.createElement(
|
|
57
|
-
|
|
10
|
+
MostUsedItem,
|
|
58
11
|
{
|
|
59
12
|
key: `${title}-${category}`,
|
|
60
13
|
title,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
import { MenubarProvider } from '../../provider/MenubarProvider.js';
|
|
3
|
-
import '../../provider/SnackbarProvider.js';
|
|
4
3
|
|
|
5
4
|
const Root = ({ children, ...rest }) => {
|
|
6
5
|
return /* @__PURE__ */ React__default.createElement(MenubarProvider, null, /* @__PURE__ */ React__default.createElement("div", { ...rest }, children));
|
|
@@ -15,18 +15,21 @@ const SelectMultiCheckAllOptions = ({
|
|
|
15
15
|
);
|
|
16
16
|
const checkAll = useCallback(() => {
|
|
17
17
|
{
|
|
18
|
-
|
|
18
|
+
const updateSelected = Array.from(currentValue);
|
|
19
19
|
if (!isChecked) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const optionKeys = new Set(
|
|
25
|
-
options?.map((option2) => keyExtractor(option2))
|
|
26
|
-
);
|
|
27
|
-
updateSelected = updateSelected.filter(
|
|
28
|
-
(item) => !optionKeys.has(keyExtractor(item))
|
|
20
|
+
const notSelected = options?.filter(
|
|
21
|
+
(option2) => !updateSelected.find(
|
|
22
|
+
(it) => keyExtractor(it) === keyExtractor(option2)
|
|
23
|
+
)
|
|
29
24
|
);
|
|
25
|
+
updateSelected.push(...notSelected ?? []);
|
|
26
|
+
} else {
|
|
27
|
+
const elementsToDelete = updateSelected.map(
|
|
28
|
+
(it) => options?.find((option2) => keyExtractor(option2) === keyExtractor(it))
|
|
29
|
+
).filter((it) => it);
|
|
30
|
+
elementsToDelete.map((it) => {
|
|
31
|
+
updateSelected.splice(updateSelected.indexOf(it), 1);
|
|
32
|
+
});
|
|
30
33
|
}
|
|
31
34
|
onSelect(updateSelected);
|
|
32
35
|
}
|
|
@@ -1,9 +1,38 @@
|
|
|
1
1
|
import { tag } from '@tecsinapse/cortex-core';
|
|
2
2
|
import React__default, { forwardRef } from 'react';
|
|
3
|
+
import { LiaTimesSolid } from 'react-icons/lia';
|
|
3
4
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const Close = ({ onClick, className }) => {
|
|
6
|
+
return /* @__PURE__ */ React__default.createElement("button", { onClick, "data-testid": "tag-close-button" }, /* @__PURE__ */ React__default.createElement(LiaTimesSolid, { className }));
|
|
7
|
+
};
|
|
8
|
+
const Label = ({ children, className }) => {
|
|
9
|
+
return /* @__PURE__ */ React__default.createElement("p", { className }, children);
|
|
10
|
+
};
|
|
11
|
+
const Face = forwardRef((props, ref) => {
|
|
12
|
+
const { variants, className, children } = props;
|
|
13
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
className: tag({
|
|
17
|
+
...variants,
|
|
18
|
+
className
|
|
19
|
+
}),
|
|
20
|
+
ref
|
|
21
|
+
},
|
|
22
|
+
children
|
|
23
|
+
);
|
|
7
24
|
});
|
|
25
|
+
const Root = forwardRef(
|
|
26
|
+
(props, ref) => {
|
|
27
|
+
const { label, variants, className, onDismiss } = props;
|
|
28
|
+
return /* @__PURE__ */ React__default.createElement(Face, { variants, className, ref }, /* @__PURE__ */ React__default.createElement(Label, null, label), onDismiss ? /* @__PURE__ */ React__default.createElement(Close, { onClick: onDismiss }) : null);
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
const Tag = {
|
|
32
|
+
Root,
|
|
33
|
+
Close,
|
|
34
|
+
Label,
|
|
35
|
+
Face
|
|
36
|
+
};
|
|
8
37
|
|
|
9
38
|
export { Tag };
|
package/dist/esm/index.js
CHANGED
|
@@ -7,6 +7,7 @@ export { Button } from './components/Button.js';
|
|
|
7
7
|
export { Calendar } from './components/Calendar/Calendar.js';
|
|
8
8
|
export { RangeCalendar } from './components/Calendar/RangeCalendar.js';
|
|
9
9
|
export { Card } from './components/Card.js';
|
|
10
|
+
export { Carousel } from './components/Carousel/Carousel.js';
|
|
10
11
|
export { DateField } from './components/DatePicker/DateField.js';
|
|
11
12
|
export { DatePickerInput } from './components/DatePicker/DatePickerInput.js';
|
|
12
13
|
export { DatePickerInputBase } from './components/DatePicker/DatePickerInputBase.js';
|
|
@@ -17,6 +18,8 @@ export { Drawer } from './components/Drawer.js';
|
|
|
17
18
|
export { GroupButton } from './components/GroupButton.js';
|
|
18
19
|
export { Hint } from './components/Hint.js';
|
|
19
20
|
export { Input } from './components/Input/index.js';
|
|
21
|
+
export { Kanban } from './components/Kanban.js';
|
|
22
|
+
export { Loading } from './components/Loading.js';
|
|
20
23
|
export { Menubar } from './components/Menubar/index.js';
|
|
21
24
|
export { Modal } from './components/Modal.js';
|
|
22
25
|
export { Popover } from './components/Popover/index.js';
|
|
@@ -33,9 +36,6 @@ export { TimeField } from './components/TimeField/TimeField.js';
|
|
|
33
36
|
export { TimeFieldInput } from './components/TimeField/TimeFieldInput.js';
|
|
34
37
|
export { Toggle } from './components/Toggle.js';
|
|
35
38
|
export { Tooltip } from './components/Tooltip.js';
|
|
36
|
-
export { Kanban } from './components/Kanban.js';
|
|
37
|
-
export { Loading } from './components/Loading.js';
|
|
38
|
-
export { Carousel } from './components/Carousel/Carousel.js';
|
|
39
39
|
export { useCalendar } from './hooks/useCalendar.js';
|
|
40
40
|
export { useCalendarCell } from './hooks/useCalendarCell.js';
|
|
41
41
|
export { useCalendarGrid } from './hooks/useCalendarGrid.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default, { createContext, useContext } from 'react';
|
|
2
|
-
import { SnackbarSonner } from '../service/SnackbarSonner.js';
|
|
3
2
|
import { Toaster } from 'sonner';
|
|
3
|
+
import { SnackbarSonner } from '../service/SnackbarSonner.js';
|
|
4
4
|
|
|
5
5
|
const SnackbarContext = createContext(null);
|
|
6
6
|
const SnackbarProvider = ({ children }) => {
|
|
@@ -1,64 +1,6 @@
|
|
|
1
|
-
import { toast } from 'sonner';
|
|
2
1
|
import React__default from 'react';
|
|
3
|
-
import '
|
|
4
|
-
import 'clsx';
|
|
5
|
-
import '@internationalized/date';
|
|
6
|
-
import '../components/Badge.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 'currency.js';
|
|
14
|
-
import '../components/Calendar/CalendarCell.js';
|
|
15
|
-
import '@tecsinapse/cortex-core';
|
|
16
|
-
import 'react-icons/fa';
|
|
17
|
-
import 'react-icons/lia';
|
|
18
|
-
import '../components/Input/Box.js';
|
|
19
|
-
import '../components/Input/Face.js';
|
|
20
|
-
import '../components/Input/Left.js';
|
|
21
|
-
import '../components/Input/Mask.js';
|
|
22
|
-
import '../components/Input/Right.js';
|
|
23
|
-
import '../components/Input/Root.js';
|
|
24
|
-
import '../components/Input/Search.js';
|
|
25
|
-
import '../components/Popover/Context.js';
|
|
26
|
-
import '../components/GroupButton.js';
|
|
27
|
-
import '../components/Hint.js';
|
|
28
|
-
import '../provider/MenubarProvider.js';
|
|
29
|
-
import '../provider/SnackbarProvider.js';
|
|
30
|
-
import '../components/Menubar/Left.js';
|
|
31
|
-
import '../styles/menubar.js';
|
|
32
|
-
import '../components/Menubar/Right.js';
|
|
33
|
-
import '../components/Menubar/Dropdown.js';
|
|
34
|
-
import '../components/Menubar/MostUsed.js';
|
|
35
|
-
import '../components/Menubar/MostUsedItem.js';
|
|
36
|
-
import '../components/Menubar/Header.js';
|
|
37
|
-
import '../components/Menubar/Item.js';
|
|
38
|
-
import '../components/Menubar/SubItem.js';
|
|
39
|
-
import '../components/Modal.js';
|
|
40
|
-
import '../styles/calendar-cell.js';
|
|
41
|
-
import '../styles/groupButton.js';
|
|
42
|
-
import '../styles/progressBar.js';
|
|
43
|
-
import '../components/RadioButton.js';
|
|
44
|
-
import '../components/Select/GroupedOptions.js';
|
|
45
|
-
import '../components/Select/context.js';
|
|
46
|
-
import '../components/Select/MultiGroupedOptions.js';
|
|
47
|
-
import '../components/Select/MultiOptions.js';
|
|
48
|
-
import '../components/Select/Options.js';
|
|
49
|
-
import '../components/Select/Trigger.js';
|
|
50
|
-
import '../components/Snackbar/BaseSnackbar.js';
|
|
2
|
+
import { toast } from 'sonner';
|
|
51
3
|
import { DefaultSnack } from '../components/Snackbar/DefaultSnack.js';
|
|
52
|
-
import '../components/Tag.js';
|
|
53
|
-
import '../components/TextArea/Box.js';
|
|
54
|
-
import '../components/TextArea/Face.js';
|
|
55
|
-
import '../components/TextArea/Left.js';
|
|
56
|
-
import '../components/TextArea/Right.js';
|
|
57
|
-
import '../components/TextArea/Root.js';
|
|
58
|
-
import '../components/Toggle.js';
|
|
59
|
-
import '../components/Tooltip.js';
|
|
60
|
-
import 'react-spring-carousel';
|
|
61
|
-
import 'react-icons/io';
|
|
62
4
|
|
|
63
5
|
class SnackbarSonner {
|
|
64
6
|
custom(Component, options) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { MostUsedItemProps } from './MostUsedItem';
|
|
3
2
|
import { DefaultProps } from './interface';
|
|
3
|
+
import { MostUsedItemProps } from './MostUsedItem';
|
|
4
4
|
interface MenuItem extends DefaultProps {
|
|
5
5
|
title: string;
|
|
6
6
|
items?: MenuItem[];
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { TagVariants } from '@tecsinapse/cortex-core';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { HTMLProps } from 'react';
|
|
3
3
|
interface TagProps {
|
|
4
4
|
variants?: TagVariants;
|
|
5
|
-
label
|
|
6
|
-
|
|
5
|
+
label: string;
|
|
6
|
+
onDismiss?: () => void;
|
|
7
7
|
}
|
|
8
|
-
export declare const Tag:
|
|
8
|
+
export declare const Tag: {
|
|
9
|
+
Root: React.ForwardRefExoticComponent<Omit<TagProps & React.HTMLProps<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
Close: ({ onClick, className }: HTMLProps<HTMLButtonElement>) => JSX.Element;
|
|
11
|
+
Label: ({ children, className }: HTMLProps<HTMLParagraphElement>) => JSX.Element;
|
|
12
|
+
Face: React.ForwardRefExoticComponent<Omit<Pick<TagProps, "variants"> & React.HTMLProps<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
};
|
|
9
14
|
export {};
|
|
@@ -5,12 +5,15 @@ export * from './Breadcrumbs';
|
|
|
5
5
|
export * from './Button';
|
|
6
6
|
export * from './Calendar';
|
|
7
7
|
export * from './Card';
|
|
8
|
+
export * from './Carousel';
|
|
8
9
|
export * from './DatePicker';
|
|
9
10
|
export * from './Divider';
|
|
10
11
|
export * from './Drawer';
|
|
11
12
|
export * from './GroupButton';
|
|
12
13
|
export * from './Hint';
|
|
13
14
|
export * from './Input';
|
|
15
|
+
export * from './Kanban';
|
|
16
|
+
export * from './Loading';
|
|
14
17
|
export * from './Menubar';
|
|
15
18
|
export * from './Modal';
|
|
16
19
|
export * from './Popover';
|
|
@@ -25,6 +28,3 @@ export * from './TextArea';
|
|
|
25
28
|
export * from './TimeField';
|
|
26
29
|
export * from './Toggle';
|
|
27
30
|
export * from './Tooltip';
|
|
28
|
-
export * from './Kanban';
|
|
29
|
-
export * from './Loading';
|
|
30
|
-
export * from './Carousel';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ExternalToast } from 'sonner';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import { ExternalToast } from 'sonner';
|
|
3
3
|
import { ISnackbar, TypeSnack } from './ISnackbar';
|
|
4
4
|
export declare class SnackbarSonner implements ISnackbar<ExternalToast> {
|
|
5
5
|
custom(Component: React.ReactElement, options?: ExternalToast): string | number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tecsinapse/cortex-react",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "React components based in @tecsinapse/cortex-core",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"dist"
|
|
11
11
|
],
|
|
12
12
|
"scripts": {
|
|
13
|
-
"dev": "rollup --config --watch",
|
|
13
|
+
"dev:es": "rollup --config --watch",
|
|
14
14
|
"dev:dts": "tsc --project tsconfig.build.json --watch",
|
|
15
15
|
"build:es": "rollup --config",
|
|
16
16
|
"build:dts": "tsc --project tsconfig.build.json",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@floating-ui/react": "^0.26.18",
|
|
22
22
|
"@internationalized/date": "*",
|
|
23
|
-
"@tecsinapse/cortex-core": "0.3.
|
|
23
|
+
"@tecsinapse/cortex-core": "0.3.2",
|
|
24
24
|
"clsx": "*",
|
|
25
25
|
"react-aria": "^3.33.1",
|
|
26
26
|
"react-icons": "^5.2.1",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"react-dom": ">=18.0.0",
|
|
46
46
|
"tailwind": ">=3.3.0"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "5b8a619a4dad4ec8a423e1e836d211262c1fc2bd"
|
|
49
49
|
}
|