@dxc-technology/halstack-react 0.0.0-e2d44ba → 0.0.0-e628009
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ThemeContext.js +69 -61
- package/dist/V3Textarea/V3Textarea.js +264 -0
- package/dist/alert/Alert.js +4 -4
- package/dist/alert/index.d.ts +51 -0
- package/dist/button/Button.js +3 -3
- package/dist/common/variables.js +302 -98
- package/dist/date/Date.js +10 -12
- package/dist/{new-date/NewDate.js → date-input/DateInput.js} +69 -72
- package/dist/date-input/index.d.ts +95 -0
- package/dist/file-input/FileInput.js +644 -0
- package/dist/file-input/FileItem.js +280 -0
- package/dist/file-input/index.d.ts +81 -0
- package/dist/footer/Footer.js +44 -18
- package/dist/footer/Icons.js +77 -0
- package/dist/header/Header.js +82 -51
- package/dist/header/Icons.js +59 -0
- package/dist/heading/Heading.js +12 -0
- package/dist/input-text/Icons.js +22 -0
- package/dist/input-text/InputText.js +7 -9
- package/dist/layout/ApplicationLayout.js +5 -9
- package/dist/layout/Icons.js +55 -0
- package/dist/link/Link.js +4 -8
- package/dist/main.d.ts +8 -0
- package/dist/main.js +37 -21
- package/dist/new-select/NewSelect.js +836 -0
- package/dist/new-select/index.d.ts +53 -0
- package/dist/{number/Number.js → number-input/NumberInput.js} +9 -11
- package/dist/{number/NumberContext.js → number-input/NumberInputContext.js} +2 -2
- package/dist/number-input/index.d.ts +113 -0
- package/dist/paginator/Icons.js +66 -0
- package/dist/paginator/Paginator.js +5 -11
- package/dist/{password/Password.js → password-input/PasswordInput.js} +11 -13
- package/dist/password-input/index.d.ts +94 -0
- package/dist/sidenav/Sidenav.js +6 -4
- package/dist/slider/Slider.js +104 -19
- package/dist/tag/Tag.js +26 -32
- package/dist/{new-input-text/NewInputText.js → text-input/TextInput.js} +180 -170
- package/dist/text-input/index.d.ts +135 -0
- package/dist/textarea/Textarea.js +227 -122
- package/dist/textarea/index.d.ts +117 -0
- package/dist/toggle-group/ToggleGroup.js +132 -28
- package/dist/upload/Upload.js +3 -3
- package/dist/upload/buttons-upload/ButtonsUpload.js +7 -11
- package/dist/upload/buttons-upload/Icons.js +40 -0
- package/dist/upload/dragAndDropArea/DragAndDropArea.js +14 -14
- package/dist/upload/dragAndDropArea/Icons.js +39 -0
- package/dist/upload/file-upload/FileToUpload.js +26 -21
- package/dist/upload/file-upload/Icons.js +66 -0
- package/dist/upload/transaction/Icons.js +160 -0
- package/dist/upload/transaction/Transaction.js +11 -38
- package/dist/wizard/Icons.js +65 -0
- package/dist/wizard/Wizard.js +3 -9
- package/package.json +2 -1
- package/test/Date.test.js +48 -44
- package/test/{NewDate.test.js → DateInput.test.js} +66 -27
- package/test/FileInput.test.js +201 -0
- package/test/Footer.test.js +2 -7
- package/test/Header.test.js +5 -10
- package/test/Heading.test.js +60 -12
- package/test/InputText.test.js +24 -16
- package/test/{Number.test.js → NumberInput.test.js} +84 -66
- package/test/PasswordInput.test.js +83 -0
- package/test/Slider.test.js +9 -17
- package/test/{NewInputText.test.js → TextInput.test.js} +146 -231
- package/test/Textarea.test.js +193 -0
- package/test/ToggleGroup.test.js +5 -1
- package/test/Upload.test.js +5 -5
- package/test/{TextArea.test.js → V3TextArea.test.js} +6 -7
- package/dist/checkbox/Checkbox.stories.js +0 -144
- package/dist/checkbox/readme.md +0 -116
- package/dist/date/Date.stories.js +0 -205
- package/dist/date/readme.md +0 -73
- package/dist/footer/Footer.stories.js +0 -94
- package/dist/footer/dxc_logo.svg +0 -15
- package/dist/footer/readme.md +0 -41
- package/dist/header/Header.stories.js +0 -176
- package/dist/header/close_icon.svg +0 -1
- package/dist/header/dxc_logo_black.svg +0 -8
- package/dist/header/hamb_menu_black.svg +0 -1
- package/dist/header/hamb_menu_white.svg +0 -1
- package/dist/header/readme.md +0 -33
- package/dist/input-text/InputText.stories.js +0 -209
- package/dist/input-text/error.svg +0 -1
- package/dist/input-text/readme.md +0 -91
- package/dist/layout/facebook.svg +0 -45
- package/dist/layout/linkedin.svg +0 -50
- package/dist/layout/twitter.svg +0 -53
- package/dist/link/readme.md +0 -51
- package/dist/new-textarea/NewTextarea.js +0 -346
- package/dist/paginator/images/next.svg +0 -3
- package/dist/paginator/images/nextPage.svg +0 -3
- package/dist/paginator/images/previous.svg +0 -3
- package/dist/paginator/images/previousPage.svg +0 -3
- package/dist/paginator/readme.md +0 -50
- package/dist/password/styles.css +0 -3
- package/dist/progress-bar/ProgressBar.stories.js +0 -280
- package/dist/progress-bar/readme.md +0 -63
- package/dist/radio/Radio.stories.js +0 -166
- package/dist/radio/readme.md +0 -70
- package/dist/resultsetTable/arrow_downward-24px_wht.svg +0 -1
- package/dist/resultsetTable/arrow_upward-24px_wht.svg +0 -1
- package/dist/resultsetTable/unfold_more-24px_wht.svg +0 -1
- package/dist/slider/Slider.stories.js +0 -241
- package/dist/slider/readme.md +0 -64
- package/dist/spinner/Spinner.stories.js +0 -183
- package/dist/spinner/readme.md +0 -65
- package/dist/switch/Switch.stories.js +0 -134
- package/dist/switch/readme.md +0 -133
- package/dist/tabs/Tabs.stories.js +0 -130
- package/dist/tabs/readme.md +0 -78
- package/dist/tabs-for-sections/readme.md +0 -78
- package/dist/toggle/Toggle.stories.js +0 -297
- package/dist/toggle/readme.md +0 -80
- package/dist/upload/Upload.stories.js +0 -72
- package/dist/upload/buttons-upload/drag-drop-icon.svg +0 -4
- package/dist/upload/buttons-upload/upload-button.svg +0 -1
- package/dist/upload/dragAndDropArea/upload_drop.svg +0 -4
- package/dist/upload/dragAndDropArea/upload_file.svg +0 -4
- package/dist/upload/file-upload/audio-icon.svg +0 -4
- package/dist/upload/file-upload/close.svg +0 -4
- package/dist/upload/file-upload/file-icon.svg +0 -4
- package/dist/upload/file-upload/video-icon.svg +0 -4
- package/dist/upload/readme.md +0 -37
- package/dist/upload/transaction/audio-icon-err.svg +0 -4
- package/dist/upload/transaction/audio-icon.svg +0 -4
- package/dist/upload/transaction/error-icon.svg +0 -4
- package/dist/upload/transaction/file-icon-err.svg +0 -4
- package/dist/upload/transaction/file-icon.svg +0 -4
- package/dist/upload/transaction/image-icon-err.svg +0 -4
- package/dist/upload/transaction/image-icon.svg +0 -4
- package/dist/upload/transaction/success-icon.svg +0 -4
- package/dist/upload/transaction/video-icon-err.svg +0 -4
- package/dist/upload/transaction/video-icon.svg +0 -4
- package/dist/wizard/invalid_icon.svg +0 -5
- package/dist/wizard/valid_icon.svg +0 -5
- package/dist/wizard/validation-wrong.svg +0 -6
- package/test/NewTextarea.test.js +0 -201
- package/test/Password.test.js +0 -76
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
type SVG = string | (HTMLElement & SVGElement);
|
|
2
|
+
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
+
type Margin = {
|
|
4
|
+
top?: Space;
|
|
5
|
+
bottom?: Space;
|
|
6
|
+
left?: Space;
|
|
7
|
+
right?: Space;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type OptionGroup = {
|
|
11
|
+
label: string;
|
|
12
|
+
options: Option[];
|
|
13
|
+
};
|
|
14
|
+
type Option = {
|
|
15
|
+
icon?: string | SVG;
|
|
16
|
+
label: string;
|
|
17
|
+
value: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
type Props = {
|
|
21
|
+
label?: string;
|
|
22
|
+
name?: string;
|
|
23
|
+
value?: string | string[];
|
|
24
|
+
options?: Option[] | OptionGroup[];
|
|
25
|
+
helperText?: string;
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
optional?: boolean;
|
|
29
|
+
searchable?: boolean;
|
|
30
|
+
multiple?: boolean;
|
|
31
|
+
onChange?: (value: string | string[]) => void;
|
|
32
|
+
onBlur?: (val: { value: string | string[]; error: string }) => void;
|
|
33
|
+
error?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
36
|
+
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
37
|
+
*/
|
|
38
|
+
margin?: Space | Margin;
|
|
39
|
+
/**
|
|
40
|
+
* Size of the component ('small' | 'medium' | 'large' | 'fillParent').
|
|
41
|
+
*/
|
|
42
|
+
size?: "small" | "medium" | "large" | "fillParent";
|
|
43
|
+
/**
|
|
44
|
+
* Value of the tabindex attribute.
|
|
45
|
+
*/
|
|
46
|
+
tabIndex?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Reference to the component.
|
|
49
|
+
*/
|
|
50
|
+
ref?: React.RefObject<HTMLDivElement>;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export default function DxcNewSelect(props: Props): JSX.Element;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -13,15 +11,15 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
13
11
|
|
|
14
12
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
13
|
|
|
16
|
-
var _react =
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
17
15
|
|
|
18
16
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
17
|
|
|
20
18
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
21
19
|
|
|
22
|
-
var
|
|
20
|
+
var _TextInput = _interopRequireDefault(require("../text-input/TextInput"));
|
|
23
21
|
|
|
24
|
-
var
|
|
22
|
+
var _NumberInputContext = _interopRequireDefault(require("./NumberInputContext"));
|
|
25
23
|
|
|
26
24
|
var _variables = require("../common/variables.js");
|
|
27
25
|
|
|
@@ -35,7 +33,7 @@ function _templateObject() {
|
|
|
35
33
|
return data;
|
|
36
34
|
}
|
|
37
35
|
|
|
38
|
-
var
|
|
36
|
+
var DxcNumberInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
39
37
|
var _ref$label = _ref.label,
|
|
40
38
|
label = _ref$label === void 0 ? "" : _ref$label,
|
|
41
39
|
_ref$name = _ref.name,
|
|
@@ -67,14 +65,14 @@ var DxcNumber = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
67
65
|
size = _ref$size === void 0 ? "medium" : _ref$size,
|
|
68
66
|
_ref$tabIndex = _ref.tabIndex,
|
|
69
67
|
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
70
|
-
return _react["default"].createElement(
|
|
68
|
+
return _react["default"].createElement(_NumberInputContext["default"].Provider, {
|
|
71
69
|
value: {
|
|
72
70
|
typeNumber: "number",
|
|
73
71
|
minNumber: min,
|
|
74
72
|
maxNumber: max,
|
|
75
73
|
stepNumber: step
|
|
76
74
|
}
|
|
77
|
-
}, _react["default"].createElement(
|
|
75
|
+
}, _react["default"].createElement(NumberInputContainer, null, _react["default"].createElement(_TextInput["default"], {
|
|
78
76
|
label: label,
|
|
79
77
|
name: name,
|
|
80
78
|
value: value,
|
|
@@ -102,9 +100,9 @@ var sizes = {
|
|
|
102
100
|
fillParent: "100%"
|
|
103
101
|
};
|
|
104
102
|
|
|
105
|
-
var
|
|
103
|
+
var NumberInputContainer = _styledComponents["default"].div(_templateObject());
|
|
106
104
|
|
|
107
|
-
|
|
105
|
+
DxcNumberInput.propTypes = {
|
|
108
106
|
label: _propTypes["default"].string,
|
|
109
107
|
name: _propTypes["default"].string,
|
|
110
108
|
value: _propTypes["default"].string,
|
|
@@ -134,5 +132,5 @@ DxcNumber.propTypes = {
|
|
|
134
132
|
size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
|
|
135
133
|
tabIndex: _propTypes["default"].number
|
|
136
134
|
};
|
|
137
|
-
var _default =
|
|
135
|
+
var _default = DxcNumberInput;
|
|
138
136
|
exports["default"] = _default;
|
|
@@ -10,7 +10,7 @@ exports["default"] = void 0;
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
12
|
/* eslint-disable prefer-template */
|
|
13
|
-
var
|
|
13
|
+
var NumberInputContext = _react["default"].createContext();
|
|
14
14
|
|
|
15
|
-
var _default =
|
|
15
|
+
var _default = NumberInputContext;
|
|
16
16
|
exports["default"] = _default;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
type Size = "small" | "medium" | "large" | "fillParent";
|
|
2
|
+
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
+
type Margin = {
|
|
4
|
+
top?: Space;
|
|
5
|
+
bottom?: Space;
|
|
6
|
+
left?: Space;
|
|
7
|
+
right?: Space;
|
|
8
|
+
};
|
|
9
|
+
type Props = {
|
|
10
|
+
/**
|
|
11
|
+
* Text to be placed above the number.
|
|
12
|
+
*/
|
|
13
|
+
label?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Name attribute of the input element.
|
|
16
|
+
*/
|
|
17
|
+
name?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Value of the input element. If undefined, the component will be uncontrolled and the value will be managed internally by the component.
|
|
20
|
+
*/
|
|
21
|
+
value?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Helper text to be placed above the number.
|
|
24
|
+
*/
|
|
25
|
+
helperText?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Text to be put as placeholder of the number.
|
|
28
|
+
*/
|
|
29
|
+
placeholder?: string;
|
|
30
|
+
/**
|
|
31
|
+
* If true, the component will be disabled.
|
|
32
|
+
*/
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* If true, the number will be optional, showing '(Optional)'
|
|
36
|
+
* next to the label. Otherwise, the field will be considered required
|
|
37
|
+
* and an error will be passed as a parameter to the OnBlur and onChange
|
|
38
|
+
* functions when it has not been filled.
|
|
39
|
+
*/
|
|
40
|
+
optional?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Prefix to be placed before the number value.
|
|
43
|
+
*/
|
|
44
|
+
prefix?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Suffix to be placed after the number value.
|
|
47
|
+
*/
|
|
48
|
+
suffix?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Minimum value allowed by the number input. If the typed value by the user is
|
|
51
|
+
* lower than min, the onBlur and onChange functions will be called with
|
|
52
|
+
* the current value and an internal error informing that the current
|
|
53
|
+
* value is not correct. If a valid state is reached, the error parameter
|
|
54
|
+
* will be null in both events.
|
|
55
|
+
*/
|
|
56
|
+
min?: number;
|
|
57
|
+
/**
|
|
58
|
+
* Maximum value allowed by the number input. If the typed value by the user
|
|
59
|
+
* surpasses max, the onBlur and onChange functions will be called with
|
|
60
|
+
* the current value and an internal error informing that the current
|
|
61
|
+
* value is not correct. If a valid state is reached, the error parameter
|
|
62
|
+
* will be null in both events.
|
|
63
|
+
*/
|
|
64
|
+
max?: number;
|
|
65
|
+
/**
|
|
66
|
+
* The step interval to use when using the up and down arrows to adjust the value.
|
|
67
|
+
*/
|
|
68
|
+
step?: number;
|
|
69
|
+
/**
|
|
70
|
+
* This function will be called when the user types within the input
|
|
71
|
+
* element of the component. An object including the current value and
|
|
72
|
+
* the error (if the value entered is not valid) will be passed to this
|
|
73
|
+
* function. If there is no error, error will be null.
|
|
74
|
+
*/
|
|
75
|
+
onChange?: (val: { value: string; error: string }) => void;
|
|
76
|
+
/**
|
|
77
|
+
* This function will be called when the input element loses the focus.
|
|
78
|
+
* An object including the input value and the error (if the value
|
|
79
|
+
* entered is not valid) will be passed to this function. If there is no error,
|
|
80
|
+
* error will be null.
|
|
81
|
+
*/
|
|
82
|
+
onBlur?: (val: { value: string; error: string }) => void;
|
|
83
|
+
/**
|
|
84
|
+
* If it is defined, the component will change its appearance, showing
|
|
85
|
+
* the error below the input component. If it is not defined, the error
|
|
86
|
+
* messages will be managed internally, but never displayed on its own.
|
|
87
|
+
*/
|
|
88
|
+
error?: string;
|
|
89
|
+
/**
|
|
90
|
+
* HTML autocomplete attribute. Lets the user specify if any permission the user agent has to provide automated assistance in filling out the input value.
|
|
91
|
+
* Its value must be one of all the possible values of the HTML autocomplete attribute: 'on', 'off', 'email', 'username', 'new-password', ...
|
|
92
|
+
*/
|
|
93
|
+
autocomplete?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
96
|
+
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
97
|
+
*/
|
|
98
|
+
margin?: Space | Margin;
|
|
99
|
+
/**
|
|
100
|
+
* Size of the component ('small' | 'medium' | 'large' | 'fillParent').
|
|
101
|
+
*/
|
|
102
|
+
size?: Size;
|
|
103
|
+
/**
|
|
104
|
+
* Value of the tabindex attribute.
|
|
105
|
+
*/
|
|
106
|
+
tabIndex?: number;
|
|
107
|
+
/**
|
|
108
|
+
* Reference to the component.
|
|
109
|
+
*/
|
|
110
|
+
ref?: React.RefObject<HTMLDivElement>;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export default function DxcNumberInput(props: Props): JSX.Element;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.lastIcon = exports.nextIcon = exports.previousIcon = exports.firstIcon = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var firstIcon = _react["default"].createElement("svg", {
|
|
13
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
+
width: "12.41",
|
|
15
|
+
height: "12",
|
|
16
|
+
viewBox: "0 0 12.41 12"
|
|
17
|
+
}, _react["default"].createElement("path", {
|
|
18
|
+
id: "Path_2463",
|
|
19
|
+
"data-name": "Path 2463",
|
|
20
|
+
d: "M18.41,16.59,13.82,12l4.59-4.59L17,6l-6,6,6,6ZM6,6H8V18H6Z",
|
|
21
|
+
transform: "translate(-6 -6)"
|
|
22
|
+
}));
|
|
23
|
+
|
|
24
|
+
exports.firstIcon = firstIcon;
|
|
25
|
+
|
|
26
|
+
var previousIcon = _react["default"].createElement("svg", {
|
|
27
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
28
|
+
width: "7.41",
|
|
29
|
+
height: "12",
|
|
30
|
+
viewBox: "0 0 7.41 12"
|
|
31
|
+
}, _react["default"].createElement("path", {
|
|
32
|
+
id: "Path_2459",
|
|
33
|
+
"data-name": "Path 2459",
|
|
34
|
+
d: "M15.41,7.41,14,6,8,12l6,6,1.41-1.41L10.83,12Z",
|
|
35
|
+
transform: "translate(-8 -6)"
|
|
36
|
+
}));
|
|
37
|
+
|
|
38
|
+
exports.previousIcon = previousIcon;
|
|
39
|
+
|
|
40
|
+
var nextIcon = _react["default"].createElement("svg", {
|
|
41
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
42
|
+
width: "7.41",
|
|
43
|
+
height: "12",
|
|
44
|
+
viewBox: "0 0 7.41 12"
|
|
45
|
+
}, _react["default"].createElement("path", {
|
|
46
|
+
id: "Path_2461",
|
|
47
|
+
"data-name": "Path 2461",
|
|
48
|
+
d: "M10,6,8.59,7.41,13.17,12,8.59,16.59,10,18l6-6Z",
|
|
49
|
+
transform: "translate(-8.59 -6)"
|
|
50
|
+
}));
|
|
51
|
+
|
|
52
|
+
exports.nextIcon = nextIcon;
|
|
53
|
+
|
|
54
|
+
var lastIcon = _react["default"].createElement("svg", {
|
|
55
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
56
|
+
width: "12.41",
|
|
57
|
+
height: "12",
|
|
58
|
+
viewBox: "0 0 12.41 12"
|
|
59
|
+
}, _react["default"].createElement("path", {
|
|
60
|
+
id: "Path_2465",
|
|
61
|
+
"data-name": "Path 2465",
|
|
62
|
+
d: "M5.59,7.41,10.18,12,5.59,16.59,7,18l6-6L7,6ZM16,6h2V18H16Z",
|
|
63
|
+
transform: "translate(-5.59 -6)"
|
|
64
|
+
}));
|
|
65
|
+
|
|
66
|
+
exports.lastIcon = lastIcon;
|
|
@@ -25,13 +25,7 @@ var _Button = _interopRequireDefault(require("../button/Button"));
|
|
|
25
25
|
|
|
26
26
|
var _Select = _interopRequireDefault(require("../select/Select"));
|
|
27
27
|
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
var _previous = _interopRequireDefault(require("./images/previous.svg"));
|
|
31
|
-
|
|
32
|
-
var _next = _interopRequireDefault(require("./images/next.svg"));
|
|
33
|
-
|
|
34
|
-
var _nextPage = _interopRequireDefault(require("./images/nextPage.svg"));
|
|
28
|
+
var _Icons = require("./Icons");
|
|
35
29
|
|
|
36
30
|
var _BackgroundColorContext = require("../BackgroundColorContext.js");
|
|
37
31
|
|
|
@@ -158,7 +152,7 @@ var DxcPaginator = function DxcPaginator(_ref) {
|
|
|
158
152
|
left: "xxsmall",
|
|
159
153
|
right: "xxsmall"
|
|
160
154
|
},
|
|
161
|
-
|
|
155
|
+
icon: _Icons.firstIcon,
|
|
162
156
|
tabIndex: tabIndex,
|
|
163
157
|
onClick: function onClick() {
|
|
164
158
|
onPageChange(1);
|
|
@@ -171,7 +165,7 @@ var DxcPaginator = function DxcPaginator(_ref) {
|
|
|
171
165
|
left: "xxsmall",
|
|
172
166
|
right: "xxsmall"
|
|
173
167
|
},
|
|
174
|
-
|
|
168
|
+
icon: _Icons.previousIcon,
|
|
175
169
|
tabIndex: tabIndex,
|
|
176
170
|
onClick: function onClick() {
|
|
177
171
|
onPageChange(currentPage - 1);
|
|
@@ -195,7 +189,7 @@ var DxcPaginator = function DxcPaginator(_ref) {
|
|
|
195
189
|
left: "xxsmall",
|
|
196
190
|
right: "xxsmall"
|
|
197
191
|
},
|
|
198
|
-
|
|
192
|
+
icon: _Icons.nextIcon,
|
|
199
193
|
tabIndex: tabIndex,
|
|
200
194
|
onClick: function onClick() {
|
|
201
195
|
onPageChange(currentPage + 1);
|
|
@@ -208,7 +202,7 @@ var DxcPaginator = function DxcPaginator(_ref) {
|
|
|
208
202
|
left: "xxsmall",
|
|
209
203
|
right: "xxsmall"
|
|
210
204
|
},
|
|
211
|
-
|
|
205
|
+
icon: _Icons.lastIcon,
|
|
212
206
|
tabIndex: tabIndex,
|
|
213
207
|
onClick: function onClick() {
|
|
214
208
|
onPageChange(totalPages);
|
|
@@ -21,14 +21,12 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
21
21
|
|
|
22
22
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _TextInput = _interopRequireDefault(require("../text-input/TextInput"));
|
|
25
25
|
|
|
26
26
|
var _variables = require("../common/variables.js");
|
|
27
27
|
|
|
28
|
-
require("./styles.css");
|
|
29
|
-
|
|
30
28
|
function _templateObject() {
|
|
31
|
-
var data = (0, _taggedTemplateLiteral2["default"])([""]);
|
|
29
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n & ::-ms-reveal {\n display: none;\n }\n"]);
|
|
32
30
|
|
|
33
31
|
_templateObject = function _templateObject() {
|
|
34
32
|
return data;
|
|
@@ -37,7 +35,7 @@ function _templateObject() {
|
|
|
37
35
|
return data;
|
|
38
36
|
}
|
|
39
37
|
|
|
40
|
-
var
|
|
38
|
+
var DxcPasswordInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
41
39
|
var _ref$label = _ref.label,
|
|
42
40
|
label = _ref$label === void 0 ? "" : _ref$label,
|
|
43
41
|
_ref$name = _ref.name,
|
|
@@ -45,17 +43,17 @@ var DxcPassword = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
45
43
|
value = _ref.value,
|
|
46
44
|
_ref$helperText = _ref.helperText,
|
|
47
45
|
helperText = _ref$helperText === void 0 ? "" : _ref$helperText,
|
|
48
|
-
_ref$error = _ref.error,
|
|
49
|
-
error = _ref$error === void 0 ? "" : _ref$error,
|
|
50
46
|
_ref$clearable = _ref.clearable,
|
|
51
47
|
clearable = _ref$clearable === void 0 ? false : _ref$clearable,
|
|
52
48
|
onChange = _ref.onChange,
|
|
53
49
|
onBlur = _ref.onBlur,
|
|
54
|
-
|
|
50
|
+
_ref$error = _ref.error,
|
|
51
|
+
error = _ref$error === void 0 ? "" : _ref$error,
|
|
55
52
|
pattern = _ref.pattern,
|
|
56
53
|
length = _ref.length,
|
|
57
54
|
_ref$autocomplete = _ref.autocomplete,
|
|
58
55
|
autocomplete = _ref$autocomplete === void 0 ? "off" : _ref$autocomplete,
|
|
56
|
+
margin = _ref.margin,
|
|
59
57
|
_ref$size = _ref.size,
|
|
60
58
|
size = _ref$size === void 0 ? "medium" : _ref$size,
|
|
61
59
|
_ref$tabIndex = _ref.tabIndex,
|
|
@@ -141,9 +139,9 @@ var DxcPassword = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
141
139
|
d: "M12 6c3.79 0 7.17 2.13 8.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5C4.83 8.13 8.21 6 12 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5c1.38 0 2.5 1.12 2.5 2.5S13.38 14 12 14s-2.5-1.12-2.5-2.5S10.62 9 12 9m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"
|
|
142
140
|
}))
|
|
143
141
|
};
|
|
144
|
-
return _react["default"].createElement(
|
|
142
|
+
return _react["default"].createElement(PasswordInput, {
|
|
145
143
|
ref: ref
|
|
146
|
-
}, _react["default"].createElement(
|
|
144
|
+
}, _react["default"].createElement(_TextInput["default"], {
|
|
147
145
|
ref: inputRef,
|
|
148
146
|
label: label,
|
|
149
147
|
name: name,
|
|
@@ -170,9 +168,9 @@ var sizes = {
|
|
|
170
168
|
fillParent: "100%"
|
|
171
169
|
};
|
|
172
170
|
|
|
173
|
-
var
|
|
171
|
+
var PasswordInput = _styledComponents["default"].div(_templateObject());
|
|
174
172
|
|
|
175
|
-
|
|
173
|
+
DxcPasswordInput.propTypes = {
|
|
176
174
|
label: _propTypes["default"].string,
|
|
177
175
|
name: _propTypes["default"].string,
|
|
178
176
|
value: _propTypes["default"].string,
|
|
@@ -196,5 +194,5 @@ DxcPassword.propTypes = {
|
|
|
196
194
|
}),
|
|
197
195
|
tabIndex: _propTypes["default"].number
|
|
198
196
|
};
|
|
199
|
-
var _default =
|
|
197
|
+
var _default = DxcPasswordInput;
|
|
200
198
|
exports["default"] = _default;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
type Size = "small" | "medium" | "large" | "fillParent";
|
|
2
|
+
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
+
type Margin = {
|
|
4
|
+
top?: Space;
|
|
5
|
+
bottom?: Space;
|
|
6
|
+
left?: Space;
|
|
7
|
+
right?: Space;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type Props = {
|
|
11
|
+
/**
|
|
12
|
+
* Text to be placed above the password.
|
|
13
|
+
*/
|
|
14
|
+
label?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Name attribute of the input element.
|
|
17
|
+
*/
|
|
18
|
+
name?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Value of the input element. If undefined, the component will be uncontrolled and the value will be managed internally by the component.
|
|
21
|
+
*/
|
|
22
|
+
value?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Helper text to be placed above the password.
|
|
25
|
+
*/
|
|
26
|
+
helperText?: string;
|
|
27
|
+
/**
|
|
28
|
+
* If true, the password input will have an action to clear the entered value.
|
|
29
|
+
*/
|
|
30
|
+
clearable?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* This function will be called when the user types within the input
|
|
33
|
+
* element of the component. An object including the current value and
|
|
34
|
+
* the error (if the value entered is not valid) will be passed to this
|
|
35
|
+
* function. If there is no error, error will be null.
|
|
36
|
+
* */
|
|
37
|
+
onChange?: (val: { value: string; error: string }) => void;
|
|
38
|
+
/**
|
|
39
|
+
* This function will be called when the input element loses the focus.
|
|
40
|
+
* An object including the input value and the error (if the value entered is
|
|
41
|
+
* not valid) will be passed to this function. If there is no error, error will be null.
|
|
42
|
+
*/
|
|
43
|
+
onBlur?: (val: { value: string; error: string }) => void;
|
|
44
|
+
/**
|
|
45
|
+
* If it is defined, the component will change its appearance, showing
|
|
46
|
+
* the error below the password input component. If it is not defined, the
|
|
47
|
+
* error messages will be managed internally, but never displayed on its own.
|
|
48
|
+
*/
|
|
49
|
+
error?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Regular expression that defines the valid format allowed by the
|
|
52
|
+
* password input. This will be checked both when the input element loses the
|
|
53
|
+
* focus and while typing within it. If the string entered does not match
|
|
54
|
+
* the pattern, the onBlur and onChange functions will be called with the
|
|
55
|
+
* current value and an internal error informing that this value does not
|
|
56
|
+
* match the pattern. If the pattern is met, the error parameter of both
|
|
57
|
+
* events will be null.
|
|
58
|
+
*/
|
|
59
|
+
pattern?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Specifies the minimun and maximum length allowed by the password input.
|
|
62
|
+
* This will be checked both when the input element loses the
|
|
63
|
+
* focus and while typing within it. If the string entered does not
|
|
64
|
+
* comply the length, the onBlur and onChange functions will be called
|
|
65
|
+
* with the current value and an internal error informing that the value
|
|
66
|
+
* length does not comply the specified range. If a valid length is
|
|
67
|
+
* reached, the error parameter of both events will be null.
|
|
68
|
+
*/
|
|
69
|
+
length?: { min?: number; max?: number };
|
|
70
|
+
/**
|
|
71
|
+
* HTML autocomplete attribute. Lets the user specify if any permission the user agent has to provide automated assistance in filling out the input value.
|
|
72
|
+
* Its value must be one of all the possible values of the HTML autocomplete attribute: 'on', 'off', 'email', 'username', 'new-password', ...
|
|
73
|
+
*/
|
|
74
|
+
autocomplete?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
77
|
+
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
78
|
+
*/
|
|
79
|
+
margin?: Space | Margin;
|
|
80
|
+
/**
|
|
81
|
+
* Size of the component ('small' | 'medium' | 'large' | 'fillParent').
|
|
82
|
+
*/
|
|
83
|
+
size?: Size;
|
|
84
|
+
/**
|
|
85
|
+
* Value of the tabindex attribute.
|
|
86
|
+
*/
|
|
87
|
+
tabIndex?: number;
|
|
88
|
+
/**
|
|
89
|
+
* Reference to the component.
|
|
90
|
+
*/
|
|
91
|
+
ref?: React.RefObject<HTMLDivElement>;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export default function DxcPasswordInput(props: Props): JSX.Element;
|
package/dist/sidenav/Sidenav.js
CHANGED
|
@@ -26,7 +26,7 @@ var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
|
26
26
|
var _BackgroundColorContext = require("../BackgroundColorContext.js");
|
|
27
27
|
|
|
28
28
|
function _templateObject4() {
|
|
29
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n text-decoration: ", ";\n margin: ", ";\n cursor: pointer;\n"]);
|
|
29
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n text-decoration: ", ";\n margin: ", ";\n cursor: pointer;\n\n :focus-visible {\n outline: 2px solid ", ";\n outline-offset: 1px;\n }\n"]);
|
|
30
30
|
|
|
31
31
|
_templateObject4 = function _templateObject4() {
|
|
32
32
|
return data;
|
|
@@ -36,7 +36,7 @@ function _templateObject4() {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
function _templateObject3() {
|
|
39
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n margin-
|
|
39
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n margin-bottom: 4px;\n"]);
|
|
40
40
|
|
|
41
41
|
_templateObject3 = function _templateObject3() {
|
|
42
42
|
return data;
|
|
@@ -46,7 +46,7 @@ function _templateObject3() {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
function _templateObject2() {
|
|
49
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n margin:
|
|
49
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n margin-bottom: 16px;\n"]);
|
|
50
50
|
|
|
51
51
|
_templateObject2 = function _templateObject2() {
|
|
52
52
|
return data;
|
|
@@ -56,7 +56,7 @@ function _templateObject2() {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
function _templateObject() {
|
|
59
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n max-width: 300px;\n width: ", ";\n padding: ", ";\n\n overflow-y: auto;\n overflow-x: hidden;\n ::-webkit-scrollbar {\n width: 2px;\n }\n ::-webkit-scrollbar-track {\n background-color: ", ";\n border-radius: 3px;\n }\n ::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: 3px;\n }\n
|
|
59
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n background-color: ", ";\n max-width: 300px;\n width: ", ";\n padding: ", ";\n\n overflow-y: auto;\n overflow-x: hidden;\n ::-webkit-scrollbar {\n width: 2px;\n }\n ::-webkit-scrollbar-track {\n background-color: ", ";\n border-radius: 3px;\n }\n ::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: 3px;\n }\n"]);
|
|
60
60
|
|
|
61
61
|
_templateObject = function _templateObject() {
|
|
62
62
|
return data;
|
|
@@ -160,6 +160,8 @@ var SideNavMenuLink = _styledComponents["default"].a(_templateObject4(), functio
|
|
|
160
160
|
return props.theme.linkTextDecoration;
|
|
161
161
|
}, function (props) {
|
|
162
162
|
return "".concat(props.theme.linkMarginTop, " ").concat(props.theme.linkMarginRight, " ").concat(props.theme.linkMarginBottom, " ").concat(props.theme.linkMarginLeft);
|
|
163
|
+
}, function (props) {
|
|
164
|
+
return props.theme.linkFocusColor;
|
|
163
165
|
});
|
|
164
166
|
|
|
165
167
|
DxcSidenav.propTypes = {
|