@dxc-technology/halstack-react 0.0.0-4a5e7d8 → 0.0.0-4b95ba0
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/BackgroundColorContext.js +0 -1
- package/ThemeContext.js +23 -31
- package/accordion/Accordion.d.ts +1 -1
- package/accordion/Accordion.js +9 -20
- package/accordion/Accordion.stories.tsx +9 -2
- package/accordion/types.d.ts +3 -7
- package/accordion-group/types.d.ts +3 -7
- package/badge/Badge.d.ts +4 -0
- package/badge/types.d.ts +4 -0
- package/badge/types.js +5 -0
- package/bleed/Bleed.d.ts +3 -0
- package/bleed/Bleed.js +84 -0
- package/bleed/Bleed.stories.tsx +342 -0
- package/bleed/types.d.ts +13 -0
- package/bleed/types.js +5 -0
- package/button/Button.d.ts +1 -1
- package/button/Button.js +7 -15
- package/button/Button.stories.tsx +6 -8
- package/button/types.d.ts +3 -7
- package/card/Card.stories.tsx +1 -1
- package/checkbox/types.d.ts +1 -1
- package/chip/Chip.d.ts +1 -1
- package/chip/Chip.js +14 -52
- package/chip/Chip.stories.tsx +6 -8
- package/chip/types.d.ts +5 -13
- package/common/variables.js +38 -234
- package/date-input/DateInput.js +6 -6
- package/dialog/Dialog.js +2 -1
- package/dropdown/Dropdown.d.ts +1 -1
- package/dropdown/Dropdown.js +12 -34
- package/dropdown/Dropdown.stories.tsx +25 -23
- package/dropdown/types.d.ts +5 -14
- package/file-input/FileInput.js +102 -33
- package/file-input/FileInput.stories.tsx +507 -0
- package/footer/Footer.js +18 -20
- package/heading/Heading.stories.tsx +3 -2
- package/inset/Inset.d.ts +3 -0
- package/inset/Inset.js +84 -0
- package/inset/Inset.stories.tsx +229 -0
- package/inset/types.d.ts +13 -0
- package/inset/types.js +5 -0
- package/layout/ApplicationLayout.js +9 -3
- package/link/Link.js +7 -15
- package/link/Link.stories.tsx +6 -1
- package/link/types.d.ts +5 -9
- package/list/List.d.ts +3 -7
- package/list/List.js +4 -4
- package/list/List.stories.tsx +10 -0
- package/list/types.d.ts +7 -0
- package/list/types.js +5 -0
- package/main.d.ts +4 -6
- package/main.js +20 -36
- package/package.json +4 -2
- package/password-input/PasswordInput.stories.tsx +3 -3
- package/progress-bar/ProgressBar.js +2 -2
- package/radio-group/Radio.d.ts +4 -0
- package/radio-group/Radio.js +140 -0
- package/radio-group/RadioGroup.d.ts +4 -0
- package/radio-group/RadioGroup.js +273 -0
- package/radio-group/RadioGroup.stories.tsx +79 -0
- package/radio-group/RadioGroup.test.js +248 -0
- package/radio-group/types.d.ts +36 -0
- package/radio-group/types.js +5 -0
- package/resultsetTable/ResultsetTable.js +5 -2
- package/resultsetTable/ResultsetTable.stories.tsx +7 -8
- package/row/Row.d.ts +3 -11
- package/row/Row.js +12 -9
- package/row/Row.stories.tsx +20 -6
- package/row/types.d.ts +10 -0
- package/row/types.js +5 -0
- package/select/Select.d.ts +4 -0
- package/select/Select.js +12 -6
- package/select/types.d.ts +170 -0
- package/select/types.js +5 -0
- package/sidenav/Sidenav.stories.tsx +18 -1
- package/spinner/Spinner.stories.jsx +1 -0
- package/stack/Stack.d.ts +3 -10
- package/stack/Stack.js +12 -9
- package/stack/Stack.stories.tsx +20 -6
- package/stack/types.d.ts +9 -0
- package/stack/types.js +5 -0
- package/switch/Switch.stories.tsx +1 -1
- package/table/Table.stories.jsx +2 -1
- package/tabs/Tabs.js +7 -7
- package/tabs/Tabs.stories.tsx +7 -8
- package/tabs/types.d.ts +23 -15
- package/tag/Tag.d.ts +1 -1
- package/tag/Tag.js +6 -11
- package/tag/Tag.stories.tsx +15 -22
- package/tag/types.d.ts +23 -14
- package/text/Text.js +1 -1
- package/text-input/TextInput.js +17 -7
- package/text-input/TextInput.stories.tsx +4 -4
- package/text-input/types.d.ts +1 -1
- package/textarea/Textarea.js +5 -3
- package/textarea/Textarea.stories.jsx +4 -3
- 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/date/Date.js +0 -373
- package/date/index.d.ts +0 -27
- package/input-text/Icons.js +0 -22
- package/input-text/InputText.js +0 -611
- package/input-text/index.d.ts +0 -36
- package/select/index.d.ts +0 -131
- package/toggle/Toggle.js +0 -186
- package/toggle/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/inset/Inset.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
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"] = Inset;
|
|
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 _templateObject;
|
|
17
|
+
|
|
18
|
+
function Inset(_ref) {
|
|
19
|
+
var space = _ref.space,
|
|
20
|
+
horizontal = _ref.horizontal,
|
|
21
|
+
vertical = _ref.vertical,
|
|
22
|
+
top = _ref.top,
|
|
23
|
+
right = _ref.right,
|
|
24
|
+
bottom = _ref.bottom,
|
|
25
|
+
left = _ref.left,
|
|
26
|
+
children = _ref.children;
|
|
27
|
+
return /*#__PURE__*/_react["default"].createElement(StyledInset, {
|
|
28
|
+
space: space,
|
|
29
|
+
horizontal: horizontal,
|
|
30
|
+
vertical: vertical,
|
|
31
|
+
top: top,
|
|
32
|
+
right: right,
|
|
33
|
+
bottom: bottom,
|
|
34
|
+
left: left
|
|
35
|
+
}, children);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function getSpacingValue(spacingName) {
|
|
39
|
+
switch (spacingName) {
|
|
40
|
+
case "none":
|
|
41
|
+
return "0rem";
|
|
42
|
+
|
|
43
|
+
case "xxxsmall":
|
|
44
|
+
return "0.125rem";
|
|
45
|
+
|
|
46
|
+
case "xxsmall":
|
|
47
|
+
return "0.25rem";
|
|
48
|
+
|
|
49
|
+
case "xsmall":
|
|
50
|
+
return "0.5rem";
|
|
51
|
+
|
|
52
|
+
case "small":
|
|
53
|
+
return "1rem";
|
|
54
|
+
|
|
55
|
+
case "medium":
|
|
56
|
+
return "1.5rem";
|
|
57
|
+
|
|
58
|
+
case "large":
|
|
59
|
+
return "2rem";
|
|
60
|
+
|
|
61
|
+
case "xlarge":
|
|
62
|
+
return "3rem";
|
|
63
|
+
|
|
64
|
+
case "xxlarge":
|
|
65
|
+
return "4rem";
|
|
66
|
+
|
|
67
|
+
case "xxxlarge":
|
|
68
|
+
return "5rem";
|
|
69
|
+
|
|
70
|
+
default:
|
|
71
|
+
return "0rem";
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
var StyledInset = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n ", "\n"])), function (_ref2) {
|
|
76
|
+
var space = _ref2.space,
|
|
77
|
+
horizontal = _ref2.horizontal,
|
|
78
|
+
vertical = _ref2.vertical,
|
|
79
|
+
top = _ref2.top,
|
|
80
|
+
right = _ref2.right,
|
|
81
|
+
bottom = _ref2.bottom,
|
|
82
|
+
left = _ref2.left;
|
|
83
|
+
return "\n padding: ".concat(getSpacingValue(top || vertical || space), " ").concat(getSpacingValue(right || horizontal || space), "\n ").concat(getSpacingValue(bottom || vertical || space), " ").concat(getSpacingValue(left || horizontal || space), ";\n");
|
|
84
|
+
});
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Title from "../../.storybook/components/Title";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
import DxcStack from "./../stack/Stack";
|
|
5
|
+
import DxcInset from "./Inset";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: "Inset",
|
|
9
|
+
component: DxcInset,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const Chromatic = () => (
|
|
13
|
+
<>
|
|
14
|
+
<Title title="Default" level={4} />
|
|
15
|
+
<Container>
|
|
16
|
+
<DxcInset>
|
|
17
|
+
<Placeholder></Placeholder>
|
|
18
|
+
</DxcInset>
|
|
19
|
+
</Container>
|
|
20
|
+
<Title title="space = none" level={4} />
|
|
21
|
+
<Container>
|
|
22
|
+
<DxcInset space="none">
|
|
23
|
+
<Placeholder></Placeholder>
|
|
24
|
+
</DxcInset>
|
|
25
|
+
</Container>
|
|
26
|
+
<Title title="space = xxxsmall" level={4} />
|
|
27
|
+
<Container>
|
|
28
|
+
<DxcInset space="xxxsmall">
|
|
29
|
+
<Placeholder></Placeholder>
|
|
30
|
+
</DxcInset>
|
|
31
|
+
</Container>
|
|
32
|
+
<Title title="space = xxsmall" level={4} />
|
|
33
|
+
<Container>
|
|
34
|
+
<DxcInset space="xxsmall">
|
|
35
|
+
<Placeholder></Placeholder>
|
|
36
|
+
</DxcInset>
|
|
37
|
+
</Container>
|
|
38
|
+
<Title title="space = xsmall" level={4} />
|
|
39
|
+
<Container>
|
|
40
|
+
<DxcInset space="xsmall">
|
|
41
|
+
<Placeholder></Placeholder>
|
|
42
|
+
</DxcInset>
|
|
43
|
+
</Container>
|
|
44
|
+
<Title title="space = small" level={4} />
|
|
45
|
+
<Container>
|
|
46
|
+
<DxcInset space="small">
|
|
47
|
+
<Placeholder></Placeholder>
|
|
48
|
+
</DxcInset>
|
|
49
|
+
</Container>
|
|
50
|
+
<Title title="space = medium" level={4} />
|
|
51
|
+
<Container>
|
|
52
|
+
<DxcInset space="medium">
|
|
53
|
+
<Placeholder></Placeholder>
|
|
54
|
+
</DxcInset>
|
|
55
|
+
</Container>
|
|
56
|
+
<Title title="space = large" level={4} />
|
|
57
|
+
<Container>
|
|
58
|
+
<DxcInset space="large">
|
|
59
|
+
<Placeholder></Placeholder>
|
|
60
|
+
</DxcInset>
|
|
61
|
+
</Container>
|
|
62
|
+
<Title title="space = xlarge" level={4} />
|
|
63
|
+
<Container>
|
|
64
|
+
<DxcInset space="xlarge">
|
|
65
|
+
<Placeholder></Placeholder>
|
|
66
|
+
</DxcInset>
|
|
67
|
+
</Container>
|
|
68
|
+
<Title title="space = xxlarge" level={4} />
|
|
69
|
+
<Container>
|
|
70
|
+
<DxcInset space="xxlarge">
|
|
71
|
+
<Placeholder></Placeholder>
|
|
72
|
+
</DxcInset>
|
|
73
|
+
</Container>
|
|
74
|
+
<Title title="space = xxxlarge" level={4} />
|
|
75
|
+
<Container>
|
|
76
|
+
<DxcInset space="xxxlarge">
|
|
77
|
+
<Placeholder></Placeholder>
|
|
78
|
+
</DxcInset>
|
|
79
|
+
</Container>
|
|
80
|
+
<Title title="horizontal = none" level={4} />
|
|
81
|
+
<Container>
|
|
82
|
+
<DxcInset horizontal="none">
|
|
83
|
+
<Placeholder></Placeholder>
|
|
84
|
+
</DxcInset>
|
|
85
|
+
</Container>
|
|
86
|
+
<Title title="horizontal = xxxsmall" level={4} />
|
|
87
|
+
<Container>
|
|
88
|
+
<DxcInset horizontal="xxxsmall">
|
|
89
|
+
<Placeholder></Placeholder>
|
|
90
|
+
</DxcInset>
|
|
91
|
+
</Container>
|
|
92
|
+
<Title title="horizontal = xxsmall" level={4} />
|
|
93
|
+
<Container>
|
|
94
|
+
<DxcInset horizontal="xxsmall">
|
|
95
|
+
<Placeholder></Placeholder>
|
|
96
|
+
</DxcInset>
|
|
97
|
+
</Container>
|
|
98
|
+
<Title title="horizontal = xsmall" level={4} />
|
|
99
|
+
<Container>
|
|
100
|
+
<DxcInset horizontal="xsmall">
|
|
101
|
+
<Placeholder></Placeholder>
|
|
102
|
+
</DxcInset>
|
|
103
|
+
</Container>
|
|
104
|
+
<Title title="horizontal = small" level={4} />
|
|
105
|
+
<Container>
|
|
106
|
+
<DxcInset horizontal="small">
|
|
107
|
+
<Placeholder></Placeholder>
|
|
108
|
+
</DxcInset>
|
|
109
|
+
</Container>
|
|
110
|
+
<Title title="horizontal = medium" level={4} />
|
|
111
|
+
<Container>
|
|
112
|
+
<DxcInset horizontal="medium">
|
|
113
|
+
<Placeholder></Placeholder>
|
|
114
|
+
</DxcInset>
|
|
115
|
+
</Container>
|
|
116
|
+
<Title title="horizontal = large" level={4} />
|
|
117
|
+
<Container>
|
|
118
|
+
<DxcInset horizontal="large">
|
|
119
|
+
<Placeholder></Placeholder>
|
|
120
|
+
</DxcInset>
|
|
121
|
+
</Container>
|
|
122
|
+
<Title title="horizontal = xlarge" level={4} />
|
|
123
|
+
<Container>
|
|
124
|
+
<DxcInset horizontal="xlarge">
|
|
125
|
+
<Placeholder></Placeholder>
|
|
126
|
+
</DxcInset>
|
|
127
|
+
</Container>
|
|
128
|
+
<Title title="horizontal = xxlarge" level={4} />
|
|
129
|
+
<Container>
|
|
130
|
+
<DxcInset horizontal="xxlarge">
|
|
131
|
+
<Placeholder></Placeholder>
|
|
132
|
+
</DxcInset>
|
|
133
|
+
</Container>
|
|
134
|
+
<Title title="horizontal = xxxlarge" level={4} />
|
|
135
|
+
<Container>
|
|
136
|
+
<DxcInset horizontal="xxxlarge">
|
|
137
|
+
<Placeholder></Placeholder>
|
|
138
|
+
</DxcInset>
|
|
139
|
+
</Container>
|
|
140
|
+
<Title title="vertical = none" level={4} />
|
|
141
|
+
<Container>
|
|
142
|
+
<DxcInset vertical="none">
|
|
143
|
+
<Placeholder></Placeholder>
|
|
144
|
+
</DxcInset>
|
|
145
|
+
</Container>
|
|
146
|
+
<Title title="vertical = xxxsmall" level={4} />
|
|
147
|
+
<Container>
|
|
148
|
+
<DxcInset vertical="xxxsmall">
|
|
149
|
+
<Placeholder></Placeholder>
|
|
150
|
+
</DxcInset>
|
|
151
|
+
</Container>
|
|
152
|
+
<Title title="vertical = xxsmall" level={4} />
|
|
153
|
+
<Container>
|
|
154
|
+
<DxcInset vertical="xxsmall">
|
|
155
|
+
<Placeholder></Placeholder>
|
|
156
|
+
</DxcInset>
|
|
157
|
+
</Container>
|
|
158
|
+
<Title title="vertical = xsmall" level={4} />
|
|
159
|
+
<Container>
|
|
160
|
+
<DxcInset vertical="xsmall">
|
|
161
|
+
<Placeholder></Placeholder>
|
|
162
|
+
</DxcInset>
|
|
163
|
+
</Container>
|
|
164
|
+
<Title title="vertical = small" level={4} />
|
|
165
|
+
<Container>
|
|
166
|
+
<DxcInset vertical="small">
|
|
167
|
+
<Placeholder></Placeholder>
|
|
168
|
+
</DxcInset>
|
|
169
|
+
</Container>
|
|
170
|
+
<Title title="vertical = medium" level={4} />
|
|
171
|
+
<Container>
|
|
172
|
+
<DxcInset vertical="medium">
|
|
173
|
+
<Placeholder></Placeholder>
|
|
174
|
+
</DxcInset>
|
|
175
|
+
</Container>
|
|
176
|
+
<Title title="vertical = large" level={4} />
|
|
177
|
+
<Container>
|
|
178
|
+
<DxcInset vertical="large">
|
|
179
|
+
<Placeholder></Placeholder>
|
|
180
|
+
</DxcInset>
|
|
181
|
+
</Container>
|
|
182
|
+
<Title title="vertical = xlarge" level={4} />
|
|
183
|
+
<Container>
|
|
184
|
+
<DxcInset vertical="xlarge">
|
|
185
|
+
<Placeholder></Placeholder>
|
|
186
|
+
</DxcInset>
|
|
187
|
+
</Container>
|
|
188
|
+
<Title title="vertical = xxlarge" level={4} />
|
|
189
|
+
<Container>
|
|
190
|
+
<DxcInset vertical="xxlarge">
|
|
191
|
+
<Placeholder></Placeholder>
|
|
192
|
+
</DxcInset>
|
|
193
|
+
</Container>
|
|
194
|
+
<Title title="vertical = xxxlarge" level={4} />
|
|
195
|
+
<Container>
|
|
196
|
+
<DxcInset vertical="xxxlarge">
|
|
197
|
+
<Placeholder></Placeholder>
|
|
198
|
+
</DxcInset>
|
|
199
|
+
</Container>
|
|
200
|
+
<Title title="top = xxsmall, right= medium, bottom = large and left = xxlarge" level={4} />
|
|
201
|
+
<Container>
|
|
202
|
+
<DxcInset top="xxsmall" right="medium" bottom="large" left="xxlarge">
|
|
203
|
+
<Placeholder></Placeholder>
|
|
204
|
+
</DxcInset>
|
|
205
|
+
</Container>
|
|
206
|
+
<Title title="Inside a stack" level={4} />
|
|
207
|
+
<Container>
|
|
208
|
+
<DxcStack gutter="medium" divider>
|
|
209
|
+
<Placeholder></Placeholder>
|
|
210
|
+
<DxcInset top="xxsmall" right="medium" bottom="large" left="xxlarge">
|
|
211
|
+
<Placeholder></Placeholder>
|
|
212
|
+
</DxcInset>
|
|
213
|
+
<Placeholder></Placeholder>
|
|
214
|
+
</DxcStack>
|
|
215
|
+
</Container>
|
|
216
|
+
</>
|
|
217
|
+
);
|
|
218
|
+
|
|
219
|
+
const Container = styled.div`
|
|
220
|
+
background: #f2eafa;
|
|
221
|
+
margin: 2.5rem;
|
|
222
|
+
`;
|
|
223
|
+
|
|
224
|
+
const Placeholder = styled.div`
|
|
225
|
+
min-height: 40px;
|
|
226
|
+
min-width: 120px;
|
|
227
|
+
border: 1px solid #a46ede;
|
|
228
|
+
background-color: #e5d5f6;
|
|
229
|
+
`;
|
package/inset/types.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type Spacing = "none" | "xxxsmall" | "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge" | "xxxlarge";
|
|
3
|
+
declare type Props = {
|
|
4
|
+
space?: Spacing;
|
|
5
|
+
horizontal?: Spacing;
|
|
6
|
+
vertical?: Spacing;
|
|
7
|
+
top?: Spacing;
|
|
8
|
+
right?: Spacing;
|
|
9
|
+
bottom?: Spacing;
|
|
10
|
+
left?: Spacing;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
};
|
|
13
|
+
export default Props;
|
package/inset/types.js
ADDED
|
@@ -114,6 +114,11 @@ var DxcApplicationLayout = function DxcApplicationLayout(_ref4) {
|
|
|
114
114
|
isResponsive = _useState4[0],
|
|
115
115
|
setIsResponsive = _useState4[1];
|
|
116
116
|
|
|
117
|
+
var _useState5 = (0, _react.useState)(null),
|
|
118
|
+
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
|
|
119
|
+
previousWidth = _useState6[0],
|
|
120
|
+
setPreviousWidth = _useState6[1];
|
|
121
|
+
|
|
117
122
|
var childrenArray = _react["default"].Children.toArray(children);
|
|
118
123
|
|
|
119
124
|
var header = childTypeExists(childrenArray, _main.DxcHeader) || childTypeExists(childrenArray, Header) || defaultHeader();
|
|
@@ -138,13 +143,14 @@ var DxcApplicationLayout = function DxcApplicationLayout(_ref4) {
|
|
|
138
143
|
|
|
139
144
|
var handleResize = function handleResize(width) {
|
|
140
145
|
if (width) {
|
|
146
|
+
setPreviousWidth(width);
|
|
141
147
|
setIsResponsive(width <= _variables.responsiveSizes.tablet);
|
|
142
148
|
setIsSideNavVisible(true);
|
|
143
149
|
}
|
|
144
150
|
};
|
|
145
151
|
|
|
146
152
|
var handleEventListener = function handleEventListener() {
|
|
147
|
-
handleResize(ref.current.offsetWidth);
|
|
153
|
+
if (previousWidth !== ref.current.offsetWidth) handleResize(ref.current.offsetWidth);
|
|
148
154
|
};
|
|
149
155
|
|
|
150
156
|
(0, _react.useEffect)(function () {
|
|
@@ -156,7 +162,7 @@ var DxcApplicationLayout = function DxcApplicationLayout(_ref4) {
|
|
|
156
162
|
return function () {
|
|
157
163
|
window.removeEventListener("resize", handleEventListener);
|
|
158
164
|
};
|
|
159
|
-
}, []);
|
|
165
|
+
}, [ref.current]);
|
|
160
166
|
|
|
161
167
|
var handleSidenav = function handleSidenav() {
|
|
162
168
|
setIsSideNavVisible(!isSideNavVisible);
|
|
@@ -213,7 +219,7 @@ var SideNavArrowContainer = _styledComponents["default"].div(_templateObject8 ||
|
|
|
213
219
|
|
|
214
220
|
var ArrowContainer = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n height: calc(100vh - 64px);\n left: 279px;\n"])));
|
|
215
221
|
|
|
216
|
-
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) {
|
|
222
|
+
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 :focus {\n outline: #0095ff auto 1px;\n }\n"])), function (props) {
|
|
217
223
|
return "".concat(props.theme.arrowContainerColor);
|
|
218
224
|
}, function (props) {
|
|
219
225
|
return props.isSideNavVisible ? "rotate(-180deg)" : "rotate(0deg)";
|
package/link/Link.js
CHANGED
|
@@ -9,10 +9,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports["default"] = void 0;
|
|
11
11
|
|
|
12
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
|
-
|
|
14
12
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
15
13
|
|
|
14
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
|
+
|
|
16
16
|
var _react = _interopRequireDefault(require("react"));
|
|
17
17
|
|
|
18
18
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
@@ -32,7 +32,6 @@ var DxcLink = function DxcLink(_ref) {
|
|
|
32
32
|
inheritColor = _ref$inheritColor === void 0 ? false : _ref$inheritColor,
|
|
33
33
|
_ref$disabled = _ref.disabled,
|
|
34
34
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
35
|
-
iconSrc = _ref.iconSrc,
|
|
36
35
|
icon = _ref.icon,
|
|
37
36
|
_ref$iconPosition = _ref.iconPosition,
|
|
38
37
|
iconPosition = _ref$iconPosition === void 0 ? "before" : _ref$iconPosition,
|
|
@@ -50,12 +49,11 @@ var DxcLink = function DxcLink(_ref) {
|
|
|
50
49
|
|
|
51
50
|
var linkContent = /*#__PURE__*/_react["default"].createElement(LinkText, {
|
|
52
51
|
iconPosition: iconPosition
|
|
53
|
-
}, text, icon
|
|
54
|
-
iconPosition: iconPosition
|
|
55
|
-
}, (0, _typeof2["default"])(icon) === "object" ? icon : /*#__PURE__*/_react["default"].createElement(icon)) : iconSrc && /*#__PURE__*/_react["default"].createElement(LinkIcon, {
|
|
56
|
-
src: iconSrc,
|
|
52
|
+
}, text, icon && /*#__PURE__*/_react["default"].createElement(LinkIconContainer, {
|
|
57
53
|
iconPosition: iconPosition
|
|
58
|
-
}
|
|
54
|
+
}, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement(LinkIcon, {
|
|
55
|
+
src: icon
|
|
56
|
+
}) : icon));
|
|
59
57
|
|
|
60
58
|
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
61
59
|
theme: colorsTheme.link
|
|
@@ -141,13 +139,7 @@ var LinkText = _styledComponents["default"].div(_templateObject4 || (_templateOb
|
|
|
141
139
|
return props.iconPosition === "after" ? "flex-start" : "flex-end";
|
|
142
140
|
});
|
|
143
141
|
|
|
144
|
-
var LinkIcon = _styledComponents["default"].img(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["
|
|
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
|
-
});
|
|
142
|
+
var LinkIcon = _styledComponents["default"].img(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])([""])));
|
|
151
143
|
|
|
152
144
|
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
145
|
return props.theme.iconSize;
|
package/link/Link.stories.tsx
CHANGED
|
@@ -28,7 +28,12 @@ export const Chromatic = () => (
|
|
|
28
28
|
<Title title="Icon before" theme="light" level={4} />
|
|
29
29
|
<DxcLink text="Test" href="https://www.google.com" icon={icon} iconPosition="before"></DxcLink>
|
|
30
30
|
<Title title="Icon after" theme="light" level={4} />
|
|
31
|
-
<DxcLink
|
|
31
|
+
<DxcLink
|
|
32
|
+
text="Test"
|
|
33
|
+
href="https://www.youtube.com/"
|
|
34
|
+
icon="https://iconape.com/wp-content/files/yd/367773/svg/logo-linkedin-logo-icon-png-svg.png"
|
|
35
|
+
iconPosition="after"
|
|
36
|
+
></DxcLink>
|
|
32
37
|
</ExampleContainer>
|
|
33
38
|
<ExampleContainer pseudoState="pseudo-hover">
|
|
34
39
|
<Title title="With link hovered" theme="light" level={4} />
|
package/link/types.d.ts
CHANGED
|
@@ -15,10 +15,6 @@ declare type LinkCommonProps = {
|
|
|
15
15
|
* If true, the link is disabled.
|
|
16
16
|
*/
|
|
17
17
|
disabled?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* @Deprecated Source of the icon.
|
|
20
|
-
*/
|
|
21
|
-
iconSrc?: string;
|
|
22
18
|
/**
|
|
23
19
|
* Indicates the position of the icon in the component.
|
|
24
20
|
*/
|
|
@@ -52,9 +48,9 @@ export declare type LinkTextProps = LinkCommonProps & {
|
|
|
52
48
|
*/
|
|
53
49
|
text: string;
|
|
54
50
|
/**
|
|
55
|
-
* Element used as the icon that will be placed next to the link text.
|
|
51
|
+
* Element or path used as the icon that will be placed next to the link text.
|
|
56
52
|
*/
|
|
57
|
-
icon?: SVG;
|
|
53
|
+
icon?: string | SVG;
|
|
58
54
|
};
|
|
59
55
|
export declare type LinkIconProps = LinkCommonProps & {
|
|
60
56
|
/**
|
|
@@ -62,13 +58,13 @@ export declare type LinkIconProps = LinkCommonProps & {
|
|
|
62
58
|
*/
|
|
63
59
|
text?: string;
|
|
64
60
|
/**
|
|
65
|
-
* Element used as the icon that will be placed next to the link text.
|
|
61
|
+
* Element or path used as the icon that will be placed next to the link text.
|
|
66
62
|
*/
|
|
67
|
-
icon: SVG;
|
|
63
|
+
icon: string | SVG;
|
|
68
64
|
};
|
|
69
65
|
declare type Overload = {
|
|
70
66
|
(props: LinkTextProps): JSX.Element;
|
|
71
67
|
(props: LinkIconProps): JSX.Element;
|
|
72
68
|
};
|
|
73
|
-
declare type SVG = React.SVGProps<SVGSVGElement
|
|
69
|
+
declare type SVG = React.SVGProps<SVGSVGElement>;
|
|
74
70
|
export default Overload;
|
package/list/List.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
gutter?: "none" | "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge" | "xxxlarge";
|
|
5
|
-
type?: "disc" | "circle" | "square" | "number";
|
|
6
|
-
};
|
|
7
|
-
declare function List({ children, type, gutter }: ListProps): JSX.Element;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import ListPropsType from "./types";
|
|
3
|
+
declare function List({ children, type, gutter }: ListPropsType): JSX.Element;
|
|
8
4
|
export default List;
|
package/list/List.js
CHANGED
|
@@ -24,7 +24,7 @@ function List(_ref) {
|
|
|
24
24
|
_ref$type = _ref.type,
|
|
25
25
|
type = _ref$type === void 0 ? "disc" : _ref$type,
|
|
26
26
|
_ref$gutter = _ref.gutter,
|
|
27
|
-
gutter = _ref$gutter === void 0 ? "
|
|
27
|
+
gutter = _ref$gutter === void 0 ? "xxsmall" : _ref$gutter;
|
|
28
28
|
return /*#__PURE__*/_react["default"].createElement(_Stack["default"], {
|
|
29
29
|
as: type === "number" ? "ol" : "ul",
|
|
30
30
|
gutter: gutter
|
|
@@ -35,11 +35,11 @@ function List(_ref) {
|
|
|
35
35
|
|
|
36
36
|
var Number = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n user-select: none;\n margin-right: 10px;\n flex-shrink: 0;\n"])));
|
|
37
37
|
|
|
38
|
-
var Square = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n background-color: black;\n width: 5px;\n height: 5px;\n flex-shrink: 0;\n margin-top:
|
|
38
|
+
var Square = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n background-color: black;\n width: 5px;\n height: 5px;\n flex-shrink: 0;\n margin-top: 10px;\n margin-right: 10px;\n"])));
|
|
39
39
|
|
|
40
|
-
var Circle = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n width: 5px;\n height: 5px;\n border-radius: 50%;\n border: 1px solid black;\n flex-shrink: 0;\n margin-top:
|
|
40
|
+
var Circle = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n width: 5px;\n height: 5px;\n border-radius: 50%;\n border: 1px solid black;\n flex-shrink: 0;\n margin-top: 10px;\n margin-right: 10px;\n box-sizing: border-box;\n"])));
|
|
41
41
|
|
|
42
|
-
var Disc = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n background-color: black;\n width: 5px;\n height: 5px;\n border-radius: 50%;\n flex-shrink: 0;\n margin-top:
|
|
42
|
+
var Disc = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n background-color: black;\n width: 5px;\n height: 5px;\n border-radius: 50%;\n flex-shrink: 0;\n margin-top: 10px;\n margin-right: 10px;\n"])));
|
|
43
43
|
|
|
44
44
|
var ListItem = _styledComponents["default"].li(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n margin: 0px;\n padding: 0px;\n list-style: none;\n display: flex;\n"])));
|
|
45
45
|
|
package/list/List.stories.tsx
CHANGED
|
@@ -41,6 +41,11 @@ export const Chromatic = () => (
|
|
|
41
41
|
<DxcText>Text 2.</DxcText>
|
|
42
42
|
</DxcList>
|
|
43
43
|
</Container>
|
|
44
|
+
<Title title="gutter = xxxsmall" theme="light" level={4} />
|
|
45
|
+
<DxcList gutter="xxsmall">
|
|
46
|
+
<DxcText>Text 1.</DxcText>
|
|
47
|
+
<DxcText>Text 2.</DxcText>
|
|
48
|
+
</DxcList>
|
|
44
49
|
<Title title="gutter = xxsmall" theme="light" level={4} />
|
|
45
50
|
<DxcList gutter="xxsmall">
|
|
46
51
|
<DxcText>Text 1.</DxcText>
|
|
@@ -76,6 +81,11 @@ export const Chromatic = () => (
|
|
|
76
81
|
<DxcText>Text 1.</DxcText>
|
|
77
82
|
<DxcText>Text 2.</DxcText>
|
|
78
83
|
</DxcList>
|
|
84
|
+
<Title title="gutter = xxxlarge" theme="light" level={4} />
|
|
85
|
+
<DxcList gutter="xxxlarge">
|
|
86
|
+
<DxcText>Text 1.</DxcText>
|
|
87
|
+
<DxcText>Text 2.</DxcText>
|
|
88
|
+
</DxcList>
|
|
79
89
|
|
|
80
90
|
</>
|
|
81
91
|
);
|
package/list/types.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type Props = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
gutter?: "none" | "xxxsmall" | "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge" | "xxxlarge";
|
|
5
|
+
type?: "disc" | "circle" | "square" | "number";
|
|
6
|
+
};
|
|
7
|
+
export default Props;
|
package/list/types.js
ADDED
package/main.d.ts
CHANGED
|
@@ -3,20 +3,16 @@ import DxcAccordion from "./accordion/Accordion";
|
|
|
3
3
|
import DxcButton from "./button/Button";
|
|
4
4
|
import DxcCard from "./card/Card";
|
|
5
5
|
import DxcCheckbox from "./checkbox/Checkbox";
|
|
6
|
-
import DxcDate from "./date/Date";
|
|
7
6
|
import DxcDialog from "./dialog/Dialog";
|
|
8
7
|
import DxcDropdown from "./dropdown/Dropdown";
|
|
9
8
|
import DxcFooter from "./footer/Footer";
|
|
10
9
|
import DxcHeader from "./header/Header";
|
|
11
|
-
import DxcInput from "./input-text/InputText";
|
|
12
10
|
import DxcRadio from "./radio/Radio";
|
|
13
|
-
import V3DxcSelect from "./V3Select/V3Select";
|
|
14
11
|
import DxcSlider from "./slider/Slider";
|
|
15
12
|
import DxcSwitch from "./switch/Switch";
|
|
16
13
|
import DxcTabs from "./tabs/Tabs";
|
|
17
14
|
import DxcProgressBar from "./progress-bar/ProgressBar";
|
|
18
15
|
import DxcSpinner from "./spinner/Spinner";
|
|
19
|
-
import DxcUpload from "./upload/Upload";
|
|
20
16
|
import DxcTable from "./table/Table";
|
|
21
17
|
import DxcBox from "./box/Box";
|
|
22
18
|
import DxcTag from "./tag/Tag";
|
|
@@ -25,7 +21,6 @@ import DxcSidenav from "./sidenav/Sidenav";
|
|
|
25
21
|
import DxcWizard from "./wizard/Wizard";
|
|
26
22
|
import DxcLink from "./link/Link";
|
|
27
23
|
import DxcHeading from "./heading/Heading";
|
|
28
|
-
import V3DxcTextarea from "./V3Textarea/V3Textarea";
|
|
29
24
|
import DxcResultsetTable from "./resultsetTable/ResultsetTable";
|
|
30
25
|
import DxcChip from "./chip/Chip";
|
|
31
26
|
import DxcApplicationLayout from "./layout/ApplicationLayout";
|
|
@@ -43,6 +38,9 @@ import DxcStack from "./stack/Stack";
|
|
|
43
38
|
import DxcRow from "./row/Row";
|
|
44
39
|
import DxcText from "./text/Text";
|
|
45
40
|
import DxcList from "./list/List";
|
|
41
|
+
import DxcRadioGroup from "./radio-group/RadioGroup";
|
|
42
|
+
import DxcBleed from "./bleed/Bleed";
|
|
43
|
+
import DxcInset from "./inset/Inset";
|
|
46
44
|
import ThemeContext, { ThemeProvider } from "./ThemeContext";
|
|
47
45
|
import { BackgroundColorProvider } from "./BackgroundColorContext";
|
|
48
|
-
export { DxcAlert, DxcButton, DxcFooter, DxcCheckbox,
|
|
46
|
+
export { DxcAlert, DxcButton, DxcFooter, DxcCheckbox, DxcTextInput, DxcDropdown, DxcSwitch, DxcSlider, DxcRadio, DxcHeader, DxcTable, DxcTabs, DxcToggleGroup, DxcDialog, DxcCard, DxcProgressBar, DxcAccordion, DxcSpinner, DxcBox, DxcTag, DxcPaginator, DxcSidenav, DxcWizard, DxcLink, DxcHeading, DxcResultsetTable, DxcChip, DxcApplicationLayout, ThemeContext, ThemeProvider, BackgroundColorProvider, DxcAccordionGroup, DxcBadge, DxcPasswordInput, DxcDateInput, DxcNumberInput, DxcTextarea, DxcSelect, DxcFileInput, DxcStack, DxcRow, DxcText, DxcList, DxcRadioGroup, DxcBleed, DxcInset };
|