@dhis2-ui/input 7.12.2 → 7.14.2

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.
@@ -7,12 +7,10 @@ exports.Input = void 0;
7
7
 
8
8
  var _style = _interopRequireDefault(require("styled-jsx/style"));
9
9
 
10
- var _loader = require("@dhis2-ui/loader");
10
+ var _statusIcon = require("@dhis2-ui/status-icon");
11
11
 
12
12
  var _uiConstants = require("@dhis2/ui-constants");
13
13
 
14
- var _uiIcons = require("@dhis2/ui-icons");
15
-
16
14
  var _classnames = _interopRequireDefault(require("classnames"));
17
15
 
18
16
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -27,55 +25,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
27
25
 
28
26
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
29
27
 
30
- const StatusIcon = ({
31
- error,
32
- warning,
33
- valid,
34
- loading,
35
- className,
36
- defaultTo
37
- }) => {
38
- if (error) {
39
- return /*#__PURE__*/_react.default.createElement(_uiIcons.IconErrorFilled24, {
40
- color: _uiConstants.theme.error
41
- });
42
- }
43
-
44
- if (warning) {
45
- return /*#__PURE__*/_react.default.createElement(_uiIcons.IconWarningFilled24, {
46
- color: _uiConstants.theme.warning
47
- });
48
- }
49
-
50
- if (valid) {
51
- return /*#__PURE__*/_react.default.createElement(_uiIcons.IconCheckmark24, {
52
- color: _uiConstants.theme.valid
53
- });
54
- }
55
-
56
- if (loading) {
57
- return /*#__PURE__*/_react.default.createElement(_loader.CircularLoader, {
58
- small: true,
59
- className: className
60
- });
61
- }
62
-
63
- return defaultTo;
64
- };
65
-
66
- StatusIcon.defaultProps = {
67
- defaultTo: null
68
- };
69
- StatusIcon.propTypes = {
70
- className: _propTypes.default.string,
71
- defaultTo: _propTypes.default.element,
72
- error: _propTypes.default.bool,
73
- loading: _propTypes.default.bool,
74
- valid: _propTypes.default.bool,
75
- warning: _propTypes.default.bool
76
- };
77
- const styles = [".input.jsx-288547973{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", `input.jsx-288547973{box-sizing:border-box;font-size:14px;line-height:16px;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;color:${_uiConstants.colors.grey900};background-color:white;padding:12px 11px 10px;outline:0;border:1px solid ${_uiConstants.colors.grey500};border-radius:3px;box-shadow:inset 0 1px 2px 0 rgba(48,54,60,0.1);text-overflow:ellipsis;}`, "input.dense.jsx-288547973{padding:8px 11px 6px;}", `input.jsx-288547973:focus{outline:none;box-shadow:inset 0 0 0 2px ${_uiConstants.theme.focus};border-color:${_uiConstants.theme.focus};}`, "input[type='date'].jsx-288547973::-webkit-inner-spin-button,input[type='date'].jsx-288547973::-webkit-calendar-picker-indicator,input[type='time'].jsx-288547973::-webkit-inner-spin-button,input[type='time'].jsx-288547973::-webkit-calendar-picker-indicator,input[type='datetime-local'].jsx-288547973::-webkit-inner-spin-button,input[type='datetime-local'].jsx-288547973::-webkit-calendar-picker-indicator{height:14px;padding-top:1px;padding-bottom:1px;}", "input[type='date'].jsx-288547973::-webkit-datetime-edit-fields-wrapper,input[type='datetime-local'].jsx-288547973::-webkit-datetime-edit-fields-wrapper,input[type='time'].jsx-288547973::-webkit-datetime-edit-fields-wrapper{padding:0;}", `input.warning.jsx-288547973{border-color:${_uiConstants.theme.warning};}`, `input.error.jsx-288547973{border-color:${_uiConstants.theme.error};}`, `input.read-only.jsx-288547973{background-color:${_uiConstants.colors.grey050};border-color:${_uiConstants.colors.grey300};box-shadow:none;cursor:text;}`, `input.disabled.jsx-288547973{background-color:${_uiConstants.colors.grey100};border-color:${_uiConstants.colors.grey500};color:${_uiConstants.theme.disabled};cursor:not-allowed;}`, `.status-icon.jsx-288547973{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;-webkit-box-flex:0;-webkit-flex-grow:0;-ms-flex-positive:0;flex-grow:0;margin-left:${_uiConstants.spacers.dp8};}`];
78
- styles.__hash = "288547973";
28
+ const styles = [`.input.jsx-2422099811{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:${_uiConstants.spacers.dp8};}`, `input.jsx-2422099811{box-sizing:border-box;font-size:14px;line-height:16px;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;color:${_uiConstants.colors.grey900};background-color:white;padding:12px 11px 10px;outline:0;border:1px solid ${_uiConstants.colors.grey500};border-radius:3px;box-shadow:inset 0 1px 2px 0 rgba(48,54,60,0.1);text-overflow:ellipsis;}`, "input.dense.jsx-2422099811{padding:8px 11px 6px;}", `input.jsx-2422099811:focus{outline:none;box-shadow:inset 0 0 0 2px ${_uiConstants.theme.focus};border-color:${_uiConstants.theme.focus};}`, "input[type='date'].jsx-2422099811::-webkit-inner-spin-button,input[type='date'].jsx-2422099811::-webkit-calendar-picker-indicator,input[type='time'].jsx-2422099811::-webkit-inner-spin-button,input[type='time'].jsx-2422099811::-webkit-calendar-picker-indicator,input[type='datetime-local'].jsx-2422099811::-webkit-inner-spin-button,input[type='datetime-local'].jsx-2422099811::-webkit-calendar-picker-indicator{height:14px;padding-top:1px;padding-bottom:1px;}", "input[type='date'].jsx-2422099811::-webkit-datetime-edit-fields-wrapper,input[type='datetime-local'].jsx-2422099811::-webkit-datetime-edit-fields-wrapper,input[type='time'].jsx-2422099811::-webkit-datetime-edit-fields-wrapper{padding:0;}", `input.warning.jsx-2422099811{border-color:${_uiConstants.theme.warning};}`, `input.error.jsx-2422099811{border-color:${_uiConstants.theme.error};}`, `input.read-only.jsx-2422099811{background-color:${_uiConstants.colors.grey050};border-color:${_uiConstants.colors.grey300};box-shadow:none;cursor:text;}`, `input.disabled.jsx-2422099811{background-color:${_uiConstants.colors.grey100};border-color:${_uiConstants.colors.grey500};color:${_uiConstants.theme.disabled};cursor:not-allowed;}`];
29
+ styles.__hash = "2422099811";
79
30
 
