@tecsinapse/cortex-react 2.2.0-beta.6 → 2.3.0-beta.0
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/Accordion/Trigger.js +6 -6
- package/dist/cjs/components/Avatar.js +1 -1
- package/dist/cjs/components/Breadcrumbs/BreadcrumbItem.js +1 -1
- package/dist/cjs/components/Calendar/CalendarGrid.js +1 -1
- package/dist/cjs/components/ColorPicker.js +18 -9
- package/dist/cjs/components/Kanban.js +1 -1
- package/dist/cjs/components/PhoneInput/FlagIcon.js +46 -0
- package/dist/cjs/components/PhoneInput/Option.js +29 -0
- package/dist/cjs/components/PhoneInput/Options.js +118 -0
- package/dist/cjs/components/PhoneInput/Popover.js +22 -0
- package/dist/cjs/components/PhoneInput/Root.js +61 -0
- package/dist/cjs/components/PhoneInput/Trigger.js +112 -0
- package/dist/cjs/components/PhoneInput/context.js +19 -0
- package/dist/cjs/components/PhoneInput/index.js +17 -0
- package/dist/cjs/components/Popover/Content.js +1 -1
- package/dist/cjs/components/Select/Popover.js +1 -1
- package/dist/cjs/components/Skeleton.js +1 -1
- package/dist/cjs/components/Stepper/Root.js +1 -1
- package/dist/cjs/components/TimePicker/TimePickerInput.js +1 -1
- package/dist/cjs/components/Uploader/Dropzone.js +3 -3
- package/dist/cjs/components/Uploader/Files.js +1 -1
- package/dist/cjs/components/Uploader/Manager.js +1 -1
- package/dist/cjs/components/Uploader/Modal.js +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/provider/ManagerContext.js +5 -3
- package/dist/cjs/service/SnackbarSonner.js +32 -0
- package/dist/cjs/styles/calendar-cell.js +2 -2
- package/dist/cjs/styles/date-picker-input-base.js +1 -1
- package/dist/cjs/styles/date-segment.js +2 -2
- package/dist/cjs/styles/groupButton.js +3 -3
- package/dist/cjs/styles/menubar.js +8 -8
- package/dist/cjs/styles/progressBar.js +1 -1
- package/dist/cjs/styles/stepNodeVariants.js +2 -2
- package/dist/cjs/styles/time-field-input.js +1 -1
- package/dist/esm/components/Accordion/Trigger.js +6 -6
- package/dist/esm/components/Avatar.js +1 -1
- package/dist/esm/components/Breadcrumbs/BreadcrumbItem.js +1 -1
- package/dist/esm/components/Calendar/CalendarGrid.js +1 -1
- package/dist/esm/components/ColorPicker.js +18 -9
- package/dist/esm/components/Kanban.js +1 -1
- package/dist/esm/components/PhoneInput/FlagIcon.js +25 -0
- package/dist/esm/components/PhoneInput/Option.js +27 -0
- package/dist/esm/components/PhoneInput/Options.js +116 -0
- package/dist/esm/components/PhoneInput/Popover.js +20 -0
- package/dist/esm/components/PhoneInput/Root.js +59 -0
- package/dist/esm/components/PhoneInput/Trigger.js +110 -0
- package/dist/esm/components/PhoneInput/context.js +16 -0
- package/dist/esm/components/PhoneInput/index.js +15 -0
- package/dist/esm/components/Popover/Content.js +1 -1
- package/dist/esm/components/Select/Popover.js +1 -1
- package/dist/esm/components/Skeleton.js +1 -1
- package/dist/esm/components/Stepper/Root.js +1 -1
- package/dist/esm/components/TimePicker/TimePickerInput.js +1 -1
- package/dist/esm/components/Uploader/Dropzone.js +3 -3
- package/dist/esm/components/Uploader/Files.js +1 -1
- package/dist/esm/components/Uploader/Manager.js +1 -1
- package/dist/esm/components/Uploader/Modal.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/provider/ManagerContext.js +5 -3
- package/dist/esm/service/SnackbarSonner.js +32 -0
- package/dist/esm/styles/calendar-cell.js +2 -2
- package/dist/esm/styles/date-picker-input-base.js +1 -1
- package/dist/esm/styles/date-segment.js +2 -2
- package/dist/esm/styles/groupButton.js +3 -3
- package/dist/esm/styles/menubar.js +8 -8
- package/dist/esm/styles/progressBar.js +1 -1
- package/dist/esm/styles/stepNodeVariants.js +2 -2
- package/dist/esm/styles/time-field-input.js +1 -1
- package/dist/types/components/PhoneInput/FlagIcon.d.ts +8 -0
- package/dist/types/components/PhoneInput/Option.d.ts +6 -0
- package/dist/types/components/PhoneInput/Options.d.ts +3 -0
- package/dist/types/components/PhoneInput/Popover.d.ts +4 -0
- package/dist/types/components/PhoneInput/Root.d.ts +2 -0
- package/dist/types/components/PhoneInput/Trigger.d.ts +2 -0
- package/dist/types/components/PhoneInput/context.d.ts +15 -0
- package/dist/types/components/PhoneInput/index.d.ts +16 -0
- package/dist/types/components/PhoneInput/types.d.ts +13 -0
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/hooks/useFileUpload.d.ts +4 -4
- package/dist/types/provider/ManagerContext.d.ts +1 -1
- package/dist/types/service/SnackbarSonner.d.ts +19 -0
- package/package.json +5 -3
- package/dist/cjs/components/Autocomplete/GroupedOptions.js +0 -32
- package/dist/cjs/components/Autocomplete/Option.js +0 -38
- package/dist/cjs/components/Autocomplete/Options.js +0 -31
- package/dist/cjs/components/Autocomplete/Popover.js +0 -34
- package/dist/cjs/components/Autocomplete/Root.js +0 -34
- package/dist/cjs/components/Autocomplete/Trigger.js +0 -48
- package/dist/cjs/components/Autocomplete/context.js +0 -9
- package/dist/cjs/components/Autocomplete/index.js +0 -19
- package/dist/cjs/hooks/useAutocompleteGroupedOptions.js +0 -35
- package/dist/cjs/hooks/useAutocompleteOptions.js +0 -35
- package/dist/esm/components/Autocomplete/GroupedOptions.js +0 -30
- package/dist/esm/components/Autocomplete/Option.js +0 -36
- package/dist/esm/components/Autocomplete/Options.js +0 -29
- package/dist/esm/components/Autocomplete/Popover.js +0 -32
- package/dist/esm/components/Autocomplete/Root.js +0 -32
- package/dist/esm/components/Autocomplete/Trigger.js +0 -46
- package/dist/esm/components/Autocomplete/context.js +0 -7
- package/dist/esm/components/Autocomplete/index.js +0 -17
- package/dist/esm/hooks/useAutocompleteGroupedOptions.js +0 -33
- package/dist/esm/hooks/useAutocompleteOptions.js +0 -33
- package/dist/types/components/Autocomplete/GroupedOptions.d.ts +0 -2
- package/dist/types/components/Autocomplete/Option.d.ts +0 -2
- package/dist/types/components/Autocomplete/Options.d.ts +0 -2
- package/dist/types/components/Autocomplete/Popover.d.ts +0 -2
- package/dist/types/components/Autocomplete/Root.d.ts +0 -2
- package/dist/types/components/Autocomplete/Trigger.d.ts +0 -2
- package/dist/types/components/Autocomplete/context.d.ts +0 -9
- package/dist/types/components/Autocomplete/index.d.ts +0 -9
- package/dist/types/components/Autocomplete/types.d.ts +0 -46
- package/dist/types/hooks/useAutocompleteGroupedOptions.d.ts +0 -10
- package/dist/types/hooks/useAutocompleteOptions.d.ts +0 -10
|
@@ -35,7 +35,7 @@ const AccordionTrigger = ({
|
|
|
35
35
|
"div",
|
|
36
36
|
{
|
|
37
37
|
className: clsx(
|
|
38
|
-
"flex justify-between align-center border-
|
|
38
|
+
"flex justify-between align-center border-content-minimal cursor-pointer",
|
|
39
39
|
{ "mr-deca": floating && direction === "horizontal" },
|
|
40
40
|
{ "mb-deca": floating && direction === "vertical" },
|
|
41
41
|
{ "border-r flex-col px-mili": direction === "horizontal" },
|
|
@@ -47,12 +47,12 @@ const AccordionTrigger = ({
|
|
|
47
47
|
"div",
|
|
48
48
|
{
|
|
49
49
|
className: clsx(
|
|
50
|
-
"rounded-mili border border-
|
|
50
|
+
"rounded-mili border border-content-minimal flex align-center justify-center p-micro",
|
|
51
51
|
{
|
|
52
|
-
"absolute -translate-x-micro translate-y-deca bg-
|
|
52
|
+
"absolute -translate-x-micro translate-y-deca bg-surface-overlay": floating && direction === "horizontal"
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
|
-
"absolute -translate-y-micro translate-x-deca bg-
|
|
55
|
+
"absolute -translate-y-micro translate-x-deca bg-surface-overlay": floating && direction === "vertical"
|
|
56
56
|
},
|
|
57
57
|
className
|
|
58
58
|
),
|
|
@@ -60,7 +60,7 @@ const AccordionTrigger = ({
|
|
|
60
60
|
lia.LiaAngleRightSolid,
|
|
61
61
|
{
|
|
62
62
|
className: clsx(
|
|
63
|
-
"text-
|
|
63
|
+
"text-content-low transition-transform duration-200",
|
|
64
64
|
{
|
|
65
65
|
"rotate-180": invertedArrow ? !open : open
|
|
66
66
|
}
|
|
@@ -70,7 +70,7 @@ const AccordionTrigger = ({
|
|
|
70
70
|
lia.LiaAngleDownSolid,
|
|
71
71
|
{
|
|
72
72
|
className: clsx(
|
|
73
|
-
"text-
|
|
73
|
+
"text-content-low transition-transform duration-200",
|
|
74
74
|
{
|
|
75
75
|
"rotate-180": invertedArrow ? !open : open
|
|
76
76
|
}
|
|
@@ -16,7 +16,7 @@ const Avatar = ({ src, name, className, ...rest }) => {
|
|
|
16
16
|
{
|
|
17
17
|
...rest,
|
|
18
18
|
className: clsx(
|
|
19
|
-
"rounded-pill bg-
|
|
19
|
+
"rounded-pill bg-content-medium h-mega flex items-center justify-center cursor-pointer aspect-square",
|
|
20
20
|
className
|
|
21
21
|
),
|
|
22
22
|
children: src && !hasError ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -17,7 +17,7 @@ const BreadcrumbItem = ({
|
|
|
17
17
|
{
|
|
18
18
|
className: clsx(
|
|
19
19
|
"no-underline",
|
|
20
|
-
isLast ? "text-
|
|
20
|
+
isLast ? "text-content-low cursor-default" : "text-content-medium cursor-pointer"
|
|
21
21
|
),
|
|
22
22
|
children: title
|
|
23
23
|
}
|
|
@@ -23,7 +23,7 @@ const CalendarGrid = ({ state }) => {
|
|
|
23
23
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
24
24
|
"div",
|
|
25
25
|
{
|
|
26
|
-
className: "bg-
|
|
26
|
+
className: "bg-surface-overlay rounded-micro px-deca py-mili",
|
|
27
27
|
"data-testid": "calendar-grid",
|
|
28
28
|
children: /* @__PURE__ */ jsxRuntime.jsxs("table", { ...gridProps, className: "border-separate border-spacing-y-nano", children: [
|
|
29
29
|
/* @__PURE__ */ jsxRuntime.jsx("thead", { ...headerProps, children: /* @__PURE__ */ jsxRuntime.jsx(CalendarGridHeaderRow.CalendarGridHeaderRow, { weekDays }) }),
|
|
@@ -6,19 +6,28 @@ var React = require('react');
|
|
|
6
6
|
|
|
7
7
|
const Box = React.forwardRef((props, ref) => {
|
|
8
8
|
const { id, className, ...rest } = props;
|
|
9
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10
|
-
"
|
|
9
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10
|
+
"div",
|
|
11
11
|
{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
className: clsx(
|
|
13
|
+
"w-tera h-kilo border overflow-hidden relative",
|
|
14
|
+
className
|
|
15
|
+
),
|
|
16
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17
|
+
"input",
|
|
18
|
+
{
|
|
19
|
+
...rest,
|
|
20
|
+
id,
|
|
21
|
+
type: "color",
|
|
22
|
+
className: "bg-transparent cursor-pointer disabled:opacity-50 disabled:cursor-default absolute -top-1.5 -right-1 w-peta h-giga",
|
|
23
|
+
ref
|
|
24
|
+
}
|
|
25
|
+
)
|
|
17
26
|
}
|
|
18
|
-
)
|
|
27
|
+
);
|
|
19
28
|
});
|
|
20
29
|
const Face = ({ children }) => {
|
|
21
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-mili p-mili shadow-default bg-
|
|
30
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-mili p-mili shadow-default bg-default flex flex-row items-center gap-2", children });
|
|
22
31
|
};
|
|
23
32
|
const Label = ({
|
|
24
33
|
children,
|
|
@@ -9,7 +9,7 @@ const Root = ({ children, className, ...rest }) => {
|
|
|
9
9
|
{
|
|
10
10
|
...rest,
|
|
11
11
|
className: clsx.clsx(
|
|
12
|
-
"border border-dashed border-
|
|
12
|
+
"border border-dashed border-content-low rounded-mili bg-content-inverse overflow-hidden",
|
|
13
13
|
className
|
|
14
14
|
),
|
|
15
15
|
children
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var Flags = require('country-flag-icons/react/3x2');
|
|
5
|
+
|
|
6
|
+
function _interopNamespaceDefault(e) {
|
|
7
|
+
var n = Object.create(null);
|
|
8
|
+
if (e) {
|
|
9
|
+
Object.keys(e).forEach(function (k) {
|
|
10
|
+
if (k !== 'default') {
|
|
11
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return e[k]; }
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
n.default = e;
|
|
20
|
+
return Object.freeze(n);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var Flags__namespace = /*#__PURE__*/_interopNamespaceDefault(Flags);
|
|
24
|
+
|
|
25
|
+
const FlagIcon = ({
|
|
26
|
+
countryCode,
|
|
27
|
+
className = "w-[25px]",
|
|
28
|
+
title
|
|
29
|
+
}) => {
|
|
30
|
+
if (!countryCode) return null;
|
|
31
|
+
const upperCode = countryCode.toUpperCase();
|
|
32
|
+
const FlagComponent = Flags__namespace[upperCode];
|
|
33
|
+
if (!FlagComponent) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37
|
+
FlagComponent,
|
|
38
|
+
{
|
|
39
|
+
className,
|
|
40
|
+
title: title || upperCode,
|
|
41
|
+
"aria-label": `Flag of ${upperCode}`
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
exports.FlagIcon = FlagIcon;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
|
|
5
|
+
const PhoneInputOption = ({
|
|
6
|
+
country,
|
|
7
|
+
handleSelectCountry,
|
|
8
|
+
disableClick = false
|
|
9
|
+
}) => {
|
|
10
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11
|
+
"button",
|
|
12
|
+
{
|
|
13
|
+
className: "flex w-full h-[2rem] items-center justify-between p-centi cursor-pointer hover:bg-content-inverse bg-inherit",
|
|
14
|
+
onClick: () => {
|
|
15
|
+
handleSelectCountry(country);
|
|
16
|
+
},
|
|
17
|
+
disabled: disableClick,
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: country?.name }),
|
|
20
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-content-minimal text-sm", children: [
|
|
21
|
+
"+",
|
|
22
|
+
country?.dialCode
|
|
23
|
+
] })
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
exports.PhoneInputOption = PhoneInputOption;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var Divider = require('../Divider.js');
|
|
6
|
+
var context = require('./context.js');
|
|
7
|
+
var Option = require('./Option.js');
|
|
8
|
+
require('clsx');
|
|
9
|
+
require('../Accordion/context.js');
|
|
10
|
+
require('react-icons/lia');
|
|
11
|
+
require('@internationalized/date');
|
|
12
|
+
require('../Badge.js');
|
|
13
|
+
require('react-icons/md');
|
|
14
|
+
require('@tecsinapse/cortex-core');
|
|
15
|
+
require('react-aria');
|
|
16
|
+
require('react-stately');
|
|
17
|
+
require('../../provider/MenubarContext.js');
|
|
18
|
+
require('../../provider/SnackbarProvider.js');
|
|
19
|
+
require('../../provider/CalendarProvider.js');
|
|
20
|
+
require('../../provider/ManagerContext.js');
|
|
21
|
+
require('../Popover/Context.js');
|
|
22
|
+
require('react-dropzone');
|
|
23
|
+
require('uuid');
|
|
24
|
+
require('@floating-ui/react');
|
|
25
|
+
require('currency.js');
|
|
26
|
+
require('../Calendar/CalendarCell.js');
|
|
27
|
+
require('react-icons/fa');
|
|
28
|
+
require('react-icons/io');
|
|
29
|
+
require('embla-carousel-react');
|
|
30
|
+
require('embla-carousel-autoplay');
|
|
31
|
+
require('../ColorPicker.js');
|
|
32
|
+
require('../DatePicker/DateSegment.js');
|
|
33
|
+
require('../DatePicker/DatePickerInputBase.js');
|
|
34
|
+
require('../GroupButton.js');
|
|
35
|
+
var index = require('../Input/index.js');
|
|
36
|
+
require('../Menubar/Left.js');
|
|
37
|
+
require('../../styles/menubar.js');
|
|
38
|
+
require('../Menubar/Right.js');
|
|
39
|
+
require('../Menubar/Dropdown.js');
|
|
40
|
+
require('../Menubar/MostUsed.js');
|
|
41
|
+
require('../Menubar/MostUsedItem.js');
|
|
42
|
+
require('../Menubar/Header.js');
|
|
43
|
+
require('../Menubar/Item.js');
|
|
44
|
+
require('../../provider/CategoriesContext.js');
|
|
45
|
+
require('../Menubar/SubItem.js');
|
|
46
|
+
require('../ProgressBar/Progress.js');
|
|
47
|
+
require('../RadioButton.js');
|
|
48
|
+
require('../Select/GroupedOptions.js');
|
|
49
|
+
require('../Select/context.js');
|
|
50
|
+
require('../Select/MultiGroupedOptions.js');
|
|
51
|
+
require('../Select/MultiOptions.js');
|
|
52
|
+
require('../Select/Options.js');
|
|
53
|
+
require('../Select/Trigger.js');
|
|
54
|
+
require('../../styles/stepNodeVariants.js');
|
|
55
|
+
require('../TextArea/Box.js');
|
|
56
|
+
require('../TextArea/Face.js');
|
|
57
|
+
require('../TextArea/Left.js');
|
|
58
|
+
require('../TextArea/Right.js');
|
|
59
|
+
require('../TextArea/Root.js');
|
|
60
|
+
require('../TimePicker/TimeFieldInput.js');
|
|
61
|
+
require('../Tooltip.js');
|
|
62
|
+
require('react-icons/hi2');
|
|
63
|
+
require('react-icons/fa6');
|
|
64
|
+
require('react-dom');
|
|
65
|
+
require('react-icons/io5');
|
|
66
|
+
var reactInternationalPhone = require('react-international-phone');
|
|
67
|
+
require('country-flag-icons/react/3x2');
|
|
68
|
+
|
|
69
|
+
const countries = reactInternationalPhone.defaultCountries.map((c) => {
|
|
70
|
+
return reactInternationalPhone.parseCountry(c);
|
|
71
|
+
});
|
|
72
|
+
const PhoneInputOptions = ({
|
|
73
|
+
hasSearch = true
|
|
74
|
+
}) => {
|
|
75
|
+
const { country, setCountry, setIsOpen } = context.usePhoneContext();
|
|
76
|
+
const [searchText, setSearchText] = React.useState("");
|
|
77
|
+
const filteredCountries = React.useMemo(() => {
|
|
78
|
+
return countries.filter(
|
|
79
|
+
(c) => c.iso2 !== country?.iso2 && (c.name.toLowerCase().includes(searchText.toLowerCase()) || c.dialCode.includes(searchText))
|
|
80
|
+
);
|
|
81
|
+
}, [country, searchText]);
|
|
82
|
+
const handleSelect = (country2) => {
|
|
83
|
+
setCountry?.(country2.iso2);
|
|
84
|
+
setIsOpen?.(false);
|
|
85
|
+
};
|
|
86
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full h-full flex flex-col overflow-y-auto", children: [
|
|
87
|
+
hasSearch ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
88
|
+
index.Input.Search,
|
|
89
|
+
{
|
|
90
|
+
onChange: (e) => setSearchText(e.target.value),
|
|
91
|
+
variants: { className: "mx-deca my-centi outline-none" }
|
|
92
|
+
}
|
|
93
|
+
) : null,
|
|
94
|
+
country ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
95
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
96
|
+
Option.PhoneInputOption,
|
|
97
|
+
{
|
|
98
|
+
country,
|
|
99
|
+
handleSelectCountry: handleSelect,
|
|
100
|
+
disableClick: true
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
/* @__PURE__ */ jsxRuntime.jsx(Divider.Divider, {})
|
|
104
|
+
] }) : null,
|
|
105
|
+
filteredCountries.map((country2) => {
|
|
106
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
107
|
+
Option.PhoneInputOption,
|
|
108
|
+
{
|
|
109
|
+
country: country2,
|
|
110
|
+
handleSelectCountry: handleSelect
|
|
111
|
+
},
|
|
112
|
+
`${country2.dialCode} ${country2.iso2}`
|
|
113
|
+
);
|
|
114
|
+
})
|
|
115
|
+
] });
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
exports.PhoneInputOptions = PhoneInputOptions;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var react = require('@floating-ui/react');
|
|
5
|
+
var index = require('../Popover/index.js');
|
|
6
|
+
var context = require('./context.js');
|
|
7
|
+
|
|
8
|
+
const PhoneInputPopover = ({ children }) => {
|
|
9
|
+
const { triggerWidth } = context.usePhoneContext();
|
|
10
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.FloatingPortal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11
|
+
index.Popover.Content,
|
|
12
|
+
{
|
|
13
|
+
className: "bg-surface-overlay shadow-md rounded-md overflow-hidden h-full max-h-[30vh] outline-none z-9999",
|
|
14
|
+
style: {
|
|
15
|
+
width: triggerWidth ? `${triggerWidth}px` : "auto"
|
|
16
|
+
},
|
|
17
|
+
children
|
|
18
|
+
}
|
|
19
|
+
) });
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
exports.PhoneInputPopover = PhoneInputPopover;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var index = require('../Popover/index.js');
|
|
6
|
+
var clsx = require('clsx');
|
|
7
|
+
var reactInternationalPhone = require('react-international-phone');
|
|
8
|
+
var context = require('./context.js');
|
|
9
|
+
|
|
10
|
+
const PhoneInputRoot = ({
|
|
11
|
+
children,
|
|
12
|
+
className,
|
|
13
|
+
onChange,
|
|
14
|
+
...rest
|
|
15
|
+
}) => {
|
|
16
|
+
const [triggerWidth, setTriggerWidth] = React.useState();
|
|
17
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
18
|
+
const {
|
|
19
|
+
country,
|
|
20
|
+
handlePhoneValueChange,
|
|
21
|
+
inputRef,
|
|
22
|
+
inputValue,
|
|
23
|
+
phone,
|
|
24
|
+
setCountry
|
|
25
|
+
} = reactInternationalPhone.usePhoneInput({
|
|
26
|
+
countries: reactInternationalPhone.defaultCountries,
|
|
27
|
+
onChange: ({ phone: phone2, ...rest2 }) => {
|
|
28
|
+
onChange?.(phone2, { ...rest2 });
|
|
29
|
+
},
|
|
30
|
+
...rest
|
|
31
|
+
});
|
|
32
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
33
|
+
index.Popover.Root,
|
|
34
|
+
{
|
|
35
|
+
placement: "bottom-start",
|
|
36
|
+
controlled: true,
|
|
37
|
+
isOpen,
|
|
38
|
+
setIsOpen,
|
|
39
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
40
|
+
context.PhoneInputContext.Provider,
|
|
41
|
+
{
|
|
42
|
+
value: {
|
|
43
|
+
triggerWidth,
|
|
44
|
+
setTriggerWidth,
|
|
45
|
+
isOpen,
|
|
46
|
+
setIsOpen,
|
|
47
|
+
country,
|
|
48
|
+
setCountry,
|
|
49
|
+
handlePhoneValueChange,
|
|
50
|
+
inputValue,
|
|
51
|
+
phone,
|
|
52
|
+
inputRef
|
|
53
|
+
},
|
|
54
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx("relative w-full h-full", className), children })
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
exports.PhoneInputRoot = PhoneInputRoot;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var io5 = require('react-icons/io5');
|
|
5
|
+
require('clsx');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
require('../Accordion/context.js');
|
|
8
|
+
require('react-icons/lia');
|
|
9
|
+
require('@internationalized/date');
|
|
10
|
+
require('../Badge.js');
|
|
11
|
+
require('react-icons/md');
|
|
12
|
+
require('@tecsinapse/cortex-core');
|
|
13
|
+
require('react-aria');
|
|
14
|
+
require('react-stately');
|
|
15
|
+
require('../../provider/MenubarContext.js');
|
|
16
|
+
require('../../provider/SnackbarProvider.js');
|
|
17
|
+
require('../../provider/CalendarProvider.js');
|
|
18
|
+
require('../../provider/ManagerContext.js');
|
|
19
|
+
require('../Popover/Context.js');
|
|
20
|
+
require('react-dropzone');
|
|
21
|
+
require('uuid');
|
|
22
|
+
require('@floating-ui/react');
|
|
23
|
+
require('currency.js');
|
|
24
|
+
require('../Calendar/CalendarCell.js');
|
|
25
|
+
require('react-icons/fa');
|
|
26
|
+
require('react-icons/io');
|
|
27
|
+
require('embla-carousel-react');
|
|
28
|
+
require('embla-carousel-autoplay');
|
|
29
|
+
require('../ColorPicker.js');
|
|
30
|
+
require('../DatePicker/DateSegment.js');
|
|
31
|
+
var index = require('../Popover/index.js');
|
|
32
|
+
require('../DatePicker/DatePickerInputBase.js');
|
|
33
|
+
require('../GroupButton.js');
|
|
34
|
+
var index$1 = require('../Input/index.js');
|
|
35
|
+
require('../Menubar/Left.js');
|
|
36
|
+
require('../../styles/menubar.js');
|
|
37
|
+
require('../Menubar/Right.js');
|
|
38
|
+
require('../Menubar/Dropdown.js');
|
|
39
|
+
require('../Menubar/MostUsed.js');
|
|
40
|
+
require('../Menubar/MostUsedItem.js');
|
|
41
|
+
require('../Menubar/Header.js');
|
|
42
|
+
require('../Menubar/Item.js');
|
|
43
|
+
require('../../provider/CategoriesContext.js');
|
|
44
|
+
require('../Menubar/SubItem.js');
|
|
45
|
+
require('../ProgressBar/Progress.js');
|
|
46
|
+
require('../RadioButton.js');
|
|
47
|
+
require('../Select/GroupedOptions.js');
|
|
48
|
+
require('../Select/context.js');
|
|
49
|
+
require('../Select/MultiGroupedOptions.js');
|
|
50
|
+
require('../Select/MultiOptions.js');
|
|
51
|
+
require('../Select/Options.js');
|
|
52
|
+
require('../Select/Trigger.js');
|
|
53
|
+
require('../../styles/stepNodeVariants.js');
|
|
54
|
+
require('../TextArea/Box.js');
|
|
55
|
+
require('../TextArea/Face.js');
|
|
56
|
+
require('../TextArea/Left.js');
|
|
57
|
+
require('../TextArea/Right.js');
|
|
58
|
+
require('../TextArea/Root.js');
|
|
59
|
+
require('../TimePicker/TimeFieldInput.js');
|
|
60
|
+
require('../Tooltip.js');
|
|
61
|
+
require('react-icons/hi2');
|
|
62
|
+
require('react-icons/fa6');
|
|
63
|
+
require('react-dom');
|
|
64
|
+
require('./Options.js');
|
|
65
|
+
var context = require('./context.js');
|
|
66
|
+
require('react-international-phone');
|
|
67
|
+
var FlagIcon = require('./FlagIcon.js');
|
|
68
|
+
|
|
69
|
+
const PhoneInputTrigger = ({
|
|
70
|
+
disabled = false,
|
|
71
|
+
label,
|
|
72
|
+
...rest
|
|
73
|
+
}) => {
|
|
74
|
+
const {
|
|
75
|
+
setIsOpen,
|
|
76
|
+
setTriggerWidth,
|
|
77
|
+
country,
|
|
78
|
+
handlePhoneValueChange,
|
|
79
|
+
inputValue
|
|
80
|
+
} = context.usePhoneContext();
|
|
81
|
+
const triggerRef = React.useRef(null);
|
|
82
|
+
React.useEffect(() => {
|
|
83
|
+
if (triggerRef.current && setTriggerWidth) {
|
|
84
|
+
const width = triggerRef.current.getBoundingClientRect().width;
|
|
85
|
+
setTriggerWidth(width);
|
|
86
|
+
}
|
|
87
|
+
}, [triggerRef.current, setTriggerWidth]);
|
|
88
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index.Popover.Trigger, { disabled, children: /* @__PURE__ */ jsxRuntime.jsxs(index$1.Input.Face, { ref: triggerRef, children: [
|
|
89
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
90
|
+
index$1.Input.Box,
|
|
91
|
+
{
|
|
92
|
+
value: inputValue,
|
|
93
|
+
onChange: handlePhoneValueChange,
|
|
94
|
+
label: label ?? "Insert a phone number",
|
|
95
|
+
...rest
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
/* @__PURE__ */ jsxRuntime.jsx(index$1.Input.Right, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
99
|
+
"div",
|
|
100
|
+
{
|
|
101
|
+
className: "flex items-center gap-1 cursor-pointer w-full",
|
|
102
|
+
onClick: () => setIsOpen?.(true),
|
|
103
|
+
children: [
|
|
104
|
+
country ? /* @__PURE__ */ jsxRuntime.jsx(FlagIcon.FlagIcon, { countryCode: country.iso2, className: "w-[25px]" }) : null,
|
|
105
|
+
/* @__PURE__ */ jsxRuntime.jsx(io5.IoChevronDown, { className: "h-full text-md" })
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
) })
|
|
109
|
+
] }) });
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
exports.PhoneInputTrigger = PhoneInputTrigger;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
|
|
5
|
+
const PhoneInputContext = React.createContext(
|
|
6
|
+
null
|
|
7
|
+
);
|
|
8
|
+
const usePhoneContext = () => {
|
|
9
|
+
const context = React.useContext(PhoneInputContext);
|
|
10
|
+
if (!context) {
|
|
11
|
+
throw new Error(
|
|
12
|
+
"usePhoneInputContext must be used within a usePhoneInputProvider"
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
return context;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
exports.PhoneInputContext = PhoneInputContext;
|
|
19
|
+
exports.usePhoneContext = usePhoneContext;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Option = require('./Option.js');
|
|
4
|
+
var Options = require('./Options.js');
|
|
5
|
+
var Popover = require('./Popover.js');
|
|
6
|
+
var Root = require('./Root.js');
|
|
7
|
+
var Trigger = require('./Trigger.js');
|
|
8
|
+
|
|
9
|
+
const PhoneInput = {
|
|
10
|
+
Root: Root.PhoneInputRoot,
|
|
11
|
+
Popover: Popover.PhoneInputPopover,
|
|
12
|
+
Trigger: Trigger.PhoneInputTrigger,
|
|
13
|
+
Option: Option.PhoneInputOption,
|
|
14
|
+
Options: Options.PhoneInputOptions
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
exports.PhoneInput = PhoneInput;
|
|
@@ -28,7 +28,7 @@ const PopoverContent = ({
|
|
|
28
28
|
ref: refs.setFloating,
|
|
29
29
|
...getFloatingProps(),
|
|
30
30
|
className: clsx(
|
|
31
|
-
"border border-gray-200 bg-
|
|
31
|
+
"border border-gray-200 bg-surface-inverse p-0 rounded-md shadow-default z-popover",
|
|
32
32
|
className
|
|
33
33
|
),
|
|
34
34
|
style: {
|
|
@@ -11,7 +11,7 @@ const SelectPopover = ({ children }) => {
|
|
|
11
11
|
return /* @__PURE__ */ jsxRuntime.jsx(react.FloatingPortal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12
12
|
index.Popover.Content,
|
|
13
13
|
{
|
|
14
|
-
className: "bg-
|
|
14
|
+
className: "bg-surface-overlay max-h-[30vh] overflow-y-auto gap-y-mili flex flex-col p-0",
|
|
15
15
|
style: {
|
|
16
16
|
width: triggerWidth ? `${triggerWidth}px` : "auto",
|
|
17
17
|
zIndex: 9999
|
|
@@ -62,7 +62,7 @@ const TimePickerInputWithPopover = (props) => {
|
|
|
62
62
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
63
63
|
index.Popover.Content,
|
|
64
64
|
{
|
|
65
|
-
className: "bg-
|
|
65
|
+
className: "bg-surface-overlay shadow-default border-none p-deca flex flex-col",
|
|
66
66
|
initialFocus: -1,
|
|
67
67
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
68
68
|
TimePickerSelector.TimePickerSelector,
|
|
@@ -19,7 +19,7 @@ const Dropzone = ({
|
|
|
19
19
|
{
|
|
20
20
|
...getRootProps(),
|
|
21
21
|
className: clsx(
|
|
22
|
-
"bg-
|
|
22
|
+
"bg-surface-overlay w-full border-dashed border-2 p-deca flex flex-col justify-center rounded-mili overflow-auto h-[18rem]",
|
|
23
23
|
{
|
|
24
24
|
"border-success-medium bg-gray-100": isDragActive
|
|
25
25
|
}
|
|
@@ -27,7 +27,7 @@ const Dropzone = ({
|
|
|
27
27
|
children: [
|
|
28
28
|
/* @__PURE__ */ jsxRuntime.jsx("input", { ...getInputProps() }),
|
|
29
29
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col justify-center text-center items-center", children: [
|
|
30
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
30
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
|
|
31
31
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
32
32
|
hi2.HiOutlineCloudArrowUp,
|
|
33
33
|
{
|
|
@@ -38,7 +38,7 @@ const Dropzone = ({
|
|
|
38
38
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-lg font-semibold", "data-testid": "select-dropzone", children: selectFileText })
|
|
39
39
|
] }),
|
|
40
40
|
hasButton ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-centi", children: [
|
|
41
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-
|
|
41
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-content-low", children: dropText }),
|
|
42
42
|
isFileLimitReached ? /* @__PURE__ */ jsxRuntime.jsx(Tooltip.Tooltip, { text: "Voc\xEA s\xF3 pode selecionar um \xFAnico arquivo.", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
43
43
|
"button",
|
|
44
44
|
{
|
|
@@ -8,7 +8,7 @@ const Files = ({
|
|
|
8
8
|
onDelete,
|
|
9
9
|
uploadProgressText = "Upload(s) in progress"
|
|
10
10
|
}) => {
|
|
11
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-
|
|
11
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-surface-overlay w-full border-2 p-deca flex flex-col overflow-y-auto rounded-mili h-[18rem]", children: [
|
|
12
12
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-mili items-center mb-deca", children: [
|
|
13
13
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center w-deca h-deca bg-primary-medium rounded-full text-micro text-white", children: `${files.length}` }),
|
|
14
14
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-md font-semibold", "data-testid": "upload-progress", children: uploadProgressText })
|
|
@@ -47,7 +47,7 @@ const Manager = ({
|
|
|
47
47
|
children: min ? /* @__PURE__ */ jsxRuntime.jsx(io5.IoChevronUp, {}) : /* @__PURE__ */ jsxRuntime.jsx(io5.IoChevronDown, {})
|
|
48
48
|
}
|
|
49
49
|
),
|
|
50
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { "data-testid": "upload-progress", children: isLoading ? uploadProgressText : uploadSuccessText }),
|
|
50
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { "data-testid": "upload-progress", className: "font-bold text-h4", children: isLoading ? uploadProgressText : uploadSuccessText }),
|
|
51
51
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
52
52
|
Button.Button,
|
|
53
53
|
{
|
|
@@ -18,7 +18,7 @@ const Modal = ({
|
|
|
18
18
|
{
|
|
19
19
|
open,
|
|
20
20
|
onClose,
|
|
21
|
-
className: "flex flex-col bg-
|
|
21
|
+
className: "flex flex-col bg-surface-base rounded-mili min-w-[70vw] max-w-[95vh] max-h-[95vh] overflow-auto text-default",
|
|
22
22
|
children: [
|
|
23
23
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full items-center justify-between mb-deca", children: [
|
|
24
24
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-deca font-semibold ml-tera flex-1 text-center", children: title }),
|