@dxc-technology/halstack-react 0.0.0-e1a279c → 0.0.0-e1c01f0
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 +46 -0
- package/dist/index.d.mts +6670 -0
- package/dist/index.d.ts +6670 -0
- package/dist/index.js +14442 -0
- package/dist/index.mjs +14385 -0
- package/package.json +69 -68
- package/BackgroundColorContext.js +0 -50
- package/ThemeContext.js +0 -246
- package/V3Select/V3Select.js +0 -455
- package/V3Select/index.d.ts +0 -27
- package/V3Textarea/V3Textarea.js +0 -260
- package/V3Textarea/index.d.ts +0 -27
- package/accordion/Accordion.d.ts +0 -4
- package/accordion/Accordion.js +0 -258
- package/accordion/types.d.ts +0 -68
- package/accordion/types.js +0 -5
- package/accordion-group/AccordionGroup.d.ts +0 -7
- package/accordion-group/AccordionGroup.js +0 -170
- package/accordion-group/types.d.ts +0 -72
- package/accordion-group/types.js +0 -5
- package/alert/Alert.d.ts +0 -4
- package/alert/Alert.js +0 -290
- package/alert/Alert.stories.tsx +0 -170
- package/alert/types.d.ts +0 -49
- package/alert/types.js +0 -5
- package/badge/Badge.js +0 -59
- package/box/Box.d.ts +0 -4
- package/box/Box.js +0 -129
- package/box/Box.stories.tsx +0 -132
- package/box/types.d.ts +0 -47
- package/box/types.js +0 -5
- package/button/Button.d.ts +0 -4
- package/button/Button.js +0 -177
- package/button/Button.stories.tsx +0 -276
- package/button/types.d.ts +0 -57
- package/button/types.js +0 -5
- package/card/Card.d.ts +0 -4
- package/card/Card.js +0 -165
- package/card/types.d.ts +0 -69
- package/card/types.js +0 -5
- package/checkbox/Checkbox.d.ts +0 -4
- package/checkbox/Checkbox.js +0 -253
- package/checkbox/Checkbox.stories.tsx +0 -192
- package/checkbox/types.d.ts +0 -60
- package/checkbox/types.js +0 -5
- package/chip/Chip.js +0 -221
- package/chip/Chip.stories.tsx +0 -121
- package/chip/index.d.ts +0 -22
- package/common/OpenSans.css +0 -81
- package/common/RequiredComponent.js +0 -32
- package/common/fonts/OpenSans-Bold.ttf +0 -0
- package/common/fonts/OpenSans-BoldItalic.ttf +0 -0
- package/common/fonts/OpenSans-ExtraBold.ttf +0 -0
- package/common/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
- package/common/fonts/OpenSans-Italic.ttf +0 -0
- package/common/fonts/OpenSans-Light.ttf +0 -0
- package/common/fonts/OpenSans-LightItalic.ttf +0 -0
- package/common/fonts/OpenSans-Regular.ttf +0 -0
- package/common/fonts/OpenSans-SemiBold.ttf +0 -0
- package/common/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
- package/common/utils.js +0 -22
- package/common/variables.js +0 -1577
- package/date/Date.js +0 -373
- package/date/index.d.ts +0 -27
- package/date-input/DateInput.d.ts +0 -4
- package/date-input/DateInput.js +0 -361
- package/date-input/DateInput.stories.tsx +0 -138
- package/date-input/types.d.ts +0 -100
- package/date-input/types.js +0 -5
- package/dialog/Dialog.d.ts +0 -4
- package/dialog/Dialog.js +0 -165
- package/dialog/Dialog.stories.tsx +0 -212
- package/dialog/types.d.ts +0 -43
- package/dialog/types.js +0 -5
- package/dropdown/Dropdown.d.ts +0 -4
- package/dropdown/Dropdown.js +0 -417
- package/dropdown/types.d.ts +0 -89
- package/dropdown/types.js +0 -5
- package/file-input/FileInput.js +0 -532
- package/file-input/FileItem.js +0 -193
- package/file-input/index.d.ts +0 -81
- package/footer/Footer.d.ts +0 -4
- package/footer/Footer.js +0 -266
- package/footer/Footer.stories.jsx +0 -151
- package/footer/Icons.js +0 -77
- package/footer/types.d.ts +0 -61
- package/footer/types.js +0 -5
- package/header/Header.d.ts +0 -7
- package/header/Header.js +0 -324
- package/header/Icons.js +0 -34
- package/header/types.d.ts +0 -45
- package/header/types.js +0 -5
- package/heading/Heading.js +0 -176
- package/heading/index.d.ts +0 -17
- package/input-text/Icons.js +0 -22
- package/input-text/InputText.js +0 -611
- package/input-text/index.d.ts +0 -36
- package/layout/ApplicationLayout.js +0 -235
- package/layout/Icons.js +0 -55
- package/link/Link.d.ts +0 -3
- package/link/Link.js +0 -161
- package/link/Link.stories.tsx +0 -70
- package/link/types.d.ts +0 -74
- package/link/types.js +0 -5
- package/main.d.ts +0 -44
- package/main.js +0 -363
- package/number-input/NumberInput.d.ts +0 -4
- package/number-input/NumberInput.js +0 -86
- package/number-input/NumberInput.stories.tsx +0 -115
- package/number-input/NumberInputContext.js +0 -16
- package/number-input/types.d.ts +0 -117
- package/number-input/types.js +0 -5
- package/paginator/Icons.js +0 -66
- package/paginator/Paginator.d.ts +0 -4
- package/paginator/Paginator.js +0 -198
- package/paginator/Paginator.stories.tsx +0 -63
- package/paginator/types.d.ts +0 -38
- package/paginator/types.js +0 -5
- package/password-input/PasswordInput.d.ts +0 -4
- package/password-input/PasswordInput.js +0 -162
- package/password-input/PasswordInput.stories.tsx +0 -131
- package/password-input/types.d.ts +0 -100
- package/password-input/types.js +0 -5
- package/progress-bar/ProgressBar.d.ts +0 -4
- package/progress-bar/ProgressBar.js +0 -170
- package/progress-bar/ProgressBar.stories.jsx +0 -58
- package/progress-bar/types.d.ts +0 -37
- package/progress-bar/types.js +0 -5
- package/radio/Radio.d.ts +0 -4
- package/radio/Radio.js +0 -174
- package/radio/Radio.stories.tsx +0 -192
- package/radio/types.d.ts +0 -54
- package/radio/types.js +0 -5
- package/resultsetTable/ResultsetTable.js +0 -274
- package/resultsetTable/index.d.ts +0 -19
- package/select/Select.js +0 -865
- package/select/Select.stories.tsx +0 -572
- package/select/index.d.ts +0 -131
- package/sidenav/Sidenav.d.ts +0 -9
- package/sidenav/Sidenav.js +0 -136
- package/sidenav/types.d.ts +0 -50
- package/sidenav/types.js +0 -5
- package/slider/Slider.d.ts +0 -4
- package/slider/Slider.js +0 -317
- package/slider/Slider.stories.tsx +0 -177
- package/slider/types.d.ts +0 -78
- package/slider/types.js +0 -5
- package/spinner/Spinner.d.ts +0 -4
- package/spinner/Spinner.js +0 -250
- package/spinner/Spinner.stories.jsx +0 -102
- package/spinner/types.d.ts +0 -32
- package/spinner/types.js +0 -5
- package/switch/Switch.d.ts +0 -4
- package/switch/Switch.js +0 -179
- package/switch/Switch.stories.tsx +0 -160
- package/switch/types.d.ts +0 -58
- package/switch/types.js +0 -5
- package/table/Table.d.ts +0 -4
- package/table/Table.js +0 -118
- package/table/Table.stories.jsx +0 -276
- package/table/types.d.ts +0 -21
- package/table/types.js +0 -5
- package/tabs/Tabs.d.ts +0 -4
- package/tabs/Tabs.js +0 -211
- package/tabs/types.d.ts +0 -71
- package/tabs/types.js +0 -5
- package/tag/Tag.d.ts +0 -4
- package/tag/Tag.js +0 -193
- package/tag/Tag.stories.tsx +0 -145
- package/tag/types.d.ts +0 -60
- package/tag/types.js +0 -5
- package/text-input/TextInput.js +0 -825
- package/text-input/index.d.ts +0 -135
- package/textarea/Textarea.js +0 -317
- package/textarea/Textarea.stories.jsx +0 -135
- package/textarea/index.d.ts +0 -117
- package/toggle/Toggle.js +0 -186
- package/toggle/index.d.ts +0 -21
- package/toggle-group/ToggleGroup.js +0 -243
- package/toggle-group/ToggleGroup.stories.tsx +0 -178
- package/toggle-group/index.d.ts +0 -21
- package/upload/Upload.js +0 -201
- package/upload/buttons-upload/ButtonsUpload.js +0 -111
- package/upload/buttons-upload/Icons.js +0 -40
- package/upload/dragAndDropArea/DragAndDropArea.js +0 -225
- package/upload/dragAndDropArea/Icons.js +0 -39
- package/upload/file-upload/FileToUpload.js +0 -115
- package/upload/file-upload/Icons.js +0 -66
- package/upload/files-upload/FilesToUpload.js +0 -109
- package/upload/index.d.ts +0 -15
- package/upload/transaction/Icons.js +0 -160
- package/upload/transaction/Transaction.js +0 -104
- package/upload/transactions/Transactions.js +0 -94
- package/useTheme.js +0 -22
- package/wizard/Icons.js +0 -65
- package/wizard/Wizard.d.ts +0 -4
- package/wizard/Wizard.js +0 -231
- package/wizard/Wizard.stories.jsx +0 -224
- package/wizard/types.d.ts +0 -64
- package/wizard/types.js +0 -5
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports["default"] = void 0;
|
|
11
|
-
|
|
12
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
|
-
|
|
14
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
|
-
|
|
16
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
17
|
-
|
|
18
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
-
|
|
20
|
-
var _main = require("../main");
|
|
21
|
-
|
|
22
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
23
|
-
|
|
24
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
|
-
|
|
26
|
-
var _variables = require("../common/variables.js");
|
|
27
|
-
|
|
28
|
-
var _Icons = require("./Icons");
|
|
29
|
-
|
|
30
|
-
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
31
|
-
|
|
32
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
33
|
-
|
|
34
|
-
var _excluded = ["displayArrow", "mode"];
|
|
35
|
-
|
|
36
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
|
-
|
|
38
|
-
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; }
|
|
39
|
-
|
|
40
|
-
var year = new Date().getFullYear();
|
|
41
|
-
|
|
42
|
-
var Header = function Header(_ref) {
|
|
43
|
-
var children = _ref.children;
|
|
44
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, children);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
var Main = function Main(_ref2) {
|
|
48
|
-
var children = _ref2.children;
|
|
49
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, children);
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
var Footer = function Footer(_ref3) {
|
|
53
|
-
var children = _ref3.children;
|
|
54
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, children);
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
var SideNav = function SideNav(props) {
|
|
58
|
-
var displayArrow = props.displayArrow,
|
|
59
|
-
mode = props.mode,
|
|
60
|
-
childProps = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
61
|
-
return /*#__PURE__*/_react["default"].createElement(_main.DxcSidenav, childProps, childProps.children);
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
SideNav.propTypes = {
|
|
65
|
-
mode: _propTypes["default"].oneOf(["overlay", "push", ""]),
|
|
66
|
-
displayArrow: _propTypes["default"].bool,
|
|
67
|
-
padding: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
68
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
69
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
70
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
71
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
72
|
-
})])
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
var defaultFooter = function defaultFooter() {
|
|
76
|
-
return /*#__PURE__*/_react["default"].createElement(_main.DxcFooter, {
|
|
77
|
-
copyright: "\xA9 DXC Technology ".concat(year, "\u200B\u200B\u200B\u200B. All rights reserved."),
|
|
78
|
-
bottomLinks: [{
|
|
79
|
-
href: "https://www.linkedin.com/company/dxctechnology",
|
|
80
|
-
text: "Linkedin"
|
|
81
|
-
}, {
|
|
82
|
-
href: "https://twitter.com/dxctechnology",
|
|
83
|
-
text: "Twitter"
|
|
84
|
-
}, {
|
|
85
|
-
href: "https://www.facebook.com/DXCTechnology/",
|
|
86
|
-
text: "Facebook"
|
|
87
|
-
}],
|
|
88
|
-
socialLinks: [{
|
|
89
|
-
href: "https://www.linkedin.com/company/dxctechnology",
|
|
90
|
-
logo: _Icons.linkedinLogo
|
|
91
|
-
}, {
|
|
92
|
-
href: "https://twitter.com/dxctechnology",
|
|
93
|
-
logo: _Icons.twitterLogo
|
|
94
|
-
}, {
|
|
95
|
-
href: "https://www.facebook.com/DXCTechnology/",
|
|
96
|
-
logo: _Icons.facebookLogo
|
|
97
|
-
}]
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
var defaultHeader = function defaultHeader() {
|
|
102
|
-
return /*#__PURE__*/_react["default"].createElement(_main.DxcHeader, {
|
|
103
|
-
underlined: true
|
|
104
|
-
});
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
var childTypeExists = function childTypeExists(children, childType) {
|
|
108
|
-
return children.find(function (child) {
|
|
109
|
-
return child && child.type && child.type === childType;
|
|
110
|
-
});
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
var DxcApplicationLayout = function DxcApplicationLayout(_ref4) {
|
|
114
|
-
var children = _ref4.children;
|
|
115
|
-
var ref = (0, _react.useRef)(null);
|
|
116
|
-
var colorsTheme = (0, _useTheme["default"])();
|
|
117
|
-
|
|
118
|
-
var _useState = (0, _react.useState)(true),
|
|
119
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
120
|
-
isSideNavVisible = _useState2[0],
|
|
121
|
-
setIsSideNavVisible = _useState2[1];
|
|
122
|
-
|
|
123
|
-
var _useState3 = (0, _react.useState)(),
|
|
124
|
-
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
125
|
-
isResponsive = _useState4[0],
|
|
126
|
-
setIsResponsive = _useState4[1];
|
|
127
|
-
|
|
128
|
-
var childrenArray = _react["default"].Children.toArray(children);
|
|
129
|
-
|
|
130
|
-
var header = childTypeExists(childrenArray, _main.DxcHeader) || childTypeExists(childrenArray, Header) || defaultHeader();
|
|
131
|
-
var footer = childTypeExists(childrenArray, _main.DxcFooter) || childTypeExists(childrenArray, Footer) || defaultFooter();
|
|
132
|
-
var sideNav = childTypeExists(childrenArray, SideNav);
|
|
133
|
-
var main = childTypeExists(childrenArray, Main);
|
|
134
|
-
var displayArrow = sideNav && sideNav.props && sideNav.props.displayArrow;
|
|
135
|
-
var sideNavMode = sideNav && sideNav.props && sideNav.props.mode;
|
|
136
|
-
|
|
137
|
-
var ArrowIcon = function ArrowIcon() {
|
|
138
|
-
return /*#__PURE__*/_react["default"].createElement("svg", {
|
|
139
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
140
|
-
width: "15.995",
|
|
141
|
-
height: "10.01",
|
|
142
|
-
viewBox: "0 0 15.995 10.01"
|
|
143
|
-
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
144
|
-
"data-testid": "arrow-to-right",
|
|
145
|
-
d: "M17.71,11.29l-4-4a1,1,0,0,0-1.42,1.42L14.59,11H3a1,1,0,0,0,0,2H14.59l-2.3,2.29a1,1,0,1,0,1.42,1.42l4-4a1.034,1.034,0,0,0,0-1.42Z",
|
|
146
|
-
transform: "translate(-2 -6.996)"
|
|
147
|
-
}));
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
var handleResize = function handleResize(width) {
|
|
151
|
-
if (width) {
|
|
152
|
-
if (width <= _variables.responsiveSizes.tablet ? setIsResponsive(true) : setIsResponsive(false)) ;
|
|
153
|
-
setIsSideNavVisible(true);
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
var handleEventListener = function handleEventListener() {
|
|
158
|
-
handleResize(ref.current.offsetWidth);
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
(0, _react.useEffect)(function () {
|
|
162
|
-
if (ref.current) {
|
|
163
|
-
window.addEventListener("resize", handleEventListener);
|
|
164
|
-
handleResize(ref.current.offsetWidth);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
return function () {
|
|
168
|
-
window.removeEventListener("resize", handleEventListener);
|
|
169
|
-
};
|
|
170
|
-
}, []);
|
|
171
|
-
|
|
172
|
-
var handleSidenav = function handleSidenav() {
|
|
173
|
-
setIsSideNavVisible(!isSideNavVisible);
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
177
|
-
theme: colorsTheme.sidenav
|
|
178
|
-
}, /*#__PURE__*/_react["default"].createElement(ApplicationLayoutContainer, {
|
|
179
|
-
ref: ref
|
|
180
|
-
}, /*#__PURE__*/_react["default"].createElement(HeaderContainer, null, header), /*#__PURE__*/_react["default"].createElement(BodyContainer, null, /*#__PURE__*/_react["default"].createElement(ContentContainer, null, /*#__PURE__*/_react["default"].createElement(SideNavArrowContainer, {
|
|
181
|
-
isSideNavVisible: isSideNavVisible
|
|
182
|
-
}, sideNav, /*#__PURE__*/_react["default"].createElement(ArrowContainer, null, sideNav && (displayArrow || isResponsive) && /*#__PURE__*/_react["default"].createElement(ArrowTrigger, {
|
|
183
|
-
tabIndex: 0,
|
|
184
|
-
onClick: handleSidenav,
|
|
185
|
-
isSideNavVisible: isSideNavVisible
|
|
186
|
-
}, /*#__PURE__*/_react["default"].createElement(ArrowIcon, null)))), /*#__PURE__*/_react["default"].createElement(MainBodyContainer, null, /*#__PURE__*/_react["default"].createElement(MainContent, {
|
|
187
|
-
sideNav: sideNav,
|
|
188
|
-
mode: isResponsive ? "overlay" : sideNavMode,
|
|
189
|
-
isSideNavVisible: isSideNavVisible
|
|
190
|
-
}, main), /*#__PURE__*/_react["default"].createElement(FooterContainer, {
|
|
191
|
-
sideNav: sideNav,
|
|
192
|
-
mode: isResponsive ? "overlay" : sideNavMode,
|
|
193
|
-
isSideNavVisible: isSideNavVisible
|
|
194
|
-
}, footer))))));
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
DxcApplicationLayout.Header = Header;
|
|
198
|
-
DxcApplicationLayout.Main = Main;
|
|
199
|
-
DxcApplicationLayout.Footer = Footer;
|
|
200
|
-
DxcApplicationLayout.SideNav = SideNav;
|
|
201
|
-
|
|
202
|
-
var ApplicationLayoutContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n position: absolute;\n top: 64px;\n bottom: 0;\n left: 0;\n right: 0;\n"])));
|
|
203
|
-
|
|
204
|
-
var HeaderContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n z-index: 1250;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n"])));
|
|
205
|
-
|
|
206
|
-
var BodyContainer = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n flex: 1;\n display: flex;\n flex-direction: column;\n"])));
|
|
207
|
-
|
|
208
|
-
var ContentContainer = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex: 1 1 auto;\n align-items: flex-start;\n"])));
|
|
209
|
-
|
|
210
|
-
var MainBodyContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n width: 100%;\n min-width: 0;\n display: flex;\n flex-direction: column;\n"])));
|
|
211
|
-
|
|
212
|
-
var FooterContainer = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: ", ";\n transition: margin 0.4s ease-in-out;\n"])), function (props) {
|
|
213
|
-
return props.sideNav ? props.mode === "push" && !props.isSideNavVisible || props.mode === "overlay" ? "-300px" : "" : "";
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
var MainContent = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n flex-grow: 1;\n position: relative;\n min-height: calc(100vh - 184px);\n margin-left: ", ";\n transition: margin 0.4s ease-in-out;\n"])), function (props) {
|
|
217
|
-
return props.sideNav ? props.mode === "push" && props.isSideNavVisible ? "" : "-297px" : "";
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
var SideNavArrowContainer = _styledComponents["default"].div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n z-index: 1200;\n transform: ", ";\n transition: transform 0.4s ease-in-out;\n height: calc(100vh - 64px);\n position: sticky;\n top: 64px;\n"])), function (props) {
|
|
221
|
-
return props.isSideNavVisible ? "translateX(0)" : !props.isSideNavVisible ? "translateX(-100%)" : "";
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
var ArrowContainer = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n height: calc(100vh - 64px);\n left: 279px;\n"])));
|
|
225
|
-
|
|
226
|
-
var ArrowTrigger = _styledComponents["default"].div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: center;\n position: sticky;\n top: 45vh;\n width: 42px;\n min-height: 42px;\n background-color: ", ";\n border-radius: 50%;\n transform: ", ";\n transition: transform 0.4s ease-in-out;\n z-index: 1250;\n cursor: pointer;\n & > svg {\n fill: ", ";\n }\n"])), function (props) {
|
|
227
|
-
return "".concat(props.theme.arrowContainerColor);
|
|
228
|
-
}, function (props) {
|
|
229
|
-
return props.isSideNavVisible ? "rotate(-180deg)" : "rotate(0deg)";
|
|
230
|
-
}, function (props) {
|
|
231
|
-
return props.theme.arrowColor;
|
|
232
|
-
});
|
|
233
|
-
|
|
234
|
-
var _default = DxcApplicationLayout;
|
|
235
|
-
exports["default"] = _default;
|
package/layout/Icons.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.twitterLogo = exports.linkedinLogo = exports.facebookLogo = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var facebookLogo = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
13
|
-
version: "1.1",
|
|
14
|
-
id: "Capa_1",
|
|
15
|
-
x: "0px",
|
|
16
|
-
y: "0px",
|
|
17
|
-
width: "438.536px",
|
|
18
|
-
height: "438.536px",
|
|
19
|
-
viewBox: "0 0 438.536 438.536",
|
|
20
|
-
fill: "#FFFFFF"
|
|
21
|
-
}, /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("path", {
|
|
22
|
-
d: "M414.41,24.123C398.333,8.042,378.963,0,356.315,0H82.228C59.58,0,40.21,8.042,24.126,24.123 C8.045,40.207,0.003,59.576,0.003,82.225v274.084c0,22.647,8.042,42.018,24.123,58.102c16.084,16.084,35.454,24.126,58.102,24.126 h274.084c22.648,0,42.018-8.042,58.095-24.126c16.084-16.084,24.126-35.454,24.126-58.102V82.225 C438.532,59.576,430.49,40.204,414.41,24.123z M373.155,225.548h-49.963V406.84h-74.802V225.548H210.99V163.02h37.401v-37.402 c0-26.838,6.283-47.107,18.843-60.813c12.559-13.706,33.304-20.555,62.242-20.555h49.963v62.526h-31.401 c-10.663,0-17.467,1.853-20.417,5.568c-2.949,3.711-4.428,10.23-4.428,19.558v31.119h56.534L373.155,225.548z"
|
|
23
|
-
})));
|
|
24
|
-
|
|
25
|
-
exports.facebookLogo = facebookLogo;
|
|
26
|
-
|
|
27
|
-
var twitterLogo = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
28
|
-
version: "1.1",
|
|
29
|
-
id: "Capa_1",
|
|
30
|
-
x: "0px",
|
|
31
|
-
y: "0px",
|
|
32
|
-
width: "438.536px",
|
|
33
|
-
height: "438.536px",
|
|
34
|
-
viewBox: "0 0 438.536 438.536",
|
|
35
|
-
fill: "#FFFFFF"
|
|
36
|
-
}, /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("path", {
|
|
37
|
-
d: "M414.41,24.123C398.333,8.042,378.963,0,356.315,0H82.228C59.58,0,40.21,8.042,24.126,24.123 C8.045,40.207,0.003,59.576,0.003,82.225v274.084c0,22.647,8.042,42.018,24.123,58.102c16.084,16.084,35.454,24.126,58.102,24.126 h274.084c22.648,0,42.018-8.042,58.095-24.126c16.084-16.084,24.126-35.454,24.126-58.102V82.225 C438.532,59.576,430.49,40.204,414.41,24.123z M335.471,168.735c0.191,1.713,0.288,4.278,0.288,7.71 c0,15.989-2.334,32.025-6.995,48.104c-4.661,16.087-11.8,31.504-21.416,46.254c-9.606,14.749-21.074,27.791-34.396,39.115 c-13.325,11.32-29.311,20.365-47.968,27.117c-18.648,6.762-38.637,10.143-59.953,10.143c-33.116,0-63.76-8.952-91.931-26.836 c4.568,0.568,9.329,0.855,14.275,0.855c27.6,0,52.439-8.565,74.519-25.7c-12.941-0.185-24.506-4.179-34.688-11.991 c-10.185-7.803-17.273-17.699-21.271-29.691c4.947,0.76,8.658,1.137,11.132,1.137c4.187,0,9.042-0.76,14.56-2.279 c-13.894-2.669-25.598-9.562-35.115-20.697c-9.519-11.136-14.277-23.84-14.277-38.114v-0.571 c10.085,4.755,19.602,7.229,28.549,7.422c-17.321-11.613-25.981-28.265-25.981-49.963c0-10.66,2.758-20.747,8.278-30.264 c15.035,18.464,33.311,33.213,54.816,44.252c21.507,11.038,44.54,17.227,69.092,18.558c-0.95-3.616-1.427-8.186-1.427-13.704 c0-16.562,5.853-30.692,17.56-42.399c11.703-11.706,25.837-17.561,42.394-17.561c17.515,0,32.079,6.283,43.688,18.846 c13.134-2.474,25.892-7.33,38.26-14.56c-4.757,14.652-13.613,25.788-26.55,33.402c12.368-1.716,23.88-4.95,34.537-9.708 C357.458,149.793,347.462,160.166,335.471,168.735z"
|
|
38
|
-
})));
|
|
39
|
-
|
|
40
|
-
exports.twitterLogo = twitterLogo;
|
|
41
|
-
|
|
42
|
-
var linkedinLogo = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
43
|
-
version: "1.1",
|
|
44
|
-
id: "Capa_1",
|
|
45
|
-
x: "0px",
|
|
46
|
-
y: "0px",
|
|
47
|
-
width: "438.536px",
|
|
48
|
-
height: "438.536px",
|
|
49
|
-
viewBox: "0 0 438.536 438.536",
|
|
50
|
-
fill: "#FFFFFF"
|
|
51
|
-
}, /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("path", {
|
|
52
|
-
d: "M414.41,24.123C398.333,8.042,378.963,0,356.315,0H82.228C59.58,0,40.21,8.042,24.126,24.123 C8.045,40.207,0.003,59.576,0.003,82.225v274.084c0,22.647,8.042,42.018,24.123,58.102c16.084,16.084,35.454,24.126,58.102,24.126 h274.084c22.648,0,42.018-8.042,58.095-24.126c16.084-16.084,24.126-35.454,24.126-58.102V82.225 C438.532,59.576,430.49,40.204,414.41,24.123z M133.618,367.157H67.666V169.016h65.952V367.157z M127.626,132.332 c-6.851,6.567-15.893,9.851-27.124,9.851h-0.288c-10.848,0-19.648-3.284-26.407-9.851c-6.76-6.567-10.138-14.703-10.138-24.41 c0-9.897,3.476-18.083,10.421-24.556c6.95-6.471,15.942-9.708,26.98-9.708c11.039,0,19.89,3.237,26.553,9.708 c6.661,6.473,10.088,14.659,10.277,24.556C137.899,117.625,134.477,125.761,127.626,132.332z M370.873,367.157h-65.952v-105.92 c0-29.879-11.036-44.823-33.116-44.823c-8.374,0-15.42,2.331-21.128,6.995c-5.715,4.661-9.996,10.324-12.847,16.991 c-1.335,3.422-1.999,8.75-1.999,15.981v110.775h-65.952c0.571-119.529,0.571-185.579,0-198.142h65.952v27.974 c13.867-21.681,33.558-32.544,59.101-32.544c22.84,0,41.21,7.52,55.104,22.554c13.895,15.037,20.841,37.214,20.841,66.519v113.64 H370.873z"
|
|
53
|
-
})));
|
|
54
|
-
|
|
55
|
-
exports.linkedinLogo = linkedinLogo;
|
package/link/Link.d.ts
DELETED
package/link/Link.js
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports["default"] = void 0;
|
|
11
|
-
|
|
12
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
|
-
|
|
14
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
15
|
-
|
|
16
|
-
var _react = _interopRequireDefault(require("react"));
|
|
17
|
-
|
|
18
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
19
|
-
|
|
20
|
-
var _variables = require("../common/variables.js");
|
|
21
|
-
|
|
22
|
-
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
23
|
-
|
|
24
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
25
|
-
|
|
26
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
|
-
|
|
28
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(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; }
|
|
29
|
-
|
|
30
|
-
var DxcLink = function DxcLink(_ref) {
|
|
31
|
-
var _ref$inheritColor = _ref.inheritColor,
|
|
32
|
-
inheritColor = _ref$inheritColor === void 0 ? false : _ref$inheritColor,
|
|
33
|
-
_ref$disabled = _ref.disabled,
|
|
34
|
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
35
|
-
iconSrc = _ref.iconSrc,
|
|
36
|
-
icon = _ref.icon,
|
|
37
|
-
_ref$iconPosition = _ref.iconPosition,
|
|
38
|
-
iconPosition = _ref$iconPosition === void 0 ? "before" : _ref$iconPosition,
|
|
39
|
-
_ref$href = _ref.href,
|
|
40
|
-
href = _ref$href === void 0 ? "" : _ref$href,
|
|
41
|
-
_ref$newWindow = _ref.newWindow,
|
|
42
|
-
newWindow = _ref$newWindow === void 0 ? false : _ref$newWindow,
|
|
43
|
-
onClick = _ref.onClick,
|
|
44
|
-
_ref$text = _ref.text,
|
|
45
|
-
text = _ref$text === void 0 ? "" : _ref$text,
|
|
46
|
-
margin = _ref.margin,
|
|
47
|
-
_ref$tabIndex = _ref.tabIndex,
|
|
48
|
-
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
49
|
-
var colorsTheme = (0, _useTheme["default"])();
|
|
50
|
-
|
|
51
|
-
var linkContent = /*#__PURE__*/_react["default"].createElement(LinkText, {
|
|
52
|
-
iconPosition: iconPosition
|
|
53
|
-
}, text, icon ? /*#__PURE__*/_react["default"].createElement(LinkIconContainer, {
|
|
54
|
-
iconPosition: iconPosition
|
|
55
|
-
}, (0, _typeof2["default"])(icon) === "object" ? icon : /*#__PURE__*/_react["default"].createElement(icon)) : iconSrc && /*#__PURE__*/_react["default"].createElement(LinkIcon, {
|
|
56
|
-
src: iconSrc,
|
|
57
|
-
iconPosition: iconPosition
|
|
58
|
-
}));
|
|
59
|
-
|
|
60
|
-
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
61
|
-
theme: colorsTheme.link
|
|
62
|
-
}, /*#__PURE__*/_react["default"].createElement(DxcLinkContainer, {
|
|
63
|
-
margin: margin
|
|
64
|
-
}, onClick ? /*#__PURE__*/_react["default"].createElement(StyledButton, {
|
|
65
|
-
type: "button",
|
|
66
|
-
onClick: !disabled && onClick,
|
|
67
|
-
margin: margin,
|
|
68
|
-
disabled: disabled,
|
|
69
|
-
inheritColor: inheritColor
|
|
70
|
-
}, linkContent) : /*#__PURE__*/_react["default"].createElement(StyledLink, {
|
|
71
|
-
tabIndex: tabIndex,
|
|
72
|
-
href: !disabled && href,
|
|
73
|
-
target: newWindow ? "_blank" : "_self",
|
|
74
|
-
margin: margin,
|
|
75
|
-
disabled: disabled,
|
|
76
|
-
inheritColor: inheritColor
|
|
77
|
-
}, linkContent)));
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
var DxcLinkContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
|
|
81
|
-
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
82
|
-
}, function (props) {
|
|
83
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
84
|
-
}, function (props) {
|
|
85
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
|
|
86
|
-
}, function (props) {
|
|
87
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
88
|
-
}, function (props) {
|
|
89
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
var StyledLink = _styledComponents["default"].a(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n ", "\n\n text-decoration-color: transparent;\n ", "\n\n &:visited {\n color: ", ";\n &:hover {\n ", "\n }\n }\n &:hover {\n ", "\n }\n &:focus {\n outline-color: ", ";\n outline-width: 2px;\n ", "\n }\n &:active {\n ", "\n }\n"])), function (props) {
|
|
93
|
-
return props.inheritColor ? "inherit" : !props.disabled ? props.theme.fontColor : props.theme.disabledColor;
|
|
94
|
-
}, function (props) {
|
|
95
|
-
return props.disabled ? "pointer-events: none;" : "";
|
|
96
|
-
}, function (props) {
|
|
97
|
-
return "padding-bottom: ".concat(props.theme.underlineSpacing, ";\n border-bottom: ").concat(props.theme.underlineThickness, " ").concat(props.theme.underlineStyle, " transparent;");
|
|
98
|
-
}, function (props) {
|
|
99
|
-
return !props.inheritColor ? props.theme.visitedFontColor : "";
|
|
100
|
-
}, function (props) {
|
|
101
|
-
return "color: ".concat(props.theme.visitedFontColor, ";\n border-bottom-color: ").concat(props.theme.visitedUnderlineColor, ";");
|
|
102
|
-
}, function (props) {
|
|
103
|
-
return "color: ".concat(props.theme.hoverFontColor, ";\n border-bottom-color: ").concat(props.theme.hoverUnderlineColor, ";\n cursor: pointer;");
|
|
104
|
-
}, function (props) {
|
|
105
|
-
return props.theme.focusColor;
|
|
106
|
-
}, function (props) {
|
|
107
|
-
return props.disabled && "outline: none";
|
|
108
|
-
}, function (props) {
|
|
109
|
-
return "color: ".concat(props.theme.activeFontColor, " !important;\n border-bottom-color: ").concat(props.theme.activeUnderlineColor, " !important;");
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
var StyledButton = _styledComponents["default"].button(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n background: none;\n border: none;\n padding: 0;\n cursor: pointer;\n font-family: inherit;\n text-decoration-color: transparent;\n\n ", "\n ", "\n color: ", ";\n ", "\n\n &:hover {\n ", "\n }\n &:focus {\n outline-color: ", ";\n outline-width: 2px;\n outline-offset: 1px;\n ", "\n }\n &:active {\n ", "\n }\n"])), function (props) {
|
|
113
|
-
return "padding-bottom: ".concat(props.theme.underlineSpacing, ";\n border-bottom: ").concat(props.theme.underlineThickness, " ").concat(props.theme.underlineStyle, " transparent;");
|
|
114
|
-
}, function (props) {
|
|
115
|
-
return props.disabled && "cursor: default;";
|
|
116
|
-
}, function (props) {
|
|
117
|
-
return props.inheritColor ? "inherit" : !props.disabled ? props.theme.fontColor : props.theme.disabledColor;
|
|
118
|
-
}, function (props) {
|
|
119
|
-
return props.disabled ? "pointer-events: none;" : "";
|
|
120
|
-
}, function (props) {
|
|
121
|
-
return "color: ".concat(props.theme.hoverFontColor, ";\n border-bottom-color: ").concat(props.theme.hoverUnderlineColor, ";\n cursor: pointer;");
|
|
122
|
-
}, function (props) {
|
|
123
|
-
return props.theme.focusColor;
|
|
124
|
-
}, function (props) {
|
|
125
|
-
return props.disabled && "outline: none";
|
|
126
|
-
}, function (props) {
|
|
127
|
-
return "color: ".concat(props.theme.activeFontColor, " !important;\n border-bottom-color: ").concat(props.theme.activeUnderlineColor, " !important;");
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
var LinkText = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n font-weight: ", ";\n font-style: ", ";\n font-family: ", ";\n display: inline-flex;\n flex-direction: ", ";\n justify-content: ", ";\n align-items: center;\n max-width: 100%;\n"])), function (props) {
|
|
131
|
-
return props.theme.fontSize;
|
|
132
|
-
}, function (props) {
|
|
133
|
-
return props.theme.fontWeight;
|
|
134
|
-
}, function (props) {
|
|
135
|
-
return props.theme.fontStyle;
|
|
136
|
-
}, function (props) {
|
|
137
|
-
return props.theme.fontFamily;
|
|
138
|
-
}, function (props) {
|
|
139
|
-
return props.iconPosition === "after" ? "row" : "row-reverse";
|
|
140
|
-
}, function (props) {
|
|
141
|
-
return props.iconPosition === "after" ? "flex-start" : "flex-end";
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
var LinkIcon = _styledComponents["default"].img(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n ", ";\n"])), function (props) {
|
|
145
|
-
return props.theme.iconSize;
|
|
146
|
-
}, function (props) {
|
|
147
|
-
return props.theme.iconSize;
|
|
148
|
-
}, function (props) {
|
|
149
|
-
return "".concat(props.iconPosition === "before" ? "margin-right" : "margin-left", ": ").concat(props.theme.iconSpacing);
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
var LinkIconContainer = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n ", ";\n overflow: hidden;\n\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"])), function (props) {
|
|
153
|
-
return props.theme.iconSize;
|
|
154
|
-
}, function (props) {
|
|
155
|
-
return props.theme.iconSize;
|
|
156
|
-
}, function (props) {
|
|
157
|
-
return "".concat(props.iconPosition === "before" ? "margin-right" : "margin-left", ": ").concat(props.theme.iconSpacing);
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
var _default = DxcLink;
|
|
161
|
-
exports["default"] = _default;
|
package/link/Link.stories.tsx
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import DxcLink from "./Link";
|
|
3
|
-
import Title from "../../.storybook/components/Title";
|
|
4
|
-
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: "Link",
|
|
8
|
-
component: DxcLink,
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const icon = (
|
|
12
|
-
<svg viewBox="0 0 24 24" enable-background="new 0 0 24 24" fill="currentColor">
|
|
13
|
-
<g id="Bounding_Box">
|
|
14
|
-
<rect fill="none" width="24" height="24" />
|
|
15
|
-
</g>
|
|
16
|
-
<g id="Master">
|
|
17
|
-
<path d="M19,9.3V4h-3v2.6L12,3L2,12h3v8h5v-6h4v6h5v-8h3L19,9.3z M10,10c0-1.1,0.9-2,2-2s2,0.9,2,2H10z" />
|
|
18
|
-
</g>
|
|
19
|
-
</svg>
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
export const Chromatic = () => (
|
|
23
|
-
<>
|
|
24
|
-
<ExampleContainer>
|
|
25
|
-
<Title title="Disabled" theme="light" level={4} />
|
|
26
|
-
<DxcLink text="Test" disabled></DxcLink>
|
|
27
|
-
<Title title="Icon before" theme="light" level={4} />
|
|
28
|
-
<DxcLink text="Test" href="https://www.google.com" icon={icon} iconPosition="before"></DxcLink>
|
|
29
|
-
<Title title="Icon after" theme="light" level={4} />
|
|
30
|
-
<DxcLink text="Test" href="https://www.youtube.com/" icon={icon} iconPosition="after"></DxcLink>
|
|
31
|
-
</ExampleContainer>
|
|
32
|
-
<ExampleContainer pseudoState="pseudo-hover">
|
|
33
|
-
<Title title="With link hovered" theme="light" level={4} />
|
|
34
|
-
<DxcLink text="Test" href="https://www.dxc.com"></DxcLink>
|
|
35
|
-
</ExampleContainer>
|
|
36
|
-
<ExampleContainer pseudoState="pseudo-focus">
|
|
37
|
-
<Title title="With link focused" theme="light" level={4} />
|
|
38
|
-
<DxcLink text="Test" href="https://www.dxc.com"></DxcLink>
|
|
39
|
-
</ExampleContainer>
|
|
40
|
-
<ExampleContainer pseudoState="pseudo-active">
|
|
41
|
-
<Title title="With link active" theme="light" level={4} />
|
|
42
|
-
<DxcLink text="Test" href="https://www.dxc.com"></DxcLink>
|
|
43
|
-
</ExampleContainer>
|
|
44
|
-
<ExampleContainer pseudoState="pseudo-visited">
|
|
45
|
-
<Title title="With link visited" theme="light" level={4} />
|
|
46
|
-
<DxcLink text="Test" href="https://www.amazon.com"></DxcLink>
|
|
47
|
-
</ExampleContainer>
|
|
48
|
-
<ExampleContainer>
|
|
49
|
-
<Title title="Inherit color" theme="light" level={4} />
|
|
50
|
-
This is a <DxcLink text="Test" inheritColor={true}></DxcLink>.
|
|
51
|
-
</ExampleContainer>
|
|
52
|
-
<Title title="Margins" theme="light" level={2} />
|
|
53
|
-
<ExampleContainer>
|
|
54
|
-
<Title title="Xxsmall margin" theme="light" level={4} />
|
|
55
|
-
<DxcLink text="Test" margin="xxsmall" href="https://www.facebook.com/"></DxcLink>
|
|
56
|
-
<Title title="Xsmall margin" theme="light" level={4} />
|
|
57
|
-
<DxcLink text="Test" margin="xsmall" href="https://www.linkedin.com/"></DxcLink>
|
|
58
|
-
<Title title="Small margin" theme="light" level={4} />
|
|
59
|
-
<DxcLink text="Test" margin="small" href="https://www.linkedin.com/"></DxcLink>
|
|
60
|
-
<Title title="Medium margin" theme="light" level={4} />
|
|
61
|
-
<DxcLink text="Test" margin="medium" href="https://www.linkedin.com/"></DxcLink>
|
|
62
|
-
<Title title="Large margin" theme="light" level={4} />
|
|
63
|
-
<DxcLink text="Test" margin="large" href="https://www.linkedin.com/"></DxcLink>
|
|
64
|
-
<Title title="Xlarge margin" theme="light" level={4} />
|
|
65
|
-
<DxcLink text="Test" margin="xlarge" href="https://www.linkedin.com/"></DxcLink>
|
|
66
|
-
<Title title="Xxlarge margin" theme="light" level={4} />
|
|
67
|
-
<DxcLink text="Test" margin="xxlarge" href="https://www.linkedin.com/"></DxcLink>
|
|
68
|
-
</ExampleContainer>
|
|
69
|
-
</>
|
|
70
|
-
);
|
package/link/types.d.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
-
declare type Margin = {
|
|
4
|
-
top?: Space;
|
|
5
|
-
bottom?: Space;
|
|
6
|
-
left?: Space;
|
|
7
|
-
right?: Space;
|
|
8
|
-
};
|
|
9
|
-
declare type LinkCommonProps = {
|
|
10
|
-
/**
|
|
11
|
-
* If true, the color is inherited from parent.
|
|
12
|
-
*/
|
|
13
|
-
inheritColor?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* If true, the link is disabled.
|
|
16
|
-
*/
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* @Deprecated Source of the icon.
|
|
20
|
-
*/
|
|
21
|
-
iconSrc?: string;
|
|
22
|
-
/**
|
|
23
|
-
* Indicates the position of the icon in the component.
|
|
24
|
-
*/
|
|
25
|
-
iconPosition?: "before" | "after";
|
|
26
|
-
/**
|
|
27
|
-
* Page to be opened when the user clicks on the link.
|
|
28
|
-
*/
|
|
29
|
-
href?: string;
|
|
30
|
-
/**
|
|
31
|
-
* If true, the page is opened in a new browser tab.
|
|
32
|
-
*/
|
|
33
|
-
newWindow?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* If defined, the link will be displayed as a button. This
|
|
36
|
-
* function will be called when the user clicks the link.
|
|
37
|
-
*/
|
|
38
|
-
onClick?: () => void;
|
|
39
|
-
/**
|
|
40
|
-
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
41
|
-
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
42
|
-
*/
|
|
43
|
-
margin?: Space | Margin;
|
|
44
|
-
/**
|
|
45
|
-
* Value of the tabindex.
|
|
46
|
-
*/
|
|
47
|
-
tabIndex?: number;
|
|
48
|
-
};
|
|
49
|
-
export declare type LinkTextProps = LinkCommonProps & {
|
|
50
|
-
/**
|
|
51
|
-
* Link text.
|
|
52
|
-
*/
|
|
53
|
-
text: string;
|
|
54
|
-
/**
|
|
55
|
-
* Element used as the icon that will be placed next to the link text.
|
|
56
|
-
*/
|
|
57
|
-
icon?: SVG;
|
|
58
|
-
};
|
|
59
|
-
export declare type LinkIconProps = LinkCommonProps & {
|
|
60
|
-
/**
|
|
61
|
-
* Link text.
|
|
62
|
-
*/
|
|
63
|
-
text?: string;
|
|
64
|
-
/**
|
|
65
|
-
* Element used as the icon that will be placed next to the link text.
|
|
66
|
-
*/
|
|
67
|
-
icon: SVG;
|
|
68
|
-
};
|
|
69
|
-
declare type Overload = {
|
|
70
|
-
(props: LinkTextProps): JSX.Element;
|
|
71
|
-
(props: LinkIconProps): JSX.Element;
|
|
72
|
-
};
|
|
73
|
-
declare type SVG = React.SVGProps<SVGSVGElement> | React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
|
74
|
-
export default Overload;
|