80
31
  class Input extends _react.Component {
81
32
  constructor(...args) {
@@ -166,14 +117,12 @@ class Input extends _react.Component {
166
117
  warning,
167
118
  'read-only': readOnly
168
119
  }) || "")
169
- }), /*#__PURE__*/_react.default.createElement("div", {
170
- className: "jsx-3353877153 " + `jsx-${styles.__hash}` + " " + "status-icon"
171
- }, /*#__PURE__*/_react.default.createElement(StatusIcon, {
120
+ }), /*#__PURE__*/_react.default.createElement(_statusIcon.StatusIcon, {
172
121
  error: error,
173
122
  valid: valid,
174
123
  loading: loading,
175
124
  warning: warning
176
- })), /*#__PURE__*/_react.default.createElement(_style.default, {
125
+ }), /*#__PURE__*/_react.default.createElement(_style.default, {
177
126
  id: styles.__hash
178
127
  }, styles), /*#__PURE__*/_react.default.createElement(_style.default, {
179
128
  id: "3353877153"
@@ -2,62 +2,13 @@ import _JSXStyle from "styled-jsx/style";
2
2
 
3
3
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
4
 
5
- import { CircularLoader } from '@dhis2-ui/loader';
5
+ import { StatusIcon } from '@dhis2-ui/status-icon';
6
6
  import { theme, colors, spacers, sharedPropTypes } from '@dhis2/ui-constants';
7
- import { IconErrorFilled24, IconWarningFilled24, IconCheckmark24 } from '@dhis2/ui-icons';
8
7
  import cx from 'classnames';
9
8
  import PropTypes from 'prop-types';
10
9
  import React, { Component } from 'react';
11
-
12
- const StatusIcon = ({
13
- error,
14
- warning,
15
- valid,
16
- loading,
17
- className,
18
- defaultTo
19
- }) => {
20
- if (error) {
21
- return /*#__PURE__*/React.createElement(IconErrorFilled24, {
22
- color: theme.error
23
- });
24
- }
25
-
26
- if (warning) {
27
- return /*#__PURE__*/React.createElement(IconWarningFilled24, {
28
- color: theme.warning
29
- });
30
- }
31
-
32
- if (valid) {
33
- return /*#__PURE__*/React.createElement(IconCheckmark24, {
34
- color: theme.valid
35
- });
36
- }
37
-
38
- if (loading) {
39
- return /*#__PURE__*/React.createElement(CircularLoader, {
40
- small: true,
41
- className: className
42
- });
43
- }
44
-
45
- return defaultTo;
46
- };
47
-
48
- StatusIcon.defaultProps = {
49
- defaultTo: null
50
- };
51
- StatusIcon.propTypes = {
52
- className: PropTypes.string,
53
- defaultTo: PropTypes.element,
54
- error: PropTypes.bool,
55
- loading: PropTypes.bool,
56
- valid: PropTypes.bool,
57
- warning: PropTypes.bool
58
- };
59
- const styles = [".input.jsx-288547973{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", `input.jsx-288547973{box-sizing:border-box;font-size:14px;line-height:16px;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;color:${colors.grey900};background-color:white;padding:12px 11px 10px;outline:0;border:1px solid ${colors.grey500};border-radius:3px;box-shadow:inset 0 1px 2px 0 rgba(48,54,60,0.1);text-overflow:ellipsis;}`, "input.dense.jsx-288547973{padding:8px 11px 6px;}", `input.jsx-288547973:focus{outline:none;box-shadow:inset 0 0 0 2px ${theme.focus};border-color:${theme.focus};}`, "input[type='date'].jsx-288547973::-webkit-inner-spin-button,input[type='date'].jsx-288547973::-webkit-calendar-picker-indicator,input[type='time'].jsx-288547973::-webkit-inner-spin-button,input[type='time'].jsx-288547973::-webkit-calendar-picker-indicator,input[type='datetime-local'].jsx-288547973::-webkit-inner-spin-button,input[type='datetime-local'].jsx-288547973::-webkit-calendar-picker-indicator{height:14px;padding-top:1px;padding-bottom:1px;}", "input[type='date'].jsx-288547973::-webkit-datetime-edit-fields-wrapper,input[type='datetime-local'].jsx-288547973::-webkit-datetime-edit-fields-wrapper,input[type='time'].jsx-288547973::-webkit-datetime-edit-fields-wrapper{padding:0;}", `input.warning.jsx-288547973{border-color:${theme.warning};}`, `input.error.jsx-288547973{border-color:${theme.error};}`, `input.read-only.jsx-288547973{background-color:${colors.grey050};border-color:${colors.grey300};box-shadow:none;cursor:text;}`, `input.disabled.jsx-288547973{background-color:${colors.grey100};border-color:${colors.grey500};color:${theme.disabled};cursor:not-allowed;}`, `.status-icon.jsx-288547973{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;-webkit-box-flex:0;-webkit-flex-grow:0;-ms-flex-positive:0;flex-grow:0;margin-left:${spacers.dp8};}`];
60
- styles.__hash = "288547973";
10
+ const styles = [`.input.jsx-2422099811{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:${spacers.dp8};}`, `input.jsx-2422099811{box-sizing:border-box;font-size:14px;line-height:16px;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;color:${colors.grey900};background-color:white;padding:12px 11px 10px;outline:0;border:1px solid ${colors.grey500};border-radius:3px;box-shadow:inset 0 1px 2px 0 rgba(48,54,60,0.1);text-overflow:ellipsis;}`, "input.dense.jsx-2422099811{padding:8px 11px 6px;}", `input.jsx-2422099811:focus{outline:none;box-shadow:inset 0 0 0 2px ${theme.focus};border-color:${theme.focus};}`, "input[type='date'].jsx-2422099811::-webkit-inner-spin-button,input[type='date'].jsx-2422099811::-webkit-calendar-picker-indicator,input[type='time'].jsx-2422099811::-webkit-inner-spin-button,input[type='time'].jsx-2422099811::-webkit-calendar-picker-indicator,input[type='datetime-local'].jsx-2422099811::-webkit-inner-spin-button,input[type='datetime-local'].jsx-2422099811::-webkit-calendar-picker-indicator{height:14px;padding-top:1px;padding-bottom:1px;}", "input[type='date'].jsx-2422099811::-webkit-datetime-edit-fields-wrapper,input[type='datetime-local'].jsx-2422099811::-webkit-datetime-edit-fields-wrapper,input[type='time'].jsx-2422099811::-webkit-datetime-edit-fields-wrapper{padding:0;}", `input.warning.jsx-2422099811{border-color:${theme.warning};}`, `input.error.jsx-2422099811{border-color:${theme.error};}`, `input.read-only.jsx-2422099811{background-color:${colors.grey050};border-color:${colors.grey300};box-shadow:none;cursor:text;}`, `input.disabled.jsx-2422099811{background-color:${colors.grey100};border-color:${colors.grey500};color:${theme.disabled};cursor:not-allowed;}`];
11
+ styles.__hash = "2422099811";
61
12
  export class Input extends Component {
62
13
  constructor(...args) {
63
14
  super(...args);
@@ -147,14 +98,12 @@ export class Input extends Component {
147
98
  warning,
148
99
  'read-only': readOnly
149
100
  }) || "")
150
- }), /*#__PURE__*/React.createElement("div", {
151
- className: "jsx-3353877153 " + `jsx-${styles.__hash}` + " " + "status-icon"
152
- }, /*#__PURE__*/React.createElement(StatusIcon, {
101
+ }), /*#__PURE__*/React.createElement(StatusIcon, {
153
102
  error: error,
154
103
  valid: valid,
155
104
  loading: loading,
156
105
  warning: warning
157
- })), /*#__PURE__*/React.createElement(_JSXStyle, {
106
+ }), /*#__PURE__*/React.createElement(_JSXStyle, {
158
107
  id: styles.__hash
159
108
  }, styles), /*#__PURE__*/React.createElement(_JSXStyle, {
160
109
  id: "3353877153"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2-ui/input",
3
- "version": "7.12.2",
3
+ "version": "7.14.2",
4
4
  "description": "UI Input",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,12 +32,13 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@dhis2/prop-types": "^3.0.0-beta.1",
35
- "@dhis2-ui/box": "7.12.2",
36
- "@dhis2-ui/field": "7.12.2",
37
- "@dhis2-ui/input": "7.12.2",
38
- "@dhis2-ui/loader": "7.12.2",
39
- "@dhis2/ui-constants": "7.12.2",
40
- "@dhis2/ui-icons": "7.12.2",
35
+ "@dhis2-ui/box": "7.14.2",
36
+ "@dhis2-ui/field": "7.14.2",
37
+ "@dhis2-ui/input": "7.14.2",
38
+ "@dhis2-ui/loader": "7.14.2",
39
+ "@dhis2-ui/status-icon": "7.14.2",
40
+ "@dhis2/ui-constants": "7.14.2",
41
+ "@dhis2/ui-icons": "7.14.2",
41
42
  "classnames": "^2.3.1",
42
43
  "prop-types": "^15.7.2"
43
44
  },