@dxc-technology/halstack-react 0.0.0-8aa8e6b → 0.0.0-8c10296
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/HalstackContext.d.ts +4 -2
- package/HalstackContext.js +110 -58
- package/alert/Alert.js +4 -1
- package/badge/Badge.d.ts +1 -1
- package/badge/Badge.js +5 -3
- package/badge/types.d.ts +1 -0
- package/bleed/Bleed.js +1 -34
- package/bleed/Bleed.stories.tsx +31 -32
- package/bleed/types.d.ts +1 -1
- package/box/Box.js +22 -32
- package/button/Button.js +3 -1
- package/card/Card.js +34 -36
- package/checkbox/Checkbox.js +4 -1
- package/common/variables.js +176 -78
- package/date-input/DateInput.js +5 -2
- package/file-input/FileInput.js +9 -6
- package/file-input/FileItem.js +7 -5
- package/footer/Footer.js +7 -5
- package/header/Header.js +7 -4
- package/inline/Inline.d.ts +4 -0
- package/inline/Inline.js +54 -0
- package/inline/Inline.stories.tsx +240 -0
- package/inline/types.d.ts +32 -0
- package/{quick-nav-container → inline}/types.js +0 -0
- package/inset/Inset.js +1 -34
- package/inset/Inset.stories.tsx +32 -32
- package/inset/types.d.ts +1 -1
- package/layout/ApplicationLayout.d.ts +4 -3
- package/layout/ApplicationLayout.js +83 -102
- package/layout/ApplicationLayout.stories.tsx +14 -59
- package/layout/Icons.d.ts +5 -0
- package/layout/Icons.js +13 -2
- package/layout/SidenavContext.d.ts +5 -0
- package/layout/SidenavContext.js +19 -0
- package/layout/types.d.ts +5 -10
- package/link/Link.d.ts +3 -2
- package/link/Link.js +57 -70
- package/link/Link.stories.tsx +87 -52
- package/link/Link.test.js +7 -15
- package/link/types.d.ts +7 -23
- package/main.d.ts +5 -4
- package/main.js +25 -11
- package/number-input/types.d.ts +1 -1
- package/package.json +2 -1
- package/paginator/Paginator.js +17 -38
- package/paginator/Paginator.test.js +42 -0
- package/password-input/PasswordInput.js +7 -4
- package/password-input/PasswordInput.test.js +1 -2
- package/password-input/types.d.ts +1 -1
- package/progress-bar/ProgressBar.js +1 -1
- package/progress-bar/ProgressBar.stories.jsx +11 -11
- package/quick-nav/QuickNav.js +65 -17
- package/quick-nav/QuickNav.stories.tsx +2 -2
- package/quick-nav/types.d.ts +1 -1
- package/radio-group/Radio.js +1 -1
- package/radio-group/RadioGroup.js +8 -6
- package/resultsetTable/ResultsetTable.test.js +42 -0
- package/select/Listbox.d.ts +1 -1
- package/select/Listbox.js +35 -8
- package/select/Select.js +83 -78
- package/select/Select.stories.tsx +144 -100
- package/select/Select.test.js +299 -194
- package/select/types.d.ts +3 -4
- package/sidenav/Sidenav.d.ts +1 -1
- package/sidenav/Sidenav.js +20 -9
- package/spinner/Spinner.js +1 -1
- package/switch/Switch.js +4 -1
- package/tabs-nav/NavTabs.d.ts +8 -0
- package/tabs-nav/NavTabs.js +125 -0
- package/tabs-nav/NavTabs.stories.tsx +170 -0
- package/tabs-nav/NavTabs.test.js +82 -0
- package/tabs-nav/Tab.d.ts +4 -0
- package/tabs-nav/Tab.js +132 -0
- package/tabs-nav/types.d.ts +53 -0
- package/{radio → tabs-nav}/types.js +0 -0
- package/text-input/Suggestion.d.ts +4 -0
- package/text-input/Suggestion.js +55 -0
- package/text-input/TextInput.js +46 -72
- package/text-input/TextInput.test.js +1 -1
- package/text-input/types.d.ts +14 -2
- package/textarea/Textarea.js +10 -19
- package/textarea/types.d.ts +1 -1
- package/useTranslatedLabels.d.ts +2 -0
- package/useTranslatedLabels.js +20 -0
- package/wizard/Wizard.js +27 -25
- package/quick-nav-container/HeadingLink.d.ts +0 -8
- package/quick-nav-container/HeadingLink.js +0 -58
- package/quick-nav-container/QuickNavContainer.d.ts +0 -4
- package/quick-nav-container/QuickNavContainer.js +0 -69
- package/quick-nav-container/Section.d.ts +0 -9
- package/quick-nav-container/Section.js +0 -37
- package/quick-nav-container/types.d.ts +0 -34
- package/radio/Radio.d.ts +0 -4
- package/radio/Radio.js +0 -173
- package/radio/Radio.stories.tsx +0 -192
- package/radio/Radio.test.js +0 -71
- package/radio/types.d.ts +0 -54
package/textarea/types.d.ts
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
|
|
10
|
+
var _variables = require("./common/variables");
|
|
11
|
+
|
|
12
|
+
var _HalstackContext = require("./HalstackContext");
|
|
13
|
+
|
|
14
|
+
var useTranslatedLabels = function useTranslatedLabels() {
|
|
15
|
+
var labels = (0, _react.useContext)(_HalstackContext.HalstackLanguageContext);
|
|
16
|
+
return labels || _variables.defaultTranslatedComponentLabels;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
var _default = useTranslatedLabels;
|
|
20
|
+
exports["default"] = _default;
|
package/wizard/Wizard.js
CHANGED
|
@@ -147,9 +147,11 @@ var DxcWizard = function DxcWizard(_ref) {
|
|
|
147
147
|
disabled: step.disabled,
|
|
148
148
|
current: i === renderedCurrent
|
|
149
149
|
}, i + 1)), step.valid !== undefined && (step.valid ? /*#__PURE__*/_react["default"].createElement(ValidityIconContainer, null, icons.validIcon) : /*#__PURE__*/_react["default"].createElement(ValidityIconContainer, null, icons.invalidIcon))), (step.label || step.description) && /*#__PURE__*/_react["default"].createElement(InfoContainer, null, step.label && /*#__PURE__*/_react["default"].createElement(Label, {
|
|
150
|
+
current: i === renderedCurrent,
|
|
150
151
|
disabled: step.disabled,
|
|
151
152
|
visited: i <= innerCurrent
|
|
152
153
|
}, step.label), step.description && /*#__PURE__*/_react["default"].createElement(Description, {
|
|
154
|
+
current: i === renderedCurrent,
|
|
153
155
|
disabled: step.disabled,
|
|
154
156
|
visited: i <= innerCurrent
|
|
155
157
|
}, step.description))), i === steps.length - 1 ? "" : /*#__PURE__*/_react["default"].createElement(StepSeparator, {
|
|
@@ -200,40 +202,40 @@ var StepHeader = _styledComponents["default"].div(_templateObject4 || (_template
|
|
|
200
202
|
return props.validityIcon && "padding-bottom: 4px;";
|
|
201
203
|
});
|
|
202
204
|
|
|
203
|
-
var IconContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n\n ", "\n ", ";\n\n border-radius: ", ";\n display: flex;\n justify-content: center;\n align-items: center;\n"])), function (props) {
|
|
204
|
-
return props.disabled ? props.theme.
|
|
205
|
+
var IconContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n\n ", "\n ", ";\n\n border-radius: ", ";\n\n display: flex;\n justify-content: center;\n align-items: center;\n"])), function (props) {
|
|
206
|
+
return props.disabled ? props.theme.disabledStepWidth : props.current ? props.theme.selectedStepWidth : props.theme.stepWidth;
|
|
205
207
|
}, function (props) {
|
|
206
|
-
return props.disabled ? props.theme.
|
|
208
|
+
return props.disabled ? props.theme.disabledStepHeight : props.current ? props.theme.selectedStepHeight : props.theme.stepHeight;
|
|
207
209
|
}, function (props) {
|
|
208
|
-
return "\n ".concat(
|
|
210
|
+
return "\n ".concat(props.disabled ? "border: ".concat(props.theme.disabledStepBorderThickness, " ").concat(props.theme.disabledStepBorderStyle, " ").concat(props.theme.disabledStepBorderColor, ";") : props.current ? "border: ".concat(props.theme.selectedStepBorderThickness, " ").concat(props.theme.selectedStepBorderStyle, " ").concat(props.theme.selectedStepBorderColor, ";") : props.visited ? "border: ".concat(props.theme.stepBorderThickness, " ").concat(props.theme.stepBorderStyle, " ").concat(props.theme.visitedStepBorderColor, ";") : "border: ".concat(props.theme.stepBorderThickness, " ").concat(props.theme.stepBorderStyle, " ").concat(props.theme.unvisitedStepBorderColor, ";"), "\n background: ").concat(props.disabled ? "".concat(props.theme.disabledStepBackgroundColor) : props.current ? "".concat(props.theme.selectedStepBackgroundColor) : !props.visited ? "".concat(props.theme.unvisitedStepBackgroundColor) : "".concat(props.theme.visitedStepBackgroundColor), ";\n ");
|
|
209
211
|
}, function (props) {
|
|
210
|
-
return props.disabled ? "color: ".concat(props.theme.
|
|
212
|
+
return props.disabled ? "color: ".concat(props.theme.disabledStepFontColor, ";") : "color: ".concat(props.current ? props.theme.selectedStepFontColor : !props.visited ? props.theme.unvisitedStepFontColor : props.theme.visitedStepFontColor, ";");
|
|
211
213
|
}, function (props) {
|
|
212
|
-
return !props.current && !props.disabled ? props.theme.
|
|
214
|
+
return !props.current && !props.disabled ? props.theme.stepBorderRadius : props.current ? props.theme.selectedStepBorderRadius : props.disabled ? props.theme.disabledStepBorderRadius : "";
|
|
213
215
|
});
|
|
214
216
|
|
|
215
217
|
var Icon = _styledComponents["default"].img(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n"])), function (props) {
|
|
216
|
-
return props.theme.
|
|
218
|
+
return props.theme.stepIconSize;
|
|
217
219
|
}, function (props) {
|
|
218
|
-
return props.theme.
|
|
220
|
+
return props.theme.stepIconSize;
|
|
219
221
|
});
|
|
220
222
|
|
|
221
223
|
var StepIconContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n overflow: hidden;\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"])), function (props) {
|
|
222
|
-
return props.theme.
|
|
224
|
+
return props.theme.stepIconSize;
|
|
223
225
|
}, function (props) {
|
|
224
|
-
return props.theme.
|
|
226
|
+
return props.theme.stepIconSize;
|
|
225
227
|
});
|
|
226
228
|
|
|
227
229
|
var Number = _styledComponents["default"].p(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n font-family: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n opacity: 1;\n margin: 0px 0px 0px 1px;\n"])), function (props) {
|
|
228
|
-
return props.theme.
|
|
230
|
+
return props.theme.stepFontSize;
|
|
229
231
|
}, function (props) {
|
|
230
|
-
return props.theme.
|
|
232
|
+
return props.theme.stepFontFamily;
|
|
231
233
|
}, function (props) {
|
|
232
|
-
return props.theme.
|
|
234
|
+
return props.theme.stepFontStyle;
|
|
233
235
|
}, function (props) {
|
|
234
|
-
return props.theme.
|
|
236
|
+
return props.theme.stepFontWeight;
|
|
235
237
|
}, function (props) {
|
|
236
|
-
return props.theme.
|
|
238
|
+
return props.theme.stepFontTracking;
|
|
237
239
|
});
|
|
238
240
|
|
|
239
241
|
var ValidityIconContainer = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n width: 18px;\n height: 18px;\n position: absolute;\n top: 22.5px;\n left: 22.5px;\n"])));
|
|
@@ -251,29 +253,29 @@ var Label = _styledComponents["default"].p(_templateObject11 || (_templateObject
|
|
|
251
253
|
}, function (props) {
|
|
252
254
|
return props.theme.labelFontWeight;
|
|
253
255
|
}, function (props) {
|
|
254
|
-
return props.theme.
|
|
256
|
+
return props.theme.labelFontTracking;
|
|
255
257
|
}, function (props) {
|
|
256
|
-
return props.disabled ? "color: ".concat(props.theme.
|
|
258
|
+
return props.disabled ? "color: ".concat(props.theme.disabledLabelFontColor, ";") : "color: ".concat(!props.visited ? props.theme.unvisitedLabelFontColor : props.current ? props.theme.selectedLabelFontColor : props.theme.visitedLabelFontColor, ";");
|
|
257
259
|
}, function (props) {
|
|
258
260
|
return props.theme.labelFontTextTransform;
|
|
259
261
|
});
|
|
260
262
|
|
|
261
263
|
var Description = _styledComponents["default"].p(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])(["\n text-align: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n ", ";\n margin: 0;\n"])), function (props) {
|
|
262
|
-
return props.theme.
|
|
264
|
+
return props.theme.helperTextTextAlign;
|
|
263
265
|
}, function (props) {
|
|
264
|
-
return props.theme.
|
|
266
|
+
return props.theme.helperTextFontFamily;
|
|
265
267
|
}, function (props) {
|
|
266
|
-
return props.theme.
|
|
268
|
+
return props.theme.helperTextFontSize;
|
|
267
269
|
}, function (props) {
|
|
268
|
-
return props.theme.
|
|
270
|
+
return props.theme.helperTextFontStyle;
|
|
269
271
|
}, function (props) {
|
|
270
|
-
return props.theme.
|
|
272
|
+
return props.theme.helperTextFontWeight;
|
|
271
273
|
}, function (props) {
|
|
272
|
-
return props.theme.
|
|
274
|
+
return props.theme.helperTextFontTracking;
|
|
273
275
|
}, function (props) {
|
|
274
|
-
return props.theme.
|
|
276
|
+
return props.theme.helperTextFontTextTransform;
|
|
275
277
|
}, function (props) {
|
|
276
|
-
return props.disabled ? "color: ".concat(props.theme.
|
|
278
|
+
return props.disabled ? "color: ".concat(props.theme.disabledHelperTextFontColor, ";") : "color: ".concat(!props.visited ? props.theme.unvisitedHelperTextFontColor : props.current ? props.theme.selectedHelperTextFontColor : props.theme.visitedHelperTextFontColor, ";");
|
|
277
279
|
});
|
|
278
280
|
|
|
279
281
|
var StepSeparator = _styledComponents["default"].div(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n ", "\n border: ", ";\n opacity: 1;\n flex-grow: 1;\n"])), function (props) {
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
declare type HeadingLinkProps = {
|
|
3
|
-
children: string;
|
|
4
|
-
level?: 1 | 2 | 3 | 4 | 5;
|
|
5
|
-
as?: "h1" | "h2" | "h3" | "h4" | "h5";
|
|
6
|
-
};
|
|
7
|
-
declare function HeadingLink({ children, level, as }: HeadingLinkProps): JSX.Element;
|
|
8
|
-
export default HeadingLink;
|
|
@@ -1,58 +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["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
-
|
|
12
|
-
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
-
|
|
16
|
-
var _slugify = _interopRequireDefault(require("slugify"));
|
|
17
|
-
|
|
18
|
-
var _Heading = _interopRequireDefault(require("../heading/Heading"));
|
|
19
|
-
|
|
20
|
-
var _templateObject, _templateObject2;
|
|
21
|
-
|
|
22
|
-
function HeadingLink(_ref) {
|
|
23
|
-
var children = _ref.children,
|
|
24
|
-
level = _ref.level,
|
|
25
|
-
as = _ref.as;
|
|
26
|
-
var elementId = (0, _slugify["default"])(children, {
|
|
27
|
-
lower: true
|
|
28
|
-
});
|
|
29
|
-
return /*#__PURE__*/_react["default"].createElement(HeadingLinkContainer, {
|
|
30
|
-
id: elementId
|
|
31
|
-
}, /*#__PURE__*/_react["default"].createElement(HeadingAnchor, {
|
|
32
|
-
href: "#".concat(elementId)
|
|
33
|
-
}, linkIcon), /*#__PURE__*/_react["default"].createElement(_Heading["default"], {
|
|
34
|
-
weight: "bold",
|
|
35
|
-
text: children,
|
|
36
|
-
level: level,
|
|
37
|
-
as: as
|
|
38
|
-
}));
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
var linkIcon = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
42
|
-
"aria-hidden": "true",
|
|
43
|
-
role: "img",
|
|
44
|
-
viewBox: "0 0 16 16",
|
|
45
|
-
width: "16",
|
|
46
|
-
height: "16",
|
|
47
|
-
fill: "currentColor"
|
|
48
|
-
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
49
|
-
fillRule: "evenodd",
|
|
50
|
-
d: "M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"
|
|
51
|
-
}));
|
|
52
|
-
|
|
53
|
-
var HeadingLinkContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n scroll-margin-top: 64px;\n &:hover svg {\n opacity: 0.5;\n }\n"])));
|
|
54
|
-
|
|
55
|
-
var HeadingAnchor = _styledComponents["default"].a(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n color: inherit;\n text-decoration: none;\n display: inline-flex;\n align-items: center;\n padding: 8px;\n margin-left: -32px;\n & svg {\n width: 16px;\n height: 16px;\n opacity: 0;\n }\n &:focus {\n outline-color: #0095ff;\n outline-offset: -0.25rem;\n svg {\n opacity: 0.5;\n }\n }\n"])));
|
|
56
|
-
|
|
57
|
-
var _default = HeadingLink;
|
|
58
|
-
exports["default"] = _default;
|
|
@@ -1,69 +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["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
-
|
|
12
|
-
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
-
|
|
16
|
-
var _QuickNav = _interopRequireDefault(require("../quick-nav/QuickNav"));
|
|
17
|
-
|
|
18
|
-
var _Stack = _interopRequireDefault(require("../stack/Stack"));
|
|
19
|
-
|
|
20
|
-
var _Section = _interopRequireDefault(require("./Section"));
|
|
21
|
-
|
|
22
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
23
|
-
|
|
24
|
-
var DxcQuickNavContainer = function DxcQuickNavContainer(_ref) {
|
|
25
|
-
var title = _ref.title,
|
|
26
|
-
sections = _ref.sections,
|
|
27
|
-
_ref$startHeadingLeve = _ref.startHeadingLevel,
|
|
28
|
-
startHeadingLevel = _ref$startHeadingLeve === void 0 ? 1 : _ref$startHeadingLeve;
|
|
29
|
-
|
|
30
|
-
var getSubSectionsLinks = function getSubSectionsLinks(sections) {
|
|
31
|
-
var linksList = [];
|
|
32
|
-
sections.map(function (section) {
|
|
33
|
-
if (section.subSections) {
|
|
34
|
-
linksList.push({
|
|
35
|
-
label: section.title,
|
|
36
|
-
links: getSubSectionsLinks(section.subSections)
|
|
37
|
-
});
|
|
38
|
-
} else {
|
|
39
|
-
linksList.push({
|
|
40
|
-
label: section.title
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
return linksList;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
return /*#__PURE__*/_react["default"].createElement(Container, null, /*#__PURE__*/_react["default"].createElement(ContentContainer, null, /*#__PURE__*/_react["default"].createElement(_Stack["default"], {
|
|
48
|
-
gutter: "xlarge"
|
|
49
|
-
}, sections.map(function (section) {
|
|
50
|
-
return /*#__PURE__*/_react["default"].createElement(_Section["default"], {
|
|
51
|
-
title: section.title,
|
|
52
|
-
subSections: section.subSections,
|
|
53
|
-
level: startHeadingLevel,
|
|
54
|
-
key: "section-".concat(section.title)
|
|
55
|
-
}, section.content);
|
|
56
|
-
}))), /*#__PURE__*/_react["default"].createElement(QuickNavContainer, null, /*#__PURE__*/_react["default"].createElement(_QuickNav["default"], {
|
|
57
|
-
title: title,
|
|
58
|
-
links: getSubSectionsLinks(sections)
|
|
59
|
-
})));
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
var Container = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n width: 100%;\n"])));
|
|
63
|
-
|
|
64
|
-
var ContentContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n width: 100%;\n"])));
|
|
65
|
-
|
|
66
|
-
var QuickNavContainer = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n max-height: calc(100vh - 150px);\n position: sticky;\n width: 300px;\n"])));
|
|
67
|
-
|
|
68
|
-
var _default = DxcQuickNavContainer;
|
|
69
|
-
exports["default"] = _default;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
declare type SectionType = {
|
|
3
|
-
title: string;
|
|
4
|
-
level?: 1 | 2 | 3 | 4 | 5;
|
|
5
|
-
subSections?: SectionType[];
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
};
|
|
8
|
-
declare const Section: ({ title, subSections, level, children }: SectionType) => JSX.Element;
|
|
9
|
-
export default Section;
|
|
@@ -1,37 +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["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _Stack = _interopRequireDefault(require("../stack/Stack"));
|
|
13
|
-
|
|
14
|
-
var _HeadingLink = _interopRequireDefault(require("./HeadingLink"));
|
|
15
|
-
|
|
16
|
-
// @ts-nocheck
|
|
17
|
-
var Section = function Section(_ref) {
|
|
18
|
-
var title = _ref.title,
|
|
19
|
-
subSections = _ref.subSections,
|
|
20
|
-
level = _ref.level,
|
|
21
|
-
children = _ref.children;
|
|
22
|
-
return /*#__PURE__*/_react["default"].createElement(_Stack["default"], {
|
|
23
|
-
gutter: level === 1 ? "xlarge" : level === 2 ? "large" : "medium"
|
|
24
|
-
}, /*#__PURE__*/_react["default"].createElement(_HeadingLink["default"], {
|
|
25
|
-
level: level
|
|
26
|
-
}, title), children, subSections === null || subSections === void 0 ? void 0 : subSections.map(function (subSection) {
|
|
27
|
-
return /*#__PURE__*/_react["default"].createElement(Section, {
|
|
28
|
-
key: "subSection-".concat(subSection.title),
|
|
29
|
-
title: subSection.title,
|
|
30
|
-
subSections: subSection.subSections,
|
|
31
|
-
level: level + 1 <= 5 ? level + 1 : 5
|
|
32
|
-
}, subSection.content);
|
|
33
|
-
}));
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
var _default = Section;
|
|
37
|
-
exports["default"] = _default;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
declare type Props = {
|
|
3
|
-
/**
|
|
4
|
-
* Title of the quick nav component.
|
|
5
|
-
*/
|
|
6
|
-
title: string;
|
|
7
|
-
/**
|
|
8
|
-
* Sections to be shown as the content of the quick nav container.
|
|
9
|
-
*/
|
|
10
|
-
sections: SectionType[];
|
|
11
|
-
/**
|
|
12
|
-
* The level of the first heading of the content.
|
|
13
|
-
*/
|
|
14
|
-
startHeadingLevel?: 1 | 2 | 3 | 4 | 5;
|
|
15
|
-
};
|
|
16
|
-
declare type SectionType = {
|
|
17
|
-
/**
|
|
18
|
-
* Title of each section.
|
|
19
|
-
*/
|
|
20
|
-
title: string;
|
|
21
|
-
/**
|
|
22
|
-
* Level of each section.
|
|
23
|
-
*/
|
|
24
|
-
level?: 1 | 2 | 3 | 4 | 5;
|
|
25
|
-
/**
|
|
26
|
-
* Content of each section.
|
|
27
|
-
*/
|
|
28
|
-
content?: React.ReactNode;
|
|
29
|
-
/**
|
|
30
|
-
* Subsections of each section.
|
|
31
|
-
*/
|
|
32
|
-
subSections?: SectionType[];
|
|
33
|
-
};
|
|
34
|
-
export default Props;
|
package/radio/Radio.d.ts
DELETED
package/radio/Radio.js
DELETED
|
@@ -1,173 +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 _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
|
-
|
|
14
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
|
-
|
|
16
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
|
-
|
|
18
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
-
|
|
20
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
21
|
-
|
|
22
|
-
var _Radio = _interopRequireDefault(require("@material-ui/core/Radio"));
|
|
23
|
-
|
|
24
|
-
var _RequiredComponent = _interopRequireDefault(require("../common/RequiredComponent"));
|
|
25
|
-
|
|
26
|
-
var _variables = require("../common/variables.js");
|
|
27
|
-
|
|
28
|
-
var _utils = require("../common/utils.js");
|
|
29
|
-
|
|
30
|
-
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
31
|
-
|
|
32
|
-
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
33
|
-
|
|
34
|
-
var _templateObject, _templateObject2;
|
|
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 || _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; }
|
|
39
|
-
|
|
40
|
-
var DxcRadio = function DxcRadio(_ref) {
|
|
41
|
-
var _ref$checked = _ref.checked,
|
|
42
|
-
checked = _ref$checked === void 0 ? false : _ref$checked,
|
|
43
|
-
value = _ref.value,
|
|
44
|
-
_ref$label = _ref.label,
|
|
45
|
-
label = _ref$label === void 0 ? "" : _ref$label,
|
|
46
|
-
_ref$labelPosition = _ref.labelPosition,
|
|
47
|
-
labelPosition = _ref$labelPosition === void 0 ? "before" : _ref$labelPosition,
|
|
48
|
-
name = _ref.name,
|
|
49
|
-
_ref$disabled = _ref.disabled,
|
|
50
|
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
51
|
-
onClick = _ref.onClick,
|
|
52
|
-
_ref$required = _ref.required,
|
|
53
|
-
required = _ref$required === void 0 ? false : _ref$required,
|
|
54
|
-
margin = _ref.margin,
|
|
55
|
-
_ref$size = _ref.size,
|
|
56
|
-
size = _ref$size === void 0 ? "fitContent" : _ref$size;
|
|
57
|
-
|
|
58
|
-
var _useState = (0, _react.useState)(false),
|
|
59
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
60
|
-
innerChecked = _useState2[0],
|
|
61
|
-
setInnerChecked = _useState2[1];
|
|
62
|
-
|
|
63
|
-
var colorsTheme = (0, _useTheme["default"])();
|
|
64
|
-
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
65
|
-
|
|
66
|
-
var handlerRadioChange = function handlerRadioChange() {
|
|
67
|
-
if (checked == null) {
|
|
68
|
-
setInnerChecked(true);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (typeof onClick === "function") {
|
|
72
|
-
onClick(true);
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
var labelComponent = /*#__PURE__*/_react["default"].createElement(LabelContainer, {
|
|
77
|
-
checked: checked || innerChecked,
|
|
78
|
-
disabled: disabled,
|
|
79
|
-
onClick: !disabled && handlerRadioChange || null,
|
|
80
|
-
backgroundType: backgroundType
|
|
81
|
-
}, required && /*#__PURE__*/_react["default"].createElement(_RequiredComponent["default"], null), label);
|
|
82
|
-
|
|
83
|
-
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
84
|
-
theme: colorsTheme.radio
|
|
85
|
-
}, /*#__PURE__*/_react["default"].createElement(RadioContainer, {
|
|
86
|
-
id: name,
|
|
87
|
-
labelPosition: labelPosition,
|
|
88
|
-
disabled: disabled,
|
|
89
|
-
margin: margin,
|
|
90
|
-
size: size,
|
|
91
|
-
backgroundType: backgroundType
|
|
92
|
-
}, labelPosition === "before" && labelComponent, /*#__PURE__*/_react["default"].createElement(_Radio["default"], {
|
|
93
|
-
checked: checked != null && checked || innerChecked,
|
|
94
|
-
name: name,
|
|
95
|
-
onClick: handlerRadioChange,
|
|
96
|
-
value: value,
|
|
97
|
-
disabled: disabled,
|
|
98
|
-
disableRipple: true
|
|
99
|
-
}), labelPosition === "after" && labelComponent));
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
var sizes = {
|
|
103
|
-
small: "120px",
|
|
104
|
-
medium: "240px",
|
|
105
|
-
large: "480px",
|
|
106
|
-
fillParent: "100%",
|
|
107
|
-
fitContent: "unset"
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
var calculateWidth = function calculateWidth(margin, size) {
|
|
111
|
-
if (size === "fillParent") {
|
|
112
|
-
return "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")");
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return sizes[size];
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
var RadioContainer = _styledComponents["default"].span(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n\n display: inline-flex;\n align-items: center;\n max-height: 42px;\n position: relative;\n vertical-align: top;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n cursor: ", ";\n .MuiButtonBase-root {\n width: auto;\n height: auto;\n padding: 10px;\n margin: 2px;\n ", ": ", ";\n padding-left: ", ";\n padding-right: ", ";\n margin-left: ", ";\n margin-right: ", ";\n .MuiIconButton-label {\n .MuiSvgIcon-root {\n height: ", ";\n width: ", ";\n }\n color: ", ";\n\n > div > :nth-child(2) path {\n color: ", ";\n }\n }\n\n &.Mui-focusVisible {\n background-color: transparent;\n .MuiSvgIcon-root {\n outline: ", "\n auto 1px;\n }\n }\n :hover {\n background-color: transparent;\n }\n .MuiTouchRipple-ripple {\n height: 40px !important;\n width: 40px !important;\n top: 0px !important;\n left: 0px !important;\n }\n }\n .MuiRadio-colorSecondary.Mui-checked {\n color: ", ";\n :hover {\n background-color: transparent;\n }\n }\n"])), function (props) {
|
|
119
|
-
return calculateWidth(props.margin, props.size);
|
|
120
|
-
}, function (props) {
|
|
121
|
-
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
122
|
-
}, function (props) {
|
|
123
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
124
|
-
}, function (props) {
|
|
125
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
|
|
126
|
-
}, function (props) {
|
|
127
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
128
|
-
}, function (props) {
|
|
129
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
130
|
-
}, function (props) {
|
|
131
|
-
return props.disabled === true ? "not-allowed" : "default";
|
|
132
|
-
}, function (props) {
|
|
133
|
-
return props.labelPosition === "after" ? "padding-right" : "padding-left";
|
|
134
|
-
}, function (props) {
|
|
135
|
-
return props.theme.circleLabelSpacing;
|
|
136
|
-
}, function (props) {
|
|
137
|
-
return props.labelPosition === "after" ? "0px" : "";
|
|
138
|
-
}, function (props) {
|
|
139
|
-
return props.labelPosition === "before" ? "0px" : "";
|
|
140
|
-
}, function (props) {
|
|
141
|
-
return props.labelPosition === "after" ? "0px" : "";
|
|
142
|
-
}, function (props) {
|
|
143
|
-
return props.labelPosition === "before" ? "0px" : "";
|
|
144
|
-
}, function (props) {
|
|
145
|
-
return props.theme.circleSize;
|
|
146
|
-
}, function (props) {
|
|
147
|
-
return props.theme.circleSize;
|
|
148
|
-
}, function (props) {
|
|
149
|
-
return props.backgroundType === "dark" ? props.disabled && props.theme.disabledColorOnDark || props.theme.colorOnDark : props.disabled && props.theme.disabledColor || props.theme.color;
|
|
150
|
-
}, function (props) {
|
|
151
|
-
return props.backgroundType === "dark" ? props.disabled && props.theme.disabledColorOnDark || props.theme.colorOnDark : props.disabled && props.theme.disabledColor || props.theme.color;
|
|
152
|
-
}, function (props) {
|
|
153
|
-
return props.backgroundType === "dark" ? props.theme.focusColorOnDark : props.theme.focusColor;
|
|
154
|
-
}, function (props) {
|
|
155
|
-
return props.backgroundType === "dark" ? props.disabled && props.theme.disabledColorOnDark || props.theme.colorOnDark : props.disabled && props.theme.disabledColor || props.theme.color;
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
var LabelContainer = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n font-style: ", ";\n color: ", ";\n cursor: ", ";\n"])), function (props) {
|
|
159
|
-
return props.theme.fontFamily;
|
|
160
|
-
}, function (props) {
|
|
161
|
-
return props.theme.fontSize;
|
|
162
|
-
}, function (props) {
|
|
163
|
-
return props.theme.fontWeight;
|
|
164
|
-
}, function (props) {
|
|
165
|
-
return props.theme.fontStyle;
|
|
166
|
-
}, function (props) {
|
|
167
|
-
return props.backgroundType === "dark" ? props.disabled && props.theme.disabledFontColorOnDark || props.theme.fontColorOnDark : props.disabled && props.theme.disabledFontColor || props.theme.fontColor;
|
|
168
|
-
}, function (props) {
|
|
169
|
-
return props.disabled === true ? "not-allowed" : "pointer";
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
var _default = DxcRadio;
|
|
173
|
-
exports["default"] = _default;
|