@factorearth/component-library 3.8.4-alpha.0 → 3.8.5-alpha.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/Atoms/Tab/Tab.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Colors } from "../../Theme/types";
|
|
3
|
-
interface
|
|
3
|
+
interface TabProps {
|
|
4
4
|
colors: Colors;
|
|
5
5
|
handleClick: () => void;
|
|
6
6
|
label: string;
|
|
7
7
|
selected?: boolean;
|
|
8
|
+
closeButton?: JSX.Element;
|
|
9
|
+
newTabButton?: JSX.Element;
|
|
8
10
|
}
|
|
9
|
-
declare function Tab(props:
|
|
11
|
+
declare function Tab(props: TabProps): React.JSX.Element;
|
|
10
12
|
export default Tab;
|
package/dist/Atoms/Tab/Tab.js
CHANGED
|
@@ -3,25 +3,28 @@ import React from "react";
|
|
|
3
3
|
const TabDiv = styled.div `
|
|
4
4
|
display: flex;
|
|
5
5
|
padding: 6px 12px;
|
|
6
|
-
justify-content:
|
|
6
|
+
justify-content: space-between;
|
|
7
7
|
align-items: center;
|
|
8
8
|
gap: 8px;
|
|
9
9
|
border-radius: 4px 4px 0px 0px;
|
|
10
10
|
background: ${({ colors, selected }) => selected ? colors.tab.selected : colors.tab.notSelected};
|
|
11
|
-
cursor: ${({ selected }) => selected ? "auto" : "pointer"};
|
|
12
11
|
border: .5px solid ${({ colors }) => colors.tab.selected};
|
|
13
|
-
`;
|
|
12
|
+
`;
|
|
14
13
|
const Label = styled.p `
|
|
15
14
|
color: ${({ colors, selected }) => selected ? colors.tabText.selected : colors.tabText.notSelected};
|
|
16
15
|
font-size: 14px;
|
|
17
16
|
line-height: 150%;
|
|
17
|
+
cursor: ${({ selected }) => selected ? "auto" : "pointer"};
|
|
18
18
|
font-weight: 700;
|
|
19
19
|
margin: 0px;
|
|
20
20
|
`;
|
|
21
21
|
function Tab(props) {
|
|
22
|
-
const { colors, handleClick, label, selected, ...remainingProps } = props;
|
|
23
|
-
return (React.createElement(
|
|
24
|
-
React.createElement(
|
|
22
|
+
const { colors, handleClick, label, selected, closeButton, newTabButton, ...remainingProps } = props;
|
|
23
|
+
return (React.createElement("div", { style: { display: "flex", alignItems: "center", gap: "8px" } },
|
|
24
|
+
React.createElement(TabDiv, { colors: colors, selected: selected, role: !selected ? "button" : undefined, "aria-label": `${label} tab`, ...remainingProps },
|
|
25
|
+
React.createElement(Label, { colors: colors, selected: selected, onClick: !selected ? handleClick : undefined }, label),
|
|
26
|
+
closeButton && closeButton),
|
|
27
|
+
newTabButton && newTabButton));
|
|
25
28
|
}
|
|
26
29
|
export default Tab;
|
|
27
30
|
//# sourceMappingURL=Tab.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tab.js","sourceRoot":"","sources":["../../../lib/Atoms/Tab/Tab.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAyC;;;;;;;eAOnD,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW;
|
|
1
|
+
{"version":3,"file":"Tab.js","sourceRoot":"","sources":["../../../lib/Atoms/Tab/Tab.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAyC;;;;;;;eAOnD,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,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,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@factorearth/component-library",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.5-alpha.0",
|
|
4
4
|
"description": " A storybook component library for FactorEarth",
|
|
5
5
|
"author": "madtrx <marlin.makori@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/FactorEarth/RecordMiddleware#readme",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"access": "public",
|
|
47
47
|
"registry": "https://registry.npmjs.org/"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "e69a39f71f9357599f7262b9e1a02bf748c6a4cd",
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@emotion/react": "^11.13.0",
|
|
52
52
|
"@emotion/styled": "^11.13.0",
|