@conduction/components 2.2.2 → 2.2.4
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/README.md +2 -0
- package/lib/components/formFields/createKeyValue/CreateKeyValue.js +1 -2
- package/lib/components/tabs/Tabs.d.ts +14 -0
- package/lib/components/tabs/Tabs.js +7 -0
- package/lib/components/tabs/Tabs.module.css +102 -0
- package/lib/components/temp/Temp.d.ts +5 -0
- package/lib/components/temp/Temp.js +14 -0
- package/lib/components/toolTip/ToolTip.d.ts +10 -6
- package/lib/components/toolTip/ToolTip.js +11 -6
- package/lib/components/toolTip/ToolTip.module.css +26 -10
- package/lib/index.d.ts +2 -1
- package/lib/index.js +2 -1
- package/package.json +3 -2
- package/src/components/formFields/createKeyValue/CreateKeyValue.tsx +11 -16
- package/src/components/tabs/Tabs.module.css +102 -0
- package/src/components/tabs/Tabs.tsx +37 -0
- package/src/components/toolTip/ToolTip.module.css +26 -10
- package/src/components/toolTip/ToolTip.tsx +11 -15
- package/src/index.ts +2 -0
package/README.md
CHANGED
|
@@ -3,7 +3,6 @@ import * as React from "react";
|
|
|
3
3
|
import * as styles from "./CreateKeyValue.module.css";
|
|
4
4
|
import { Controller } from "react-hook-form";
|
|
5
5
|
import { Table, TableBody, TableCell, TableHeaderCell, TableHeader, TableRow, Textbox, Button, } from "@utrecht/component-library-react/dist/css-module";
|
|
6
|
-
import { ToolTip } from "../../toolTip/ToolTip";
|
|
7
6
|
import clsx from "clsx";
|
|
8
7
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
9
8
|
import { faCopy, faTrash } from "@fortawesome/free-solid-svg-icons";
|
|
@@ -37,5 +36,5 @@ const KeyValueComponent = ({ defaultValue, handleChange, disabled, copyValue, })
|
|
|
37
36
|
React.useEffect(() => {
|
|
38
37
|
handleChange(keyValues);
|
|
39
38
|
}, [keyValues]);
|
|
40
|
-
return (_jsxs("div", { className: styles.keyValue, children: [keyValues && (_jsxs(Table, { className: styles.table, children: [_jsx(TableHeader, { className: styles.tableHeader, children: _jsxs(TableRow, { children: [_jsx(TableHeaderCell, { children: "Key" }), _jsx(TableHeaderCell, { children: "Value" }), _jsx(TableHeaderCell, {})] }) }), _jsx(TableBody, { children: keyValues.map((keyValue, idx) => (_jsxs(TableRow, { children: [_jsx(TableCell, { children: keyValue.key }), _jsx(TableCell, { children: keyValue.value }), _jsx(TableCell, { children: _jsxs("div", { className: styles.buttonsContainer, children: [copyValue && (_jsx(
|
|
39
|
+
return (_jsxs("div", { className: styles.keyValue, children: [keyValues && (_jsxs(Table, { className: styles.table, children: [_jsx(TableHeader, { className: styles.tableHeader, children: _jsxs(TableRow, { children: [_jsx(TableHeaderCell, { children: "Key" }), _jsx(TableHeaderCell, { children: "Value" }), _jsx(TableHeaderCell, {})] }) }), _jsx(TableBody, { children: keyValues.map((keyValue, idx) => (_jsxs(TableRow, { children: [_jsx(TableCell, { children: keyValue.key }), _jsx(TableCell, { children: keyValue.value }), _jsx(TableCell, { children: _jsxs("div", { className: styles.buttonsContainer, children: [copyValue && (_jsx(Button, { ...{ disabled }, onClick: () => handleCopyToClipboard(keyValue.value, idx), appearance: currentCopyIdx === idx ? "secondary-action-button" : "primary-action-button", children: _jsx(FontAwesomeIcon, { icon: faCopy }) })), _jsx(Button, { ...{ disabled }, onClick: () => setKeyValues(keyValues.filter((_keyValue) => _keyValue !== keyValue)), className: clsx(styles.deleteButton), children: _jsx(FontAwesomeIcon, { icon: faTrash }) })] }) })] }, `${keyValue.key}${keyValue.value}${idx}`))) })] })), _jsxs("div", { className: styles.form, children: [_jsx(Textbox, { type: "text", placeholder: "Key", value: currentKey, ref: currentKeyRef, onChange: (e) => setCurrentKey(e.target.value), ...{ disabled } }), _jsx(Textbox, { type: "text", placeholder: "Value", value: currentValue, ref: currentValueRef, onChange: (e) => setCurrentValue(e.target.value), ...{ disabled } }), _jsx(Button, { onClick: handleCreate, disabled: !currentKey || !currentValue || disabled, children: "Add" })] })] }));
|
|
41
40
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface testProps {
|
|
3
|
+
tabs: ITabProps[];
|
|
4
|
+
tabContent: ITabPanelProps[];
|
|
5
|
+
}
|
|
6
|
+
interface ITabProps {
|
|
7
|
+
name: string;
|
|
8
|
+
badge?: string;
|
|
9
|
+
}
|
|
10
|
+
interface ITabPanelProps {
|
|
11
|
+
content: JSX.Element;
|
|
12
|
+
}
|
|
13
|
+
export declare const TabContext: React.FC<testProps>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as styles from "./Tabs.module.css";
|
|
3
|
+
import { Tab, Tabs, TabList, TabPanel } from "react-tabs";
|
|
4
|
+
import { BadgeCounter } from "@utrecht/component-library-react";
|
|
5
|
+
export const TabContext = ({ tabs, tabContent }) => {
|
|
6
|
+
return (_jsxs(Tabs, { className: styles.tabs, children: [_jsx(TabList, { className: styles.tabList, children: tabs.map(({ name, badge }) => (_jsx(Tab, { className: styles.tab, children: _jsxs("span", { children: [name, badge !== undefined && _jsx(BadgeCounter, { className: styles.badge, children: badge })] }) }))) }), tabContent.map(({ content }) => (_jsx(TabPanel, { className: styles.tabPanel, children: content })))] }));
|
|
7
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--conduction-tab-list-padding-inline-start: 0px;
|
|
3
|
+
--conduction-tab-list-border-bottom-width: var(--skeleton-size-3xs);
|
|
4
|
+
--conduction-tab-list-border-bottom-style: solid;
|
|
5
|
+
--conduction-tab-list-border-bottom-color: #d1d1d1;
|
|
6
|
+
|
|
7
|
+
--conduction-tab-padding-block-start: var(--skeleton-size-xs);
|
|
8
|
+
--conduction-tab-padding-block-end: var(--skeleton-size-xs);
|
|
9
|
+
--conduction-tab-padding-inline-start: var(--skeleton-size-sm);
|
|
10
|
+
--conduction-tab-padding-inline-end: var(--skeleton-size-sm);
|
|
11
|
+
--conduction-tab-font-size: var(--skeleton-font-size-sm: );
|
|
12
|
+
--conduction-tab-font-weight: var(--skeleton-font-weight-normal);
|
|
13
|
+
--conduction-tab-font-family: "Noto Sans", Arial, sans-serif;
|
|
14
|
+
--conduction-tab-max-width: unset;
|
|
15
|
+
--conduction-tab-min-width: 160px;
|
|
16
|
+
--conduction-tab-min-height: 61px;
|
|
17
|
+
/* --conduction-tab-letter-spacing: 0.02857em; */
|
|
18
|
+
/* --conduction-tab-text-transform: uppercase; */
|
|
19
|
+
--conduction-tab-color: #4a4a4a;
|
|
20
|
+
|
|
21
|
+
--conduction-tab-selected-color: #4a4a4a;
|
|
22
|
+
--conduction-tab-selected-border-bottom-width: var(--skeleton-size-3xs);
|
|
23
|
+
--conduction-tab-selected-border-bottom-style: solid;
|
|
24
|
+
--conduction-tab-selected-border-bottom-color: #4376fc;
|
|
25
|
+
--conduction-tab-selected-font-weight: var(--skeleton-font-weight-bold);
|
|
26
|
+
|
|
27
|
+
--conduction-tab-panel-padding-block-start: var(--skeleton-size-lg);
|
|
28
|
+
--conduction-tab-panel-padding-block-end: var(--skeleton-size-lg);
|
|
29
|
+
--conduction-tab-panel-padding-inline-start: var(--skeleton-size-lg);
|
|
30
|
+
--conduction-tab-panel-padding-inline-end: var(--skeleton-size-lg);
|
|
31
|
+
|
|
32
|
+
--conduction-tab-badge-margin-inline-start: var(--skeleton-size-xs);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.tabList {
|
|
36
|
+
padding-inline-start: var(--conduction-tab-list-padding-inline-start);
|
|
37
|
+
border-bottom-width: var(--conduction-tab-list-border-bottom-width);
|
|
38
|
+
border-bottom-style: var(--conduction-tab-list-border-bottom-style);
|
|
39
|
+
border-bottom-color: var(--conduction-tab-list-border-bottom-color);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.tab {
|
|
43
|
+
display: inline-flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
position: relative;
|
|
49
|
+
box-sizing: border-box;
|
|
50
|
+
text-align: center;
|
|
51
|
+
white-space: normal;
|
|
52
|
+
bottom: -2px;
|
|
53
|
+
|
|
54
|
+
color: var(--conduction-tab-color);
|
|
55
|
+
padding-block-start: var(--conduction-tab-padding-block-start);
|
|
56
|
+
padding-block-end: var(--conduction-tab-padding-block-end);
|
|
57
|
+
padding-inline-start: var(--conduction-tab-padding-inline-start);
|
|
58
|
+
padding-inline-end: var(--conduction-tab-padding-inline-end);
|
|
59
|
+
font-size: var(--conduction-tab-font-size);
|
|
60
|
+
font-weight: var(--conduction-tab-font-weight);
|
|
61
|
+
font-family: var(--conduction-tab-font-family);
|
|
62
|
+
max-width: var(--conduction-tab-max-width);
|
|
63
|
+
min-width: var(--conduction-tab-min-width);
|
|
64
|
+
min-height: var(--conduction-tab-min-height);
|
|
65
|
+
letter-spacing: var(--conduction-tab-letter-spacing);
|
|
66
|
+
text-transform: var(--conduction-tab-text-transform);
|
|
67
|
+
|
|
68
|
+
border-bottom-width: var(--conduction-tab-list-border-bottom-width);
|
|
69
|
+
border-bottom-style: var(--conduction-tab-list-border-bottom-style);
|
|
70
|
+
border-bottom-color: var(--conduction-tab-list-border-bottom-color);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.tab[aria-selected="true"] {
|
|
74
|
+
color: var(--conduction-tab-selected-color);
|
|
75
|
+
border-bottom-width: var(--conduction-tab-selected-border-bottom-width);
|
|
76
|
+
border-bottom-style: var(--conduction-tab-selected-border-bottom-style);
|
|
77
|
+
border-bottom-color: var(--conduction-tab-selected-border-bottom-color);
|
|
78
|
+
font-weight: var(--conduction-tab-selected-font-weight);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.tabs [class*="react-tabs__tab-panel--selected"] {
|
|
82
|
+
padding-block-start: var(--conduction-tab-panel-padding-block-start);
|
|
83
|
+
padding-block-end: var(--conduction-tab-panel-padding-block-end);
|
|
84
|
+
padding-inline-start: var(--conduction-tab-panel-padding-inline-start);
|
|
85
|
+
padding-inline-end: var(--conduction-tab-panel-padding-inline-end);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.badge {
|
|
89
|
+
margin-inline-start: var(--conduction-tab-badge-margin-inline-start);
|
|
90
|
+
background-color: var(--utrecht-badge-counter-background-color, var(--utrecht-badge-background-color, #000));
|
|
91
|
+
border-radius: var(--utrecht-badge-counter-border-radius, var(--utrecht-badge-border-radius, 0.5ch));
|
|
92
|
+
color: var(--utrecht-badge-counter-color, var(--utrecht-badge-color, #fff));
|
|
93
|
+
display: inline-block;
|
|
94
|
+
font-family: var(--utrecht-document-font-family, sans-serif);
|
|
95
|
+
font-style: var(--utrecht-badge-counter-font-style, normal);
|
|
96
|
+
font-weight: var(--utrecht-badge-counter-font-weight, var(--utrecht-badge-font-weight, bold));
|
|
97
|
+
padding-block-end: var(--utrecht-badge-counter-padding-block, var(--utrecht-badge-padding-block, 0.5ex));
|
|
98
|
+
padding-block-start: var(--utrecht-badge-counter-padding-block, var(--utrecht-badge-padding-block, 0.5ex));
|
|
99
|
+
padding-inline-end: var(--utrecht-badge-counter-padding-inline, var(--utrecht-badge-padding-inline, 0.5ch));
|
|
100
|
+
padding-inline-start: var(--utrecht-badge-counter-padding-inline, var(--utrecht-badge-padding-inline, 0.5ch));
|
|
101
|
+
text-decoration: none;
|
|
102
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ReactTabsFunctionComponent, TabProps, TabPanelProps, TabListProps, TabsProps } from "react-tabs";
|
|
2
|
+
export declare const Tabs: ReactTabsFunctionComponent<TabsProps>;
|
|
3
|
+
export declare const TabList: ReactTabsFunctionComponent<TabListProps>;
|
|
4
|
+
export declare const Tab: ReactTabsFunctionComponent<TabProps>;
|
|
5
|
+
export declare const TabPanel: ReactTabsFunctionComponent<TabPanelProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Tabs as RTabs, TabList as RTabList, Tab as RTab, TabPanel as RTabPanel, } from "react-tabs";
|
|
3
|
+
// Tabs
|
|
4
|
+
export const Tabs = ({ children, ...otherProps }) => (_jsx(RTabs, { ...otherProps, children: _jsx("h1", { children: children }) }));
|
|
5
|
+
Tabs.tabsRole = "Tabs";
|
|
6
|
+
// TabList
|
|
7
|
+
export const TabList = ({ children, ...otherProps }) => (_jsx(RTabList, { ...otherProps, children: children }));
|
|
8
|
+
TabList.tabsRole = "TabList";
|
|
9
|
+
// Tab
|
|
10
|
+
export const Tab = ({ children, ...otherProps }) => (_jsx(RTab, { ...otherProps, children: children }));
|
|
11
|
+
Tab.tabsRole = "Tab";
|
|
12
|
+
// TabPanel
|
|
13
|
+
export const TabPanel = ({ children, ...otherProps }) => (_jsx(RTabPanel, { ...otherProps, children: children }));
|
|
14
|
+
TabPanel.tabsRole = "TabPanel";
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import ReactTooltip from "react-tooltip";
|
|
3
2
|
interface ToolTipProps {
|
|
4
|
-
|
|
5
|
-
tooltip: string;
|
|
6
|
-
layoutClassName?: string;
|
|
3
|
+
id: string;
|
|
7
4
|
}
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Implement this ToolTip only once, in a high-level wrapper.
|
|
7
|
+
* Use the ToolTip anywhere, in any element, by setting the following data props:
|
|
8
|
+
*
|
|
9
|
+
* data-tooltip-id="this-is-the-id-set-in-ToolTipProps"
|
|
10
|
+
* data-tooltip-content="Hello world!"
|
|
11
|
+
*/
|
|
12
|
+
export declare const ToolTip: React.FC<ToolTipProps>;
|
|
13
|
+
export {};
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import clsx from "clsx";
|
|
3
|
-
import ReactTooltip from "react-tooltip";
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
2
|
import * as styles from "./ToolTip.module.css";
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { Tooltip } from "react-tooltip";
|
|
4
|
+
/**
|
|
5
|
+
* Implement this ToolTip only once, in a high-level wrapper.
|
|
6
|
+
* Use the ToolTip anywhere, in any element, by setting the following data props:
|
|
7
|
+
*
|
|
8
|
+
* data-tooltip-id="this-is-the-id-set-in-ToolTipProps"
|
|
9
|
+
* data-tooltip-content="Hello world!"
|
|
10
|
+
*/
|
|
11
|
+
export const ToolTip = ({ id }) => {
|
|
12
|
+
return _jsx(Tooltip, { className: styles.tooltip, ...{ id } });
|
|
7
13
|
};
|
|
8
|
-
export { ReactTooltip };
|
|
@@ -1,17 +1,33 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--conduction-tooltip-
|
|
3
|
-
|
|
2
|
+
--conduction-tooltip-padding-inline-start: 0px;
|
|
3
|
+
--conduction-tooltip-padding-inline-end: 0px;
|
|
4
|
+
--conduction-tooltip-padding-block-start: 0px;
|
|
5
|
+
--conduction-tooltip-padding-block-end: 0px;
|
|
6
|
+
|
|
7
|
+
--conduction-tooltip-background-color: var(--skeleton-color-black);
|
|
8
|
+
--conduction-tooltip-color: var(--skeleton-color-white);
|
|
9
|
+
|
|
10
|
+
--conduction-tooltip-border-width: 0px;
|
|
11
|
+
--conduction-tooltip-border-color: unset;
|
|
12
|
+
--conduction-tooltip-border-style: unset;
|
|
13
|
+
--conduction-tooltip-border-radius: 0px;
|
|
4
14
|
|
|
5
|
-
|
|
6
|
-
display: inline-block;
|
|
7
|
-
position: relative;
|
|
15
|
+
--conduction-tooltip-opacity: 1;
|
|
8
16
|
}
|
|
9
17
|
|
|
10
18
|
.tooltip {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
19
|
+
padding-inline-start: var(--conduction-tooltip-padding-inline-start);
|
|
20
|
+
padding-inline-end: var(--conduction-tooltip-padding-inline-end);
|
|
21
|
+
padding-block-start: var(--conduction-tooltip-padding-block-start);
|
|
22
|
+
padding-block-end: var(--conduction-tooltip-padding-block-end);
|
|
23
|
+
|
|
24
|
+
background-color: var(--conduction-tooltip-background-color) !important;
|
|
25
|
+
color: var(--conduction-tooltip-color) !important;
|
|
26
|
+
|
|
27
|
+
border-width: var(--conductino-tooltip-border-width);
|
|
28
|
+
border-color: var(--conduction-tooltip-border-color);
|
|
29
|
+
border-style: var(--conduction-tooltip-border-style);
|
|
30
|
+
border-radius: var(--conduction-tooltip-border-radius) !important;
|
|
14
31
|
|
|
15
|
-
|
|
16
|
-
all: unset !important;
|
|
32
|
+
opacity: var(--conduction-tooltip-opacity);
|
|
17
33
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -22,4 +22,5 @@ import { BadgeCounter } from "./components/badgeCounter/BadgeCounter";
|
|
|
22
22
|
import { CodeBlock } from "./components/codeBlock/CodeBlock";
|
|
23
23
|
import { ToolTip } from "./components/toolTip/ToolTip";
|
|
24
24
|
import { Pagination } from "./components/Pagination/Pagination";
|
|
25
|
-
|
|
25
|
+
import { TabContext } from "./components/tabs/Tabs";
|
|
26
|
+
export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, DetailsCard, InfoCard, Container, Breadcrumbs, InputText, InputPassword, InputEmail, InputDate, InputNumber, InputFile, Textarea, InputCheckbox, SelectMultiple, SelectSingle, ImageDivider, AuthenticatedLogo, UnauthenticatedLogo, MetaIcon, PrivateRoute, PrimaryTopNav, SecondaryTopNav, Tag, NotificationPopUp, QuoteWrapper, Pagination, BadgeCounter, CodeBlock, ToolTip, TabContext, };
|
package/lib/index.js
CHANGED
|
@@ -15,4 +15,5 @@ import { BadgeCounter } from "./components/badgeCounter/BadgeCounter";
|
|
|
15
15
|
import { CodeBlock } from "./components/codeBlock/CodeBlock";
|
|
16
16
|
import { ToolTip } from "./components/toolTip/ToolTip";
|
|
17
17
|
import { Pagination } from "./components/Pagination/Pagination";
|
|
18
|
-
|
|
18
|
+
import { TabContext } from "./components/tabs/Tabs";
|
|
19
|
+
export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, DetailsCard, InfoCard, Container, Breadcrumbs, InputText, InputPassword, InputEmail, InputDate, InputNumber, InputFile, Textarea, InputCheckbox, SelectMultiple, SelectSingle, ImageDivider, AuthenticatedLogo, UnauthenticatedLogo, MetaIcon, PrivateRoute, PrimaryTopNav, SecondaryTopNav, Tag, NotificationPopUp, QuoteWrapper, Pagination, BadgeCounter, CodeBlock, ToolTip, TabContext, };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@conduction/components",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.4",
|
|
4
4
|
"description": "React (Gatsby) components used within the Conduction Skeleton Application (and its implementations)",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"react-hook-form": "7.29.0",
|
|
32
32
|
"react-paginate": "^8.2.0",
|
|
33
33
|
"react-select": "5.3.2",
|
|
34
|
-
"react-
|
|
34
|
+
"react-tabs": "^6.0.2",
|
|
35
|
+
"react-tooltip": "^5.21.3"
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
37
38
|
"@types/node": "^17.0.23",
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
Textbox,
|
|
13
13
|
Button,
|
|
14
14
|
} from "@utrecht/component-library-react/dist/css-module";
|
|
15
|
-
import { ToolTip } from "../../toolTip/ToolTip";
|
|
16
15
|
import clsx from "clsx";
|
|
17
16
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
18
17
|
import { faCopy, faTrash } from "@fortawesome/free-solid-svg-icons";
|
|
@@ -133,25 +132,21 @@ const KeyValueComponent = ({
|
|
|
133
132
|
<TableCell>
|
|
134
133
|
<div className={styles.buttonsContainer}>
|
|
135
134
|
{copyValue && (
|
|
136
|
-
<ToolTip tooltip="Copy value">
|
|
137
|
-
<Button
|
|
138
|
-
{...{ disabled }}
|
|
139
|
-
onClick={() => handleCopyToClipboard(keyValue.value, idx)}
|
|
140
|
-
appearance={currentCopyIdx === idx ? "secondary-action-button" : "primary-action-button"}
|
|
141
|
-
>
|
|
142
|
-
<FontAwesomeIcon icon={faCopy} />
|
|
143
|
-
</Button>
|
|
144
|
-
</ToolTip>
|
|
145
|
-
)}
|
|
146
|
-
<ToolTip tooltip="Delete value">
|
|
147
135
|
<Button
|
|
148
136
|
{...{ disabled }}
|
|
149
|
-
onClick={() =>
|
|
150
|
-
|
|
137
|
+
onClick={() => handleCopyToClipboard(keyValue.value, idx)}
|
|
138
|
+
appearance={currentCopyIdx === idx ? "secondary-action-button" : "primary-action-button"}
|
|
151
139
|
>
|
|
152
|
-
<FontAwesomeIcon icon={
|
|
140
|
+
<FontAwesomeIcon icon={faCopy} />
|
|
153
141
|
</Button>
|
|
154
|
-
|
|
142
|
+
)}
|
|
143
|
+
<Button
|
|
144
|
+
{...{ disabled }}
|
|
145
|
+
onClick={() => setKeyValues(keyValues.filter((_keyValue) => _keyValue !== keyValue))}
|
|
146
|
+
className={clsx(styles.deleteButton)}
|
|
147
|
+
>
|
|
148
|
+
<FontAwesomeIcon icon={faTrash} />
|
|
149
|
+
</Button>
|
|
155
150
|
</div>
|
|
156
151
|
</TableCell>
|
|
157
152
|
</TableRow>
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--conduction-tab-list-padding-inline-start: 0px;
|
|
3
|
+
--conduction-tab-list-border-bottom-width: var(--skeleton-size-3xs);
|
|
4
|
+
--conduction-tab-list-border-bottom-style: solid;
|
|
5
|
+
--conduction-tab-list-border-bottom-color: #d1d1d1;
|
|
6
|
+
|
|
7
|
+
--conduction-tab-padding-block-start: var(--skeleton-size-xs);
|
|
8
|
+
--conduction-tab-padding-block-end: var(--skeleton-size-xs);
|
|
9
|
+
--conduction-tab-padding-inline-start: var(--skeleton-size-sm);
|
|
10
|
+
--conduction-tab-padding-inline-end: var(--skeleton-size-sm);
|
|
11
|
+
--conduction-tab-font-size: var(--skeleton-font-size-sm: );
|
|
12
|
+
--conduction-tab-font-weight: var(--skeleton-font-weight-normal);
|
|
13
|
+
--conduction-tab-font-family: "Noto Sans", Arial, sans-serif;
|
|
14
|
+
--conduction-tab-max-width: unset;
|
|
15
|
+
--conduction-tab-min-width: 160px;
|
|
16
|
+
--conduction-tab-min-height: 61px;
|
|
17
|
+
/* --conduction-tab-letter-spacing: 0.02857em; */
|
|
18
|
+
/* --conduction-tab-text-transform: uppercase; */
|
|
19
|
+
--conduction-tab-color: #4a4a4a;
|
|
20
|
+
|
|
21
|
+
--conduction-tab-selected-color: #4a4a4a;
|
|
22
|
+
--conduction-tab-selected-border-bottom-width: var(--skeleton-size-3xs);
|
|
23
|
+
--conduction-tab-selected-border-bottom-style: solid;
|
|
24
|
+
--conduction-tab-selected-border-bottom-color: #4376fc;
|
|
25
|
+
--conduction-tab-selected-font-weight: var(--skeleton-font-weight-bold);
|
|
26
|
+
|
|
27
|
+
--conduction-tab-panel-padding-block-start: var(--skeleton-size-lg);
|
|
28
|
+
--conduction-tab-panel-padding-block-end: var(--skeleton-size-lg);
|
|
29
|
+
--conduction-tab-panel-padding-inline-start: var(--skeleton-size-lg);
|
|
30
|
+
--conduction-tab-panel-padding-inline-end: var(--skeleton-size-lg);
|
|
31
|
+
|
|
32
|
+
--conduction-tab-badge-margin-inline-start: var(--skeleton-size-xs);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.tabList {
|
|
36
|
+
padding-inline-start: var(--conduction-tab-list-padding-inline-start);
|
|
37
|
+
border-bottom-width: var(--conduction-tab-list-border-bottom-width);
|
|
38
|
+
border-bottom-style: var(--conduction-tab-list-border-bottom-style);
|
|
39
|
+
border-bottom-color: var(--conduction-tab-list-border-bottom-color);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.tab {
|
|
43
|
+
display: inline-flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
position: relative;
|
|
49
|
+
box-sizing: border-box;
|
|
50
|
+
text-align: center;
|
|
51
|
+
white-space: normal;
|
|
52
|
+
bottom: -2px;
|
|
53
|
+
|
|
54
|
+
color: var(--conduction-tab-color);
|
|
55
|
+
padding-block-start: var(--conduction-tab-padding-block-start);
|
|
56
|
+
padding-block-end: var(--conduction-tab-padding-block-end);
|
|
57
|
+
padding-inline-start: var(--conduction-tab-padding-inline-start);
|
|
58
|
+
padding-inline-end: var(--conduction-tab-padding-inline-end);
|
|
59
|
+
font-size: var(--conduction-tab-font-size);
|
|
60
|
+
font-weight: var(--conduction-tab-font-weight);
|
|
61
|
+
font-family: var(--conduction-tab-font-family);
|
|
62
|
+
max-width: var(--conduction-tab-max-width);
|
|
63
|
+
min-width: var(--conduction-tab-min-width);
|
|
64
|
+
min-height: var(--conduction-tab-min-height);
|
|
65
|
+
letter-spacing: var(--conduction-tab-letter-spacing);
|
|
66
|
+
text-transform: var(--conduction-tab-text-transform);
|
|
67
|
+
|
|
68
|
+
border-bottom-width: var(--conduction-tab-list-border-bottom-width);
|
|
69
|
+
border-bottom-style: var(--conduction-tab-list-border-bottom-style);
|
|
70
|
+
border-bottom-color: var(--conduction-tab-list-border-bottom-color);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.tab[aria-selected="true"] {
|
|
74
|
+
color: var(--conduction-tab-selected-color);
|
|
75
|
+
border-bottom-width: var(--conduction-tab-selected-border-bottom-width);
|
|
76
|
+
border-bottom-style: var(--conduction-tab-selected-border-bottom-style);
|
|
77
|
+
border-bottom-color: var(--conduction-tab-selected-border-bottom-color);
|
|
78
|
+
font-weight: var(--conduction-tab-selected-font-weight);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.tabs [class*="react-tabs__tab-panel--selected"] {
|
|
82
|
+
padding-block-start: var(--conduction-tab-panel-padding-block-start);
|
|
83
|
+
padding-block-end: var(--conduction-tab-panel-padding-block-end);
|
|
84
|
+
padding-inline-start: var(--conduction-tab-panel-padding-inline-start);
|
|
85
|
+
padding-inline-end: var(--conduction-tab-panel-padding-inline-end);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.badge {
|
|
89
|
+
margin-inline-start: var(--conduction-tab-badge-margin-inline-start);
|
|
90
|
+
background-color: var(--utrecht-badge-counter-background-color, var(--utrecht-badge-background-color, #000));
|
|
91
|
+
border-radius: var(--utrecht-badge-counter-border-radius, var(--utrecht-badge-border-radius, 0.5ch));
|
|
92
|
+
color: var(--utrecht-badge-counter-color, var(--utrecht-badge-color, #fff));
|
|
93
|
+
display: inline-block;
|
|
94
|
+
font-family: var(--utrecht-document-font-family, sans-serif);
|
|
95
|
+
font-style: var(--utrecht-badge-counter-font-style, normal);
|
|
96
|
+
font-weight: var(--utrecht-badge-counter-font-weight, var(--utrecht-badge-font-weight, bold));
|
|
97
|
+
padding-block-end: var(--utrecht-badge-counter-padding-block, var(--utrecht-badge-padding-block, 0.5ex));
|
|
98
|
+
padding-block-start: var(--utrecht-badge-counter-padding-block, var(--utrecht-badge-padding-block, 0.5ex));
|
|
99
|
+
padding-inline-end: var(--utrecht-badge-counter-padding-inline, var(--utrecht-badge-padding-inline, 0.5ch));
|
|
100
|
+
padding-inline-start: var(--utrecht-badge-counter-padding-inline, var(--utrecht-badge-padding-inline, 0.5ch));
|
|
101
|
+
text-decoration: none;
|
|
102
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as styles from "./Tabs.module.css";
|
|
3
|
+
import { Tab, Tabs, TabList, TabPanel } from "react-tabs";
|
|
4
|
+
import { BadgeCounter } from "@utrecht/component-library-react";
|
|
5
|
+
|
|
6
|
+
interface testProps {
|
|
7
|
+
tabs: ITabProps[];
|
|
8
|
+
tabContent: ITabPanelProps[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface ITabProps {
|
|
12
|
+
name: string;
|
|
13
|
+
badge?: string;
|
|
14
|
+
}
|
|
15
|
+
interface ITabPanelProps {
|
|
16
|
+
content: JSX.Element;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const TabContext: React.FC<testProps> = ({ tabs, tabContent }) => {
|
|
20
|
+
return (
|
|
21
|
+
<Tabs className={styles.tabs}>
|
|
22
|
+
<TabList className={styles.tabList}>
|
|
23
|
+
{tabs.map(({ name, badge }) => (
|
|
24
|
+
<Tab className={styles.tab}>
|
|
25
|
+
<span>
|
|
26
|
+
{name}
|
|
27
|
+
{badge !== undefined && <BadgeCounter className={styles.badge}>{badge}</BadgeCounter>}
|
|
28
|
+
</span>
|
|
29
|
+
</Tab>
|
|
30
|
+
))}
|
|
31
|
+
</TabList>
|
|
32
|
+
{tabContent.map(({ content }) => (
|
|
33
|
+
<TabPanel className={styles.tabPanel}>{content}</TabPanel>
|
|
34
|
+
))}
|
|
35
|
+
</Tabs>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
@@ -1,17 +1,33 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--conduction-tooltip-
|
|
3
|
-
|
|
2
|
+
--conduction-tooltip-padding-inline-start: 0px;
|
|
3
|
+
--conduction-tooltip-padding-inline-end: 0px;
|
|
4
|
+
--conduction-tooltip-padding-block-start: 0px;
|
|
5
|
+
--conduction-tooltip-padding-block-end: 0px;
|
|
6
|
+
|
|
7
|
+
--conduction-tooltip-background-color: var(--skeleton-color-black);
|
|
8
|
+
--conduction-tooltip-color: var(--skeleton-color-white);
|
|
9
|
+
|
|
10
|
+
--conduction-tooltip-border-width: 0px;
|
|
11
|
+
--conduction-tooltip-border-color: unset;
|
|
12
|
+
--conduction-tooltip-border-style: unset;
|
|
13
|
+
--conduction-tooltip-border-radius: 0px;
|
|
4
14
|
|
|
5
|
-
|
|
6
|
-
display: inline-block;
|
|
7
|
-
position: relative;
|
|
15
|
+
--conduction-tooltip-opacity: 1;
|
|
8
16
|
}
|
|
9
17
|
|
|
10
18
|
.tooltip {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
19
|
+
padding-inline-start: var(--conduction-tooltip-padding-inline-start);
|
|
20
|
+
padding-inline-end: var(--conduction-tooltip-padding-inline-end);
|
|
21
|
+
padding-block-start: var(--conduction-tooltip-padding-block-start);
|
|
22
|
+
padding-block-end: var(--conduction-tooltip-padding-block-end);
|
|
23
|
+
|
|
24
|
+
background-color: var(--conduction-tooltip-background-color) !important;
|
|
25
|
+
color: var(--conduction-tooltip-color) !important;
|
|
26
|
+
|
|
27
|
+
border-width: var(--conductino-tooltip-border-width);
|
|
28
|
+
border-color: var(--conduction-tooltip-border-color);
|
|
29
|
+
border-style: var(--conduction-tooltip-border-style);
|
|
30
|
+
border-radius: var(--conduction-tooltip-border-radius) !important;
|
|
14
31
|
|
|
15
|
-
|
|
16
|
-
all: unset !important;
|
|
32
|
+
opacity: var(--conduction-tooltip-opacity);
|
|
17
33
|
}
|
|
@@ -1,23 +1,19 @@
|
|
|
1
|
-
import clsx from "clsx";
|
|
2
|
-
import _ from "lodash";
|
|
3
1
|
import * as React from "react";
|
|
4
|
-
import ReactTooltip from "react-tooltip";
|
|
5
2
|
import * as styles from "./ToolTip.module.css";
|
|
3
|
+
import { Tooltip } from "react-tooltip";
|
|
6
4
|
|
|
7
5
|
interface ToolTipProps {
|
|
8
|
-
|
|
9
|
-
tooltip: string;
|
|
10
|
-
layoutClassName?: string;
|
|
6
|
+
id: string;
|
|
11
7
|
}
|
|
12
8
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Implement this ToolTip only once, in a high-level wrapper.
|
|
11
|
+
* Use the ToolTip anywhere, in any element, by setting the following data props:
|
|
12
|
+
*
|
|
13
|
+
* data-tooltip-id="this-is-the-id-set-in-ToolTipProps"
|
|
14
|
+
* data-tooltip-content="Hello world!"
|
|
15
|
+
*/
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
);
|
|
17
|
+
export const ToolTip: React.FC<ToolTipProps> = ({ id }) => {
|
|
18
|
+
return <Tooltip className={styles.tooltip} {...{ id }} />;
|
|
21
19
|
};
|
|
22
|
-
|
|
23
|
-
export { ReactTooltip };
|
package/src/index.ts
CHANGED
|
@@ -29,6 +29,7 @@ import { BadgeCounter } from "./components/badgeCounter/BadgeCounter";
|
|
|
29
29
|
import { CodeBlock } from "./components/codeBlock/CodeBlock";
|
|
30
30
|
import { ToolTip } from "./components/toolTip/ToolTip";
|
|
31
31
|
import { Pagination } from "./components/Pagination/Pagination";
|
|
32
|
+
import { TabContext } from "./components/tabs/Tabs";
|
|
32
33
|
|
|
33
34
|
export {
|
|
34
35
|
DownloadCard,
|
|
@@ -62,4 +63,5 @@ export {
|
|
|
62
63
|
BadgeCounter,
|
|
63
64
|
CodeBlock,
|
|
64
65
|
ToolTip,
|
|
66
|
+
TabContext,
|
|
65
67
|
};
|