@dxc-technology/halstack-react 0.0.0-fdc49d2 → 0.0.0-ff5083e
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 +12 -0
- package/HalstackContext.js +295 -0
- package/accordion/Accordion.js +5 -27
- package/accordion/Accordion.stories.tsx +3 -3
- package/accordion-group/AccordionGroup.d.ts +1 -1
- package/accordion-group/AccordionGroup.js +13 -15
- package/accordion-group/AccordionGroup.stories.tsx +1 -1
- package/accordion-group/AccordionGroup.test.js +24 -6
- package/accordion-group/types.d.ts +4 -0
- 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/bulleted-list/BulletedList.d.ts +7 -0
- package/bulleted-list/BulletedList.js +120 -0
- package/bulleted-list/BulletedList.stories.tsx +203 -0
- package/bulleted-list/types.d.ts +11 -0
- package/{list → bulleted-list}/types.js +0 -0
- package/button/Button.js +14 -11
- package/card/Card.js +24 -27
- package/checkbox/Checkbox.d.ts +1 -1
- package/checkbox/Checkbox.js +38 -28
- package/checkbox/Checkbox.stories.tsx +124 -128
- package/checkbox/types.d.ts +3 -3
- package/common/variables.js +197 -84
- package/date-input/DateInput.js +38 -20
- package/date-input/DateInput.test.js +9 -22
- package/date-input/types.d.ts +12 -9
- package/dialog/Dialog.js +4 -32
- package/dropdown/Dropdown.js +13 -17
- package/file-input/FileInput.js +9 -6
- package/file-input/FileItem.js +7 -5
- package/footer/Footer.js +15 -88
- package/header/Header.js +27 -48
- package/header/Header.stories.tsx +46 -36
- package/header/Header.test.js +18 -2
- package/inset/Inset.js +1 -34
- package/inset/Inset.stories.tsx +32 -32
- package/inset/types.d.ts +25 -1
- package/layout/ApplicationLayout.d.ts +4 -3
- package/layout/ApplicationLayout.js +82 -114
- 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 -74
- 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 +6 -5
- package/main.js +37 -23
- package/number-input/NumberInput.test.js +2 -4
- package/number-input/types.d.ts +13 -10
- package/package.json +6 -5
- package/paginator/Paginator.js +17 -38
- package/paragraph/Paragraph.d.ts +6 -0
- package/paragraph/Paragraph.js +38 -0
- package/paragraph/Paragraph.stories.tsx +44 -0
- package/password-input/PasswordInput.js +7 -4
- package/password-input/PasswordInput.test.js +3 -6
- package/password-input/types.d.ts +14 -11
- package/progress-bar/ProgressBar.js +1 -1
- package/progress-bar/ProgressBar.stories.jsx +11 -11
- package/quick-nav/QuickNav.js +75 -23
- package/quick-nav/QuickNav.stories.tsx +13 -13
- package/quick-nav/types.d.ts +4 -8
- package/radio-group/Radio.js +1 -1
- package/radio-group/RadioGroup.js +8 -6
- package/select/Listbox.d.ts +4 -0
- package/select/Listbox.js +152 -0
- package/select/Option.js +1 -1
- package/select/Select.js +66 -161
- package/select/Select.stories.tsx +14 -2
- package/select/Select.test.js +335 -231
- package/select/types.d.ts +33 -11
- package/sidenav/Sidenav.d.ts +1 -1
- package/sidenav/Sidenav.js +20 -9
- package/slider/Slider.d.ts +1 -1
- package/slider/Slider.js +2 -1
- package/slider/Slider.stories.tsx +8 -8
- package/slider/Slider.test.js +31 -10
- package/slider/types.d.ts +4 -0
- package/spinner/Spinner.js +1 -1
- package/switch/Switch.d.ts +1 -1
- package/switch/Switch.js +19 -16
- package/switch/Switch.stories.tsx +8 -8
- package/switch/types.d.ts +2 -2
- package/tabs/Tabs.d.ts +1 -1
- package/tabs/Tabs.js +9 -11
- package/tabs/Tabs.stories.tsx +0 -8
- package/tabs/Tabs.test.js +26 -9
- package/tabs/types.d.ts +4 -0
- 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/tag/Tag.js +5 -8
- package/text-input/Suggestion.d.ts +4 -0
- package/text-input/Suggestion.js +55 -0
- package/text-input/TextInput.js +48 -76
- package/text-input/TextInput.test.js +22 -35
- package/text-input/types.d.ts +27 -12
- package/textarea/Textarea.js +10 -19
- package/textarea/types.d.ts +10 -7
- package/toggle-group/ToggleGroup.d.ts +1 -1
- package/toggle-group/ToggleGroup.js +5 -4
- package/toggle-group/ToggleGroup.stories.tsx +4 -4
- package/toggle-group/ToggleGroup.test.js +35 -4
- package/toggle-group/types.d.ts +8 -0
- package/typography/Typography.d.ts +4 -0
- package/typography/Typography.js +131 -0
- package/typography/Typography.stories.tsx +175 -0
- package/typography/types.d.ts +18 -0
- package/typography/types.js +5 -0
- package/typography/typographyContextTypes.d.ts +16 -0
- package/typography/typographyContextTypes.js +5 -0
- package/useTheme.js +2 -2
- package/useTranslatedLabels.d.ts +2 -0
- package/useTranslatedLabels.js +20 -0
- package/wizard/Wizard.js +35 -29
- package/ThemeContext.d.ts +0 -10
- package/ThemeContext.js +0 -243
- package/list/List.d.ts +0 -4
- package/list/List.js +0 -47
- package/list/List.stories.tsx +0 -95
- package/list/types.d.ts +0 -7
- package/radio/Radio.d.ts +0 -4
- package/radio/Radio.js +0 -174
- package/radio/Radio.stories.tsx +0 -192
- package/radio/Radio.test.js +0 -71
- package/radio/types.d.ts +0 -54
- package/text/Text.d.ts +0 -7
- package/text/Text.js +0 -30
- package/text/Text.stories.tsx +0 -19
|
@@ -0,0 +1,131 @@
|
|
|
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 _react = _interopRequireWildcard(require("react"));
|
|
15
|
+
|
|
16
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
17
|
+
|
|
18
|
+
var _templateObject;
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
var TypographyContext = /*#__PURE__*/_react["default"].createContext(null);
|
|
25
|
+
|
|
26
|
+
function Typography(_ref) {
|
|
27
|
+
var as = _ref.as,
|
|
28
|
+
display = _ref.display,
|
|
29
|
+
fontFamily = _ref.fontFamily,
|
|
30
|
+
fontSize = _ref.fontSize,
|
|
31
|
+
fontStyle = _ref.fontStyle,
|
|
32
|
+
fontWeight = _ref.fontWeight,
|
|
33
|
+
letterSpacing = _ref.letterSpacing,
|
|
34
|
+
lineHeight = _ref.lineHeight,
|
|
35
|
+
textAlign = _ref.textAlign,
|
|
36
|
+
color = _ref.color,
|
|
37
|
+
textDecoration = _ref.textDecoration,
|
|
38
|
+
textOverflow = _ref.textOverflow,
|
|
39
|
+
whiteSpace = _ref.whiteSpace,
|
|
40
|
+
children = _ref.children;
|
|
41
|
+
var componentContext = (0, _react.useContext)(TypographyContext);
|
|
42
|
+
var asValue = as !== null && as !== void 0 ? as : (componentContext === null || componentContext === void 0 ? void 0 : componentContext.as) || "span";
|
|
43
|
+
var displayValue = display !== null && display !== void 0 ? display : (componentContext === null || componentContext === void 0 ? void 0 : componentContext.display) || "inline";
|
|
44
|
+
var fontFamilyValue = fontFamily !== null && fontFamily !== void 0 ? fontFamily : (componentContext === null || componentContext === void 0 ? void 0 : componentContext.fontFamily) || "Open Sans, sans-serif";
|
|
45
|
+
var fontSizeValue = fontSize !== null && fontSize !== void 0 ? fontSize : (componentContext === null || componentContext === void 0 ? void 0 : componentContext.fontSize) || "1rem";
|
|
46
|
+
var fontStyleValue = fontStyle !== null && fontStyle !== void 0 ? fontStyle : (componentContext === null || componentContext === void 0 ? void 0 : componentContext.fontStyle) || "normal";
|
|
47
|
+
var fontWeightValue = fontWeight !== null && fontWeight !== void 0 ? fontWeight : (componentContext === null || componentContext === void 0 ? void 0 : componentContext.fontWeight) || "400";
|
|
48
|
+
var letterSpacingValue = letterSpacing !== null && letterSpacing !== void 0 ? letterSpacing : (componentContext === null || componentContext === void 0 ? void 0 : componentContext.letterSpacing) || "0em";
|
|
49
|
+
var lineHeightValue = lineHeight !== null && lineHeight !== void 0 ? lineHeight : (componentContext === null || componentContext === void 0 ? void 0 : componentContext.lineHeight) || "1.5em";
|
|
50
|
+
var textAlignValue = textAlign !== null && textAlign !== void 0 ? textAlign : (componentContext === null || componentContext === void 0 ? void 0 : componentContext.textAlign) || "left";
|
|
51
|
+
var colorValue = color !== null && color !== void 0 ? color : (componentContext === null || componentContext === void 0 ? void 0 : componentContext.color) || "#000000";
|
|
52
|
+
var textDecorationValue = textDecoration !== null && textDecoration !== void 0 ? textDecoration : (componentContext === null || componentContext === void 0 ? void 0 : componentContext.textDecoration) || "none";
|
|
53
|
+
var textOverflowValue = textOverflow !== null && textOverflow !== void 0 ? textOverflow : (componentContext === null || componentContext === void 0 ? void 0 : componentContext.textOverflow) || "unset";
|
|
54
|
+
var whiteSpaceValue = whiteSpace !== null && whiteSpace !== void 0 ? whiteSpace : (componentContext === null || componentContext === void 0 ? void 0 : componentContext.whiteSpace) || "normal";
|
|
55
|
+
return /*#__PURE__*/_react["default"].createElement(TypographyContext.Provider, {
|
|
56
|
+
value: {
|
|
57
|
+
as: asValue,
|
|
58
|
+
display: displayValue,
|
|
59
|
+
fontFamily: fontFamilyValue,
|
|
60
|
+
fontSize: fontSizeValue,
|
|
61
|
+
fontStyle: fontStyleValue,
|
|
62
|
+
fontWeight: fontWeightValue,
|
|
63
|
+
letterSpacing: letterSpacingValue,
|
|
64
|
+
lineHeight: lineHeightValue,
|
|
65
|
+
textAlign: textAlignValue,
|
|
66
|
+
color: colorValue,
|
|
67
|
+
textDecoration: textDecorationValue,
|
|
68
|
+
textOverflow: textOverflowValue,
|
|
69
|
+
whiteSpace: whiteSpaceValue
|
|
70
|
+
}
|
|
71
|
+
}, /*#__PURE__*/_react["default"].createElement(StyledTypography, {
|
|
72
|
+
as: asValue,
|
|
73
|
+
display: displayValue,
|
|
74
|
+
fontFamily: fontFamilyValue,
|
|
75
|
+
fontSize: fontSizeValue,
|
|
76
|
+
fontStyle: fontStyleValue,
|
|
77
|
+
fontWeight: fontWeightValue,
|
|
78
|
+
letterSpacing: letterSpacingValue,
|
|
79
|
+
lineHeight: lineHeightValue,
|
|
80
|
+
textAlign: textAlignValue,
|
|
81
|
+
color: colorValue,
|
|
82
|
+
textDecoration: textDecorationValue,
|
|
83
|
+
textOverflow: textOverflowValue,
|
|
84
|
+
whiteSpace: whiteSpaceValue
|
|
85
|
+
}, children));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
var StyledTypography = _styledComponents["default"].span(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n margin: 0px;\n display: ", ";\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n text-align: ", ";\n line-height: ", ";\n text-decoration: ", ";\n text-overflow: ", ";\n white-space: ", ";\n overflow: ", ";\n"])), function (_ref2) {
|
|
89
|
+
var display = _ref2.display;
|
|
90
|
+
return display;
|
|
91
|
+
}, function (_ref3) {
|
|
92
|
+
var color = _ref3.color;
|
|
93
|
+
return color;
|
|
94
|
+
}, function (_ref4) {
|
|
95
|
+
var fontFamily = _ref4.fontFamily;
|
|
96
|
+
return fontFamily;
|
|
97
|
+
}, function (_ref5) {
|
|
98
|
+
var fontSize = _ref5.fontSize;
|
|
99
|
+
return fontSize;
|
|
100
|
+
}, function (_ref6) {
|
|
101
|
+
var fontStyle = _ref6.fontStyle;
|
|
102
|
+
return fontStyle;
|
|
103
|
+
}, function (_ref7) {
|
|
104
|
+
var fontWeight = _ref7.fontWeight;
|
|
105
|
+
return fontWeight;
|
|
106
|
+
}, function (_ref8) {
|
|
107
|
+
var letterSpacing = _ref8.letterSpacing;
|
|
108
|
+
return letterSpacing;
|
|
109
|
+
}, function (_ref9) {
|
|
110
|
+
var textAlign = _ref9.textAlign;
|
|
111
|
+
return textAlign;
|
|
112
|
+
}, function (_ref10) {
|
|
113
|
+
var lineHeight = _ref10.lineHeight;
|
|
114
|
+
return lineHeight;
|
|
115
|
+
}, function (_ref11) {
|
|
116
|
+
var textDecoration = _ref11.textDecoration;
|
|
117
|
+
return textDecoration;
|
|
118
|
+
}, function (_ref12) {
|
|
119
|
+
var textOverflow = _ref12.textOverflow;
|
|
120
|
+
return textOverflow;
|
|
121
|
+
}, function (_ref13) {
|
|
122
|
+
var whiteSpace = _ref13.whiteSpace,
|
|
123
|
+
textOverflow = _ref13.textOverflow;
|
|
124
|
+
return whiteSpace !== "normal" ? whiteSpace : textOverflow !== "unset" ? "nowrap" : "normal";
|
|
125
|
+
}, function (_ref14) {
|
|
126
|
+
var textOverflow = _ref14.textOverflow;
|
|
127
|
+
return textOverflow !== "unset" ? "hidden" : "visible";
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
var _default = Typography;
|
|
131
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Title from "../../.storybook/components/Title";
|
|
3
|
+
import DxcTypography from "./Typography";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: "Typography",
|
|
7
|
+
component: DxcTypography,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const Chromatic = () => (
|
|
11
|
+
<>
|
|
12
|
+
<Title title="Default Typography" theme="light" level={4} />
|
|
13
|
+
<DxcTypography>Default typography.</DxcTypography>
|
|
14
|
+
<Title title="Typography font sizes" theme="light" level={4} />
|
|
15
|
+
<DxcTypography display="block" fontSize="3.75rem">
|
|
16
|
+
3.75rem.
|
|
17
|
+
</DxcTypography>
|
|
18
|
+
<DxcTypography display="block" fontSize="3rem">
|
|
19
|
+
3rem.
|
|
20
|
+
</DxcTypography>
|
|
21
|
+
<DxcTypography display="block" fontSize="2rem">
|
|
22
|
+
2rem.
|
|
23
|
+
</DxcTypography>
|
|
24
|
+
<DxcTypography display="block" fontSize="1.5rem">
|
|
25
|
+
1.5rem.
|
|
26
|
+
</DxcTypography>
|
|
27
|
+
<DxcTypography display="block" fontSize="1.25rem">
|
|
28
|
+
1.25rem.
|
|
29
|
+
</DxcTypography>
|
|
30
|
+
<DxcTypography display="block" fontSize="1rem">
|
|
31
|
+
1rem.
|
|
32
|
+
</DxcTypography>
|
|
33
|
+
<DxcTypography display="block" fontSize="0.875rem">
|
|
34
|
+
0.875rem.
|
|
35
|
+
</DxcTypography>
|
|
36
|
+
<DxcTypography display="block" fontSize="0.75rem">
|
|
37
|
+
0.75rem.
|
|
38
|
+
</DxcTypography>
|
|
39
|
+
<Title title="Typography letter spacing" theme="light" level={4} />
|
|
40
|
+
<DxcTypography display="block" letterSpacing="-0.025em">
|
|
41
|
+
-0.025em.
|
|
42
|
+
</DxcTypography>
|
|
43
|
+
<DxcTypography display="block" letterSpacing="-0.0125em">
|
|
44
|
+
-0.0125em.
|
|
45
|
+
</DxcTypography>
|
|
46
|
+
<DxcTypography display="block" letterSpacing="0em">
|
|
47
|
+
0em.
|
|
48
|
+
</DxcTypography>
|
|
49
|
+
<DxcTypography display="block" letterSpacing="0.025em">
|
|
50
|
+
0.025em.
|
|
51
|
+
</DxcTypography>
|
|
52
|
+
<DxcTypography display="block" letterSpacing="0.05em">
|
|
53
|
+
0.05em.
|
|
54
|
+
</DxcTypography>
|
|
55
|
+
<DxcTypography display="block" letterSpacing="0.1em">
|
|
56
|
+
0.1em.
|
|
57
|
+
</DxcTypography>
|
|
58
|
+
<Title title="Typography line height" theme="light" level={4} />
|
|
59
|
+
<DxcTypography display="block" lineHeight="1em">
|
|
60
|
+
1em.
|
|
61
|
+
</DxcTypography>
|
|
62
|
+
<DxcTypography display="block" lineHeight="1.25em">
|
|
63
|
+
1.25em.
|
|
64
|
+
</DxcTypography>
|
|
65
|
+
<DxcTypography display="block" lineHeight="1.365em">
|
|
66
|
+
1.365em.
|
|
67
|
+
</DxcTypography>
|
|
68
|
+
<DxcTypography display="block" lineHeight="1.5em">
|
|
69
|
+
1.5em.
|
|
70
|
+
</DxcTypography>
|
|
71
|
+
<DxcTypography display="block" lineHeight="1.715em">
|
|
72
|
+
1.715em.
|
|
73
|
+
</DxcTypography>
|
|
74
|
+
<DxcTypography display="block" lineHeight="2em">
|
|
75
|
+
2em.
|
|
76
|
+
</DxcTypography>
|
|
77
|
+
<Title title="Typography font weight" theme="light" level={4} />
|
|
78
|
+
<DxcTypography display="block" fontWeight="300">
|
|
79
|
+
300.
|
|
80
|
+
</DxcTypography>
|
|
81
|
+
<DxcTypography display="block" fontWeight="400">
|
|
82
|
+
400.
|
|
83
|
+
</DxcTypography>
|
|
84
|
+
<DxcTypography display="block" fontWeight="600">
|
|
85
|
+
600.
|
|
86
|
+
</DxcTypography>
|
|
87
|
+
<DxcTypography display="block" fontWeight="700">
|
|
88
|
+
700.
|
|
89
|
+
</DxcTypography>
|
|
90
|
+
<Title title="Typography decoration" theme="light" level={4} />
|
|
91
|
+
<DxcTypography display="block" textDecoration="underline">
|
|
92
|
+
Underline.
|
|
93
|
+
</DxcTypography>
|
|
94
|
+
<DxcTypography display="block" textDecoration="line-through">
|
|
95
|
+
Line-through.
|
|
96
|
+
</DxcTypography>
|
|
97
|
+
<Title title="Typography font family" theme="light" level={4} />
|
|
98
|
+
<DxcTypography display="block" fontFamily="Open Sans, sans-serif">
|
|
99
|
+
Open Sans, sans-serif.
|
|
100
|
+
</DxcTypography>
|
|
101
|
+
<DxcTypography display="block" fontFamily="Source Code Pro, monospace">
|
|
102
|
+
Source Code Pro, monospace.
|
|
103
|
+
</DxcTypography>
|
|
104
|
+
<Title title="Typography font style" theme="light" level={4} />
|
|
105
|
+
<DxcTypography display="block" fontStyle="italic">
|
|
106
|
+
Italic.
|
|
107
|
+
</DxcTypography>
|
|
108
|
+
<DxcTypography display="block" fontStyle="normal">
|
|
109
|
+
Normal.
|
|
110
|
+
</DxcTypography>
|
|
111
|
+
<Title title="Typography align" theme="light" level={4} />
|
|
112
|
+
<DxcTypography display="block" textAlign="left">
|
|
113
|
+
Left.
|
|
114
|
+
</DxcTypography>
|
|
115
|
+
<DxcTypography display="block" textAlign="center">
|
|
116
|
+
Center.
|
|
117
|
+
</DxcTypography>
|
|
118
|
+
<DxcTypography display="block" textAlign="right">
|
|
119
|
+
Right.
|
|
120
|
+
</DxcTypography>
|
|
121
|
+
<Title title="Typography whitespace" theme="light" level={4} />
|
|
122
|
+
<div style={{ margin: "50px", border: "1px solid red", width: "125px" }}>
|
|
123
|
+
<DxcTypography whiteSpace="normal" fontSize="2rem">
|
|
124
|
+
{" "} Normal: A bunch of words you see.
|
|
125
|
+
</DxcTypography>
|
|
126
|
+
</div>
|
|
127
|
+
<div style={{ margin: "50px", border: "1px solid red", width: "125px" }}>
|
|
128
|
+
<DxcTypography whiteSpace="nowrap" fontSize="2rem">
|
|
129
|
+
{" "}No-wrap: A bunch of words you see.
|
|
130
|
+
</DxcTypography>
|
|
131
|
+
</div>
|
|
132
|
+
<div style={{ margin: "50px", border: "1px solid red", width: "125px" }}>
|
|
133
|
+
<DxcTypography whiteSpace="pre" fontSize="2rem">
|
|
134
|
+
{" "} pre: A bunch of words you see.
|
|
135
|
+
</DxcTypography>
|
|
136
|
+
</div>
|
|
137
|
+
<div style={{ margin: "50px", border: "1px solid red", width: "125px" }}>
|
|
138
|
+
<DxcTypography whiteSpace="pre-line" fontSize="2rem">
|
|
139
|
+
{" "}pre-line: A bunch of words you see.
|
|
140
|
+
</DxcTypography>
|
|
141
|
+
</div>
|
|
142
|
+
<div style={{ margin: "50px", border: "1px solid red", width: "125px" }}>
|
|
143
|
+
<DxcTypography whiteSpace="pre-wrap" fontSize="2rem">
|
|
144
|
+
{" "} pre-wrap: A bunch of words you see.
|
|
145
|
+
</DxcTypography>
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
<Title title="Typography display" theme="light" level={4} />
|
|
149
|
+
<DxcTypography display="block" textAlign="left">
|
|
150
|
+
Display Block.
|
|
151
|
+
<DxcTypography>A different text.</DxcTypography>
|
|
152
|
+
</DxcTypography>
|
|
153
|
+
<DxcTypography display="inline" textAlign="left">
|
|
154
|
+
Display Inline.
|
|
155
|
+
<DxcTypography>A different text.</DxcTypography>
|
|
156
|
+
</DxcTypography>
|
|
157
|
+
|
|
158
|
+
<Title title="Typography text-overflow" theme="light" level={4} />
|
|
159
|
+
<div style={{ width: "75px" }}>
|
|
160
|
+
<DxcTypography display="block" textOverflow="clip">
|
|
161
|
+
Overflow clip.
|
|
162
|
+
</DxcTypography>
|
|
163
|
+
</div>
|
|
164
|
+
<div style={{ width: "75px" }}>
|
|
165
|
+
<DxcTypography display="block" textOverflow="ellipsis">
|
|
166
|
+
Overflow ellipsis.
|
|
167
|
+
</DxcTypography>
|
|
168
|
+
</div>
|
|
169
|
+
<div style={{ width: "75px" }}>
|
|
170
|
+
<DxcTypography display="block" textOverflow="unset">
|
|
171
|
+
Overflow unset.
|
|
172
|
+
</DxcTypography>
|
|
173
|
+
</div>
|
|
174
|
+
</>
|
|
175
|
+
);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type Props = {
|
|
3
|
+
as?: keyof HTMLElementTagNameMap;
|
|
4
|
+
display?: "inline" | "block";
|
|
5
|
+
fontFamily?: "Open Sans, sans-serif" | "Source Code Pro, monospace";
|
|
6
|
+
fontSize?: "0.75rem" | "0.875rem" | "1rem" | "1.25rem" | "1.5rem" | "2rem" | "3rem" | "3.75rem";
|
|
7
|
+
fontStyle?: "italic" | "normal";
|
|
8
|
+
fontWeight?: "300" | "400" | "600" | "700";
|
|
9
|
+
letterSpacing?: "-0.025em" | "-0.0125em" | "0em" | "0.025em" | "0.05em" | "0.1em";
|
|
10
|
+
lineHeight?: "1em" | "1.25em" | "1.365em" | "1.5em" | "1.715em" | "2em";
|
|
11
|
+
textAlign?: "left" | "center" | "right";
|
|
12
|
+
color?: string;
|
|
13
|
+
textDecoration?: "none" | "underline" | "line-through";
|
|
14
|
+
textOverflow?: "clip" | "ellipsis" | "unset";
|
|
15
|
+
whiteSpace?: "normal" | "nowrap" | "pre" | "pre-line" | "pre-wrap";
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
};
|
|
18
|
+
export default Props;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare type Props = {
|
|
2
|
+
as?: keyof HTMLElementTagNameMap;
|
|
3
|
+
display?: "inline" | "block";
|
|
4
|
+
fontFamily?: "Open Sans, sans-serif" | "Source Code Pro, monospace";
|
|
5
|
+
fontSize?: "0.75rem" | "0.875rem" | "1rem" | "1.25rem" | "1.5rem" | "2rem" | "3rem" | "3.75rem";
|
|
6
|
+
fontStyle?: "italic" | "normal";
|
|
7
|
+
fontWeight?: "300" | "400" | "600" | "700";
|
|
8
|
+
letterSpacing?: "-0.025em" | "-0.0125em" | "0em" | "0.025em" | "0.05em" | "0.1em";
|
|
9
|
+
lineHeight?: "1em" | "1.25em" | "1.365em" | "1.5em" | "1.715em" | "2em";
|
|
10
|
+
textAlign?: "left" | "center" | "right";
|
|
11
|
+
color?: string;
|
|
12
|
+
textDecoration?: "none" | "underline" | "line-through";
|
|
13
|
+
textOverflow?: "clip" | "ellipsis" | "unset";
|
|
14
|
+
whiteSpace?: "normal" | "nowrap" | "pre" | "pre-line" | "pre-wrap";
|
|
15
|
+
};
|
|
16
|
+
export default Props;
|
package/useTheme.js
CHANGED
|
@@ -11,10 +11,10 @@ var _react = require("react");
|
|
|
11
11
|
|
|
12
12
|
var _variables = require("./common/variables.js");
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _HalstackContext = _interopRequireDefault(require("./HalstackContext"));
|
|
15
15
|
|
|
16
16
|
var useTheme = function useTheme() {
|
|
17
|
-
var colorsTheme = (0, _react.useContext)(
|
|
17
|
+
var colorsTheme = (0, _react.useContext)(_HalstackContext["default"]);
|
|
18
18
|
return colorsTheme || _variables.componentTokens;
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -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
|
@@ -133,7 +133,9 @@ var DxcWizard = function DxcWizard(_ref) {
|
|
|
133
133
|
last: i === (steps === null || steps === void 0 ? void 0 : steps.length) - 1,
|
|
134
134
|
"aria-current": renderedCurrent === i ? "step" : "false",
|
|
135
135
|
tabIndex: tabIndex
|
|
136
|
-
}, /*#__PURE__*/_react["default"].createElement(StepHeader,
|
|
136
|
+
}, /*#__PURE__*/_react["default"].createElement(StepHeader, {
|
|
137
|
+
validityIcon: step.valid !== undefined
|
|
138
|
+
}, /*#__PURE__*/_react["default"].createElement(IconContainer, {
|
|
137
139
|
current: i === renderedCurrent,
|
|
138
140
|
visited: i < renderedCurrent,
|
|
139
141
|
disabled: step.disabled
|
|
@@ -145,9 +147,11 @@ var DxcWizard = function DxcWizard(_ref) {
|
|
|
145
147
|
disabled: step.disabled,
|
|
146
148
|
current: i === renderedCurrent
|
|
147
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,
|
|
148
151
|
disabled: step.disabled,
|
|
149
152
|
visited: i <= innerCurrent
|
|
150
153
|
}, step.label), step.description && /*#__PURE__*/_react["default"].createElement(Description, {
|
|
154
|
+
current: i === renderedCurrent,
|
|
151
155
|
disabled: step.disabled,
|
|
152
156
|
visited: i <= innerCurrent
|
|
153
157
|
}, step.description))), i === steps.length - 1 ? "" : /*#__PURE__*/_react["default"].createElement(StepSeparator, {
|
|
@@ -156,10 +160,10 @@ var DxcWizard = function DxcWizard(_ref) {
|
|
|
156
160
|
})));
|
|
157
161
|
};
|
|
158
162
|
|
|
159
|
-
var StepsContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display:
|
|
163
|
+
var StepsContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: ", ";\n justify-content: \"center\";\n ", ";\n font-family: ", ";\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
|
|
160
164
|
return props.mode === "vertical" ? "column" : "row";
|
|
161
165
|
}, function (props) {
|
|
162
|
-
return props.mode === "vertical"
|
|
166
|
+
return props.mode === "vertical" && "height: 500px";
|
|
163
167
|
}, function (props) {
|
|
164
168
|
return props.theme.fontFamily;
|
|
165
169
|
}, function (props) {
|
|
@@ -194,42 +198,44 @@ var Step = _styledComponents["default"].button(_templateObject3 || (_templateObj
|
|
|
194
198
|
return props.theme.focusColor;
|
|
195
199
|
});
|
|
196
200
|
|
|
197
|
-
var StepHeader = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n display: inline-flex;\n
|
|
201
|
+
var StepHeader = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n display: inline-flex;\n ", "\n"])), function (props) {
|
|
202
|
+
return props.validityIcon && "padding-bottom: 4px;";
|
|
203
|
+
});
|
|
198
204
|
|
|
199
|
-
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) {
|
|
200
|
-
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;
|
|
201
207
|
}, function (props) {
|
|
202
|
-
return props.disabled ? props.theme.
|
|
208
|
+
return props.disabled ? props.theme.disabledStepHeight : props.current ? props.theme.selectedStepHeight : props.theme.stepHeight;
|
|
203
209
|
}, function (props) {
|
|
204
|
-
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 ");
|
|
205
211
|
}, function (props) {
|
|
206
|
-
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, ";");
|
|
207
213
|
}, function (props) {
|
|
208
|
-
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 : "";
|
|
209
215
|
});
|
|
210
216
|
|
|
211
217
|
var Icon = _styledComponents["default"].img(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n"])), function (props) {
|
|
212
|
-
return props.theme.
|
|
218
|
+
return props.theme.stepIconSize;
|
|
213
219
|
}, function (props) {
|
|
214
|
-
return props.theme.
|
|
220
|
+
return props.theme.stepIconSize;
|
|
215
221
|
});
|
|
216
222
|
|
|
217
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) {
|
|
218
|
-
return props.theme.
|
|
224
|
+
return props.theme.stepIconSize;
|
|
219
225
|
}, function (props) {
|
|
220
|
-
return props.theme.
|
|
226
|
+
return props.theme.stepIconSize;
|
|
221
227
|
});
|
|
222
228
|
|
|
223
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) {
|
|
224
|
-
return props.theme.
|
|
230
|
+
return props.theme.stepFontSize;
|
|
225
231
|
}, function (props) {
|
|
226
|
-
return props.theme.
|
|
232
|
+
return props.theme.stepFontFamily;
|
|
227
233
|
}, function (props) {
|
|
228
|
-
return props.theme.
|
|
234
|
+
return props.theme.stepFontStyle;
|
|
229
235
|
}, function (props) {
|
|
230
|
-
return props.theme.
|
|
236
|
+
return props.theme.stepFontWeight;
|
|
231
237
|
}, function (props) {
|
|
232
|
-
return props.theme.
|
|
238
|
+
return props.theme.stepFontTracking;
|
|
233
239
|
});
|
|
234
240
|
|
|
235
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"])));
|
|
@@ -247,29 +253,29 @@ var Label = _styledComponents["default"].p(_templateObject11 || (_templateObject
|
|
|
247
253
|
}, function (props) {
|
|
248
254
|
return props.theme.labelFontWeight;
|
|
249
255
|
}, function (props) {
|
|
250
|
-
return props.theme.
|
|
256
|
+
return props.theme.labelFontTracking;
|
|
251
257
|
}, function (props) {
|
|
252
|
-
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, ";");
|
|
253
259
|
}, function (props) {
|
|
254
260
|
return props.theme.labelFontTextTransform;
|
|
255
261
|
});
|
|
256
262
|
|
|
257
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) {
|
|
258
|
-
return props.theme.
|
|
264
|
+
return props.theme.helperTextTextAlign;
|
|
259
265
|
}, function (props) {
|
|
260
|
-
return props.theme.
|
|
266
|
+
return props.theme.helperTextFontFamily;
|
|
261
267
|
}, function (props) {
|
|
262
|
-
return props.theme.
|
|
268
|
+
return props.theme.helperTextFontSize;
|
|
263
269
|
}, function (props) {
|
|
264
|
-
return props.theme.
|
|
270
|
+
return props.theme.helperTextFontStyle;
|
|
265
271
|
}, function (props) {
|
|
266
|
-
return props.theme.
|
|
272
|
+
return props.theme.helperTextFontWeight;
|
|
267
273
|
}, function (props) {
|
|
268
|
-
return props.theme.
|
|
274
|
+
return props.theme.helperTextFontTracking;
|
|
269
275
|
}, function (props) {
|
|
270
|
-
return props.theme.
|
|
276
|
+
return props.theme.helperTextFontTextTransform;
|
|
271
277
|
}, function (props) {
|
|
272
|
-
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, ";");
|
|
273
279
|
});
|
|
274
280
|
|
|
275
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) {
|
package/ThemeContext.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
declare const ThemeContext: React.Context<object>;
|
|
3
|
-
declare type ThemeProviderPropsType = {
|
|
4
|
-
theme?: object;
|
|
5
|
-
advancedTheme?: object;
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
};
|
|
8
|
-
declare const ThemeProvider: ({ theme, advancedTheme, children }: ThemeProviderPropsType) => JSX.Element;
|
|
9
|
-
export default ThemeContext;
|
|
10
|
-
export { ThemeProvider };
|