@tecsinapse/cortex-react 1.3.0-beta.2 → 1.3.0-beta.3
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/Calendar.js +1 -0
- package/dist/cjs/components/CalendarCell.js +1 -0
- package/dist/cjs/components/CalendarGrid.js +1 -0
- package/dist/cjs/components/DatePickerInput.js +1 -0
- package/dist/cjs/components/DatePickerInputBase.js +2 -2
- package/dist/cjs/components/DateRangePickerInput.js +1 -0
- package/dist/cjs/components/Input/Box.js +32 -0
- package/dist/cjs/components/Input/Face.js +30 -0
- package/dist/cjs/components/Input/Left.js +12 -0
- package/dist/cjs/components/Input/Right.js +12 -0
- package/dist/cjs/components/Input/Root.js +13 -0
- package/dist/cjs/components/Input/Search.js +25 -0
- package/dist/cjs/components/Input/index.js +19 -0
- package/dist/cjs/components/Popover/Popover.js +13 -0
- package/dist/cjs/components/Popover/PopoverContent.js +28 -0
- package/dist/cjs/components/Popover/PopoverContext.js +29 -0
- package/dist/cjs/components/Popover/PopoverRoot.js +10 -0
- package/dist/cjs/components/Popover/PopoverTrigger.js +11 -0
- package/dist/cjs/components/RangeCalendar.js +1 -0
- package/dist/cjs/components/Select/Root.js +1 -0
- package/dist/cjs/components/TimeFieldInput.js +2 -2
- package/dist/cjs/components/Tooltip.js +47 -0
- package/dist/cjs/hooks/useFloatingLogic.js +53 -0
- package/dist/cjs/index.js +23 -27
- package/dist/cjs/service/SnackbarSonner.js +9 -4
- package/dist/esm/components/Calendar.js +1 -0
- package/dist/esm/components/CalendarCell.js +1 -0
- package/dist/esm/components/CalendarGrid.js +1 -0
- package/dist/esm/components/DatePickerInput.js +1 -0
- package/dist/esm/components/DatePickerInputBase.js +1 -1
- package/dist/esm/components/DateRangePickerInput.js +1 -0
- package/dist/esm/components/Input/Box.js +30 -0
- package/dist/esm/components/Input/Face.js +28 -0
- package/dist/esm/components/Input/Left.js +10 -0
- package/dist/esm/components/Input/Right.js +10 -0
- package/dist/esm/components/Input/Root.js +11 -0
- package/dist/esm/components/Input/Search.js +23 -0
- package/dist/esm/components/Input/index.js +17 -0
- package/dist/esm/components/Popover/Popover.js +11 -0
- package/dist/esm/components/Popover/PopoverContent.js +26 -0
- package/dist/esm/components/Popover/PopoverContext.js +26 -0
- package/dist/esm/components/Popover/PopoverRoot.js +8 -0
- package/dist/esm/components/Popover/PopoverTrigger.js +9 -0
- package/dist/esm/components/RangeCalendar.js +1 -0
- package/dist/esm/components/Select/Root.js +1 -0
- package/dist/esm/components/TimeFieldInput.js +1 -1
- package/dist/esm/components/Tooltip.js +45 -0
- package/dist/esm/hooks/useFloatingLogic.js +51 -0
- package/dist/esm/index.js +11 -12
- package/dist/esm/service/SnackbarSonner.js +9 -4
- package/dist/types/components/Input/Box.d.ts +3 -0
- package/dist/types/components/Input/Face.d.ts +3 -0
- package/dist/types/components/Input/Left.d.ts +3 -0
- package/dist/types/components/Input/Right.d.ts +3 -0
- package/dist/types/components/Input/Root.d.ts +3 -0
- package/dist/types/components/Input/Search.d.ts +3 -0
- package/dist/types/components/Input/index.d.ts +9 -0
- package/dist/types/components/Input/types.d.ts +20 -0
- package/dist/types/components/Popover/Popover.d.ts +5 -0
- package/dist/types/components/Popover/PopoverContent.d.ts +7 -0
- package/dist/types/components/Popover/PopoverContext.d.ts +22 -0
- package/dist/types/components/Popover/PopoverRoot.d.ts +9 -0
- package/dist/types/components/Popover/PopoverTrigger.d.ts +6 -0
- package/dist/types/components/Popover/index.d.ts +3 -0
- package/dist/types/components/Tooltip.d.ts +13 -0
- package/dist/types/components/index.d.ts +9 -1
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/useFloatingLogic.d.ts +46 -0
- package/dist/types/tests/Input/Left.test.d.ts +1 -0
- package/dist/types/tests/Input/Right.test.d.ts +1 -0
- package/dist/types/tests/Input/Root.test.d.ts +1 -0
- package/dist/types/tests/Input/Search.test.d.ts +1 -0
- package/dist/types/tests/Popover.test.d.ts +1 -0
- package/dist/types/tests/Tooltip.test.d.ts +1 -0
- package/package.json +4 -3
- package/dist/cjs/components/Input.js +0 -81
- package/dist/esm/components/Input.js +0 -74
- package/dist/types/components/Input.d.ts +0 -34
- package/dist/types/components/SearchInput.d.ts +0 -11
- /package/dist/types/tests/{Input.test.d.ts → Input/Box.test.d.ts} +0 -0
- /package/dist/types/tests/{SearchInput.test.d.ts → Input/Face.test.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tecsinapse/cortex-react",
|
|
3
|
-
"version": "1.3.0-beta.
|
|
3
|
+
"version": "1.3.0-beta.3",
|
|
4
4
|
"description": "React components based in @tecsinapse/cortex-core",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
@@ -18,8 +18,9 @@
|
|
|
18
18
|
"test:watch": "jest --watch"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
+
"@floating-ui/react": "^0.26.18",
|
|
21
22
|
"@internationalized/date": "*",
|
|
22
|
-
"@tecsinapse/cortex-core": "0.3.0-beta.
|
|
23
|
+
"@tecsinapse/cortex-core": "0.3.0-beta.1",
|
|
23
24
|
"clsx": "*",
|
|
24
25
|
"react-aria": "^3.33.1",
|
|
25
26
|
"react-icons": "^5.2.1",
|
|
@@ -41,5 +42,5 @@
|
|
|
41
42
|
"react-dom": ">=18.0.0",
|
|
42
43
|
"tailwind": ">=3.3.0"
|
|
43
44
|
},
|
|
44
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "6cfddfd6db49be4dcf6dc53f192e659566bce3b3"
|
|
45
46
|
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var cortexCore = require('@tecsinapse/cortex-core');
|
|
4
|
-
var clsx = require('clsx');
|
|
5
|
-
var React = require('react');
|
|
6
|
-
|
|
7
|
-
const getValidChildren = (children) => {
|
|
8
|
-
return React.Children.toArray(children).filter(
|
|
9
|
-
(el) => React.isValidElement(el)
|
|
10
|
-
);
|
|
11
|
-
};
|
|
12
|
-
const InputBox = React.forwardRef(
|
|
13
|
-
({ id, name, variants, label, placeholder, className, ...rest }, ref) => {
|
|
14
|
-
return /* @__PURE__ */ React.createElement("div", { className: "flex w-full flex-col" }, /* @__PURE__ */ React.createElement(
|
|
15
|
-
"input",
|
|
16
|
-
{
|
|
17
|
-
id: id ?? name,
|
|
18
|
-
name,
|
|
19
|
-
placeholder: placeholder ?? " ",
|
|
20
|
-
className: clsx.clsx(cortexCore.inputBox(placeholder, label, className)),
|
|
21
|
-
...rest,
|
|
22
|
-
ref,
|
|
23
|
-
"data-testid": "input-input"
|
|
24
|
-
}
|
|
25
|
-
), /* @__PURE__ */ React.createElement(
|
|
26
|
-
"label",
|
|
27
|
-
{
|
|
28
|
-
htmlFor: id ?? name,
|
|
29
|
-
className: cortexCore.labelStyle({ intent: variants?.intent, placeholder }),
|
|
30
|
-
"data-testid": "input-label"
|
|
31
|
-
},
|
|
32
|
-
label
|
|
33
|
-
));
|
|
34
|
-
}
|
|
35
|
-
);
|
|
36
|
-
const InputFace = React.forwardRef(
|
|
37
|
-
({ children, variants, className, ...rest }, ref) => {
|
|
38
|
-
const clones = getValidChildren(children).map((el) => {
|
|
39
|
-
return React.cloneElement(el, { ...el.props, variants });
|
|
40
|
-
});
|
|
41
|
-
return /* @__PURE__ */ React.createElement(
|
|
42
|
-
"div",
|
|
43
|
-
{
|
|
44
|
-
...rest,
|
|
45
|
-
className: clsx.clsx(cortexCore.input(variants), className),
|
|
46
|
-
id: "input-face",
|
|
47
|
-
ref
|
|
48
|
-
},
|
|
49
|
-
clones
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
const InputRoot = React.forwardRef(
|
|
54
|
-
({ variants, className, ...rest }, ref) => {
|
|
55
|
-
return /* @__PURE__ */ React.createElement(InputFace, { variants, className }, /* @__PURE__ */ React.createElement(InputBox, { ...rest, ref }));
|
|
56
|
-
}
|
|
57
|
-
);
|
|
58
|
-
const InputLeft = React.forwardRef(
|
|
59
|
-
({ children, className, ...rest }, ref) => {
|
|
60
|
-
return /* @__PURE__ */ React.createElement("div", { className: clsx.clsx(className, "mr-2.5"), ...rest, ref }, children);
|
|
61
|
-
}
|
|
62
|
-
);
|
|
63
|
-
const InputRight = React.forwardRef(
|
|
64
|
-
({ children, className, ...rest }, ref) => {
|
|
65
|
-
return /* @__PURE__ */ React.createElement("div", { className: clsx.clsx(className, "ml-2.5"), ...rest, ref }, children);
|
|
66
|
-
}
|
|
67
|
-
);
|
|
68
|
-
const Input = {
|
|
69
|
-
Root: InputRoot,
|
|
70
|
-
Face: InputFace,
|
|
71
|
-
Box: InputBox,
|
|
72
|
-
Left: InputLeft,
|
|
73
|
-
Right: InputRight
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
exports.Input = Input;
|
|
77
|
-
exports.InputBox = InputBox;
|
|
78
|
-
exports.InputFace = InputFace;
|
|
79
|
-
exports.InputLeft = InputLeft;
|
|
80
|
-
exports.InputRight = InputRight;
|
|
81
|
-
exports.InputRoot = InputRoot;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { inputBox, labelStyle, input } from '@tecsinapse/cortex-core';
|
|
2
|
-
import { clsx } from 'clsx';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
|
|
5
|
-
const getValidChildren = (children) => {
|
|
6
|
-
return React.Children.toArray(children).filter(
|
|
7
|
-
(el) => React.isValidElement(el)
|
|
8
|
-
);
|
|
9
|
-
};
|
|
10
|
-
const InputBox = React.forwardRef(
|
|
11
|
-
({ id, name, variants, label, placeholder, className, ...rest }, ref) => {
|
|
12
|
-
return /* @__PURE__ */ React.createElement("div", { className: "flex w-full flex-col" }, /* @__PURE__ */ React.createElement(
|
|
13
|
-
"input",
|
|
14
|
-
{
|
|
15
|
-
id: id ?? name,
|
|
16
|
-
name,
|
|
17
|
-
placeholder: placeholder ?? " ",
|
|
18
|
-
className: clsx(inputBox(placeholder, label, className)),
|
|
19
|
-
...rest,
|
|
20
|
-
ref,
|
|
21
|
-
"data-testid": "input-input"
|
|
22
|
-
}
|
|
23
|
-
), /* @__PURE__ */ React.createElement(
|
|
24
|
-
"label",
|
|
25
|
-
{
|
|
26
|
-
htmlFor: id ?? name,
|
|
27
|
-
className: labelStyle({ intent: variants?.intent, placeholder }),
|
|
28
|
-
"data-testid": "input-label"
|
|
29
|
-
},
|
|
30
|
-
label
|
|
31
|
-
));
|
|
32
|
-
}
|
|
33
|
-
);
|
|
34
|
-
const InputFace = React.forwardRef(
|
|
35
|
-
({ children, variants, className, ...rest }, ref) => {
|
|
36
|
-
const clones = getValidChildren(children).map((el) => {
|
|
37
|
-
return React.cloneElement(el, { ...el.props, variants });
|
|
38
|
-
});
|
|
39
|
-
return /* @__PURE__ */ React.createElement(
|
|
40
|
-
"div",
|
|
41
|
-
{
|
|
42
|
-
...rest,
|
|
43
|
-
className: clsx(input(variants), className),
|
|
44
|
-
id: "input-face",
|
|
45
|
-
ref
|
|
46
|
-
},
|
|
47
|
-
clones
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
);
|
|
51
|
-
const InputRoot = React.forwardRef(
|
|
52
|
-
({ variants, className, ...rest }, ref) => {
|
|
53
|
-
return /* @__PURE__ */ React.createElement(InputFace, { variants, className }, /* @__PURE__ */ React.createElement(InputBox, { ...rest, ref }));
|
|
54
|
-
}
|
|
55
|
-
);
|
|
56
|
-
const InputLeft = React.forwardRef(
|
|
57
|
-
({ children, className, ...rest }, ref) => {
|
|
58
|
-
return /* @__PURE__ */ React.createElement("div", { className: clsx(className, "mr-2.5"), ...rest, ref }, children);
|
|
59
|
-
}
|
|
60
|
-
);
|
|
61
|
-
const InputRight = React.forwardRef(
|
|
62
|
-
({ children, className, ...rest }, ref) => {
|
|
63
|
-
return /* @__PURE__ */ React.createElement("div", { className: clsx(className, "ml-2.5"), ...rest, ref }, children);
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
const Input = {
|
|
67
|
-
Root: InputRoot,
|
|
68
|
-
Face: InputFace,
|
|
69
|
-
Box: InputBox,
|
|
70
|
-
Left: InputLeft,
|
|
71
|
-
Right: InputRight
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export { Input, InputBox, InputFace, InputLeft, InputRight, InputRoot };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { InputBaseVariants } from '@tecsinapse/cortex-core';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export interface InputPropsBase {
|
|
4
|
-
variants?: InputBaseVariants;
|
|
5
|
-
label?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>, InputPropsBase {
|
|
8
|
-
}
|
|
9
|
-
export declare const InputBox: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
10
|
-
type DivBaseProps = React.HTMLAttributes<HTMLDivElement>;
|
|
11
|
-
export declare const InputFace: React.ForwardRefExoticComponent<DivBaseProps & Pick<InputPropsBase, "variants"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
-
export declare const InputRoot: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
13
|
-
export declare const InputLeft: React.ForwardRefExoticComponent<DivBaseProps & {
|
|
14
|
-
children: React.ReactNode;
|
|
15
|
-
className?: string | undefined;
|
|
16
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
-
export declare const InputRight: React.ForwardRefExoticComponent<DivBaseProps & {
|
|
18
|
-
children: React.ReactNode;
|
|
19
|
-
className?: string | undefined;
|
|
20
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
-
export declare const Input: {
|
|
22
|
-
Root: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
23
|
-
Face: React.ForwardRefExoticComponent<DivBaseProps & Pick<InputPropsBase, "variants"> & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
-
Box: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
25
|
-
Left: React.ForwardRefExoticComponent<DivBaseProps & {
|
|
26
|
-
children: React.ReactNode;
|
|
27
|
-
className?: string | undefined;
|
|
28
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
-
Right: React.ForwardRefExoticComponent<DivBaseProps & {
|
|
30
|
-
children: React.ReactNode;
|
|
31
|
-
className?: string | undefined;
|
|
32
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
-
};
|
|
34
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
2
|
-
interface SearchInputProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onClick' | 'onChange'> {
|
|
3
|
-
label?: string;
|
|
4
|
-
placeholder?: string;
|
|
5
|
-
isSubmitting?: boolean;
|
|
6
|
-
onChange?: (value: string) => void;
|
|
7
|
-
onClick?: (value: string) => void;
|
|
8
|
-
BOUNCE_TIMEOUT?: number;
|
|
9
|
-
}
|
|
10
|
-
declare const SearchInput: ({ label, placeholder, isSubmitting, onChange, onClick, BOUNCE_TIMEOUT, className, ...rest }: SearchInputProps) => JSX.Element;
|
|
11
|
-
export default SearchInput;
|
|
File without changes
|
|
File without changes
|