@laerdal/life-react-components 2.1.0-dev.3 → 2.1.0-dev.7
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/AuthPage/AuthPage.d.ts +1 -1
- package/dist/Banners/Banner.d.ts +1 -1
- package/dist/Banners/OverviewBanner.d.ts +1 -1
- package/dist/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/Button/Iconbutton.cjs +6 -4
- package/dist/Button/Iconbutton.cjs.map +1 -1
- package/dist/Button/Iconbutton.d.ts +1 -0
- package/dist/Button/Iconbutton.js +6 -4
- package/dist/Button/Iconbutton.js.map +1 -1
- package/dist/Card/HorizontalCard/HorizontalCardActions.d.ts +1 -1
- package/dist/Card/HorizontalCard/HorizontalCardBody.d.ts +1 -1
- package/dist/Card/HorizontalCard/HorizontalCardThumbnail.d.ts +1 -1
- package/dist/Card/HorizontalCard/types.d.ts +4 -4
- package/dist/Chips/ChipTypes.d.ts +2 -2
- package/dist/ChipsInput/ChipDropdownInput.cjs.map +1 -1
- package/dist/ChipsInput/ChipDropdownInput.d.ts +1 -1
- package/dist/ChipsInput/ChipDropdownInput.js.map +1 -1
- package/dist/ChipsInput/ChipInput.cjs +13 -2
- package/dist/ChipsInput/ChipInput.cjs.map +1 -1
- package/dist/ChipsInput/ChipInput.js +14 -3
- package/dist/ChipsInput/ChipInput.js.map +1 -1
- package/dist/ChipsInput/ChipInputField.cjs +1 -0
- package/dist/ChipsInput/ChipInputField.cjs.map +1 -1
- package/dist/ChipsInput/ChipInputField.js +1 -0
- package/dist/ChipsInput/ChipInputField.js.map +1 -1
- package/dist/ChipsInput/ChipInputTypes.cjs.map +1 -1
- package/dist/ChipsInput/ChipInputTypes.d.ts +2 -1
- package/dist/ChipsInput/ChipInputTypes.js.map +1 -1
- package/dist/Dropdown/BasicDropdown.cjs.map +1 -1
- package/dist/Dropdown/BasicDropdown.d.ts +3 -3
- package/dist/Dropdown/BasicDropdown.js.map +1 -1
- package/dist/Dropdown/CommonStyling.cjs +1 -1
- package/dist/Dropdown/CommonStyling.cjs.map +1 -1
- package/dist/Dropdown/CommonStyling.js +1 -1
- package/dist/Dropdown/CommonStyling.js.map +1 -1
- package/dist/Dropdown/DropdownButtonTypes.d.ts +3 -3
- package/dist/GlobalNavigationBar/GlobalNavigationBar.cjs +1 -1
- package/dist/GlobalNavigationBar/GlobalNavigationBar.cjs.map +1 -1
- package/dist/GlobalNavigationBar/GlobalNavigationBar.d.ts +1 -1
- package/dist/GlobalNavigationBar/GlobalNavigationBar.js +1 -1
- package/dist/GlobalNavigationBar/GlobalNavigationBar.js.map +1 -1
- package/dist/GlobalNavigationBar/Logo.d.ts +1 -1
- package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.d.ts +1 -1
- package/dist/GlobalNavigationBar/desktop/MainMenu.d.ts +1 -1
- package/dist/GlobalNavigationBar/desktop/RightSideNav.d.ts +1 -1
- package/dist/GlobalNavigationBar/desktop/UserMenu.cjs +4 -2
- package/dist/GlobalNavigationBar/desktop/UserMenu.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/UserMenu.js +4 -2
- package/dist/GlobalNavigationBar/desktop/UserMenu.js.map +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenu.cjs +3 -0
- package/dist/GlobalNavigationBar/mobile/MobileMenu.cjs.map +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenu.d.ts +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenu.js +3 -0
- package/dist/GlobalNavigationBar/mobile/MobileMenu.js.map +1 -1
- package/dist/GlobalNavigationBar/types.d.ts +7 -7
- package/dist/HyperLink/index.cjs +10 -2
- package/dist/HyperLink/index.cjs.map +1 -1
- package/dist/HyperLink/index.d.ts +2 -2
- package/dist/HyperLink/index.js +2 -2
- package/dist/HyperLink/index.js.map +1 -1
- package/dist/Image/ImageWithFallbacks.d.ts +1 -1
- package/dist/InputFields/Label.cjs +39 -6
- package/dist/InputFields/Label.cjs.map +1 -1
- package/dist/InputFields/Label.d.ts +2 -1
- package/dist/InputFields/Label.js +41 -9
- package/dist/InputFields/Label.js.map +1 -1
- package/dist/InputFields/QuickSearch.d.ts +1 -1
- package/dist/InputFields/ResponsiveComponentWrapper.d.ts +1 -1
- package/dist/InputFields/SearchBar.d.ts +1 -1
- package/dist/InputFields/components/SearchBarInput.d.ts +1 -1
- package/dist/InputFields/types.d.ts +3 -3
- package/dist/List/ListRow.d.ts +1 -1
- package/dist/LoadingIndicator/LoadingIndicator.d.ts +1 -1
- package/dist/MiniProductCard/MiniProductCard.d.ts +1 -1
- package/dist/Modals/Modal.d.ts +1 -1
- package/dist/Modals/ModalContainer.d.ts +2 -2
- package/dist/Modals/ModalTypes.d.ts +1 -1
- package/dist/NavItem/NavItem.d.ts +1 -1
- package/dist/Paginator/Paginator.d.ts +1 -1
- package/dist/Popover/Popover.d.ts +4 -4
- package/dist/ProfileButton/ProfileButton.d.ts +1 -1
- package/dist/QuizButton/QuizButton.d.ts +1 -1
- package/dist/SideMenu/types.d.ts +3 -3
- package/dist/SkipToContent/SkipToContent.d.ts +1 -1
- package/dist/Table/TableTypes.d.ts +4 -4
- package/dist/Tabs/TabLink.d.ts +1 -1
- package/dist/Tabs/Tabs.d.ts +1 -1
- package/dist/Tag/Tag.cjs +3 -5
- package/dist/Tag/Tag.cjs.map +1 -1
- package/dist/Tag/Tag.d.ts +2 -2
- package/dist/Tag/Tag.js +3 -5
- package/dist/Tag/Tag.js.map +1 -1
- package/dist/Tile/TileTypes.d.ts +8 -8
- package/dist/Toasters/Toast.d.ts +2 -2
- package/dist/Toasters/ToastContext.d.ts +2 -2
- package/dist/assets/index.d.ts +1 -1
- package/dist/icons/index.d.ts +2 -2
- package/dist/styles/typography.cjs +2 -1
- package/dist/styles/typography.cjs.map +1 -1
- package/dist/styles/typography.d.ts +3 -2
- package/dist/styles/typography.js +1 -1
- package/dist/styles/typography.js.map +1 -1
- package/package.json +10 -13
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
3
3
|
import _pt from "prop-types";
|
|
4
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
4
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
5
5
|
/**
|
|
6
6
|
* Import React libraries.
|
|
7
7
|
*/
|
|
@@ -17,33 +17,43 @@ import { Size } from '../types';
|
|
|
17
17
|
* Import third-party libraries.
|
|
18
18
|
*/
|
|
19
19
|
import styled from 'styled-components';
|
|
20
|
-
import { ComponentXSStyling, ComponentXXSStyling } from '../styles/typography';
|
|
20
|
+
import { ComponentXS, ComponentXSStyling, ComponentXXS, ComponentXXSStyling, TypographyBase } from '../styles/typography';
|
|
21
21
|
import { SystemIcons } from '../icons';
|
|
22
|
-
|
|
23
|
-
// Add component-specific styles.
|
|
24
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
23
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
|
-
|
|
24
|
+
// Add component-specific styles.
|
|
25
|
+
var Label = styled.label(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n\n ", " {\n ", "\n }\n\n &.small {\n ", "\n }\n &.medium {\n ", "\n }\n\n pointer-events: none;\n flex: 1;\n"])), ComponentXXSStyling(1, COLORS.neutral_500), BREAKPOINTS.MEDIUM, ComponentXSStyling(1, COLORS.neutral_500), ComponentXXSStyling(1, COLORS.neutral_500), ComponentXSStyling(1, COLORS.neutral_500));
|
|
27
26
|
var LabelRow = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n align-items: flex-start;\n height: 16px;\n ", "\n"])), function (props) {
|
|
28
27
|
return props.margin ? "margin: ".concat(props.margin, ";") : '';
|
|
29
28
|
});
|
|
30
|
-
var
|
|
29
|
+
var CopyContainer = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\n &:visited:not(.disabled) {\n ", "\n {\n color: ", ";\n }\n }\n\n &:hover:not(.disabled),\n &.hover-state:not(.disabled) {\n ", "\n {\n color: ", ";\n text-decoration-line: underline;\n }\n }\n\n &:focus:not(.disabled),\n &.focus-state:not(.disabled) {\n ", "\n {\n color: ", ";\n background-color: white;\n text-decoration-line: underline;\n }\n }\n\n &:active:not(.disabled),\n &.active-state:not(.disabled) {\n ", "\n {\n color: ", ";\n background-color: white;\n text-decoration-line: underline;\n }\n }\n\n &:not(.disabled)\n {\n ", "\n {\n outline: none;\n padding: 2px 0;\n text-decoration-style: solid;\n text-decoration-line: none;\n font-weight: 700;\n color: ", ";\n }\n }\n\n &.disabled\n {\n ", "\n {\n outline: none;\n padding: 2px 0;\n text-decoration-style: solid;\n text-decoration-line: none;\n font-weight: 700;\n color: ", ";\n }\n }\n cursor: pointer;\n"])), TypographyBase, COLORS.primary_800, TypographyBase, COLORS.primary_700, TypographyBase, COLORS.primary_700, TypographyBase, COLORS.primary_700, TypographyBase, COLORS.primary_600, TypographyBase, COLORS.neutral_300);
|
|
30
|
+
var LabelRowInner = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n width: 100%;\n height: 100%;\n gap: ", ";\n align-items: center;\n"])), function (props) {
|
|
31
31
|
return props.size === Size.Small ? '2px' : '4px';
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
// Add component-specific types
|
|
35
|
-
|
|
35
|
+
var CopyState;
|
|
36
|
+
(function (CopyState) {
|
|
37
|
+
CopyState[CopyState["Disabled"] = 0] = "Disabled";
|
|
38
|
+
CopyState[CopyState["Available"] = 1] = "Available";
|
|
39
|
+
CopyState[CopyState["Copied"] = 2] = "Copied";
|
|
40
|
+
})(CopyState || (CopyState = {}));
|
|
36
41
|
var InputLabel = function InputLabel(_ref) {
|
|
37
42
|
var inputId = _ref.inputId,
|
|
38
43
|
text = _ref.text,
|
|
39
44
|
size = _ref.size,
|
|
40
45
|
margin = _ref.margin,
|
|
41
|
-
requiredProp = _ref.required
|
|
46
|
+
requiredProp = _ref.required,
|
|
47
|
+
showCopyButton = _ref.showCopyButton;
|
|
42
48
|
// Globally used variables within the component
|
|
43
49
|
var _React$useState = React.useState(false),
|
|
44
50
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
45
51
|
required = _React$useState2[0],
|
|
46
52
|
setRequired = _React$useState2[1];
|
|
53
|
+
var _React$useState3 = React.useState(CopyState.Available),
|
|
54
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
55
|
+
copyState = _React$useState4[0],
|
|
56
|
+
setCopyState = _React$useState4[1];
|
|
47
57
|
|
|
48
58
|
/**
|
|
49
59
|
* Checks if field is set as required and we have to mark it accordingly.
|
|
@@ -66,6 +76,19 @@ var InputLabel = function InputLabel(_ref) {
|
|
|
66
76
|
var _document$getElementB2;
|
|
67
77
|
(_document$getElementB2 = document.getElementById(id)) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.click();
|
|
68
78
|
};
|
|
79
|
+
var copyInputClick = function copyInputClick(e) {
|
|
80
|
+
var _document$getElementB3;
|
|
81
|
+
e.preventDefault();
|
|
82
|
+
if (copyState == CopyState.Copied) return;
|
|
83
|
+
var val = (_document$getElementB3 = document.getElementById(inputId)) === null || _document$getElementB3 === void 0 ? void 0 : _document$getElementB3.value;
|
|
84
|
+
if (val) {
|
|
85
|
+
window.navigator.clipboard.writeText(val);
|
|
86
|
+
setCopyState(CopyState.Copied);
|
|
87
|
+
setTimeout(function () {
|
|
88
|
+
setCopyState(CopyState.Available);
|
|
89
|
+
}, 1000);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
69
92
|
return /*#__PURE__*/_jsx(LabelRow, {
|
|
70
93
|
margin: margin,
|
|
71
94
|
children: /*#__PURE__*/_jsxs(LabelRowInner, {
|
|
@@ -80,6 +103,14 @@ var InputLabel = function InputLabel(_ref) {
|
|
|
80
103
|
},
|
|
81
104
|
className: size || '',
|
|
82
105
|
children: text
|
|
106
|
+
}), showCopyButton && /*#__PURE__*/_jsx(CopyContainer, {
|
|
107
|
+
className: copyState != CopyState.Available ? "disabled" : "",
|
|
108
|
+
onClick: copyInputClick,
|
|
109
|
+
children: size == Size.Medium ? /*#__PURE__*/_jsx(ComponentXS, {
|
|
110
|
+
children: copyState == CopyState.Copied ? 'Copied' : 'Copy'
|
|
111
|
+
}) : /*#__PURE__*/_jsx(ComponentXXS, {
|
|
112
|
+
children: copyState == CopyState.Copied ? 'Copied' : 'Copy'
|
|
113
|
+
})
|
|
83
114
|
})]
|
|
84
115
|
})
|
|
85
116
|
});
|
|
@@ -88,7 +119,8 @@ InputLabel.propTypes = {
|
|
|
88
119
|
inputId: _pt.string.isRequired,
|
|
89
120
|
text: _pt.string.isRequired,
|
|
90
121
|
margin: _pt.string,
|
|
91
|
-
required: _pt.bool
|
|
122
|
+
required: _pt.bool,
|
|
123
|
+
showCopyButton: _pt.bool
|
|
92
124
|
};
|
|
93
125
|
export default InputLabel;
|
|
94
126
|
//# sourceMappingURL=Label.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.js","names":["React","BREAKPOINTS","COLORS","Size","styled","ComponentXSStyling","ComponentXXSStyling","SystemIcons","Label","label","neutral_500","MEDIUM","LabelRow","div","props","margin","LabelRowInner","size","Small","InputLabel","inputId","text","requiredProp","required","useState","setRequired","useEffect","undefined","document","getElementById","getAttribute","Boolean","onTriggerClick","id","click","critical_500"],"sources":["../../src/InputFields/Label.tsx"],"sourcesContent":["/**\n * Import React libraries.\n */\nimport * as React from 'react';\n\n/**\n * Import custom styles.\n */\nimport { BREAKPOINTS, COLORS } from '../styles';\nimport { Size } from '../types';\n\n/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\nimport { ComponentXSStyling, ComponentXXSStyling } from '../styles/typography';\nimport { SystemIcons } from '../icons';\n\n// Add component-specific styles.\nconst Label = styled.label`\n ${ComponentXXSStyling(1, COLORS.neutral_500)}\n\n ${BREAKPOINTS.MEDIUM} {\n ${ComponentXSStyling(1, COLORS.neutral_500)}\n }\n\n &.small {\n ${ComponentXXSStyling(1, COLORS.neutral_500)}\n }\n &.medium {\n ${ComponentXSStyling(1, COLORS.neutral_500)}\n }\n\n pointer-events: none;\n`;\n\nconst LabelRow = styled.div<{ margin?: string }>`\n display: flex;\n align-items: flex-start;\n height: 16px;\n ${(props) => (props.margin ? `margin: ${props.margin};` : '')}\n`;\n\nconst LabelRowInner = styled.div<{ size: Size.Small | Size.Medium | undefined }>`\n display: flex;\n flex-direction: row;\n height: 100%;\n gap: ${(props) => (props.size === Size.Small ? '2px' : '4px')};\n align-items: center;\n`;\n\n// Add component-specific types\ntype LabelProps = {\n inputId: string;\n text: string;\n size?: Size.Small | Size.Medium;\n margin?: string;\n required?: boolean;\n};\n\nconst InputLabel: React.FunctionComponent<LabelProps> = ({ inputId, text, size, margin, required: requiredProp }: LabelProps) => {\n // Globally used variables within the component\n const [required, setRequired] = React.useState<boolean>(false);\n\n /**\n * Checks if field is set as required and we have to mark it accordingly.\n */\n React.useEffect(() => {\n if(requiredProp === undefined)\n {\n if (document.getElementById(inputId)?.getAttribute('required') === '') {\n setRequired(true);\n } else {\n setRequired(false);\n }\n }\n else\n setRequired(Boolean(requiredProp));\n }, []);\n /**\n * Triggers a click element on a specific element.\n * @param id - ID of the element which needs to be clicked.\n */\n const onTriggerClick = (id: string): void => {\n document.getElementById(id)?.click();\n };\n\n return (\n <LabelRow margin={margin}>\n <LabelRowInner size={size}>\n {required && <SystemIcons.Asterisk size=\"16px\" color={COLORS.critical_500} />}\n <Label htmlFor={inputId} onClick={() => onTriggerClick(inputId)} className={size || ''}>\n {text}\n </Label>\n </LabelRowInner>\n </LabelRow>\n );\n};\n\nexport default InputLabel;\n"],"mappings":";;;;AAAA;AACA;AACA;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;;AAE9B;AACA;AACA;AACA,SAASC,WAAW,EAAEC,MAAM,QAAQ,WAAW;AAC/C,SAASC,IAAI,QAAQ,UAAU;;AAE/B;AACA;AACA;AACA,OAAOC,MAAM,MAAM,mBAAmB;AACtC,SAASC,kBAAkB,EAAEC,mBAAmB,QAAQ,sBAAsB;
|
|
1
|
+
{"version":3,"file":"Label.js","names":["React","BREAKPOINTS","COLORS","Size","styled","ComponentXS","ComponentXSStyling","ComponentXXS","ComponentXXSStyling","TypographyBase","SystemIcons","Label","label","neutral_500","MEDIUM","LabelRow","div","props","margin","CopyContainer","primary_800","primary_700","primary_600","neutral_300","LabelRowInner","size","Small","CopyState","InputLabel","inputId","text","requiredProp","required","showCopyButton","useState","setRequired","Available","copyState","setCopyState","useEffect","undefined","document","getElementById","getAttribute","Boolean","onTriggerClick","id","click","copyInputClick","e","preventDefault","Copied","val","value","window","navigator","clipboard","writeText","setTimeout","critical_500","Medium"],"sources":["../../src/InputFields/Label.tsx"],"sourcesContent":["/**\n * Import React libraries.\n */\nimport * as React from 'react';\n\n/**\n * Import custom styles.\n */\nimport { BREAKPOINTS, COLORS } from '../styles';\nimport { Size } from '../types';\n\n/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\nimport { ComponentXS, ComponentXSStyling, ComponentXXS, ComponentXXSStyling, TypographyBase } from '../styles/typography';\nimport { SystemIcons } from '../icons';\nimport {HyperLink, StyledLink} from '../HyperLink';\n\n// Add component-specific styles.\nconst Label = styled.label`\n ${ComponentXXSStyling(1, COLORS.neutral_500)}\n\n ${BREAKPOINTS.MEDIUM} {\n ${ComponentXSStyling(1, COLORS.neutral_500)}\n }\n\n &.small {\n ${ComponentXXSStyling(1, COLORS.neutral_500)}\n }\n &.medium {\n ${ComponentXSStyling(1, COLORS.neutral_500)}\n }\n\n pointer-events: none;\n flex: 1;\n`;\n\nconst LabelRow = styled.div<{ margin?: string }>`\n display: flex;\n align-items: flex-start;\n height: 16px;\n ${(props) => (props.margin ? `margin: ${props.margin};` : '')}\n`;\n\nconst CopyContainer = styled.div`\n\n &:visited:not(.disabled) {\n ${TypographyBase}\n {\n color: ${COLORS.primary_800};\n }\n }\n\n &:hover:not(.disabled),\n &.hover-state:not(.disabled) {\n ${TypographyBase}\n {\n color: ${COLORS.primary_700};\n text-decoration-line: underline;\n }\n }\n\n &:focus:not(.disabled),\n &.focus-state:not(.disabled) {\n ${TypographyBase}\n {\n color: ${COLORS.primary_700};\n background-color: white;\n text-decoration-line: underline;\n }\n }\n\n &:active:not(.disabled),\n &.active-state:not(.disabled) {\n ${TypographyBase}\n {\n color: ${COLORS.primary_700};\n background-color: white;\n text-decoration-line: underline;\n }\n }\n\n &:not(.disabled)\n {\n ${TypographyBase}\n {\n outline: none;\n padding: 2px 0;\n text-decoration-style: solid;\n text-decoration-line: none;\n font-weight: 700;\n color: ${COLORS.primary_600};\n }\n }\n\n &.disabled\n {\n ${TypographyBase}\n {\n outline: none;\n padding: 2px 0;\n text-decoration-style: solid;\n text-decoration-line: none;\n font-weight: 700;\n color: ${COLORS.neutral_300};\n }\n }\n cursor: pointer;\n`;\n\nconst LabelRowInner = styled.div<{ size: Size.Small | Size.Medium | undefined }>`\n display: flex;\n flex-direction: row;\n width: 100%;\n height: 100%;\n gap: ${(props) => (props.size === Size.Small ? '2px' : '4px')};\n align-items: center;\n`;\n\n// Add component-specific types\ntype LabelProps = {\n inputId: string;\n text: string;\n size?: Size.Small | Size.Medium;\n margin?: string;\n required?: boolean;\n showCopyButton?: boolean;\n};\n\nenum CopyState {\n Disabled = 0,\n Available = 1,\n Copied = 2\n}\n\nconst InputLabel: React.FunctionComponent<LabelProps> = ({ inputId, text, size, margin, required: requiredProp, showCopyButton }: LabelProps) => {\n // Globally used variables within the component\n const [required, setRequired] = React.useState<boolean>(false);\n const [copyState, setCopyState] = React.useState<CopyState>(CopyState.Available);\n\n /**\n * Checks if field is set as required and we have to mark it accordingly.\n */\n React.useEffect(() => {\n if(requiredProp === undefined)\n {\n if (document.getElementById(inputId)?.getAttribute('required') === '') {\n setRequired(true);\n } else {\n setRequired(false);\n }\n }\n else\n setRequired(Boolean(requiredProp));\n }, []);\n /**\n * Triggers a click element on a specific element.\n * @param id - ID of the element which needs to be clicked.\n */\n const onTriggerClick = (id: string): void => {\n document.getElementById(id)?.click();\n };\n\n const copyInputClick = (e: any) => {\n e.preventDefault();\n if(copyState == CopyState.Copied)\n return;\n \n const val = (document.getElementById(inputId) as HTMLInputElement)?.value;\n if(val)\n {\n window.navigator.clipboard.writeText(val);\n setCopyState(CopyState.Copied);\n setTimeout(() => {\n setCopyState(CopyState.Available);\n }, 1000);\n }\n };\n\n return (\n <LabelRow margin={margin}>\n <LabelRowInner size={size}>\n {required && <SystemIcons.Asterisk size=\"16px\" color={COLORS.critical_500} />}\n <Label htmlFor={inputId} onClick={() => onTriggerClick(inputId)} className={size || ''}>\n {text}\n </Label>\n {showCopyButton && \n <CopyContainer className={copyState != CopyState.Available ? \"disabled\" : \"\"} onClick={copyInputClick}>\n { size == Size.Medium ? <ComponentXS>{copyState == CopyState.Copied ? 'Copied' : 'Copy'}</ComponentXS> :\n <ComponentXXS>{copyState == CopyState.Copied ? 'Copied' : 'Copy'}</ComponentXXS> }\n </CopyContainer> }\n </LabelRowInner>\n </LabelRow>\n );\n};\n\nexport default InputLabel;\n"],"mappings":"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"}
|
|
@@ -3,7 +3,7 @@ import { Size } from '../../types';
|
|
|
3
3
|
export declare const Search: import("styled-components").StyledComponent<"input", any, {
|
|
4
4
|
type: "search";
|
|
5
5
|
}, "type">;
|
|
6
|
-
|
|
6
|
+
type SearchBarInputProps = {
|
|
7
7
|
id: string;
|
|
8
8
|
searchTerm?: string;
|
|
9
9
|
setSearchTerm: (term: string) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Size } from '../types';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export
|
|
3
|
+
export type TextFieldProps = {
|
|
4
4
|
id: string;
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
readOnly?: boolean;
|
|
@@ -19,7 +19,7 @@ export declare type TextFieldProps = {
|
|
|
19
19
|
margin?: string;
|
|
20
20
|
note?: TextFieldNote;
|
|
21
21
|
};
|
|
22
|
-
export
|
|
22
|
+
export type TextareaProps = Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'value' | 'placeholder' | 'disabled' | 'required' | 'onChange'> & {
|
|
23
23
|
id: string;
|
|
24
24
|
placeholder: string;
|
|
25
25
|
value?: string;
|
|
@@ -33,7 +33,7 @@ export declare type TextareaProps = Omit<React.TextareaHTMLAttributes<HTMLTextAr
|
|
|
33
33
|
note?: TextFieldNote;
|
|
34
34
|
required: boolean;
|
|
35
35
|
};
|
|
36
|
-
export
|
|
36
|
+
export type TextFieldNote = {
|
|
37
37
|
message: string;
|
|
38
38
|
icon: React.ReactNode;
|
|
39
39
|
};
|
package/dist/List/ListRow.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DropdownButtonProps } from '../Dropdown/DropdownButtonTypes';
|
|
3
3
|
import { Size } from '../types';
|
|
4
|
-
|
|
4
|
+
type Props = Omit<React.HTMLAttributes<HTMLDivElement>, 'tabIndex' | 'onMouseDown' | 'onKeyDown'> & {
|
|
5
5
|
size?: Size;
|
|
6
6
|
variant?: 'normal' | 'overlay';
|
|
7
7
|
icon?: React.ReactNode;
|
package/dist/Modals/Modal.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
type ModalContainerProps = {
|
|
3
3
|
id?: string;
|
|
4
4
|
showModal: boolean;
|
|
5
5
|
closeModal: () => void;
|
|
@@ -12,7 +12,7 @@ declare type ModalContainerProps = {
|
|
|
12
12
|
maxWidth?: string;
|
|
13
13
|
zIndex?: number;
|
|
14
14
|
};
|
|
15
|
-
|
|
15
|
+
type ModalContainerState = {
|
|
16
16
|
scroll: number;
|
|
17
17
|
};
|
|
18
18
|
declare class ModalContainer extends React.Component<ModalContainerProps, ModalContainerState> {
|
|
@@ -20,4 +20,4 @@ export interface LeftFooterHyperlink extends HyperlinkProps, LeftFooterActionBas
|
|
|
20
20
|
export interface LeftFooterButton extends Pick<ButtonProps, 'variant' | 'id' | 'loading' | 'disabled' | 'icon' | 'type'>, LeftFooterActionBase {
|
|
21
21
|
text: string;
|
|
22
22
|
}
|
|
23
|
-
export
|
|
23
|
+
export type LeftFooterAction = LeftFooterButton | LeftFooterHyperlink;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StyledComponentProps } from 'styled-components';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export
|
|
3
|
+
export type StyledComponentPropsWithAs<C extends string | React.ComponentType<any>, T extends object, O extends object, A extends keyof any, AsC extends string | React.ComponentType<any> = C, FAsC extends string | React.ComponentType<any> = C> = StyledComponentProps<C, T, O, A, FAsC> & {
|
|
4
4
|
as?: AsC | undefined;
|
|
5
5
|
forwardedAs?: FAsC | undefined;
|
|
6
6
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Position, Size } from '../types';
|
|
3
|
-
|
|
3
|
+
type topSectionProps = {
|
|
4
4
|
text: string;
|
|
5
5
|
note?: string;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
type actionButtonProps = {
|
|
8
8
|
icon: React.ReactNode;
|
|
9
9
|
action: () => void;
|
|
10
10
|
label?: string;
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
type bottomSectionProps = {
|
|
13
13
|
iconButtons?: actionButtonProps[];
|
|
14
14
|
textButton?: actionButtonProps;
|
|
15
15
|
};
|
|
16
|
-
|
|
16
|
+
type PopoverProps = {
|
|
17
17
|
size?: Size.Small | Size.Medium | Size.Large;
|
|
18
18
|
topSectionProps?: topSectionProps;
|
|
19
19
|
bottomSectionProps?: bottomSectionProps;
|
package/dist/SideMenu/types.d.ts
CHANGED
|
@@ -2,13 +2,13 @@ import { ButtonProps } from '../Button/Button';
|
|
|
2
2
|
import { IconButtonProps } from '../Button/Iconbutton';
|
|
3
3
|
import { MenuItemProps } from '../MenuItem/MenuItem';
|
|
4
4
|
import { Size } from '../types';
|
|
5
|
-
export
|
|
5
|
+
export type SideMenuAction = Omit<IconButtonProps, 'variant' | 'shape' | 'isInMobileMenu' | 'borderRadius' | 'flatEdge' | 'focusBackgroundColor' | 'useTransparentBackground' | 'unsetIconSize' | 'shouldNotInteract' | 'invertFocus' | 'hideOnLowWidth' | 'children'> & {
|
|
6
6
|
icon: React.ReactNode;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type SideMenuButton = Omit<ButtonProps, 'size' | 'iconOnly' | 'minWidth' | 'testId' | 'width' | 'invertFocus' | 'colorTheme' | 'flatEdge' | 'children'> & {
|
|
9
9
|
label: string;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type SideMenuItem = Omit<MenuItemProps, 'size'>;
|
|
12
12
|
export interface SideMenuHeader {
|
|
13
13
|
actions?: SideMenuAction[];
|
|
14
14
|
label?: string;
|
|
@@ -51,10 +51,10 @@ export interface TableColumn {
|
|
|
51
51
|
customContent?: (row: any, key: string) => any;
|
|
52
52
|
sortable?: boolean;
|
|
53
53
|
}
|
|
54
|
-
export
|
|
55
|
-
export
|
|
56
|
-
export
|
|
57
|
-
export
|
|
54
|
+
export type TableColumnTypes = 'text' | 'boolean' | 'number' | 'custom' | 'button' | 'icon' | 'link';
|
|
55
|
+
export type TableJustification = 'right' | 'left' | 'center';
|
|
56
|
+
export type TableSortingDirection = 'asc' | 'desc';
|
|
57
|
+
export type TableLayout = 'auto' | 'fixed';
|
|
58
58
|
export interface TablePagination {
|
|
59
59
|
from: number;
|
|
60
60
|
to: number;
|
package/dist/Tabs/TabLink.d.ts
CHANGED
package/dist/Tabs/Tabs.d.ts
CHANGED
package/dist/Tag/Tag.cjs
CHANGED
|
@@ -20,13 +20,11 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
20
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
21
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
22
22
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
|
-
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n height: 24px;\n width: calc(100%);\n
|
|
23
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n padding: 4px;\n height: 24px;\n width: calc(100%);\n max-width: fit-content;\n align-items: center;\n justify-content: center;\n min-width: ", ";\n border-radius: 2px;\n box-sizing: border-box;\n\n &.neutral {\n background-color: ", ";\n color: ", ";\n }\n &.positive {\n background-color: ", ";\n color: ", ";\n }\n &.warning {\n background-color: ", ";\n color: ", ";\n }\n &.critical {\n background-color: ", ";\n color: ", ";\n }\n &.accent1 {\n background-color: ", ";\n color: ", ";\n }\n &.accent2 {\n background-color: ", ";\n color: ", ";\n }\n\n"])), function (props) {
|
|
24
24
|
return props.isLabelPresent ? '64px' : '';
|
|
25
25
|
}, _.COLORS.neutral_100, _.COLORS.neutral_600, _.COLORS.correct_100, _.COLORS.correct_600, _.COLORS.warning_100, _.COLORS.warning_600, _.COLORS.critical_100, _.COLORS.critical_600, _.COLORS.accent1_100, _.COLORS.accent1_600, _.COLORS.accent2_100, _.COLORS.accent2_600);
|
|
26
|
-
var IconContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n
|
|
27
|
-
var TextContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n
|
|
28
|
-
return props.icon ? "4px 8px 4px 0" : "4px 8px";
|
|
29
|
-
}, (0, _.ComponentXSStyling)(_.ComponentTextStyle.Bold, null));
|
|
26
|
+
var IconContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n width: 16px;\n height: 16px;\n svg {\n width: 16px;\n height: 16px;\n }\n"])));
|
|
27
|
+
var TextContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n height: 16px;\n padding: 0 4px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden; \n ", "\n"])), (0, _.ComponentXSStyling)(_.ComponentTextStyle.Bold, null));
|
|
30
28
|
var Tag = function Tag(_ref) {
|
|
31
29
|
var label = _ref.label,
|
|
32
30
|
icon = _ref.icon,
|
package/dist/Tag/Tag.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.cjs","names":["Container","styled","div","props","isLabelPresent","COLORS","neutral_100","neutral_600","correct_100","correct_600","warning_100","warning_600","critical_100","critical_600","accent1_100","accent1_600","accent2_100","accent2_600","IconContainer","TextContainer","
|
|
1
|
+
{"version":3,"file":"Tag.cjs","names":["Container","styled","div","props","isLabelPresent","COLORS","neutral_100","neutral_600","correct_100","correct_600","warning_100","warning_600","critical_100","critical_600","accent1_100","accent1_600","accent2_100","accent2_600","IconContainer","TextContainer","ComponentXSStyling","ComponentTextStyle","Bold","Tag","label","icon","variant","className","rest","cls"],"sources":["../../src/Tag/Tag.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport { COLORS, ComponentTextStyle, ComponentXSStyling } from '..';\n\nconst Container = styled.div<{variant: TagVariants, isLabelPresent: boolean}>`\n display: flex;\n padding: 4px;\n height: 24px;\n width: calc(100%);\n max-width: fit-content;\n align-items: center;\n justify-content: center;\n min-width: ${props=>props.isLabelPresent ? '64px' : ''};\n border-radius: 2px;\n box-sizing: border-box;\n\n &.neutral {\n background-color: ${COLORS.neutral_100};\n color: ${COLORS.neutral_600};\n }\n &.positive {\n background-color: ${COLORS.correct_100};\n color: ${COLORS.correct_600};\n }\n &.warning {\n background-color: ${COLORS.warning_100};\n color: ${COLORS.warning_600};\n }\n &.critical {\n background-color: ${COLORS.critical_100};\n color: ${COLORS.critical_600};\n }\n &.accent1 {\n background-color: ${COLORS.accent1_100};\n color: ${COLORS.accent1_600};\n }\n &.accent2 {\n background-color: ${COLORS.accent2_100};\n color: ${COLORS.accent2_600};\n }\n\n`;\n\nconst IconContainer = styled.div<{variant: TagVariants}>`\n display: flex;\n width: 16px;\n height: 16px;\n svg {\n width: 16px;\n height: 16px;\n }\n`;\n\nconst TextContainer = styled.div<{variant: TagVariants, icon: React.ReactNode}>`\n height: 16px;\n padding: 0 4px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden; \n ${ComponentXSStyling(ComponentTextStyle.Bold, null)}\n`;\n\n\nexport type TagVariants = 'neutral' | 'positive' | 'warning' | 'critical' | 'accent1' | 'accent2';\n\ntype TagProps = React.HTMLAttributes<HTMLDivElement> & {\n label?: string;\n icon?: React.ReactNode;\n variant?: TagVariants;\n}\n\nconst Tag: React.FunctionComponent<TagProps> = ({label, icon, variant='neutral', className, ...rest}) => {\n const cls = `${className ?? ''} ${variant}`;\n return ( \n <Container variant={variant} isLabelPresent={!!label} className={cls} {...rest}>\n {icon && <IconContainer variant={variant} data-testid={'iconContainer'}>\n {icon}\n </IconContainer>\n }\n {label && <TextContainer variant={variant} icon={icon}>\n {label}\n </TextContainer>\n }\n </Container>\n );\n};\n\nexport default Tag;\n"],"mappings":";;;;;;;;;;;;AAAA;AACA;AACA;AAAoE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEpE,IAAMA,SAAS,GAAGC,yBAAM,CAACC,GAAG,6sBAQb,UAAAC,KAAK;EAAA,OAAEA,KAAK,CAACC,cAAc,GAAG,MAAM,GAAG,EAAE;AAAA,GAKhCC,QAAM,CAACC,WAAW,EAC7BD,QAAM,CAACE,WAAW,EAGPF,QAAM,CAACG,WAAW,EAC7BH,QAAM,CAACI,WAAW,EAGPJ,QAAM,CAACK,WAAW,EAC7BL,QAAM,CAACM,WAAW,EAGPN,QAAM,CAACO,YAAY,EAC9BP,QAAM,CAACQ,YAAY,EAGRR,QAAM,CAACS,WAAW,EAC7BT,QAAM,CAACU,WAAW,EAGPV,QAAM,CAACW,WAAW,EAC7BX,QAAM,CAACY,WAAW,CAG9B;AAED,IAAMC,aAAa,GAAGjB,yBAAM,CAACC,GAAG,6LAQ/B;AAED,IAAMiB,aAAa,GAAGlB,yBAAM,CAACC,GAAG,+MAM5B,IAAAkB,oBAAkB,EAACC,oBAAkB,CAACC,IAAI,EAAE,IAAI,CAAC,CACpD;AAWD,IAAMC,GAAsC,GAAG,SAAzCA,GAAsC,OAA6D;EAAA,IAAxDC,KAAK,QAALA,KAAK;IAAEC,IAAI,QAAJA,IAAI;IAAA,oBAAEC,OAAO;IAAPA,OAAO,6BAAC,SAAS;IAAEC,SAAS,QAATA,SAAS;IAAKC,IAAI;EACjG,IAAMC,GAAG,aAAMF,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,EAAE,cAAID,OAAO,CAAE;EAC3C,oBACE,sBAAC,SAAS;IAAC,OAAO,EAAEA,OAAQ;IAAC,cAAc,EAAE,CAAC,CAACF,KAAM;IAAC,SAAS,EAAEK;EAAI,GAAKD,IAAI;IAAA,WAC3EH,IAAI,iBAAI,qBAAC,aAAa;MAAC,OAAO,EAAEC,OAAQ;MAAC,eAAa,eAAgB;MAAA,UAClED;IAAI,EACS,EAEjBD,KAAK,iBAAI,qBAAC,aAAa;MAAC,OAAO,EAAEE,OAAQ;MAAC,IAAI,EAAED,IAAK;MAAA,UACjDD;IAAK,EACQ;EAAA,GAER;AAEhB,CAAC;AAAC;EAnBAA,KAAK;EACLC,IAAI;EACJC,OAAO,4BALiB,SAAS,EAAG,UAAU,EAAG,SAAS,EAAG,UAAU,EAAG,SAAS,EAAG,SAAS;AAAA;AAAA,eAwBlFH,GAAG;AAAA"}
|
package/dist/Tag/Tag.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export
|
|
3
|
-
|
|
2
|
+
export type TagVariants = 'neutral' | 'positive' | 'warning' | 'critical' | 'accent1' | 'accent2';
|
|
3
|
+
type TagProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
4
4
|
label?: string;
|
|
5
5
|
icon?: React.ReactNode;
|
|
6
6
|
variant?: TagVariants;
|
package/dist/Tag/Tag.js
CHANGED
|
@@ -11,13 +11,11 @@ import styled from 'styled-components';
|
|
|
11
11
|
import { COLORS, ComponentTextStyle, ComponentXSStyling } from '..';
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
var Container = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n height: 24px;\n width: calc(100%);\n
|
|
14
|
+
var Container = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n padding: 4px;\n height: 24px;\n width: calc(100%);\n max-width: fit-content;\n align-items: center;\n justify-content: center;\n min-width: ", ";\n border-radius: 2px;\n box-sizing: border-box;\n\n &.neutral {\n background-color: ", ";\n color: ", ";\n }\n &.positive {\n background-color: ", ";\n color: ", ";\n }\n &.warning {\n background-color: ", ";\n color: ", ";\n }\n &.critical {\n background-color: ", ";\n color: ", ";\n }\n &.accent1 {\n background-color: ", ";\n color: ", ";\n }\n &.accent2 {\n background-color: ", ";\n color: ", ";\n }\n\n"])), function (props) {
|
|
15
15
|
return props.isLabelPresent ? '64px' : '';
|
|
16
16
|
}, COLORS.neutral_100, COLORS.neutral_600, COLORS.correct_100, COLORS.correct_600, COLORS.warning_100, COLORS.warning_600, COLORS.critical_100, COLORS.critical_600, COLORS.accent1_100, COLORS.accent1_600, COLORS.accent2_100, COLORS.accent2_600);
|
|
17
|
-
var IconContainer = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n
|
|
18
|
-
var TextContainer = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n
|
|
19
|
-
return props.icon ? "4px 8px 4px 0" : "4px 8px";
|
|
20
|
-
}, ComponentXSStyling(ComponentTextStyle.Bold, null));
|
|
17
|
+
var IconContainer = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n width: 16px;\n height: 16px;\n svg {\n width: 16px;\n height: 16px;\n }\n"])));
|
|
18
|
+
var TextContainer = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n height: 16px;\n padding: 0 4px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden; \n ", "\n"])), ComponentXSStyling(ComponentTextStyle.Bold, null));
|
|
21
19
|
var Tag = function Tag(_ref) {
|
|
22
20
|
var label = _ref.label,
|
|
23
21
|
icon = _ref.icon,
|
package/dist/Tag/Tag.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.js","names":["React","styled","COLORS","ComponentTextStyle","ComponentXSStyling","Container","div","props","isLabelPresent","neutral_100","neutral_600","correct_100","correct_600","warning_100","warning_600","critical_100","critical_600","accent1_100","accent1_600","accent2_100","accent2_600","IconContainer","TextContainer","
|
|
1
|
+
{"version":3,"file":"Tag.js","names":["React","styled","COLORS","ComponentTextStyle","ComponentXSStyling","Container","div","props","isLabelPresent","neutral_100","neutral_600","correct_100","correct_600","warning_100","warning_600","critical_100","critical_600","accent1_100","accent1_600","accent2_100","accent2_600","IconContainer","TextContainer","Bold","Tag","label","icon","variant","className","rest","cls"],"sources":["../../src/Tag/Tag.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport { COLORS, ComponentTextStyle, ComponentXSStyling } from '..';\n\nconst Container = styled.div<{variant: TagVariants, isLabelPresent: boolean}>`\n display: flex;\n padding: 4px;\n height: 24px;\n width: calc(100%);\n max-width: fit-content;\n align-items: center;\n justify-content: center;\n min-width: ${props=>props.isLabelPresent ? '64px' : ''};\n border-radius: 2px;\n box-sizing: border-box;\n\n &.neutral {\n background-color: ${COLORS.neutral_100};\n color: ${COLORS.neutral_600};\n }\n &.positive {\n background-color: ${COLORS.correct_100};\n color: ${COLORS.correct_600};\n }\n &.warning {\n background-color: ${COLORS.warning_100};\n color: ${COLORS.warning_600};\n }\n &.critical {\n background-color: ${COLORS.critical_100};\n color: ${COLORS.critical_600};\n }\n &.accent1 {\n background-color: ${COLORS.accent1_100};\n color: ${COLORS.accent1_600};\n }\n &.accent2 {\n background-color: ${COLORS.accent2_100};\n color: ${COLORS.accent2_600};\n }\n\n`;\n\nconst IconContainer = styled.div<{variant: TagVariants}>`\n display: flex;\n width: 16px;\n height: 16px;\n svg {\n width: 16px;\n height: 16px;\n }\n`;\n\nconst TextContainer = styled.div<{variant: TagVariants, icon: React.ReactNode}>`\n height: 16px;\n padding: 0 4px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden; \n ${ComponentXSStyling(ComponentTextStyle.Bold, null)}\n`;\n\n\nexport type TagVariants = 'neutral' | 'positive' | 'warning' | 'critical' | 'accent1' | 'accent2';\n\ntype TagProps = React.HTMLAttributes<HTMLDivElement> & {\n label?: string;\n icon?: React.ReactNode;\n variant?: TagVariants;\n}\n\nconst Tag: React.FunctionComponent<TagProps> = ({label, icon, variant='neutral', className, ...rest}) => {\n const cls = `${className ?? ''} ${variant}`;\n return ( \n <Container variant={variant} isLabelPresent={!!label} className={cls} {...rest}>\n {icon && <IconContainer variant={variant} data-testid={'iconContainer'}>\n {icon}\n </IconContainer>\n }\n {label && <TextContainer variant={variant} icon={icon}>\n {label}\n </TextContainer>\n }\n </Container>\n );\n};\n\nexport default Tag;\n"],"mappings":";;;;;;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,MAAM,MAAM,mBAAmB;AACtC,SAASC,MAAM,EAAEC,kBAAkB,EAAEC,kBAAkB,QAAQ,IAAI;AAAC;AAAA;AAEpE,IAAMC,SAAS,GAAGJ,MAAM,CAACK,GAAG,+rBAQb,UAAAC,KAAK;EAAA,OAAEA,KAAK,CAACC,cAAc,GAAG,MAAM,GAAG,EAAE;AAAA,GAKhCN,MAAM,CAACO,WAAW,EAC7BP,MAAM,CAACQ,WAAW,EAGPR,MAAM,CAACS,WAAW,EAC7BT,MAAM,CAACU,WAAW,EAGPV,MAAM,CAACW,WAAW,EAC7BX,MAAM,CAACY,WAAW,EAGPZ,MAAM,CAACa,YAAY,EAC9Bb,MAAM,CAACc,YAAY,EAGRd,MAAM,CAACe,WAAW,EAC7Bf,MAAM,CAACgB,WAAW,EAGPhB,MAAM,CAACiB,WAAW,EAC7BjB,MAAM,CAACkB,WAAW,CAG9B;AAED,IAAMC,aAAa,GAAGpB,MAAM,CAACK,GAAG,+KAQ/B;AAED,IAAMgB,aAAa,GAAGrB,MAAM,CAACK,GAAG,iMAM5BF,kBAAkB,CAACD,kBAAkB,CAACoB,IAAI,EAAE,IAAI,CAAC,CACpD;AAWD,IAAMC,GAAsC,GAAG,SAAzCA,GAAsC,OAA6D;EAAA,IAAxDC,KAAK,QAALA,KAAK;IAAEC,IAAI,QAAJA,IAAI;IAAA,oBAAEC,OAAO;IAAPA,OAAO,6BAAC,SAAS;IAAEC,SAAS,QAATA,SAAS;IAAKC,IAAI;EACjG,IAAMC,GAAG,aAAMF,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,EAAE,cAAID,OAAO,CAAE;EAC3C,oBACE,MAAC,SAAS;IAAC,OAAO,EAAEA,OAAQ;IAAC,cAAc,EAAE,CAAC,CAACF,KAAM;IAAC,SAAS,EAAEK;EAAI,GAAKD,IAAI;IAAA,WAC3EH,IAAI,iBAAI,KAAC,aAAa;MAAC,OAAO,EAAEC,OAAQ;MAAC,eAAa,eAAgB;MAAA,UAClED;IAAI,EACS,EAEjBD,KAAK,iBAAI,KAAC,aAAa;MAAC,OAAO,EAAEE,OAAQ;MAAC,IAAI,EAAED,IAAK;MAAA,UACjDD;IAAK,EACQ;EAAA,GAER;AAEhB,CAAC;AAAC;EAnBAA,KAAK;EACLC,IAAI;EACJC,OAAO,aALiB,SAAS,EAAG,UAAU,EAAG,SAAS,EAAG,UAAU,EAAG,SAAS,EAAG,SAAS;AAAA;AAwBjG,eAAeH,GAAG"}
|
package/dist/Tile/TileTypes.d.ts
CHANGED
|
@@ -5,33 +5,33 @@ import { DropdownButtonProps } from '../Dropdown/DropdownButtonTypes';
|
|
|
5
5
|
import { ButtonProps } from '../Button/Button';
|
|
6
6
|
import { HyperlinkProps } from '../HyperLink/HyperLink';
|
|
7
7
|
import { Size } from '../types';
|
|
8
|
-
export
|
|
8
|
+
export type TileIconButton = Pick<IconButtonProps, 'action' | 'disabled'> & {
|
|
9
9
|
componentType: 'icon';
|
|
10
10
|
icon: React.ReactNode;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type TileToggleButton = Pick<ToggleButtonProps, 'active' | 'onChange' | 'disabled' | 'defaultState' | 'activeState'> & {
|
|
13
13
|
componentType: 'toggle';
|
|
14
14
|
};
|
|
15
|
-
export
|
|
15
|
+
export type TileDropdownButton = Pick<DropdownButtonProps, 'items' | 'onClick' | 'disabled' | 'itemsType' | 'action' | 'actionIcon' | 'actionLabel' | 'actionLoading' | 'actionVariant' | 'multiSelect' | 'scrollable' | 'pinTopItem' | 'maxHeight'> & {
|
|
16
16
|
componentType: 'dropdown';
|
|
17
17
|
icon: React.ReactNode;
|
|
18
18
|
};
|
|
19
|
-
export
|
|
19
|
+
export type TileStandardButton = Pick<ButtonProps, 'variant' | 'loading' | 'icon' | 'onClick' | 'disabled'> & {
|
|
20
20
|
componentType: 'button';
|
|
21
21
|
buttonText: string;
|
|
22
22
|
};
|
|
23
|
-
export
|
|
23
|
+
export type TileNote = {
|
|
24
24
|
componentType: 'note';
|
|
25
25
|
noteIcon?: React.ReactNode;
|
|
26
26
|
noteText: string;
|
|
27
27
|
};
|
|
28
|
-
export
|
|
28
|
+
export type TileHyperLink = HyperlinkProps & {
|
|
29
29
|
componentType: 'link';
|
|
30
30
|
linkIcon?: React.ReactNode;
|
|
31
31
|
linkText: string;
|
|
32
32
|
};
|
|
33
|
-
export
|
|
34
|
-
export
|
|
33
|
+
export type FooterButtons = TileIconButton | TileToggleButton | TileDropdownButton | TileStandardButton;
|
|
34
|
+
export type HeaderButtons = TileIconButton | TileToggleButton | TileDropdownButton;
|
|
35
35
|
export interface TileHeaderProps {
|
|
36
36
|
title: string;
|
|
37
37
|
tooltip?: string;
|
package/dist/Toasters/Toast.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ToastActionType, ToastColor, ToastEntryDirection, ToastPosition } from '../types';
|
|
3
|
-
export
|
|
3
|
+
export type ToastOptions = {
|
|
4
4
|
color?: ToastColor;
|
|
5
5
|
autoClose?: boolean;
|
|
6
6
|
delay?: number;
|
|
@@ -14,7 +14,7 @@ export declare type ToastOptions = {
|
|
|
14
14
|
enterFrom?: ToastEntryDirection;
|
|
15
15
|
icon?: React.ReactNode;
|
|
16
16
|
};
|
|
17
|
-
|
|
17
|
+
type Props = {
|
|
18
18
|
remove?: any;
|
|
19
19
|
content: any;
|
|
20
20
|
options?: ToastOptions;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ToastOptions } from './Toast';
|
|
3
|
-
export
|
|
3
|
+
export type ToastProviderProps = {
|
|
4
4
|
children?: any;
|
|
5
5
|
};
|
|
6
6
|
export interface toast {
|
|
@@ -8,7 +8,7 @@ export interface toast {
|
|
|
8
8
|
id: string;
|
|
9
9
|
content: any;
|
|
10
10
|
}
|
|
11
|
-
export
|
|
11
|
+
export type ToasterValueProps = {
|
|
12
12
|
toasts: toast[];
|
|
13
13
|
addToast: (content: any, options: ToastOptions) => string;
|
|
14
14
|
removeToast: (id: string) => void;
|
package/dist/assets/index.d.ts
CHANGED
package/dist/icons/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as ContentIcons from './contenticons/ContentIcons';
|
|
3
3
|
import * as SystemIcons from './systemicons/SystemIcons';
|
|
4
|
-
export
|
|
4
|
+
export type BaseProps = {
|
|
5
5
|
children?: any;
|
|
6
6
|
tooltip?: string;
|
|
7
7
|
tooltipId?: string;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type IconProps = {
|
|
10
10
|
label?: string;
|
|
11
11
|
className?: string;
|
|
12
12
|
color?: string;
|