norma-library 0.6.4 → 0.6.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/esm/components/UncontrolledTable/components/header/index.js +1 -1
- package/dist/esm/components/UncontrolledTable/components/header/styles.js +1 -1
- package/dist/esm/components/UncontrolledTable/components/header/styles.js.map +1 -1
- package/dist/esm/components/UncontrolledTabs/UncontrolledTabs.d.ts +2 -1
- package/dist/esm/components/UncontrolledTabs/UncontrolledTabs.js +5 -2
- package/dist/esm/components/UncontrolledTabs/UncontrolledTabs.js.map +1 -1
- package/dist/esm/components/UncontrolledTabs/UncontrolledTabsInfo.style.d.ts +2 -0
- package/dist/esm/components/UncontrolledTabs/UncontrolledTabsInfo.style.js +5 -0
- package/dist/esm/components/UncontrolledTabs/UncontrolledTabsInfo.style.js.map +1 -0
- package/package.json +1 -1
- package/src/components/UncontrolledTable/components/header/index.tsx +1 -1
- package/src/components/UncontrolledTable/components/header/styles.tsx +1 -0
- package/src/components/UncontrolledTabs/UncontrolledTabs.style.tsx +2 -0
- package/src/components/UncontrolledTabs/UncontrolledTabs.tsx +5 -2
- package/src/components/UncontrolledTabs/UncontrolledTabsInfo.style.ts +8 -0
- package/src/stories/UncontrolledTable.stories.tsx +2 -2
- package/src/stories/UncontrolledTabs.stories.tsx +11 -0
|
@@ -15,7 +15,7 @@ var Header = function (_a) {
|
|
|
15
15
|
showClearFiels && (React.createElement(S.TextClearSearch, { onClick: function () { return onClearFieldsClick && onClearFieldsClick(); } }, clearLabel || 'Limpar busca'))),
|
|
16
16
|
React.createElement(S.Tools, null,
|
|
17
17
|
showSettings ? (React.createElement(S.IconTools, { onClick: function () { return setOpenTools(!openTools); } },
|
|
18
|
-
React.createElement(SettingsIcon, { sx: { fontSize:
|
|
18
|
+
React.createElement(SettingsIcon, { sx: { fontSize: 18, color: '#DE8B50' } }))) : null,
|
|
19
19
|
customIcons &&
|
|
20
20
|
customIcons.map(function (IconComponent, index) { return (React.createElement(S.IconTools, { key: index }, IconComponent)); }),
|
|
21
21
|
openTools ? (React.createElement(S.ListTools, { ref: listToolsRef }, table.getAllLeafColumns().map(function (column) {
|
|
@@ -2,7 +2,7 @@ import { __makeTemplateObject } from "tslib";
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
export var Header = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n width: calc(100% - 32px);\n @media screen and (max-width: 1440px) {\n width: calc(100% - 16px);\n }\n margin: 0 auto;\n"], ["\n display: flex;\n justify-content: space-between;\n width: calc(100% - 32px);\n @media screen and (max-width: 1440px) {\n width: calc(100% - 16px);\n }\n margin: 0 auto;\n"])));
|
|
4
4
|
export var Results = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n"], ["\n display: flex;\n flex-direction: column;\n gap: 8px;\n"])));
|
|
5
|
-
export var Tools = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
|
|
5
|
+
export var Tools = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n"], ["\n display: flex;\n align-items: center;\n"])));
|
|
6
6
|
export var TextResult = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: #666666;\n font-size: 16px;\n"], ["\n color: #666666;\n font-size: 16px;\n"])));
|
|
7
7
|
export var TextClearSearchContent = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n height: 10px;\n"], ["\n height: 10px;\n"])));
|
|
8
8
|
export var TextClearSearch = styled.p(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: #de8b50;\n font-size: 14px;\n cursor: pointer;\n margin: 0;\n &:hover {\n text-decoration: underline;\n }\n"], ["\n color: #de8b50;\n font-size: 14px;\n cursor: pointer;\n margin: 0;\n &:hover {\n text-decoration: underline;\n }\n"])));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../../src/components/UncontrolledTable/components/header/styles.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,MAAM,CAAC,IAAM,MAAM,GAAG,MAAM,CAAC,GAAG,2PAAK,wLAQpC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,OAAO,GAAG,MAAM,CAAC,GAAG,iIAAA,8DAIhC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,KAAK,GAAG,MAAM,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../../src/components/UncontrolledTable/components/header/styles.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,MAAM,CAAC,IAAM,MAAM,GAAG,MAAM,CAAC,GAAG,2PAAK,wLAQpC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,OAAO,GAAG,MAAM,CAAC,GAAG,iIAAA,8DAIhC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,KAAK,GAAG,MAAM,CAAC,GAAG,iHAAA,8CAG9B,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,UAAU,GAAG,MAAM,CAAC,GAAG,8GAAA,2CAGnC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,sBAAsB,GAAG,MAAM,CAAC,GAAG,wFAAA,qBAE/C,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,eAAe,GAAG,MAAM,CAAC,CAAC,mMAAA,gIAQtC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,SAAS,GAAG,MAAM,CAAC,GAAG,4HAAA,yDAIlC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,SAAS,GAAG,MAAM,CAAC,GAAG,gZAAA,6UAiBlC,IAAA,CAAC"}
|
|
@@ -9,6 +9,7 @@ interface Props extends MuiTabsBaseProps {
|
|
|
9
9
|
onTabChange: (event: SyntheticEvent, tab: number) => void;
|
|
10
10
|
color?: ColorVariant;
|
|
11
11
|
variant?: TabsVariant;
|
|
12
|
+
info?: React.ReactNode;
|
|
12
13
|
}
|
|
13
|
-
declare const UncontrolledTabs: ({ tabs, tab, color, onTabChange, ...props }: Props) => React.JSX.Element;
|
|
14
|
+
declare const UncontrolledTabs: ({ tabs, tab, color, onTabChange, info, ...props }: Props) => React.JSX.Element;
|
|
14
15
|
export default UncontrolledTabs;
|
|
@@ -2,6 +2,7 @@ import { __assign, __rest } from "tslib";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Box } from '@mui/material';
|
|
4
4
|
import { NormaTab, NormaTabs } from './UncontrolledTabs.style';
|
|
5
|
+
import { NormaTabInfo } from './UncontrolledTabsInfo.style';
|
|
5
6
|
function TabPanel(props) {
|
|
6
7
|
var children = props.children, value = props.value, index = props.index, other = __rest(props, ["children", "value", "index"]);
|
|
7
8
|
return (React.createElement("div", __assign({ role: "tabpanel", hidden: value !== index, id: "simple-tabpanel-".concat(index), "aria-labelledby": "simple-tab-".concat(index) }, other), value === index && React.createElement(Box, { sx: { p: 3 } }, children)));
|
|
@@ -13,13 +14,15 @@ function a11yProps(index) {
|
|
|
13
14
|
};
|
|
14
15
|
}
|
|
15
16
|
var UncontrolledTabs = function (_a) {
|
|
16
|
-
var tabs = _a.tabs, tab = _a.tab, _b = _a.color, color = _b === void 0 ? 'primary' : _b, onTabChange = _a.onTabChange, props = __rest(_a, ["tabs", "tab", "color", "onTabChange"]);
|
|
17
|
+
var tabs = _a.tabs, tab = _a.tab, _b = _a.color, color = _b === void 0 ? 'primary' : _b, onTabChange = _a.onTabChange, info = _a.info, props = __rest(_a, ["tabs", "tab", "color", "onTabChange", "info"]);
|
|
17
18
|
var handleChange = function (event, newValue) {
|
|
18
19
|
onTabChange(event, newValue);
|
|
19
20
|
};
|
|
20
21
|
return (React.createElement(Box, { sx: { width: '100%' } },
|
|
21
22
|
React.createElement(Box, null,
|
|
22
|
-
React.createElement(NormaTabs, __assign({ value: tab, color: color, onChange: handleChange, "aria-label": "tabs" }, props),
|
|
23
|
+
React.createElement(NormaTabs, __assign({ value: tab, color: color, onChange: handleChange, "aria-label": "tabs" }, props),
|
|
24
|
+
tabs.map(function (item, key) { return (React.createElement(NormaTab, __assign({ key: key, label: item.label, color: color }, a11yProps(key)))); }),
|
|
25
|
+
info && React.createElement(NormaTabInfo, null, info))),
|
|
23
26
|
tabs.map(function (item, key) {
|
|
24
27
|
var _a;
|
|
25
28
|
return (React.createElement(TabPanel, __assign({}, (_a = item.tabPanel) === null || _a === void 0 ? void 0 : _a.props, { key: key, value: tab, index: key }), item.children));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UncontrolledTabs.js","sourceRoot":"","sources":["../../../../src/components/UncontrolledTabs/UncontrolledTabs.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAW,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"UncontrolledTabs.js","sourceRoot":"","sources":["../../../../src/components/UncontrolledTabs/UncontrolledTabs.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAW,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAkB5D,SAAS,QAAQ,CAAC,KAAoB;IAC5B,IAAA,QAAQ,GAA6B,KAAK,SAAlC,EAAE,KAAK,GAAsB,KAAK,MAA3B,EAAE,KAAK,GAAe,KAAK,MAApB,EAAK,KAAK,UAAK,KAAK,EAA5C,8BAAoC,CAAF,CAAW;IAEnD,OAAO,CACL,sCACE,IAAI,EAAC,UAAU,EAC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C,GAAG,CAAC,UAAC,IAAI,EAAE,GAAG;;YAAK,OAAA,CACvB,oBAAC,QAAQ,eAAK,MAAA,IAAI,CAAC,QAAQ,0CAAE,KAAK,IAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,KACjE,IAAI,CAAC,QAAQ,CACL,CACZ,CAAA;SAAA,CAAC,CACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const NormaTabInfo: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { __makeTemplateObject } from "tslib";
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
export var NormaTabInfo = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n right: 0;\n bottom: 0;\n height: 38px;\n"], ["\n position: absolute;\n right: 0;\n bottom: 0;\n height: 38px;\n"])));
|
|
4
|
+
var templateObject_1;
|
|
5
|
+
//# sourceMappingURL=UncontrolledTabsInfo.style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UncontrolledTabsInfo.style.js","sourceRoot":"","sources":["../../../../src/components/UncontrolledTabs/UncontrolledTabsInfo.style.ts"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,MAAM,CAAC,IAAM,YAAY,GAAG,MAAM,CAAC,GAAG,0IAAA,uEAKrC,IAAA,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "norma-library",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.005",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Olos/Norma-DS. Design System based on Material UI, developed with TypeScript and Styled Components to create reusable and consistent components in web applications.",
|
|
6
6
|
"scripts": {
|
|
@@ -38,7 +38,7 @@ const Header: React.FC<any> = ({
|
|
|
38
38
|
<S.Tools>
|
|
39
39
|
{showSettings ? (
|
|
40
40
|
<S.IconTools onClick={() => setOpenTools(!openTools)}>
|
|
41
|
-
<SettingsIcon sx={{ fontSize:
|
|
41
|
+
<SettingsIcon sx={{ fontSize: 18, color: '#DE8B50' }} />
|
|
42
42
|
</S.IconTools>
|
|
43
43
|
) : null}
|
|
44
44
|
|
|
@@ -3,6 +3,7 @@ import { Box, SxProps } from '@mui/material';
|
|
|
3
3
|
import { ColorVariant, DataTabs, MuiTabsBaseProps, TabsVariant } from '@/types';
|
|
4
4
|
import { NormaTab, NormaTabs } from './UncontrolledTabs.style';
|
|
5
5
|
import { Theme } from '@emotion/react';
|
|
6
|
+
import { NormaTabInfo } from './UncontrolledTabsInfo.style';
|
|
6
7
|
|
|
7
8
|
interface Props extends MuiTabsBaseProps {
|
|
8
9
|
sx?: SxProps<Theme>;
|
|
@@ -11,6 +12,7 @@ interface Props extends MuiTabsBaseProps {
|
|
|
11
12
|
onTabChange: (event: SyntheticEvent, tab: number) => void;
|
|
12
13
|
color?: ColorVariant;
|
|
13
14
|
variant?: TabsVariant;
|
|
15
|
+
info?: React.ReactNode;
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
interface TabPanelProps {
|
|
@@ -20,7 +22,7 @@ interface TabPanelProps {
|
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
function TabPanel(props: TabPanelProps) {
|
|
23
|
-
const { children, value, index,
|
|
25
|
+
const { children, value, index, ...other } = props;
|
|
24
26
|
|
|
25
27
|
return (
|
|
26
28
|
<div
|
|
@@ -42,7 +44,7 @@ function a11yProps(index: number) {
|
|
|
42
44
|
};
|
|
43
45
|
}
|
|
44
46
|
|
|
45
|
-
const UncontrolledTabs = ({ tabs, tab, color = 'primary', onTabChange, ...props }: Props) => {
|
|
47
|
+
const UncontrolledTabs = ({ tabs, tab, color = 'primary', onTabChange, info, ...props }: Props) => {
|
|
46
48
|
const handleChange = (event: SyntheticEvent, newValue: number) => {
|
|
47
49
|
onTabChange(event, newValue);
|
|
48
50
|
};
|
|
@@ -54,6 +56,7 @@ const UncontrolledTabs = ({ tabs, tab, color = 'primary', onTabChange, ...props
|
|
|
54
56
|
{tabs.map((item, key) => (
|
|
55
57
|
<NormaTab key={key} label={item.label} color={color} {...a11yProps(key)} />
|
|
56
58
|
))}
|
|
59
|
+
{info && <NormaTabInfo>{info}</NormaTabInfo>}
|
|
57
60
|
</NormaTabs>
|
|
58
61
|
</Box>
|
|
59
62
|
{tabs.map((item, key) => (
|
|
@@ -280,10 +280,10 @@ export const Default = args => {
|
|
|
280
280
|
showSettings
|
|
281
281
|
customIcons={[
|
|
282
282
|
<div key="1" onClick={() => alert('Ícone 1 clicado')}>
|
|
283
|
-
<CodeIcon sx={{ fontSize:
|
|
283
|
+
<CodeIcon sx={{ fontSize: 18, color: '#DE8B50' }} />
|
|
284
284
|
</div>,
|
|
285
285
|
<div key="2" onClick={() => alert('Ícone 2 clicado')}>
|
|
286
|
-
<CreateIcon sx={{ fontSize:
|
|
286
|
+
<CreateIcon sx={{ fontSize: 18, color: '#DE8B50' }} />
|
|
287
287
|
</div>,
|
|
288
288
|
]}
|
|
289
289
|
onClick={value => console.log('onClick line:', value)}
|
|
@@ -61,3 +61,14 @@ export const UncontrolledTabsBasic = () => {
|
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
UncontrolledTabsBasic.storyName = 'Uncontrolled Tabs';
|
|
64
|
+
|
|
65
|
+
export const UncontrolledTabsInfo = () => {
|
|
66
|
+
const [tab, setTab] = useState(0);
|
|
67
|
+
return (
|
|
68
|
+
<div style={{ width: '480px', marginBottom: 30 }}>
|
|
69
|
+
<UncontrolledTabs info={<div>Informação dentro da tab</div>} tab={tab} tabs={data} onTabChange={(evt, tab) => setTab(tab)} />
|
|
70
|
+
</div>
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
UncontrolledTabsInfo.storyName = 'Uncontrolled Tabs With Info';
|