@tecsinapse/cortex-react 1.3.0-beta.25 → 1.3.0-beta.27
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/Input/Mask.js +13 -33
- package/dist/cjs/components/Input/index.js +1 -3
- package/dist/cjs/components/Input/masks.js +43 -0
- 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 +13 -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 +14 -32
- 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/Input/index.js +2 -4
- package/dist/esm/components/Input/masks.js +38 -0
- 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 +5 -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/Input/Mask.d.ts +2 -4
- package/dist/types/components/Input/index.d.ts +2 -3
- package/dist/types/components/Input/masks.d.ts +39 -0
- package/dist/types/components/Input/types.d.ts +11 -4
- 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,18 +1,18 @@
|
|
|
1
1
|
import { radioButtonStyles } from '@tecsinapse/cortex-core';
|
|
2
|
-
import
|
|
2
|
+
import React__default, { forwardRef } from 'react';
|
|
3
3
|
|
|
4
4
|
const { container, input, label: labelStyle } = radioButtonStyles();
|
|
5
5
|
const RadioButton = forwardRef(
|
|
6
6
|
({ label, reversed, id, ...rest }, ref) => {
|
|
7
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
8
8
|
"div",
|
|
9
9
|
{
|
|
10
10
|
className: container({ reversed }),
|
|
11
11
|
ref,
|
|
12
12
|
"data-testid": "radio-button-container"
|
|
13
13
|
},
|
|
14
|
-
/* @__PURE__ */
|
|
15
|
-
label ? /* @__PURE__ */
|
|
14
|
+
/* @__PURE__ */ React__default.createElement("input", { id, type: "radio", className: input(), ...rest }),
|
|
15
|
+
label ? /* @__PURE__ */ React__default.createElement("label", { htmlFor: id, className: labelStyle() }, label) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null)
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
18
|
);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { useRef } from 'react';
|
|
2
2
|
import '@internationalized/date';
|
|
3
3
|
import 'react-aria';
|
|
4
4
|
import 'react-stately';
|
|
5
|
-
import { useOutsideClickListener } from '../../hooks/useOutsideClickListener.js';
|
|
6
5
|
import '@floating-ui/react';
|
|
6
|
+
import { useOutsideClickListener } from '../../hooks/useOutsideClickListener.js';
|
|
7
7
|
import { usePopoverContext } from '../Popover/Context.js';
|
|
8
8
|
|
|
9
9
|
const Content = ({ children }) => {
|
|
@@ -13,7 +13,7 @@ const Content = ({ children }) => {
|
|
|
13
13
|
ref,
|
|
14
14
|
onClickOutside: () => setIsOpen(false)
|
|
15
15
|
});
|
|
16
|
-
return /* @__PURE__ */
|
|
16
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: "w-full relative bg-white", ref }, children);
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export { Content };
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { selectVariants } from '@tecsinapse/cortex-core';
|
|
2
|
-
import
|
|
2
|
+
import React__default, { useContext, useCallback } from 'react';
|
|
3
3
|
import { Select } from './index.js';
|
|
4
|
+
import '@internationalized/date';
|
|
5
|
+
import 'react-aria';
|
|
6
|
+
import 'react-stately';
|
|
7
|
+
import '@floating-ui/react';
|
|
8
|
+
import { useSelectGroupedOptions } from '../../hooks/useSelectGroupedOptions.js';
|
|
4
9
|
import { usePopoverContext } from '../Popover/Context.js';
|
|
10
|
+
import { SkeletonOptions } from './SkeletonOptions.js';
|
|
5
11
|
import { SelectContext } from './context.js';
|
|
6
12
|
|
|
7
13
|
const { groupedTitle, list } = selectVariants();
|
|
@@ -12,6 +18,7 @@ const SelectGroupedOptions = ({
|
|
|
12
18
|
}) => {
|
|
13
19
|
const { keyExtractor } = useContext(SelectContext);
|
|
14
20
|
const { setIsOpen } = usePopoverContext();
|
|
21
|
+
const { options: _options, isLoading } = useSelectGroupedOptions({ options });
|
|
15
22
|
const handleSelect = useCallback(
|
|
16
23
|
(option) => {
|
|
17
24
|
onSelect(option);
|
|
@@ -19,7 +26,7 @@ const SelectGroupedOptions = ({
|
|
|
19
26
|
},
|
|
20
27
|
[onSelect]
|
|
21
28
|
);
|
|
22
|
-
return /* @__PURE__ */
|
|
29
|
+
return isLoading ? /* @__PURE__ */ React__default.createElement(SkeletonOptions, null) : /* @__PURE__ */ React__default.createElement("ul", { role: "select", className: list() }, [..._options ?? []].map(([key, value]) => /* @__PURE__ */ React__default.createElement("div", { key }, /* @__PURE__ */ React__default.createElement("span", { className: groupedTitle() }, groupedLabelExtractor?.(key)), value.map((option) => /* @__PURE__ */ React__default.createElement(
|
|
23
30
|
Select.Option,
|
|
24
31
|
{
|
|
25
32
|
grouped: true,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { option, checkbox } from '@tecsinapse/cortex-core';
|
|
2
|
-
import
|
|
2
|
+
import React__default, { useContext, useMemo, useCallback } from 'react';
|
|
3
3
|
import { SelectContext, SelectMultiOptionsContext } from './context.js';
|
|
4
4
|
|
|
5
5
|
const SelectMultiCheckAllOptions = ({
|
|
@@ -31,15 +31,15 @@ const SelectMultiCheckAllOptions = ({
|
|
|
31
31
|
onSelect(updateSelected);
|
|
32
32
|
}
|
|
33
33
|
}, [options, onSelect]);
|
|
34
|
-
return options?.length ? /* @__PURE__ */
|
|
34
|
+
return options?.length ? /* @__PURE__ */ React__default.createElement("div", { className: option(), onClick: checkAll }, /* @__PURE__ */ React__default.createElement(
|
|
35
35
|
"input",
|
|
36
36
|
{
|
|
37
37
|
type: "checkbox",
|
|
38
38
|
className: checkbox(),
|
|
39
|
-
onChange:
|
|
39
|
+
onChange: () => void 0,
|
|
40
40
|
checked: isChecked
|
|
41
41
|
}
|
|
42
|
-
), /* @__PURE__ */
|
|
42
|
+
), /* @__PURE__ */ React__default.createElement("span", null, checkAllLabel)) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null);
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
export { SelectMultiCheckAllOptions };
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { selectVariants } from '@tecsinapse/cortex-core';
|
|
2
|
-
import
|
|
2
|
+
import React__default, { useContext, useMemo } from 'react';
|
|
3
3
|
import { Select } from './index.js';
|
|
4
|
+
import '@internationalized/date';
|
|
5
|
+
import 'react-aria';
|
|
6
|
+
import 'react-stately';
|
|
7
|
+
import '@floating-ui/react';
|
|
8
|
+
import { useSelectGroupedOptions } from '../../hooks/useSelectGroupedOptions.js';
|
|
9
|
+
import { SkeletonOptions } from './SkeletonOptions.js';
|
|
4
10
|
import { SelectContext, SelectMultiOptionsContext } from './context.js';
|
|
5
11
|
import { handleSelectMulti } from './utils.js';
|
|
6
12
|
|
|
@@ -12,17 +18,18 @@ const SelectMultiGroupedOptions = ({
|
|
|
12
18
|
children
|
|
13
19
|
}) => {
|
|
14
20
|
const { value: currentValue = [], keyExtractor } = useContext(SelectContext);
|
|
21
|
+
const { options: _options, isLoading } = useSelectGroupedOptions({ options });
|
|
15
22
|
const flattenMap = useMemo(
|
|
16
|
-
() =>
|
|
23
|
+
() => _options ? Array.from(_options?.values()).flatMap((value) => value) : [],
|
|
17
24
|
[options]
|
|
18
25
|
);
|
|
19
|
-
return /* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
20
27
|
SelectMultiOptionsContext.Provider,
|
|
21
28
|
{
|
|
22
29
|
value: { onSelect, options: flattenMap }
|
|
23
30
|
},
|
|
24
31
|
children,
|
|
25
|
-
[...
|
|
32
|
+
isLoading ? /* @__PURE__ */ React__default.createElement(SkeletonOptions, null) : /* @__PURE__ */ React__default.createElement("ul", { role: "select", className: list() }, [..._options ?? []].map(([key, value]) => /* @__PURE__ */ React__default.createElement("div", { key }, /* @__PURE__ */ React__default.createElement("span", { className: groupedTitle() }, groupedLabelExtractor?.(key)), value.map((option) => /* @__PURE__ */ React__default.createElement(
|
|
26
33
|
Select.MultiOption,
|
|
27
34
|
{
|
|
28
35
|
grouped: true,
|
|
@@ -35,8 +42,8 @@ const SelectMultiGroupedOptions = ({
|
|
|
35
42
|
keyExtractor
|
|
36
43
|
)
|
|
37
44
|
}
|
|
38
|
-
))))
|
|
39
|
-
)
|
|
45
|
+
)))))
|
|
46
|
+
);
|
|
40
47
|
};
|
|
41
48
|
|
|
42
49
|
export { SelectMultiGroupedOptions };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { option, checkbox } from '@tecsinapse/cortex-core';
|
|
2
|
-
import
|
|
2
|
+
import React__default, { useContext, useRef, useMemo, useCallback } from 'react';
|
|
3
3
|
import { SelectContext } from './context.js';
|
|
4
4
|
|
|
5
5
|
const SelectMultiOption = ({
|
|
@@ -17,14 +17,14 @@ const SelectMultiOption = ({
|
|
|
17
17
|
onSelectOption(option$1);
|
|
18
18
|
inputRef.current?.click();
|
|
19
19
|
}, [onSelectOption, inputRef]);
|
|
20
|
-
return /* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
21
21
|
"li",
|
|
22
22
|
{
|
|
23
23
|
onClick: onClickOption,
|
|
24
24
|
className: option({ grouped }),
|
|
25
25
|
role: "option"
|
|
26
26
|
},
|
|
27
|
-
/* @__PURE__ */
|
|
27
|
+
/* @__PURE__ */ React__default.createElement(
|
|
28
28
|
"input",
|
|
29
29
|
{
|
|
30
30
|
type: "checkbox",
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { selectVariants } from '@tecsinapse/cortex-core';
|
|
2
|
-
import
|
|
2
|
+
import React__default, { useContext } from 'react';
|
|
3
3
|
import { Select } from './index.js';
|
|
4
|
+
import '@internationalized/date';
|
|
5
|
+
import 'react-aria';
|
|
6
|
+
import 'react-stately';
|
|
7
|
+
import '@floating-ui/react';
|
|
8
|
+
import { useSelectOptions } from '../../hooks/useSelectOptions.js';
|
|
9
|
+
import { SkeletonOptions } from './SkeletonOptions.js';
|
|
4
10
|
import { SelectContext, SelectMultiOptionsContext } from './context.js';
|
|
5
11
|
import { handleSelectMulti } from './utils.js';
|
|
6
12
|
|
|
@@ -11,7 +17,8 @@ const SelectMultiOptions = ({
|
|
|
11
17
|
children
|
|
12
18
|
}) => {
|
|
13
19
|
const { keyExtractor, value: currentValue = [] } = useContext(SelectContext);
|
|
14
|
-
|
|
20
|
+
const { options: _options, isLoading } = useSelectOptions({ options });
|
|
21
|
+
return /* @__PURE__ */ React__default.createElement(SelectMultiOptionsContext.Provider, { value: { onSelect, options: _options } }, isLoading ? /* @__PURE__ */ React__default.createElement(SkeletonOptions, null) : /* @__PURE__ */ React__default.createElement("ul", { role: "select", className: list() }, children, _options?.map((option) => /* @__PURE__ */ React__default.createElement(
|
|
15
22
|
Select.MultiOption,
|
|
16
23
|
{
|
|
17
24
|
option,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { option } from '@tecsinapse/cortex-core';
|
|
2
|
-
import
|
|
2
|
+
import React__default, { useContext } from 'react';
|
|
3
3
|
import { SelectContext } from './context.js';
|
|
4
4
|
|
|
5
5
|
const SelectOption = ({
|
|
@@ -8,7 +8,7 @@ const SelectOption = ({
|
|
|
8
8
|
grouped = false
|
|
9
9
|
}) => {
|
|
10
10
|
const { keyExtractor, labelExtractor, value } = useContext(SelectContext);
|
|
11
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
12
12
|
"li",
|
|
13
13
|
{
|
|
14
14
|
onClick: () => onSelectOption(option$1),
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { selectVariants } from '@tecsinapse/cortex-core';
|
|
2
|
-
import
|
|
2
|
+
import React__default, { useContext, useCallback } from 'react';
|
|
3
3
|
import { Select } from './index.js';
|
|
4
|
+
import '@internationalized/date';
|
|
5
|
+
import 'react-aria';
|
|
6
|
+
import 'react-stately';
|
|
7
|
+
import '@floating-ui/react';
|
|
8
|
+
import { useSelectOptions } from '../../hooks/useSelectOptions.js';
|
|
4
9
|
import { usePopoverContext } from '../Popover/Context.js';
|
|
10
|
+
import { SkeletonOptions } from './SkeletonOptions.js';
|
|
5
11
|
import { SelectContext } from './context.js';
|
|
6
12
|
|
|
7
13
|
const { list } = selectVariants();
|
|
@@ -11,6 +17,7 @@ const SelectOptions = ({
|
|
|
11
17
|
}) => {
|
|
12
18
|
const { keyExtractor } = useContext(SelectContext);
|
|
13
19
|
const { setIsOpen } = usePopoverContext();
|
|
20
|
+
const { options: _options, isLoading } = useSelectOptions({ options });
|
|
14
21
|
const handleSelect = useCallback(
|
|
15
22
|
(option) => {
|
|
16
23
|
onSelect(option);
|
|
@@ -18,7 +25,7 @@ const SelectOptions = ({
|
|
|
18
25
|
},
|
|
19
26
|
[onSelect]
|
|
20
27
|
);
|
|
21
|
-
return /* @__PURE__ */
|
|
28
|
+
return isLoading ? /* @__PURE__ */ React__default.createElement(SkeletonOptions, null) : /* @__PURE__ */ React__default.createElement("ul", { role: "select", className: list() }, _options?.map((option) => /* @__PURE__ */ React__default.createElement(
|
|
22
29
|
Select.Option,
|
|
23
30
|
{
|
|
24
31
|
option,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { Popover } from '../Popover/index.js';
|
|
3
3
|
|
|
4
4
|
const SelectPopover = ({ children }) => {
|
|
5
|
-
return /* @__PURE__ */
|
|
5
|
+
return /* @__PURE__ */ React__default.createElement(Popover.Content, { className: "bg-white max-h-[30vh] w-full overflow-y-scroll gap-y-mili flex flex-col p-0" }, children);
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export { SelectPopover };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { Popover } from '../Popover/index.js';
|
|
3
3
|
import { Content } from './Content.js';
|
|
4
4
|
import { SelectContext } from './context.js';
|
|
@@ -9,7 +9,7 @@ const SelectRoot = ({
|
|
|
9
9
|
keyExtractor,
|
|
10
10
|
labelExtractor
|
|
11
11
|
}) => {
|
|
12
|
-
return /* @__PURE__ */
|
|
12
|
+
return /* @__PURE__ */ React__default.createElement(Popover.Provider, null, /* @__PURE__ */ React__default.createElement(Popover.Root, { placement: "bottom", trigger: "click" }, /* @__PURE__ */ React__default.createElement(SelectContext.Provider, { value: { value, keyExtractor, labelExtractor } }, /* @__PURE__ */ React__default.createElement(Content, null, children))));
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
export { SelectRoot };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { Skeleton } from '../Skeleton.js';
|
|
3
|
+
|
|
4
|
+
const optionSkeletonStyle = "w-full px-deca my-nano h-[30px]";
|
|
5
|
+
const SkeletonOptions = () => {
|
|
6
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col gap-y-nano" }, Array.from(Array(10).keys()).map((value) => /* @__PURE__ */ React__default.createElement(Skeleton, { key: value }, /* @__PURE__ */ React__default.createElement("div", { className: optionSkeletonStyle }))));
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export { SkeletonOptions };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { selectVariants } from '@tecsinapse/cortex-core';
|
|
2
|
-
import
|
|
2
|
+
import React__default, { useContext, useMemo } from 'react';
|
|
3
3
|
import { IoChevronDownOutline } from 'react-icons/io5';
|
|
4
4
|
import { Popover } from '../Popover/index.js';
|
|
5
5
|
import { SelectContext } from './context.js';
|
|
@@ -13,15 +13,15 @@ const SelectTrigger = ({ label, disabled }) => {
|
|
|
13
13
|
if (value?.length > 1) return `${value.length} items selected`;
|
|
14
14
|
return labelExtractor(value);
|
|
15
15
|
}, [label, value]);
|
|
16
|
-
return /* @__PURE__ */
|
|
16
|
+
return /* @__PURE__ */ React__default.createElement(Popover.Trigger, null, /* @__PURE__ */ React__default.createElement(
|
|
17
17
|
"button",
|
|
18
18
|
{
|
|
19
19
|
className: button({ disabled }),
|
|
20
20
|
disabled,
|
|
21
21
|
role: "button"
|
|
22
22
|
},
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
23
|
+
/* @__PURE__ */ React__default.createElement("span", { "data-testid": "select-placeholder" }, placeholder),
|
|
24
|
+
/* @__PURE__ */ React__default.createElement(IoChevronDownOutline, null)
|
|
25
25
|
));
|
|
26
26
|
};
|
|
27
27
|
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
|
-
import
|
|
2
|
+
import React__default from 'react';
|
|
3
3
|
|
|
4
|
-
const Skeleton = ({
|
|
5
|
-
|
|
6
|
-
children,
|
|
7
|
-
...rest
|
|
8
|
-
}) => {
|
|
9
|
-
return /* @__PURE__ */ React.createElement(
|
|
4
|
+
const Skeleton = ({ className, children, ...rest }) => {
|
|
5
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
10
6
|
"div",
|
|
11
7
|
{
|
|
12
8
|
...rest,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React, { forwardRef } from 'react';
|
|
2
1
|
import { snackbar } from '@tecsinapse/cortex-core';
|
|
2
|
+
import React__default, { forwardRef } from 'react';
|
|
3
3
|
|
|
4
4
|
const BaseSnackbar = forwardRef(
|
|
5
5
|
(props, ref) => {
|
|
6
6
|
const { children, show, variants } = props;
|
|
7
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, show ? /* @__PURE__ */ React__default.createElement("div", { className: snackbar(variants), ref, "data-testid": "snackbar" }, children) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null));
|
|
8
8
|
}
|
|
9
9
|
);
|
|
10
10
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { IoMdInformationCircleOutline, IoMdClose } from 'react-icons/io';
|
|
3
3
|
import { BaseSnackbar } from './BaseSnackbar.js';
|
|
4
4
|
|
|
@@ -6,13 +6,13 @@ const DefaultSnack = ({
|
|
|
6
6
|
text,
|
|
7
7
|
onDismiss,
|
|
8
8
|
variants
|
|
9
|
-
}) => /* @__PURE__ */
|
|
9
|
+
}) => /* @__PURE__ */ React__default.createElement(BaseSnackbar, { show: true, variants: { intent: variants?.intent } }, /* @__PURE__ */ React__default.createElement("div", { className: "flex justify-between items-center flex-row gap-x-mili" }, /* @__PURE__ */ React__default.createElement(
|
|
10
10
|
IoMdInformationCircleOutline,
|
|
11
11
|
{
|
|
12
12
|
className: "w-[20px] h-[20px] shrink-0",
|
|
13
13
|
"data-testid": "icon-info"
|
|
14
14
|
}
|
|
15
|
-
), /* @__PURE__ */
|
|
15
|
+
), /* @__PURE__ */ React__default.createElement("p", null, text), /* @__PURE__ */ React__default.createElement(
|
|
16
16
|
IoMdClose,
|
|
17
17
|
{
|
|
18
18
|
"data-testid": "icon-close",
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import { tHead, tRow, tHeadCell, hr, tCell, tFoot, tRoot } from '@tecsinapse/cortex-core';
|
|
2
|
-
import
|
|
2
|
+
import React__default from 'react';
|
|
3
3
|
|
|
4
4
|
const THead = ({
|
|
5
5
|
children,
|
|
6
6
|
className,
|
|
7
7
|
...rest
|
|
8
|
-
}) => /* @__PURE__ */
|
|
8
|
+
}) => /* @__PURE__ */ React__default.createElement("thead", { className: tHead({ className }), "data-testid": "thead", ...rest }, children);
|
|
9
9
|
const TRow = ({
|
|
10
10
|
children,
|
|
11
11
|
className,
|
|
12
12
|
...rest
|
|
13
|
-
}) => /* @__PURE__ */
|
|
13
|
+
}) => /* @__PURE__ */ React__default.createElement("tr", { className: tRow({ className }), "data-testid": "trow", ...rest }, children);
|
|
14
14
|
const THeadCell = ({
|
|
15
15
|
children,
|
|
16
16
|
className,
|
|
17
17
|
...rest
|
|
18
|
-
}) => /* @__PURE__ */
|
|
18
|
+
}) => /* @__PURE__ */ React__default.createElement("th", { className: tHeadCell({ className }), "data-testid": "thead-cell", ...rest }, children);
|
|
19
19
|
const TRowHeader = ({
|
|
20
20
|
children
|
|
21
|
-
}) => /* @__PURE__ */
|
|
21
|
+
}) => /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("tr", { className: tRow(), "data-testid": "trow-header" }, children), /* @__PURE__ */ React__default.createElement("tr", { className: tRow() }, /* @__PURE__ */ React__default.createElement("td", { colSpan: 99 }, /* @__PURE__ */ React__default.createElement("hr", { className: hr() }))));
|
|
22
22
|
const TCell = ({
|
|
23
23
|
children,
|
|
24
24
|
className,
|
|
25
25
|
...rest
|
|
26
|
-
}) => /* @__PURE__ */
|
|
26
|
+
}) => /* @__PURE__ */ React__default.createElement("td", { className: tCell({ className }), "data-testid": "tcell", ...rest }, children);
|
|
27
27
|
const TFoot = ({
|
|
28
28
|
children,
|
|
29
29
|
className,
|
|
30
30
|
...rest
|
|
31
|
-
}) => /* @__PURE__ */
|
|
31
|
+
}) => /* @__PURE__ */ React__default.createElement("tfoot", { className: tFoot({ className }), "data-testid": "tfoot", ...rest }, children);
|
|
32
32
|
const Table = ({
|
|
33
33
|
children,
|
|
34
34
|
className,
|
|
35
35
|
...rest
|
|
36
|
-
}) => /* @__PURE__ */
|
|
36
|
+
}) => /* @__PURE__ */ React__default.createElement("table", { className: tRoot({ className }), "data-testid": "table", ...rest }, children);
|
|
37
37
|
const Td = ({
|
|
38
38
|
children,
|
|
39
39
|
...rest
|
|
40
|
-
}) => /* @__PURE__ */
|
|
40
|
+
}) => /* @__PURE__ */ React__default.createElement("td", { "data-testid": "td", ...rest }, children);
|
|
41
41
|
|
|
42
42
|
export { TCell, TFoot, THead, THeadCell, TRow, TRowHeader, Table, Td };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { tag } from '@tecsinapse/cortex-core';
|
|
2
|
-
import
|
|
2
|
+
import React__default, { forwardRef } from 'react';
|
|
3
3
|
|
|
4
4
|
const Tag = forwardRef((props, ref) => {
|
|
5
5
|
const { label, variants } = props;
|
|
6
|
-
return /* @__PURE__ */
|
|
6
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: tag(variants), ref }, /* @__PURE__ */ React__default.createElement("p", null, label));
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
export { Tag };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { inputBox, labelStyle } from '@tecsinapse/cortex-core';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import React__default from 'react';
|
|
4
|
+
|
|
5
|
+
const TextAreaBox = React__default.forwardRef(
|
|
6
|
+
({
|
|
7
|
+
id,
|
|
8
|
+
name,
|
|
9
|
+
variants,
|
|
10
|
+
label,
|
|
11
|
+
placeholder,
|
|
12
|
+
rows,
|
|
13
|
+
className,
|
|
14
|
+
...rest
|
|
15
|
+
}, ref) => {
|
|
16
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: "flex w-full flex-col" }, /* @__PURE__ */ React__default.createElement(
|
|
17
|
+
"textarea",
|
|
18
|
+
{
|
|
19
|
+
"data-testid": "textarea-box",
|
|
20
|
+
ref,
|
|
21
|
+
id: id ?? name,
|
|
22
|
+
name,
|
|
23
|
+
placeholder: placeholder ?? " ",
|
|
24
|
+
className: clsx(
|
|
25
|
+
inputBox(placeholder, label, className),
|
|
26
|
+
"resize-none mt-mili"
|
|
27
|
+
),
|
|
28
|
+
rows,
|
|
29
|
+
...rest
|
|
30
|
+
}
|
|
31
|
+
), /* @__PURE__ */ React__default.createElement(
|
|
32
|
+
"label",
|
|
33
|
+
{
|
|
34
|
+
htmlFor: id ?? name,
|
|
35
|
+
className: labelStyle({
|
|
36
|
+
intent: variants?.intent,
|
|
37
|
+
placeholder
|
|
38
|
+
})
|
|
39
|
+
},
|
|
40
|
+
label
|
|
41
|
+
));
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
export { TextAreaBox };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { input } from '@tecsinapse/cortex-core';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import React__default from 'react';
|
|
4
|
+
import { getValidChildren } from './utils.js';
|
|
5
|
+
|
|
6
|
+
const TextAreaFace = React__default.forwardRef(
|
|
7
|
+
({ children, variants, className, ...rest }, ref) => {
|
|
8
|
+
const clones = getValidChildren(children).map((el) => {
|
|
9
|
+
return React__default.cloneElement(el, { ...el.props, variants });
|
|
10
|
+
});
|
|
11
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
ref,
|
|
15
|
+
className: clsx(input(variants), className),
|
|
16
|
+
"data-testid": "textarea-face",
|
|
17
|
+
id: "textarea-face",
|
|
18
|
+
...rest
|
|
19
|
+
},
|
|
20
|
+
clones
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
export { TextAreaFace };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
const TextAreaLeft = React__default.forwardRef(({ children, className, ...rest }, ref) => {
|
|
5
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: clsx(className, "mr-2.5"), ...rest, ref }, children);
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export { TextAreaLeft };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
const TextAreaRight = React__default.forwardRef(({ children, className, ...rest }, ref) => {
|
|
5
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: clsx(className, "ml-2.5"), ...rest, ref }, children);
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export { TextAreaRight };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { TextAreaBox } from './Box.js';
|
|
3
|
+
import { TextAreaFace } from './Face.js';
|
|
4
|
+
|
|
5
|
+
const TextAreaRoot = React__default.forwardRef(({ variants, className, ...rest }, ref) => {
|
|
6
|
+
return /* @__PURE__ */ React__default.createElement(TextAreaFace, { variants, className }, /* @__PURE__ */ React__default.createElement(TextAreaBox, { ref, ...rest }));
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export { TextAreaRoot };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TextAreaBox } from './Box.js';
|
|
2
|
+
import { TextAreaFace } from './Face.js';
|
|
3
|
+
import { TextAreaLeft } from './Left.js';
|
|
4
|
+
import { TextAreaRight } from './Right.js';
|
|
5
|
+
import { TextAreaRoot } from './Root.js';
|
|
6
|
+
|
|
7
|
+
const TextArea = {
|
|
8
|
+
Root: TextAreaRoot,
|
|
9
|
+
Face: TextAreaFace,
|
|
10
|
+
Box: TextAreaBox,
|
|
11
|
+
Left: TextAreaLeft,
|
|
12
|
+
Right: TextAreaRight
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { TextArea };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { useTimeField } from '../../hooks/useTimeField.js';
|
|
3
3
|
import { DateSegment } from '../DatePicker/DateSegment.js';
|
|
4
4
|
|
|
5
5
|
const TimeField = (props) => {
|
|
6
6
|
const { fieldProps, ref, state } = useTimeField(props);
|
|
7
|
-
return /* @__PURE__ */
|
|
7
|
+
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 })));
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export { TimeField };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { labelStyle, inputBox } from '@tecsinapse/cortex-core';
|
|
2
|
-
import
|
|
2
|
+
import React__default from 'react';
|
|
3
3
|
import { Input } from '../Input/index.js';
|
|
4
4
|
import { TimeField } from './TimeField.js';
|
|
5
5
|
|
|
6
6
|
const TimeFieldInput = (props) => {
|
|
7
7
|
const { onChange, value, label, variants } = props;
|
|
8
|
-
return /* @__PURE__ */
|
|
8
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
|
|
9
9
|
Input.Face,
|
|
10
10
|
{
|
|
11
11
|
variants,
|
|
12
12
|
className: "flex flex-row",
|
|
13
13
|
"data-testid": "time-field-input"
|
|
14
14
|
},
|
|
15
|
-
/* @__PURE__ */
|
|
16
|
-
/* @__PURE__ */
|
|
15
|
+
/* @__PURE__ */ React__default.createElement("span", { className: labelStyle({}) }, label),
|
|
16
|
+
/* @__PURE__ */ React__default.createElement("div", { className: inputBox("", label) }, /* @__PURE__ */ React__default.createElement(TimeField, { onChange, value }))
|
|
17
17
|
));
|
|
18
18
|
};
|
|
19
19
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { styleLabelElement, styleInputElement, toggle } from '@tecsinapse/cortex-core';
|
|
2
|
-
import
|
|
2
|
+
import React__default, { forwardRef } from 'react';
|
|
3
3
|
|
|
4
4
|
const Toggle = forwardRef((props, ref) => {
|
|
5
|
-
return /* @__PURE__ */
|
|
5
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
6
6
|
"div",
|
|
7
7
|
{
|
|
8
8
|
className: "flex flex-row items-center gap-x-centi",
|
|
9
9
|
"data-testid": "toggle-div"
|
|
10
10
|
},
|
|
11
|
-
/* @__PURE__ */
|
|
11
|
+
/* @__PURE__ */ React__default.createElement("label", { className: styleLabelElement() }, /* @__PURE__ */ React__default.createElement(
|
|
12
12
|
"input",
|
|
13
13
|
{
|
|
14
14
|
type: "checkbox",
|
|
@@ -17,7 +17,7 @@ const Toggle = forwardRef((props, ref) => {
|
|
|
17
17
|
"data-testid": "toggle-input",
|
|
18
18
|
...props
|
|
19
19
|
}
|
|
20
|
-
), /* @__PURE__ */
|
|
20
|
+
), /* @__PURE__ */ React__default.createElement("div", { className: toggle() }))
|
|
21
21
|
);
|
|
22
22
|
});
|
|
23
23
|
|