@tecsinapse/cortex-react 1.9.4 → 1.9.5
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/Drawer.js +4 -2
- package/dist/cjs/components/GroupButton.js +30 -22
- package/dist/esm/components/Drawer.js +4 -2
- package/dist/esm/components/GroupButton.js +30 -22
- package/dist/types/components/Drawer.d.ts +2 -1
- package/dist/types/components/GroupButton.d.ts +1 -0
- package/package.json +3 -3
|
@@ -7,7 +7,8 @@ const Drawer = ({
|
|
|
7
7
|
children,
|
|
8
8
|
onClose,
|
|
9
9
|
open,
|
|
10
|
-
position = "right"
|
|
10
|
+
position = "right",
|
|
11
|
+
className
|
|
11
12
|
}) => {
|
|
12
13
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
13
14
|
"div",
|
|
@@ -22,7 +23,8 @@ const Drawer = ({
|
|
|
22
23
|
"data-testid": "drawer",
|
|
23
24
|
className: cortexCore.drawer({
|
|
24
25
|
position,
|
|
25
|
-
open
|
|
26
|
+
open,
|
|
27
|
+
className
|
|
26
28
|
})
|
|
27
29
|
},
|
|
28
30
|
children
|
|
@@ -15,29 +15,37 @@ const GroupButton = (props) => {
|
|
|
15
15
|
renderOption,
|
|
16
16
|
onChange,
|
|
17
17
|
customStyles,
|
|
18
|
-
disableAllOptions
|
|
18
|
+
disableAllOptions,
|
|
19
|
+
className
|
|
19
20
|
} = props;
|
|
20
|
-
return /* @__PURE__ */ React.createElement(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"button"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
21
|
+
return /* @__PURE__ */ React.createElement(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
className: container({ className }),
|
|
25
|
+
"data-testid": "group-button-container"
|
|
26
|
+
},
|
|
27
|
+
options.map((option) => {
|
|
28
|
+
const key = renderKey?.(option.value);
|
|
29
|
+
const isActive = key === renderKey?.(value);
|
|
30
|
+
return /* @__PURE__ */ React.createElement(
|
|
31
|
+
"button",
|
|
32
|
+
{
|
|
33
|
+
disabled: disableAllOptions,
|
|
34
|
+
value: String(value),
|
|
35
|
+
onClick: () => onChange(option.value),
|
|
36
|
+
className: clsx(
|
|
37
|
+
button(),
|
|
38
|
+
firstButton({ className: customStyles?.firstButton }),
|
|
39
|
+
lastButton({ className: customStyles?.lastButton }),
|
|
40
|
+
!isActive && inactive({ className: customStyles?.inactive }),
|
|
41
|
+
isActive && active({ className: customStyles?.active })
|
|
42
|
+
),
|
|
43
|
+
key
|
|
44
|
+
},
|
|
45
|
+
renderOption(option.value)
|
|
46
|
+
);
|
|
47
|
+
})
|
|
48
|
+
);
|
|
41
49
|
};
|
|
42
50
|
|
|
43
51
|
exports.GroupButton = GroupButton;
|
|
@@ -5,7 +5,8 @@ const Drawer = ({
|
|
|
5
5
|
children,
|
|
6
6
|
onClose,
|
|
7
7
|
open,
|
|
8
|
-
position = "right"
|
|
8
|
+
position = "right",
|
|
9
|
+
className
|
|
9
10
|
}) => {
|
|
10
11
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
|
|
11
12
|
"div",
|
|
@@ -20,7 +21,8 @@ const Drawer = ({
|
|
|
20
21
|
"data-testid": "drawer",
|
|
21
22
|
className: drawer({
|
|
22
23
|
position,
|
|
23
|
-
open
|
|
24
|
+
open,
|
|
25
|
+
className
|
|
24
26
|
})
|
|
25
27
|
},
|
|
26
28
|
children
|
|
@@ -13,29 +13,37 @@ const GroupButton = (props) => {
|
|
|
13
13
|
renderOption,
|
|
14
14
|
onChange,
|
|
15
15
|
customStyles,
|
|
16
|
-
disableAllOptions
|
|
16
|
+
disableAllOptions,
|
|
17
|
+
className
|
|
17
18
|
} = props;
|
|
18
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"button"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
19
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
className: container({ className }),
|
|
23
|
+
"data-testid": "group-button-container"
|
|
24
|
+
},
|
|
25
|
+
options.map((option) => {
|
|
26
|
+
const key = renderKey?.(option.value);
|
|
27
|
+
const isActive = key === renderKey?.(value);
|
|
28
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
29
|
+
"button",
|
|
30
|
+
{
|
|
31
|
+
disabled: disableAllOptions,
|
|
32
|
+
value: String(value),
|
|
33
|
+
onClick: () => onChange(option.value),
|
|
34
|
+
className: clsx(
|
|
35
|
+
button(),
|
|
36
|
+
firstButton({ className: customStyles?.firstButton }),
|
|
37
|
+
lastButton({ className: customStyles?.lastButton }),
|
|
38
|
+
!isActive && inactive({ className: customStyles?.inactive }),
|
|
39
|
+
isActive && active({ className: customStyles?.active })
|
|
40
|
+
),
|
|
41
|
+
key
|
|
42
|
+
},
|
|
43
|
+
renderOption(option.value)
|
|
44
|
+
);
|
|
45
|
+
})
|
|
46
|
+
);
|
|
39
47
|
};
|
|
40
48
|
|
|
41
49
|
export { GroupButton };
|
|
@@ -4,5 +4,6 @@ export interface DrawerProps {
|
|
|
4
4
|
onClose: () => void;
|
|
5
5
|
position?: 'left' | 'right';
|
|
6
6
|
children?: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
7
8
|
}
|
|
8
|
-
export declare const Drawer: ({ children, onClose, open, position, }: DrawerProps) => JSX.Element;
|
|
9
|
+
export declare const Drawer: ({ children, onClose, open, position, className, }: DrawerProps) => JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tecsinapse/cortex-react",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.5",
|
|
4
4
|
"description": "React components based in @tecsinapse/cortex-core",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@floating-ui/react": "^0.26.18",
|
|
22
22
|
"@internationalized/date": "*",
|
|
23
|
-
"@tecsinapse/cortex-core": "0.4.
|
|
23
|
+
"@tecsinapse/cortex-core": "0.4.4",
|
|
24
24
|
"clsx": "*",
|
|
25
25
|
"currency.js": "~2.0.4",
|
|
26
26
|
"react-aria": "^3.33.1",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"react-dom": ">=18.0.0",
|
|
49
49
|
"tailwind": ">=3.3.0"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "4998a3b3a66a0f3d5b2da717281f7478eee04400"
|
|
52
52
|
}
|