@tecsinapse/cortex-react 1.9.3 → 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/Accordion/index.js +3 -0
- package/dist/cjs/components/Drawer.js +4 -2
- package/dist/cjs/components/GroupButton.js +30 -22
- package/dist/cjs/index.js +3 -0
- package/dist/esm/components/Accordion/index.js +1 -0
- package/dist/esm/components/Drawer.js +4 -2
- package/dist/esm/components/GroupButton.js +30 -22
- package/dist/esm/index.js +1 -0
- package/dist/types/components/Accordion/index.d.ts +1 -0
- package/dist/types/components/Drawer.d.ts +2 -1
- package/dist/types/components/GroupButton.d.ts +1 -0
- package/package.json +3 -3
|
@@ -4,6 +4,7 @@ var Content = require('./Content.js');
|
|
|
4
4
|
var Face = require('./Face.js');
|
|
5
5
|
var Root = require('./Root.js');
|
|
6
6
|
var Trigger = require('./Trigger.js');
|
|
7
|
+
var context = require('./context.js');
|
|
7
8
|
|
|
8
9
|
const Accordion = {
|
|
9
10
|
Root: Root.AccordionRoot,
|
|
@@ -12,4 +13,6 @@ const Accordion = {
|
|
|
12
13
|
Trigger: Trigger.AccordionTrigger
|
|
13
14
|
};
|
|
14
15
|
|
|
16
|
+
exports.Context = context.Context;
|
|
17
|
+
exports.useAccordionContext = context.useAccordionContext;
|
|
15
18
|
exports.Accordion = Accordion;
|
|
@@ -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;
|
package/dist/cjs/index.js
CHANGED
|
@@ -61,6 +61,7 @@ var MenubarProvider = require('./provider/MenubarProvider.js');
|
|
|
61
61
|
var SnackbarProvider = require('./provider/SnackbarProvider.js');
|
|
62
62
|
var MenubarContext = require('./provider/MenubarContext.js');
|
|
63
63
|
var useMenubar = require('./provider/useMenubar.js');
|
|
64
|
+
var context = require('./components/Accordion/context.js');
|
|
64
65
|
var masks = require('./components/Input/masks.js');
|
|
65
66
|
var Root = require('./components/Uploader/Root.js');
|
|
66
67
|
var types = require('./components/Uploader/types.js');
|
|
@@ -140,6 +141,8 @@ exports.SnackbarProvider = SnackbarProvider.SnackbarProvider;
|
|
|
140
141
|
exports.useSnackbar = SnackbarProvider.useSnackbar;
|
|
141
142
|
exports.MenubarContext = MenubarContext.MenubarContext;
|
|
142
143
|
exports.useMenubar = useMenubar.useMenubar;
|
|
144
|
+
exports.Context = context.Context;
|
|
145
|
+
exports.useAccordionContext = context.useAccordionContext;
|
|
143
146
|
exports.BRLMask = masks.BRLMask;
|
|
144
147
|
exports.CurrencyIMask = masks.CurrencyIMask;
|
|
145
148
|
exports.ExpressionMasks = masks.ExpressionMasks;
|
|
@@ -2,6 +2,7 @@ import { AccordionContent } from './Content.js';
|
|
|
2
2
|
import { AccordionFace } from './Face.js';
|
|
3
3
|
import { AccordionRoot } from './Root.js';
|
|
4
4
|
import { AccordionTrigger } from './Trigger.js';
|
|
5
|
+
export { Context, useAccordionContext } from './context.js';
|
|
5
6
|
|
|
6
7
|
const Accordion = {
|
|
7
8
|
Root: AccordionRoot,
|
|
@@ -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 };
|
package/dist/esm/index.js
CHANGED
|
@@ -59,6 +59,7 @@ export { MenubarProvider } from './provider/MenubarProvider.js';
|
|
|
59
59
|
export { SnackbarProvider, useSnackbar } from './provider/SnackbarProvider.js';
|
|
60
60
|
export { MenubarContext } from './provider/MenubarContext.js';
|
|
61
61
|
export { useMenubar } from './provider/useMenubar.js';
|
|
62
|
+
export { Context, useAccordionContext } from './components/Accordion/context.js';
|
|
62
63
|
export { BRLMask, CurrencyIMask, ExpressionMasks, Masks, NumberIMask, PercentageIMask, PercentageMask } from './components/Input/masks.js';
|
|
63
64
|
export { Root } from './components/Uploader/Root.js';
|
|
64
65
|
export { AcceptSpecificMap, FileStatus } from './components/Uploader/types.js';
|
|
@@ -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
|
}
|