@tecsinapse/cortex-react 1.3.0-beta.25 → 1.3.0-beta.26
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/Badge.js +21 -2
- package/dist/cjs/components/Calendar/RangeCalendar.js +1 -1
- package/dist/cjs/components/Menubar/Header.js +2 -2
- package/dist/cjs/components/Menubar/Item.js +1 -1
- package/dist/cjs/components/Menubar/MostUsedList.js +5 -1
- package/dist/cjs/components/Popover/Trigger.js +1 -1
- package/dist/cjs/components/Select/Content.js +1 -1
- package/dist/cjs/components/Select/GroupedOptions.js +8 -1
- package/dist/cjs/components/Select/MultiCheckAllOptions.js +1 -1
- package/dist/cjs/components/Select/MultiGroupedOptions.js +12 -5
- package/dist/cjs/components/Select/MultiOptions.js +8 -1
- package/dist/cjs/components/Select/Options.js +8 -1
- package/dist/cjs/components/Select/SkeletonOptions.js +11 -0
- package/dist/cjs/components/Skeleton.js +1 -5
- package/dist/cjs/components/Snackbar/BaseSnackbar.js +1 -1
- package/dist/cjs/components/TextArea/Box.js +47 -0
- package/dist/cjs/components/TextArea/Face.js +27 -0
- package/dist/cjs/components/TextArea/Left.js +10 -0
- package/dist/cjs/components/TextArea/Right.js +10 -0
- package/dist/cjs/components/TextArea/Root.js +11 -0
- package/dist/cjs/components/TextArea/index.js +17 -0
- package/dist/cjs/components/TextArea/utils.js +11 -0
- package/dist/cjs/hooks/useSelectGroupedOptions.js +35 -0
- package/dist/cjs/hooks/useSelectOptions.js +35 -0
- package/dist/cjs/index.js +8 -4
- package/dist/cjs/service/SnackbarSonner.js +5 -1
- package/dist/esm/components/Avatar.js +6 -6
- package/dist/esm/components/Badge.js +2 -1
- package/dist/esm/components/Breadcrumbs/BreadcrumbItem.js +4 -4
- package/dist/esm/components/Breadcrumbs/Breadcrumbs.js +3 -3
- package/dist/esm/components/Button.js +2 -2
- package/dist/esm/components/Calendar/Calendar.js +3 -3
- package/dist/esm/components/Calendar/CalendarCell.js +3 -3
- package/dist/esm/components/Calendar/CalendarGrid.js +3 -3
- package/dist/esm/components/Calendar/CalendarGridBodyRows.js +3 -3
- package/dist/esm/components/Calendar/CalendarGridHeaderRow.js +2 -2
- package/dist/esm/components/Calendar/CalendarHeader.js +7 -7
- package/dist/esm/components/Calendar/RangeCalendar.js +5 -5
- package/dist/esm/components/Card.js +2 -2
- package/dist/esm/components/DatePicker/DateField.js +3 -3
- package/dist/esm/components/DatePicker/DatePickerInput.js +5 -5
- package/dist/esm/components/DatePicker/DatePickerInputBase.js +2 -2
- package/dist/esm/components/DatePicker/DateRangePickerInput.js +6 -6
- package/dist/esm/components/DatePicker/DateSegment.js +3 -3
- package/dist/esm/components/Divider.js +2 -2
- package/dist/esm/components/Drawer.js +3 -3
- package/dist/esm/components/GroupButton.js +3 -3
- package/dist/esm/components/Hint.js +2 -2
- package/dist/esm/components/Input/Box.js +4 -4
- package/dist/esm/components/Input/Face.js +6 -6
- package/dist/esm/components/Input/Left.js +3 -3
- package/dist/esm/components/Input/Mask.js +7 -7
- package/dist/esm/components/Input/Right.js +3 -3
- package/dist/esm/components/Input/Root.js +3 -3
- package/dist/esm/components/Input/Search.js +3 -3
- package/dist/esm/components/Masonry.js +6 -6
- package/dist/esm/components/Menubar/Categories.js +2 -2
- package/dist/esm/components/Menubar/Category.js +2 -2
- package/dist/esm/components/Menubar/Dropdown.js +2 -2
- package/dist/esm/components/Menubar/DropdownRoot.js +4 -4
- package/dist/esm/components/Menubar/Header.js +5 -5
- package/dist/esm/components/Menubar/IconControlSubItem.js +2 -2
- package/dist/esm/components/Menubar/Item.js +3 -3
- package/dist/esm/components/Menubar/ItemLink.js +2 -2
- package/dist/esm/components/Menubar/Left.js +2 -2
- package/dist/esm/components/Menubar/MostUsed.js +2 -2
- package/dist/esm/components/Menubar/MostUsedItem.js +4 -4
- package/dist/esm/components/Menubar/MostUsedList.js +9 -5
- package/dist/esm/components/Menubar/Right.js +2 -2
- package/dist/esm/components/Menubar/Root.js +2 -2
- package/dist/esm/components/Menubar/Search.js +2 -2
- package/dist/esm/components/Menubar/SubItem.js +2 -2
- package/dist/esm/components/Modal.js +3 -3
- package/dist/esm/components/Popover/Content.js +3 -3
- package/dist/esm/components/Popover/Provider.js +2 -2
- package/dist/esm/components/Popover/Root.js +2 -2
- package/dist/esm/components/Popover/Trigger.js +1 -1
- package/dist/esm/components/ProgressBar.js +4 -4
- package/dist/esm/components/RadioButton.js +4 -4
- package/dist/esm/components/Select/Content.js +3 -3
- package/dist/esm/components/Select/GroupedOptions.js +9 -2
- package/dist/esm/components/Select/MultiCheckAllOptions.js +4 -4
- package/dist/esm/components/Select/MultiGroupedOptions.js +13 -6
- package/dist/esm/components/Select/MultiOption.js +3 -3
- package/dist/esm/components/Select/MultiOptions.js +9 -2
- package/dist/esm/components/Select/Option.js +2 -2
- package/dist/esm/components/Select/Options.js +9 -2
- package/dist/esm/components/Select/Popover.js +2 -2
- package/dist/esm/components/Select/Root.js +2 -2
- package/dist/esm/components/Select/SkeletonOptions.js +9 -0
- package/dist/esm/components/Select/Trigger.js +4 -4
- package/dist/esm/components/Skeleton.js +3 -7
- package/dist/esm/components/Snackbar/BaseSnackbar.js +2 -2
- package/dist/esm/components/Snackbar/DefaultSnack.js +3 -3
- package/dist/esm/components/Table.js +9 -9
- package/dist/esm/components/Tag.js +2 -2
- package/dist/esm/components/TextArea/Box.js +45 -0
- package/dist/esm/components/TextArea/Face.js +25 -0
- package/dist/esm/components/TextArea/Left.js +8 -0
- package/dist/esm/components/TextArea/Right.js +8 -0
- package/dist/esm/components/TextArea/Root.js +9 -0
- package/dist/esm/components/TextArea/index.js +15 -0
- package/dist/esm/components/TextArea/utils.js +9 -0
- package/dist/esm/components/TimeField/TimeField.js +2 -2
- package/dist/esm/components/TimeField/TimeFieldInput.js +4 -4
- package/dist/esm/components/Toggle.js +4 -4
- package/dist/esm/components/Tooltip.js +4 -4
- package/dist/esm/components/utils.js +2 -2
- package/dist/esm/hooks/useSelectGroupedOptions.js +33 -0
- package/dist/esm/hooks/useSelectOptions.js +33 -0
- package/dist/esm/hooks/useTimeField.js +2 -2
- package/dist/esm/index.js +4 -2
- package/dist/esm/provider/MenubarProvider.js +3 -3
- package/dist/esm/provider/SnackbarProvider.js +2 -2
- package/dist/esm/service/SnackbarSonner.js +7 -3
- package/dist/types/components/Badge.d.ts +4 -5
- package/dist/types/components/Popover/Provider.d.ts +1 -1
- package/dist/types/components/Select/SkeletonOptions.d.ts +1 -0
- package/dist/types/components/Select/types.d.ts +4 -4
- package/dist/types/components/Skeleton.d.ts +6 -4
- package/dist/types/components/Snackbar/BaseSnackbar.d.ts +1 -1
- package/dist/types/components/TextArea/Box.d.ts +3 -0
- package/dist/types/components/TextArea/Face.d.ts +3 -0
- package/dist/types/components/TextArea/Left.d.ts +3 -0
- package/dist/types/components/TextArea/Right.d.ts +3 -0
- package/dist/types/components/TextArea/Root.d.ts +3 -0
- package/dist/types/components/TextArea/index.d.ts +8 -0
- package/dist/types/components/TextArea/types.d.ts +15 -0
- package/dist/types/components/TextArea/utils.d.ts +2 -0
- package/dist/types/hooks/index.d.ts +3 -1
- package/dist/types/hooks/useSelectGroupedOptions.d.ts +9 -0
- package/dist/types/hooks/useSelectOptions.d.ts +9 -0
- package/package.json +2 -2
- package/dist/cjs/components/TextArea.js +0 -83
- package/dist/esm/components/TextArea.js +0 -81
- package/dist/types/components/TextArea.d.ts +0 -24
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { Card } from '../Card.js';
|
|
3
3
|
import { BreadcrumbItem } from './BreadcrumbItem.js';
|
|
4
4
|
|
|
5
5
|
const Breadcrumbs = (props) => {
|
|
6
6
|
const { breadcrumbs, ...rest } = props;
|
|
7
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ React__default.createElement(Card, { className: "flex gap-x-mili w-full items-center py-mili", ...rest }, breadcrumbs.map((item, index) => {
|
|
8
8
|
const isLast = index === breadcrumbs.length - 1;
|
|
9
|
-
return /* @__PURE__ */
|
|
9
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
10
10
|
BreadcrumbItem,
|
|
11
11
|
{
|
|
12
12
|
key: `${item.title}-${index}`,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { button } from '@tecsinapse/cortex-core';
|
|
2
|
-
import
|
|
2
|
+
import React__default, { forwardRef } from 'react';
|
|
3
3
|
|
|
4
4
|
const Button = forwardRef((props, ref) => {
|
|
5
5
|
const { variants, children, ...rest } = props;
|
|
6
|
-
return /* @__PURE__ */
|
|
6
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
7
7
|
"button",
|
|
8
8
|
{
|
|
9
9
|
className: button(variants),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { useCalendar } from '../../hooks/useCalendar.js';
|
|
3
3
|
import '@internationalized/date';
|
|
4
4
|
import 'react-aria';
|
|
@@ -9,14 +9,14 @@ import { CalendarHeader } from './CalendarHeader.js';
|
|
|
9
9
|
|
|
10
10
|
const Calendar = ({ value, onChange }) => {
|
|
11
11
|
const { calendarProps, title, state } = useCalendar({ value, onChange });
|
|
12
|
-
return /* @__PURE__ */
|
|
12
|
+
return /* @__PURE__ */ React__default.createElement("div", { ...calendarProps, className: "calendar", "data-testid": "calendar-div" }, /* @__PURE__ */ React__default.createElement(
|
|
13
13
|
CalendarHeader,
|
|
14
14
|
{
|
|
15
15
|
onClickPrevButton: () => state.focusPreviousPage(),
|
|
16
16
|
onClickNextButton: () => state.focusNextPage(),
|
|
17
17
|
title
|
|
18
18
|
}
|
|
19
|
-
), /* @__PURE__ */
|
|
19
|
+
), /* @__PURE__ */ React__default.createElement(CalendarGrid, { state }));
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
export { Calendar };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import '@internationalized/date';
|
|
3
3
|
import 'react-aria';
|
|
4
4
|
import 'react-stately';
|
|
@@ -22,7 +22,7 @@ const CalendarCell = ({ state, date }) => {
|
|
|
22
22
|
isSelectionEnd,
|
|
23
23
|
inRange
|
|
24
24
|
} = useCalendarCell({ state, date });
|
|
25
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
26
26
|
Td,
|
|
27
27
|
{
|
|
28
28
|
...cellProps,
|
|
@@ -35,7 +35,7 @@ const CalendarCell = ({ state, date }) => {
|
|
|
35
35
|
inRange
|
|
36
36
|
})
|
|
37
37
|
},
|
|
38
|
-
/* @__PURE__ */
|
|
38
|
+
/* @__PURE__ */ React__default.createElement(
|
|
39
39
|
"div",
|
|
40
40
|
{
|
|
41
41
|
...buttonProps,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import '@internationalized/date';
|
|
3
3
|
import 'react-aria';
|
|
4
4
|
import 'react-stately';
|
|
@@ -9,13 +9,13 @@ import { CalendarGridHeaderRow } from './CalendarGridHeaderRow.js';
|
|
|
9
9
|
|
|
10
10
|
const CalendarGrid = ({ state }) => {
|
|
11
11
|
const { gridProps, headerProps, weekDays } = useCalendarGrid({ state });
|
|
12
|
-
return /* @__PURE__ */
|
|
12
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
13
13
|
"div",
|
|
14
14
|
{
|
|
15
15
|
className: "bg-white rounded-micro px-deca py-mili",
|
|
16
16
|
"data-testid": "calendar-grid"
|
|
17
17
|
},
|
|
18
|
-
/* @__PURE__ */
|
|
18
|
+
/* @__PURE__ */ React__default.createElement("table", { ...gridProps, className: "border-separate border-spacing-y-nano" }, /* @__PURE__ */ React__default.createElement("thead", { ...headerProps }, /* @__PURE__ */ React__default.createElement(CalendarGridHeaderRow, { weekDays })), /* @__PURE__ */ React__default.createElement("tbody", null, /* @__PURE__ */ React__default.createElement(CalendarGridBodyRows, { state })))
|
|
19
19
|
);
|
|
20
20
|
};
|
|
21
21
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { CalendarCell } from './CalendarCell.js';
|
|
3
3
|
|
|
4
4
|
const CalendarGridBodyRows = ({ state }) => {
|
|
5
|
-
return /* @__PURE__ */
|
|
6
|
-
return date ? /* @__PURE__ */
|
|
5
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, [...new Array(6).keys()].map((weekIndex) => /* @__PURE__ */ React__default.createElement("tr", { key: weekIndex, className: "shadow-0 px-deca" }, state.getDatesInWeek(weekIndex).map((date, i) => {
|
|
6
|
+
return date ? /* @__PURE__ */ React__default.createElement(CalendarCell, { key: i, state, date }) : /* @__PURE__ */ React__default.createElement("td", { key: i });
|
|
7
7
|
}))));
|
|
8
8
|
};
|
|
9
9
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { THeadCell } from '../Table.js';
|
|
3
3
|
|
|
4
4
|
const CalendarGridHeaderRow = ({
|
|
5
5
|
weekDays
|
|
6
6
|
}) => {
|
|
7
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ React__default.createElement("tr", { "data-testid": "calendar-grid-header-row" }, weekDays.map((day, index) => /* @__PURE__ */ React__default.createElement(THeadCell, { key: index }, day)));
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export { CalendarGridHeaderRow };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { FaChevronLeft, FaChevronRight } from 'react-icons/fa';
|
|
3
3
|
import { Button } from '../Button.js';
|
|
4
4
|
|
|
@@ -7,30 +7,30 @@ const CalendarHeader = ({
|
|
|
7
7
|
onClickNextButton,
|
|
8
8
|
title
|
|
9
9
|
}) => {
|
|
10
|
-
return /* @__PURE__ */
|
|
10
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
11
11
|
"div",
|
|
12
12
|
{
|
|
13
13
|
className: "flex flex-row justify-between items-center gap-x-deca bg-miscellaneous-body p-mili",
|
|
14
14
|
"data-testid": "calendar-header"
|
|
15
15
|
},
|
|
16
|
-
/* @__PURE__ */
|
|
16
|
+
/* @__PURE__ */ React__default.createElement(
|
|
17
17
|
Button,
|
|
18
18
|
{
|
|
19
19
|
onClick: onClickPrevButton,
|
|
20
20
|
variants: { variant: "text", intent: "secondary", size: "small" },
|
|
21
21
|
"data-testid": "calendar-header-prev-button"
|
|
22
22
|
},
|
|
23
|
-
/* @__PURE__ */
|
|
23
|
+
/* @__PURE__ */ React__default.createElement(FaChevronLeft, null)
|
|
24
24
|
),
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
/* @__PURE__ */
|
|
25
|
+
/* @__PURE__ */ React__default.createElement("span", { className: "font-bold capitalize" }, title),
|
|
26
|
+
/* @__PURE__ */ React__default.createElement(
|
|
27
27
|
Button,
|
|
28
28
|
{
|
|
29
29
|
onClick: onClickNextButton,
|
|
30
30
|
variants: { variant: "text", intent: "secondary", size: "small" },
|
|
31
31
|
"data-testid": "calendar-header-next-button"
|
|
32
32
|
},
|
|
33
|
-
/* @__PURE__ */
|
|
33
|
+
/* @__PURE__ */ React__default.createElement(FaChevronRight, null)
|
|
34
34
|
)
|
|
35
35
|
);
|
|
36
36
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import '@internationalized/date';
|
|
3
3
|
import 'react-aria';
|
|
4
4
|
import 'react-stately';
|
|
5
|
-
import { useRangeCalendar } from '../../hooks/useRangeCalendar.js';
|
|
6
5
|
import '@floating-ui/react';
|
|
6
|
+
import { useRangeCalendar } from '../../hooks/useRangeCalendar.js';
|
|
7
7
|
import { CalendarGrid } from './CalendarGrid.js';
|
|
8
8
|
import { CalendarHeader } from './CalendarHeader.js';
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ const RangeCalendar = ({ value, onChange }) => {
|
|
|
12
12
|
value,
|
|
13
13
|
onChange
|
|
14
14
|
});
|
|
15
|
-
return /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
16
16
|
"div",
|
|
17
17
|
{
|
|
18
18
|
...calendarProps,
|
|
@@ -20,7 +20,7 @@ const RangeCalendar = ({ value, onChange }) => {
|
|
|
20
20
|
ref,
|
|
21
21
|
"data-testid": "calendar-range-div"
|
|
22
22
|
},
|
|
23
|
-
/* @__PURE__ */
|
|
23
|
+
/* @__PURE__ */ React__default.createElement(
|
|
24
24
|
CalendarHeader,
|
|
25
25
|
{
|
|
26
26
|
onClickPrevButton: () => state.focusPreviousPage(),
|
|
@@ -28,7 +28,7 @@ const RangeCalendar = ({ value, onChange }) => {
|
|
|
28
28
|
title
|
|
29
29
|
}
|
|
30
30
|
),
|
|
31
|
-
/* @__PURE__ */
|
|
31
|
+
/* @__PURE__ */ React__default.createElement(CalendarGrid, { state })
|
|
32
32
|
);
|
|
33
33
|
};
|
|
34
34
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { card } from '@tecsinapse/cortex-core';
|
|
2
|
-
import
|
|
2
|
+
import React__default, { forwardRef } from 'react';
|
|
3
3
|
|
|
4
4
|
const Card = forwardRef((props, ref) => {
|
|
5
5
|
const { children, className, ...rest } = props;
|
|
6
|
-
return /* @__PURE__ */
|
|
6
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: card({ className }), ref, ...rest }, children);
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
export { Card };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createCalendar } from '@internationalized/date';
|
|
2
|
-
import
|
|
2
|
+
import React__default from 'react';
|
|
3
3
|
import { useLocale, useDateField } from 'react-aria';
|
|
4
4
|
import { useDateFieldState } from 'react-stately';
|
|
5
5
|
import { DateSegment } from './DateSegment.js';
|
|
@@ -11,13 +11,13 @@ const DateField = (props) => {
|
|
|
11
11
|
createCalendar,
|
|
12
12
|
locale
|
|
13
13
|
});
|
|
14
|
-
const ref =
|
|
14
|
+
const ref = React__default.useRef(null);
|
|
15
15
|
const { fieldProps } = useDateField(
|
|
16
16
|
{ "aria-label": "date-field" },
|
|
17
17
|
state,
|
|
18
18
|
ref
|
|
19
19
|
);
|
|
20
|
-
return /* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ React__default.createElement("div", { ...fieldProps, ref, className: "flex flex-row" }, state.segments.map((segment, i) => /* @__PURE__ */ React__default.createElement(DateSegment, { key: i, segment, state })));
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
export { DateField };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import '@internationalized/date';
|
|
3
3
|
import 'react-aria';
|
|
4
4
|
import 'react-stately';
|
|
@@ -12,7 +12,7 @@ import { DatePickerInputBase } from './DatePickerInputBase.js';
|
|
|
12
12
|
const DatePickerInput = (props) => {
|
|
13
13
|
const { onChange, value, label, variants } = props;
|
|
14
14
|
const { fieldProps, state, ref } = useDatePickerInput({ value, onChange });
|
|
15
|
-
return /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ React__default.createElement("div", { "data-testid": "date-picker-input" }, /* @__PURE__ */ React__default.createElement(
|
|
16
16
|
DatePickerInputBase,
|
|
17
17
|
{
|
|
18
18
|
onClickCalendar: () => state.isOpen ? state.close() : state.open(),
|
|
@@ -22,7 +22,7 @@ const DatePickerInput = (props) => {
|
|
|
22
22
|
},
|
|
23
23
|
label
|
|
24
24
|
},
|
|
25
|
-
/* @__PURE__ */
|
|
25
|
+
/* @__PURE__ */ React__default.createElement("div", { ref }, /* @__PURE__ */ React__default.createElement(
|
|
26
26
|
DateField,
|
|
27
27
|
{
|
|
28
28
|
...fieldProps,
|
|
@@ -32,7 +32,7 @@ const DatePickerInput = (props) => {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
))
|
|
35
|
-
), state.isOpen ? /* @__PURE__ */
|
|
35
|
+
), state.isOpen ? /* @__PURE__ */ React__default.createElement("div", { className: "absolute" }, /* @__PURE__ */ React__default.createElement(
|
|
36
36
|
Calendar,
|
|
37
37
|
{
|
|
38
38
|
value,
|
|
@@ -41,7 +41,7 @@ const DatePickerInput = (props) => {
|
|
|
41
41
|
state.close();
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
)) : /* @__PURE__ */
|
|
44
|
+
)) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null));
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
export { DatePickerInput };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { labelStyle, inputBox } from '@tecsinapse/cortex-core';
|
|
2
|
-
import
|
|
2
|
+
import React__default from 'react';
|
|
3
3
|
import { LiaCalendar } from 'react-icons/lia';
|
|
4
4
|
import { Input } from '../Input/index.js';
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ const DatePickerInputBase = ({
|
|
|
9
9
|
label,
|
|
10
10
|
onClickCalendar
|
|
11
11
|
}) => {
|
|
12
|
-
return /* @__PURE__ */
|
|
12
|
+
return /* @__PURE__ */ React__default.createElement(Input.Face, { variants, "data-testid": "date-picker-input-base" }, /* @__PURE__ */ React__default.createElement("span", { className: labelStyle({}) }, label), /* @__PURE__ */ React__default.createElement("div", { className: inputBox("", label, "w-full flex flex-row") }, children), /* @__PURE__ */ React__default.createElement(Input.Right, { className: "" }, /* @__PURE__ */ React__default.createElement(
|
|
13
13
|
LiaCalendar,
|
|
14
14
|
{
|
|
15
15
|
className: "cursor-pointer mt-centi",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import '@internationalized/date';
|
|
3
3
|
import 'react-aria';
|
|
4
4
|
import 'react-stately';
|
|
@@ -12,7 +12,7 @@ import { DatePickerInputBase } from './DatePickerInputBase.js';
|
|
|
12
12
|
const DateRangePickerInput = (props) => {
|
|
13
13
|
const { onChange, value, label, variants } = props;
|
|
14
14
|
const { endFieldProps, startFieldProps, ref, state } = useDateRangePickerInput({ value, onChange });
|
|
15
|
-
return /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ React__default.createElement("div", { "data-testid": "date-range-picker-input" }, /* @__PURE__ */ React__default.createElement(
|
|
16
16
|
DatePickerInputBase,
|
|
17
17
|
{
|
|
18
18
|
onClickCalendar: () => state.isOpen ? state.close() : state.open(),
|
|
@@ -22,7 +22,7 @@ const DateRangePickerInput = (props) => {
|
|
|
22
22
|
},
|
|
23
23
|
label
|
|
24
24
|
},
|
|
25
|
-
/* @__PURE__ */
|
|
25
|
+
/* @__PURE__ */ React__default.createElement("div", { ref, className: "flex flex-row gap-x-micro items-center" }, /* @__PURE__ */ React__default.createElement(
|
|
26
26
|
DateField,
|
|
27
27
|
{
|
|
28
28
|
...startFieldProps,
|
|
@@ -32,7 +32,7 @@ const DateRangePickerInput = (props) => {
|
|
|
32
32
|
state.close();
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
), /* @__PURE__ */
|
|
35
|
+
), /* @__PURE__ */ React__default.createElement("span", null, "-"), /* @__PURE__ */ React__default.createElement(
|
|
36
36
|
DateField,
|
|
37
37
|
{
|
|
38
38
|
...endFieldProps,
|
|
@@ -43,7 +43,7 @@ const DateRangePickerInput = (props) => {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
))
|
|
46
|
-
), state.isOpen ? /* @__PURE__ */
|
|
46
|
+
), state.isOpen ? /* @__PURE__ */ React__default.createElement("div", { className: "absolute" }, /* @__PURE__ */ React__default.createElement(
|
|
47
47
|
RangeCalendar,
|
|
48
48
|
{
|
|
49
49
|
value,
|
|
@@ -55,7 +55,7 @@ const DateRangePickerInput = (props) => {
|
|
|
55
55
|
state.close();
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
)) : /* @__PURE__ */
|
|
58
|
+
)) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null));
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
export { DateRangePickerInput };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { useDateSegment } from 'react-aria';
|
|
3
3
|
|
|
4
4
|
const DateSegment = ({ segment, state }) => {
|
|
5
|
-
const ref =
|
|
5
|
+
const ref = React__default.useRef(null);
|
|
6
6
|
const { segmentProps } = useDateSegment(segment, state, ref);
|
|
7
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
8
8
|
"div",
|
|
9
9
|
{
|
|
10
10
|
...segmentProps,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { divider } from '@tecsinapse/cortex-core';
|
|
2
|
-
import
|
|
2
|
+
import React__default from 'react';
|
|
3
3
|
|
|
4
4
|
const Divider = ({ className, ...rest }) => {
|
|
5
|
-
return /* @__PURE__ */
|
|
5
|
+
return /* @__PURE__ */ React__default.createElement("hr", { ...rest, className: divider({ className }) });
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export { Divider };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { overlay, drawer } from '@tecsinapse/cortex-core';
|
|
2
|
-
import
|
|
2
|
+
import React__default from 'react';
|
|
3
3
|
|
|
4
4
|
const Drawer = ({
|
|
5
5
|
children,
|
|
@@ -7,14 +7,14 @@ const Drawer = ({
|
|
|
7
7
|
open,
|
|
8
8
|
position = "right"
|
|
9
9
|
}) => {
|
|
10
|
-
return /* @__PURE__ */
|
|
10
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
|
|
11
11
|
"div",
|
|
12
12
|
{
|
|
13
13
|
"data-testid": "overlay",
|
|
14
14
|
className: overlay({ show: open }),
|
|
15
15
|
onClick: onClose
|
|
16
16
|
}
|
|
17
|
-
), /* @__PURE__ */
|
|
17
|
+
), /* @__PURE__ */ React__default.createElement(
|
|
18
18
|
"div",
|
|
19
19
|
{
|
|
20
20
|
"data-testid": "drawer",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
|
-
import
|
|
2
|
+
import React__default from 'react';
|
|
3
3
|
import '../styles/calendar-cell.js';
|
|
4
4
|
import { groupButton } from '../styles/groupButton.js';
|
|
5
5
|
import '../styles/progressBar.js';
|
|
@@ -15,10 +15,10 @@ const GroupButton = (props) => {
|
|
|
15
15
|
customStyles,
|
|
16
16
|
disableAllOptions
|
|
17
17
|
} = props;
|
|
18
|
-
return /* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: container(), "data-testid": "group-button-container" }, options.map((option) => {
|
|
19
19
|
const key = renderKey?.(option.value);
|
|
20
20
|
const isActive = key === renderKey?.(value);
|
|
21
|
-
return /* @__PURE__ */
|
|
21
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
22
22
|
"button",
|
|
23
23
|
{
|
|
24
24
|
disabled: disableAllOptions,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { hint } from '@tecsinapse/cortex-core';
|
|
2
|
-
import
|
|
2
|
+
import React__default, { forwardRef } from 'react';
|
|
3
3
|
|
|
4
4
|
const Hint = forwardRef((props, ref) => {
|
|
5
5
|
const { children, variants } = props;
|
|
6
|
-
return /* @__PURE__ */
|
|
6
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: hint(variants), ref }, children ?? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null));
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
export { Hint };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { inputBox, labelStyle } from '@tecsinapse/cortex-core';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import
|
|
3
|
+
import React__default from 'react';
|
|
4
4
|
|
|
5
|
-
const InputBox =
|
|
5
|
+
const InputBox = React__default.forwardRef(
|
|
6
6
|
({ id, name, variants, label, placeholder, className, ...rest }, ref) => {
|
|
7
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: "flex w-full flex-col" }, /* @__PURE__ */ React__default.createElement(
|
|
8
8
|
"input",
|
|
9
9
|
{
|
|
10
10
|
id: id ?? name,
|
|
@@ -15,7 +15,7 @@ const InputBox = React.forwardRef(
|
|
|
15
15
|
ref,
|
|
16
16
|
"data-testid": "input-box"
|
|
17
17
|
}
|
|
18
|
-
), /* @__PURE__ */
|
|
18
|
+
), /* @__PURE__ */ React__default.createElement(
|
|
19
19
|
"label",
|
|
20
20
|
{
|
|
21
21
|
htmlFor: id ?? name,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { input } from '@tecsinapse/cortex-core';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import
|
|
3
|
+
import React__default from 'react';
|
|
4
4
|
|
|
5
5
|
const getValidChildren = (children) => {
|
|
6
|
-
return
|
|
7
|
-
(el) =>
|
|
6
|
+
return React__default.Children.toArray(children).filter(
|
|
7
|
+
(el) => React__default.isValidElement(el)
|
|
8
8
|
);
|
|
9
9
|
};
|
|
10
|
-
const InputFace =
|
|
10
|
+
const InputFace = React__default.forwardRef(
|
|
11
11
|
({ children, variants, className, ...rest }, ref) => {
|
|
12
12
|
const clones = getValidChildren(children).map((el) => {
|
|
13
|
-
return
|
|
13
|
+
return React__default.cloneElement(el, { ...el.props, variants });
|
|
14
14
|
});
|
|
15
|
-
return /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
16
16
|
"div",
|
|
17
17
|
{
|
|
18
18
|
"data-testid": "input-face",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
|
-
import
|
|
2
|
+
import React__default from 'react';
|
|
3
3
|
|
|
4
|
-
const InputLeft =
|
|
4
|
+
const InputLeft = React__default.forwardRef(
|
|
5
5
|
({ children, className, ...rest }, ref) => {
|
|
6
|
-
return /* @__PURE__ */
|
|
6
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: clsx(className, "mr-2.5"), ...rest, ref }, children);
|
|
7
7
|
}
|
|
8
8
|
);
|
|
9
9
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { createRef, useEffect } from 'react';
|
|
2
2
|
import { useIMask } from 'react-imask';
|
|
3
3
|
import { Input } from './index.js';
|
|
4
4
|
|
|
@@ -19,16 +19,16 @@ const useIMaskLocal = (mask, inputProps, ref, unmaskedRef) => {
|
|
|
19
19
|
iMaskRef
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
-
const InputMaskExpression =
|
|
22
|
+
const InputMaskExpression = React__default.forwardRef(({ mask, unmaskedRef, ...rest }, ref) => {
|
|
23
23
|
const { iMaskRef } = useIMaskLocal({ mask }, rest, ref, unmaskedRef);
|
|
24
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ React__default.createElement(Input.Root, { ...rest, ref: iMaskRef });
|
|
25
25
|
});
|
|
26
|
-
const InputMaskNumber =
|
|
26
|
+
const InputMaskNumber = React__default.forwardRef(({ unmaskedRef, ...rest }, ref) => {
|
|
27
27
|
const mask = { mask: Number, scale: 2 };
|
|
28
28
|
const { iMaskRef } = useIMaskLocal(mask, rest, ref, unmaskedRef);
|
|
29
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ React__default.createElement(Input.Root, { ...rest, ref: iMaskRef });
|
|
30
30
|
});
|
|
31
|
-
const InputMaskCurrency =
|
|
31
|
+
const InputMaskCurrency = React__default.forwardRef(({ unmaskedRef, ...rest }, ref) => {
|
|
32
32
|
const mask = {
|
|
33
33
|
mask: "R$ num",
|
|
34
34
|
blocks: {
|
|
@@ -43,7 +43,7 @@ const InputMaskCurrency = React.forwardRef(({ unmaskedRef, ...rest }, ref) => {
|
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
const { iMaskRef } = useIMaskLocal(mask, rest, ref, unmaskedRef);
|
|
46
|
-
return /* @__PURE__ */
|
|
46
|
+
return /* @__PURE__ */ React__default.createElement(Input.Root, { ...rest, ref: iMaskRef });
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
export { InputMaskCurrency, InputMaskExpression, InputMaskNumber };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
|
-
import
|
|
2
|
+
import React__default from 'react';
|
|
3
3
|
|
|
4
|
-
const InputRight =
|
|
4
|
+
const InputRight = React__default.forwardRef(
|
|
5
5
|
({ children, className, ...rest }, ref) => {
|
|
6
|
-
return /* @__PURE__ */
|
|
6
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: clsx(className, "ml-2.5"), ...rest, ref }, children);
|
|
7
7
|
}
|
|
8
8
|
);
|
|
9
9
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { InputBox } from './Box.js';
|
|
3
3
|
import { InputFace } from './Face.js';
|
|
4
4
|
|
|
5
|
-
const InputRoot =
|
|
5
|
+
const InputRoot = React__default.forwardRef(
|
|
6
6
|
({ variants, className, ...rest }, ref) => {
|
|
7
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ React__default.createElement(InputFace, { variants, className }, /* @__PURE__ */ React__default.createElement(InputBox, { ...rest, ref }));
|
|
8
8
|
}
|
|
9
9
|
);
|
|
10
10
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { useState, useEffect } from 'react';
|
|
2
2
|
import { IoSearchOutline } from 'react-icons/io5';
|
|
3
3
|
import { Input } from './index.js';
|
|
4
4
|
import '@internationalized/date';
|
|
@@ -7,7 +7,7 @@ import 'react-stately';
|
|
|
7
7
|
import { useDebouncedState } from '../../hooks/useDebouncedState.js';
|
|
8
8
|
import '@floating-ui/react';
|
|
9
9
|
|
|
10
|
-
const InputSearch =
|
|
10
|
+
const InputSearch = React__default.forwardRef(
|
|
11
11
|
({
|
|
12
12
|
bounceTimeout = 1e3,
|
|
13
13
|
variants,
|
|
@@ -22,7 +22,7 @@ const InputSearch = React.forwardRef(
|
|
|
22
22
|
onChange(searchInputEvent);
|
|
23
23
|
}
|
|
24
24
|
}, [bouncedTextEvent]);
|
|
25
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ React__default.createElement(Input.Face, { variants, className }, /* @__PURE__ */ React__default.createElement(Input.Left, null, /* @__PURE__ */ React__default.createElement(IoSearchOutline, { "data-testid": "icon-search-left" })), /* @__PURE__ */ React__default.createElement(Input.Box, { ...rest, ref, onChange: (e) => setSearchInputEvent(e) }));
|
|
26
26
|
}
|
|
27
27
|
);
|
|
28
28
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
|
-
import
|
|
2
|
+
import React__default from 'react';
|
|
3
3
|
|
|
4
4
|
const Masonry = ({ children, columns }) => {
|
|
5
5
|
const getColumns = () => {
|
|
@@ -7,8 +7,8 @@ const Masonry = ({ children, columns }) => {
|
|
|
7
7
|
{ length: columns },
|
|
8
8
|
() => []
|
|
9
9
|
);
|
|
10
|
-
|
|
11
|
-
if (child &&
|
|
10
|
+
React__default.Children.forEach(children, (child, index) => {
|
|
11
|
+
if (child && React__default.isValidElement(child)) {
|
|
12
12
|
columnsArray[index % columns].push(child);
|
|
13
13
|
}
|
|
14
14
|
});
|
|
@@ -16,12 +16,12 @@ const Masonry = ({ children, columns }) => {
|
|
|
16
16
|
};
|
|
17
17
|
const renderColumn = (column) => {
|
|
18
18
|
return column.map((item, index) => {
|
|
19
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: index > 0 ? "mt-deca" : "mt-0", key: index }, item);
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
const renderColumns = () => {
|
|
23
23
|
return getColumns().map((column, index) => {
|
|
24
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
25
25
|
"div",
|
|
26
26
|
{
|
|
27
27
|
className: clsx(
|
|
@@ -34,7 +34,7 @@ const Masonry = ({ children, columns }) => {
|
|
|
34
34
|
);
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
|
-
return /* @__PURE__ */
|
|
37
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
38
38
|
"div",
|
|
39
39
|
{
|
|
40
40
|
"data-testid": "masonry",
|