@dhis2-ui/file-input 8.2.0 → 8.2.1

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.
@@ -30,8 +30,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
30
30
  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; }
31
31
 
32
32
  class FileInput extends _react.Component {
33
- constructor(...args) {
34
- super(...args);
33
+ constructor() {
34
+ super(...arguments);
35
35
 
36
36
  _defineProperty(this, "ref", /*#__PURE__*/(0, _react.createRef)());
37
37
 
@@ -121,7 +121,7 @@ class FileInput extends _react.Component {
121
121
  }), /*#__PURE__*/_react.default.createElement(_style.default, {
122
122
  id: "1746996489",
123
123
  dynamic: [_uiConstants.spacers.dp8, _uiConstants.spacers.dp4]
124
- }, ["input.__jsx-style-dynamic-selector{display:none;}", `.file-input.__jsx-style-dynamic-selector{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};padding-bottom:${_uiConstants.spacers.dp4};}`]));
124
+ }, ["input.__jsx-style-dynamic-selector{display:none;}", ".file-input.__jsx-style-dynamic-selector{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:".concat(_uiConstants.spacers.dp8, ";padding-bottom:").concat(_uiConstants.spacers.dp4, ";}")]));
125
125
  }
126
126
 
127
127
  }
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Statuses = exports.Sizes = exports.Disabled = exports.Multiple = exports.Default = exports.default = void 0;
6
+ exports.default = exports.Statuses = exports.Sizes = exports.Multiple = exports.Disabled = exports.Default = void 0;
7
7
 
8
8
  var _uiConstants = require("@dhis2/ui-constants");
9
9
 
@@ -15,14 +15,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
15
15
 
16
16
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
17
 
18
- const subtitle = `The file input component allows users to select and upload files from their local machine.`;
19
- const description = `
20
- Use a file input component in forms and interfaces wherever a user needs to be able to select and upload a file from their local machine.
21
-
22
- \`\`\`js
23
- import { FileInput } from '@dhis2/ui'
24
- \`\`\`
25
- `;
18
+ const subtitle = "The file input component allows users to select and upload files from their local machine.";
19
+ const description = "\nUse a file input component in forms and interfaces wherever a user needs to be able to select and upload a file from their local machine.\n\n```js\nimport { FileInput } from '@dhis2/ui'\n```\n";
26
20
 
27
21
  const onChange = (payload, event) => {
28
22
  console.log('onChange payload', payload);
@@ -39,7 +33,7 @@ const {
39
33
  statusArgType
40
34
  } = _uiConstants.sharedPropTypes;
41
35
  var _default = {
42
- title: 'Forms/File Input/File Input',
36
+ title: 'File Input',
43
37
  component: _index.FileInput,
44
38
  // Default args for each story unless overridden
45
39
  args: {
@@ -30,60 +30,63 @@ const translate = (prop, interpolationObject) => {
30
30
  return prop;
31
31
  };
32
32
 
33
- const FileInputField = ({
34
- accept,
35
- buttonLabel,
36
- children,
37
- className,
38
- dataTest,
39
- disabled,
40
- error,
41
- helpText,
42
- initialFocus,
43
- label,
44
- large,
45
- multiple,
46
- name,
47
- onBlur,
48
- onChange,
49
- onFocus,
50
- placeholder,
51
- required,
52
- small,
53
- tabIndex,
54
- valid,
55
- validationText,
56
- warning
57
- }) => /*#__PURE__*/_react.default.createElement(_field.Field, {
58
- className: className,
59
- dataTest: dataTest,
60
- helpText: helpText,
61
- validationText: validationText,
62
- error: error,
63
- warning: warning,
64
- valid: valid
65
- }, label && /*#__PURE__*/_react.default.createElement(_label.Label, {
66
- required: required,
67
- disabled: disabled,
68
- htmlFor: name
69
- }, label), /*#__PURE__*/_react.default.createElement(_index.FileInput, {
70
- accept: accept,
71
- buttonLabel: translate(buttonLabel),
72
- className: className,
73
- disabled: disabled,
74
- error: error,
75
- initialFocus: initialFocus,
76
- large: large,
77
- multiple: multiple,
78
- name: name,
79
- onBlur: onBlur,
80
- onChange: onChange,
81
- onFocus: onFocus,
82
- small: small,
83
- tabIndex: tabIndex,
84
- valid: valid,
85
- warning: warning
86
- }), /*#__PURE__*/_react.default.createElement(_index.FileList, null, children ? children : /*#__PURE__*/_react.default.createElement(_index.FileListPlaceholder, null, translate(placeholder))));
33
+ const FileInputField = _ref => {
34
+ let {
35
+ accept,
36
+ buttonLabel,
37
+ children,
38
+ className,
39
+ dataTest,
40
+ disabled,
41
+ error,
42
+ helpText,
43
+ initialFocus,
44
+ label,
45
+ large,
46
+ multiple,
47
+ name,
48
+ onBlur,
49
+ onChange,
50
+ onFocus,
51
+ placeholder,
52
+ required,
53
+ small,
54
+ tabIndex,
55
+ valid,
56
+ validationText,
57
+ warning
58
+ } = _ref;
59
+ return /*#__PURE__*/_react.default.createElement(_field.Field, {
60
+ className: className,
61
+ dataTest: dataTest,
62
+ helpText: helpText,
63
+ validationText: validationText,
64
+ error: error,
65
+ warning: warning,
66
+ valid: valid
67
+ }, label && /*#__PURE__*/_react.default.createElement(_label.Label, {
68
+ required: required,
69
+ disabled: disabled,
70
+ htmlFor: name
71
+ }, label), /*#__PURE__*/_react.default.createElement(_index.FileInput, {
72
+ accept: accept,
73
+ buttonLabel: translate(buttonLabel),
74
+ className: className,
75
+ disabled: disabled,
76
+ error: error,
77
+ initialFocus: initialFocus,
78
+ large: large,
79
+ multiple: multiple,
80
+ name: name,
81
+ onBlur: onBlur,
82
+ onChange: onChange,
83
+ onFocus: onFocus,
84
+ small: small,
85
+ tabIndex: tabIndex,
86
+ valid: valid,
87
+ warning: warning
88
+ }), /*#__PURE__*/_react.default.createElement(_index.FileList, null, children ? children : /*#__PURE__*/_react.default.createElement(_index.FileListPlaceholder, null, translate(placeholder))));
89
+ };
87
90
 
88
91
  exports.FileInputField = FileInputField;
89
92
  FileInputField.defaultProps = {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.DefaultButtonLabelAndPlaceholder = exports.DesignSystemStackingOrderEmptyFileList = exports.DesignSystemStackingOrder = exports.HelpText = exports.PlaceholderText = exports.FileList = exports.Statuses = exports.Sizes = exports.Disabled = exports.Multiple = exports.Required = exports.WithLabel = exports.Default = exports.default = void 0;
6
+ exports.default = exports.WithLabel = exports.Statuses = exports.Sizes = exports.Required = exports.PlaceholderText = exports.Multiple = exports.HelpText = exports.FileList = exports.Disabled = exports.DesignSystemStackingOrderEmptyFileList = exports.DesignSystemStackingOrder = exports.DefaultButtonLabelAndPlaceholder = exports.Default = void 0;
7
7
 
8
8
  var _uiConstants = require("@dhis2/ui-constants");
9
9
 
@@ -17,13 +17,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
17
17
 
18
18
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
19
19
 
20
- const description = `
21
- The \`FileInputField\` component wraps the \`FileInput\` component in a \`Field\` wrapper to add labels, help text, and validation text.
22
-
23
- \`\`\`js
24
- import { FileInputField, FileListItem } from '@dhis2/ui'
25
- \`\`\`
26
- `;
20
+ const description = "\nThe `FileInputField` component wraps the `FileInput` component in a `Field` wrapper to add labels, help text, and validation text.\n\n```js\nimport { FileInputField, FileListItem } from '@dhis2/ui'\n```\n";
27
21
 
28
22
  const onChange = obj => console.log('onChange', obj);
29
23
 
@@ -32,7 +26,7 @@ const onRemove = () => console.log('onRemove');
32
26
  const onCancel = () => console.log('onCancel');
33
27
 
34
28
  var _default = {
35
- title: 'Forms/File Input/File Input Field',
29
+ title: 'File Input Field',
36
30
  component: _fileInputField.FileInputField,
37
31
  parameters: {
38
32
  docs: {
@@ -35,12 +35,13 @@ const translate = (prop, interpolationObject) => {
35
35
  };
36
36
 
37
37
  class FileInputFieldWithList extends _react.Component {
38
- constructor(...args) {
39
- super(...args);
38
+ constructor() {
39
+ super(...arguments);
40
40
 
41
- _defineProperty(this, "handleChange", ({
42
- files: fileList
43
- }, event) => {
41
+ _defineProperty(this, "handleChange", (_ref, event) => {
42
+ let {
43
+ files: fileList
44
+ } = _ref;
44
45
  const {
45
46
  onChange,
46
47
  name
@@ -51,9 +52,10 @@ class FileInputFieldWithList extends _react.Component {
51
52
  }, event);
52
53
  });
53
54
 
54
- _defineProperty(this, "handleRemove", ({
55
- file: fileToRemove
56
- }, event) => {
55
+ _defineProperty(this, "handleRemove", (_ref2, event) => {
56
+ let {
57
+ file: fileToRemove
58
+ } = _ref2;
57
59
  const {
58
60
  files,
59
61
  onChange,
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.DefaultPlaceholder = exports.DefaultButtonLabelAndRemoveText = exports.Default = exports.default = void 0;
6
+ exports.default = exports.DefaultPlaceholder = exports.DefaultButtonLabelAndRemoveText = exports.Default = void 0;
7
7
 
8
8
  var _uiConstants = require("@dhis2/ui-constants");
9
9
 
@@ -13,23 +13,18 @@ var _fileInputFieldWithList = require("./file-input-field-with-list.js");
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
 
16
- const description = `
17
- A FileInputField with logic for creating a dynamic list of removable files from an array of \`File\` objects.
16
+ const description = "\nA FileInputField with logic for creating a dynamic list of removable files from an array of `File` objects.\n\n```js\nimport { FileInputFieldWithList } from '@dhis2/ui'\n```\n";
17
+ const files = new Array(10).fill('dummy-file-name').map((name, i) => new File([], "".concat(name, "-").concat(i + 1, ".txt")));
18
18
 
19
- \`\`\`js
20
- import { FileInputFieldWithList } from '@dhis2/ui'
21
- \`\`\`
22
- `;
23
- const files = new Array(10).fill('dummy-file-name').map((name, i) => new File([], `${name}-${i + 1}.txt`));
24
-
25
- const onChange = ({
26
- files
27
- }) => {
19
+ const onChange = _ref => {
20
+ let {
21
+ files
22
+ } = _ref;
28
23
  console.log('files: ', files);
29
24
  };
30
25
 
31
26
  var _default = {
32
- title: 'Forms/File Input/File Input Field With List',
27
+ title: 'File Input Field With List',
33
28
  component: _fileInputFieldWithList.FileInputFieldWithList,
34
29
  parameters: {
35
30
  docs: {
@@ -20,8 +20,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
20
20
  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; }
21
21
 
22
22
  class FileListItemWithRemove extends _react.Component {
23
- constructor(...args) {
24
- super(...args);
23
+ constructor() {
24
+ super(...arguments);
25
25
 
26
26
  _defineProperty(this, "handleRemove", event => {
27
27
  const {
@@ -21,40 +21,43 @@ var _react = _interopRequireDefault(require("react"));
21
21
 
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
23
 
24
- const FileListItem = ({
25
- className,
26
- label,
27
- onRemove,
28
- removeText,
29
- loading,
30
- onCancel,
31
- cancelText,
32
- dataTest
33
- }) => /*#__PURE__*/_react.default.createElement("p", {
34
- "data-test": dataTest,
35
- className: _style.default.dynamic([["3793849083", [_uiConstants.spacers.dp4, _uiConstants.colors.grey900, _uiConstants.colors.grey700, _uiConstants.colors.red700, _uiConstants.colors.red800, _uiConstants.theme.focus]]]) + " " + ((0, _classnames.default)('selected-file', className) || "")
36
- }, /*#__PURE__*/_react.default.createElement("span", {
37
- className: _style.default.dynamic([["3793849083", [_uiConstants.spacers.dp4, _uiConstants.colors.grey900, _uiConstants.colors.grey700, _uiConstants.colors.red700, _uiConstants.colors.red800, _uiConstants.theme.focus]]]) + " " + "icon"
38
- }, loading ? /*#__PURE__*/_react.default.createElement(_loader.CircularLoader, {
39
- extrasmall: true
40
- }) : /*#__PURE__*/_react.default.createElement(_uiIcons.IconAttachment16, {
41
- color: _uiConstants.colors.grey700
42
- })), /*#__PURE__*/_react.default.createElement("span", {
43
- className: _style.default.dynamic([["3793849083", [_uiConstants.spacers.dp4, _uiConstants.colors.grey900, _uiConstants.colors.grey700, _uiConstants.colors.red700, _uiConstants.colors.red800, _uiConstants.theme.focus]]]) + " " + "text"
44
- }, /*#__PURE__*/_react.default.createElement("span", {
45
- className: _style.default.dynamic([["3793849083", [_uiConstants.spacers.dp4, _uiConstants.colors.grey900, _uiConstants.colors.grey700, _uiConstants.colors.red700, _uiConstants.colors.red800, _uiConstants.theme.focus]]]) + " " + "label"
46
- }, label), loading && onCancel && cancelText && /*#__PURE__*/_react.default.createElement("span", {
47
- onClick: event => onCancel({}, event),
48
- "data-test": `${dataTest}-cancel`,
49
- className: _style.default.dynamic([["3793849083", [_uiConstants.spacers.dp4, _uiConstants.colors.grey900, _uiConstants.colors.grey700, _uiConstants.colors.red700, _uiConstants.colors.red800, _uiConstants.theme.focus]]]) + " " + "action"
50
- }, cancelText), !loading && /*#__PURE__*/_react.default.createElement("span", {
51
- onClick: event => onRemove({}, event),
52
- "data-test": `${dataTest}-remove`,
53
- className: _style.default.dynamic([["3793849083", [_uiConstants.spacers.dp4, _uiConstants.colors.grey900, _uiConstants.colors.grey700, _uiConstants.colors.red700, _uiConstants.colors.red800, _uiConstants.theme.focus]]]) + " " + "action"
54
- }, removeText)), /*#__PURE__*/_react.default.createElement(_style.default, {
55
- id: "3793849083",
56
- dynamic: [_uiConstants.spacers.dp4, _uiConstants.colors.grey900, _uiConstants.colors.grey700, _uiConstants.colors.red700, _uiConstants.colors.red800, _uiConstants.theme.focus]
57
- }, [`p.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin:0;padding-top:${_uiConstants.spacers.dp4};}`, ".icon.__jsx-style-dynamic-selector{margin-right:4px;-webkit-box-flex:0;-webkit-flex-grow:0;-ms-flex-positive:0;flex-grow:0;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding-top:1px;}", ".text.__jsx-style-dynamic-selector{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1;}", `.label.__jsx-style-dynamic-selector{font-size:14px;color:${_uiConstants.colors.grey900};word-break:break-all;}`, ".label.__jsx-style-dynamic-selector::after{content:' ';display:inline-block;width:12px;}", `.action.__jsx-style-dynamic-selector{font-size:12px;line-height:12px;margin-top:0;-webkit-text-decoration:underline;text-decoration:underline;cursor:pointer;color:${_uiConstants.colors.grey700};}`, `.action.__jsx-style-dynamic-selector:hover{color:${_uiConstants.colors.red700};}`, `.action.__jsx-style-dynamic-selector:active{color:${_uiConstants.colors.red800};}`, `.action.__jsx-style-dynamic-selector:focus{outline:3px solid ${_uiConstants.theme.focus};outline-offset:2px;}`]));
24
+ const FileListItem = _ref => {
25
+ let {
26
+ className,
27
+ label,
28
+ onRemove,
29
+ removeText,
30
+ loading,
31
+ onCancel,
32
+ cancelText,
33
+ dataTest
34
+ } = _ref;
35
+ return /*#__PURE__*/_react.default.createElement("p", {
36
+ "data-test": dataTest,
37
+ className: _style.default.dynamic([["3793849083", [_uiConstants.spacers.dp4, _uiConstants.colors.grey900, _uiConstants.colors.grey700, _uiConstants.colors.red700, _uiConstants.colors.red800, _uiConstants.theme.focus]]]) + " " + ((0, _classnames.default)('selected-file', className) || "")
38
+ }, /*#__PURE__*/_react.default.createElement("span", {
39
+ className: _style.default.dynamic([["3793849083", [_uiConstants.spacers.dp4, _uiConstants.colors.grey900, _uiConstants.colors.grey700, _uiConstants.colors.red700, _uiConstants.colors.red800, _uiConstants.theme.focus]]]) + " " + "icon"
40
+ }, loading ? /*#__PURE__*/_react.default.createElement(_loader.CircularLoader, {
41
+ extrasmall: true
42
+ }) : /*#__PURE__*/_react.default.createElement(_uiIcons.IconAttachment16, {
43
+ color: _uiConstants.colors.grey700
44
+ })), /*#__PURE__*/_react.default.createElement("span", {
45
+ className: _style.default.dynamic([["3793849083", [_uiConstants.spacers.dp4, _uiConstants.colors.grey900, _uiConstants.colors.grey700, _uiConstants.colors.red700, _uiConstants.colors.red800, _uiConstants.theme.focus]]]) + " " + "text"
46
+ }, /*#__PURE__*/_react.default.createElement("span", {
47
+ className: _style.default.dynamic([["3793849083", [_uiConstants.spacers.dp4, _uiConstants.colors.grey900, _uiConstants.colors.grey700, _uiConstants.colors.red700, _uiConstants.colors.red800, _uiConstants.theme.focus]]]) + " " + "label"
48
+ }, label), loading && onCancel && cancelText && /*#__PURE__*/_react.default.createElement("span", {
49
+ onClick: event => onCancel({}, event),
50
+ "data-test": "".concat(dataTest, "-cancel"),
51
+ className: _style.default.dynamic([["3793849083", [_uiConstants.spacers.dp4, _uiConstants.colors.grey900, _uiConstants.colors.grey700, _uiConstants.colors.red700, _uiConstants.colors.red800, _uiConstants.theme.focus]]]) + " " + "action"
52
+ }, cancelText), !loading && /*#__PURE__*/_react.default.createElement("span", {
53
+ onClick: event => onRemove({}, event),
54
+ "data-test": "".concat(dataTest, "-remove"),
55
+ className: _style.default.dynamic([["3793849083", [_uiConstants.spacers.dp4, _uiConstants.colors.grey900, _uiConstants.colors.grey700, _uiConstants.colors.red700, _uiConstants.colors.red800, _uiConstants.theme.focus]]]) + " " + "action"
56
+ }, removeText)), /*#__PURE__*/_react.default.createElement(_style.default, {
57
+ id: "3793849083",
58
+ dynamic: [_uiConstants.spacers.dp4, _uiConstants.colors.grey900, _uiConstants.colors.grey700, _uiConstants.colors.red700, _uiConstants.colors.red800, _uiConstants.theme.focus]
59
+ }, ["p.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin:0;padding-top:".concat(_uiConstants.spacers.dp4, ";}"), ".icon.__jsx-style-dynamic-selector{margin-right:4px;-webkit-box-flex:0;-webkit-flex-grow:0;-ms-flex-positive:0;flex-grow:0;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding-top:1px;}", ".text.__jsx-style-dynamic-selector{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1;}", ".label.__jsx-style-dynamic-selector{font-size:14px;color:".concat(_uiConstants.colors.grey900, ";word-break:break-all;}"), ".label.__jsx-style-dynamic-selector::after{content:' ';display:inline-block;width:12px;}", ".action.__jsx-style-dynamic-selector{font-size:12px;line-height:12px;margin-top:0;-webkit-text-decoration:underline;text-decoration:underline;cursor:pointer;color:".concat(_uiConstants.colors.grey700, ";}"), ".action.__jsx-style-dynamic-selector:hover{color:".concat(_uiConstants.colors.red700, ";}"), ".action.__jsx-style-dynamic-selector:active{color:".concat(_uiConstants.colors.red800, ";}"), ".action.__jsx-style-dynamic-selector:focus{outline:3px solid ".concat(_uiConstants.theme.focus, ";outline-offset:2px;}")]));
60
+ };
58
61
 
59
62
  exports.FileListItem = FileListItem;
60
63
  FileListItem.defaultProps = {
@@ -15,16 +15,19 @@ var _react = _interopRequireDefault(require("react"));
15
15
 
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
17
 
18
- const FileListPlaceholder = ({
19
- children,
20
- dataTest
21
- }) => /*#__PURE__*/_react.default.createElement("p", {
22
- "data-test": dataTest,
23
- className: _style.default.dynamic([["1287857385", [_uiConstants.spacers.dp4, _uiConstants.colors.grey700]]])
24
- }, children, /*#__PURE__*/_react.default.createElement(_style.default, {
25
- id: "1287857385",
26
- dynamic: [_uiConstants.spacers.dp4, _uiConstants.colors.grey700]
27
- }, [`p.__jsx-style-dynamic-selector{margin:0;padding-top:${_uiConstants.spacers.dp4};font-size:14px;color:${_uiConstants.colors.grey700};}`]));
18
+ const FileListPlaceholder = _ref => {
19
+ let {
20
+ children,
21
+ dataTest
22
+ } = _ref;
23
+ return /*#__PURE__*/_react.default.createElement("p", {
24
+ "data-test": dataTest,
25
+ className: _style.default.dynamic([["1287857385", [_uiConstants.spacers.dp4, _uiConstants.colors.grey700]]])
26
+ }, children, /*#__PURE__*/_react.default.createElement(_style.default, {
27
+ id: "1287857385",
28
+ dynamic: [_uiConstants.spacers.dp4, _uiConstants.colors.grey700]
29
+ }, ["p.__jsx-style-dynamic-selector{margin:0;padding-top:".concat(_uiConstants.spacers.dp4, ";font-size:14px;color:").concat(_uiConstants.colors.grey700, ";}")]));
30
+ };
28
31
 
29
32
  exports.FileListPlaceholder = FileListPlaceholder;
30
33
  FileListPlaceholder.defaultProps = {
@@ -13,16 +13,19 @@ var _react = _interopRequireDefault(require("react"));
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
 
16
- const FileList = ({
17
- children,
18
- className,
19
- dataTest
20
- }) => /*#__PURE__*/_react.default.createElement("div", {
21
- "data-test": dataTest,
22
- className: "jsx-2770071620" + " " + (className || "")
23
- }, children, /*#__PURE__*/_react.default.createElement(_style.default, {
24
- id: "2770071620"
25
- }, ["div.jsx-2770071620{padding-top:4px;}", ".file-input+div.jsx-2770071620{padding-top:0;}"]));
16
+ const FileList = _ref => {
17
+ let {
18
+ children,
19
+ className,
20
+ dataTest
21
+ } = _ref;
22
+ return /*#__PURE__*/_react.default.createElement("div", {
23
+ "data-test": dataTest,
24
+ className: "jsx-2770071620" + " " + (className || "")
25
+ }, children, /*#__PURE__*/_react.default.createElement(_style.default, {
26
+ id: "2770071620"
27
+ }, ["div.jsx-2770071620{padding-top:4px;}", ".file-input+div.jsx-2770071620{padding-top:0;}"]));
28
+ };
26
29
 
27
30
  exports.FileList = FileList;
28
31
  FileList.defaultProps = {
@@ -9,34 +9,34 @@ Object.defineProperty(exports, "FileInput", {
9
9
  return _index.FileInput;
10
10
  }
11
11
  });
12
- Object.defineProperty(exports, "FileList", {
12
+ Object.defineProperty(exports, "FileInputField", {
13
13
  enumerable: true,
14
14
  get: function () {
15
- return _index2.FileList;
15
+ return _index3.FileInputField;
16
16
  }
17
17
  });
18
- Object.defineProperty(exports, "FileListItem", {
18
+ Object.defineProperty(exports, "FileInputFieldWithList", {
19
19
  enumerable: true,
20
20
  get: function () {
21
- return _index2.FileListItem;
21
+ return _index4.FileInputFieldWithList;
22
22
  }
23
23
  });
24
- Object.defineProperty(exports, "FileListPlaceholder", {
24
+ Object.defineProperty(exports, "FileList", {
25
25
  enumerable: true,
26
26
  get: function () {
27
- return _index2.FileListPlaceholder;
27
+ return _index2.FileList;
28
28
  }
29
29
  });
30
- Object.defineProperty(exports, "FileInputField", {
30
+ Object.defineProperty(exports, "FileListItem", {
31
31
  enumerable: true,
32
32
  get: function () {
33
- return _index3.FileInputField;
33
+ return _index2.FileListItem;
34
34
  }
35
35
  });
36
- Object.defineProperty(exports, "FileInputFieldWithList", {
36
+ Object.defineProperty(exports, "FileListPlaceholder", {
37
37
  enumerable: true,
38
38
  get: function () {
39
- return _index4.FileInputFieldWithList;
39
+ return _index2.FileListPlaceholder;
40
40
  }
41
41
  });
42
42
 
@@ -11,8 +11,8 @@ import PropTypes from 'prop-types';
11
11
  import React, { createRef, Component } from 'react';
12
12
 
13
13
  class FileInput extends Component {
14
- constructor(...args) {
15
- super(...args);
14
+ constructor() {
15
+ super(...arguments);
16
16
 
17
17
  _defineProperty(this, "ref", /*#__PURE__*/createRef());
18
18
 
@@ -102,7 +102,7 @@ class FileInput extends Component {
102
102
  }), /*#__PURE__*/React.createElement(_JSXStyle, {
103
103
  id: "1746996489",
104
104
  dynamic: [spacers.dp8, spacers.dp4]
105
- }, ["input.__jsx-style-dynamic-selector{display:none;}", `.file-input.__jsx-style-dynamic-selector{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};padding-bottom:${spacers.dp4};}`]));
105
+ }, ["input.__jsx-style-dynamic-selector{display:none;}", ".file-input.__jsx-style-dynamic-selector{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:".concat(spacers.dp8, ";padding-bottom:").concat(spacers.dp4, ";}")]));
106
106
  }
107
107
 
108
108
  }
@@ -3,14 +3,8 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
3
3
  import { sharedPropTypes } from '@dhis2/ui-constants';
4
4
  import React from 'react';
5
5
  import { FileInput } from './index.js';
6
- const subtitle = `The file input component allows users to select and upload files from their local machine.`;
7
- const description = `
8
- Use a file input component in forms and interfaces wherever a user needs to be able to select and upload a file from their local machine.
9
-
10
- \`\`\`js
11
- import { FileInput } from '@dhis2/ui'
12
- \`\`\`
13
- `;
6
+ const subtitle = "The file input component allows users to select and upload files from their local machine.";
7
+ const description = "\nUse a file input component in forms and interfaces wherever a user needs to be able to select and upload a file from their local machine.\n\n```js\nimport { FileInput } from '@dhis2/ui'\n```\n";
14
8
 
15
9
  const onChange = (payload, event) => {
16
10
  console.log('onChange payload', payload);
@@ -27,7 +21,7 @@ const {
27
21
  statusArgType
28
22
  } = sharedPropTypes;
29
23
  export default {
30
- title: 'Forms/File Input/File Input',
24
+ title: 'File Input',
31
25
  component: FileInput,
32
26
  // Default args for each story unless overridden
33
27
  args: {
@@ -14,60 +14,63 @@ const translate = (prop, interpolationObject) => {
14
14
  return prop;
15
15
  };
16
16
 
17
- const FileInputField = ({
18
- accept,
19
- buttonLabel,
20
- children,
21
- className,
22
- dataTest,
23
- disabled,
24
- error,
25
- helpText,
26
- initialFocus,
27
- label,
28
- large,
29
- multiple,
30
- name,
31
- onBlur,
32
- onChange,
33
- onFocus,
34
- placeholder,
35
- required,
36
- small,
37
- tabIndex,
38
- valid,
39
- validationText,
40
- warning
41
- }) => /*#__PURE__*/React.createElement(Field, {
42
- className: className,
43
- dataTest: dataTest,
44
- helpText: helpText,
45
- validationText: validationText,
46
- error: error,
47
- warning: warning,
48
- valid: valid
49
- }, label && /*#__PURE__*/React.createElement(Label, {
50
- required: required,
51
- disabled: disabled,
52
- htmlFor: name
53
- }, label), /*#__PURE__*/React.createElement(FileInput, {
54
- accept: accept,
55
- buttonLabel: translate(buttonLabel),
56
- className: className,
57
- disabled: disabled,
58
- error: error,
59
- initialFocus: initialFocus,
60
- large: large,
61
- multiple: multiple,
62
- name: name,
63
- onBlur: onBlur,
64
- onChange: onChange,
65
- onFocus: onFocus,
66
- small: small,
67
- tabIndex: tabIndex,
68
- valid: valid,
69
- warning: warning
70
- }), /*#__PURE__*/React.createElement(FileList, null, children ? children : /*#__PURE__*/React.createElement(FileListPlaceholder, null, translate(placeholder))));
17
+ const FileInputField = _ref => {
18
+ let {
19
+ accept,
20
+ buttonLabel,
21
+ children,
22
+ className,
23
+ dataTest,
24
+ disabled,
25
+ error,
26
+ helpText,
27
+ initialFocus,
28
+ label,
29
+ large,
30
+ multiple,
31
+ name,
32
+ onBlur,
33
+ onChange,
34
+ onFocus,
35
+ placeholder,
36
+ required,
37
+ small,
38
+ tabIndex,
39
+ valid,
40
+ validationText,
41
+ warning
42
+ } = _ref;
43
+ return /*#__PURE__*/React.createElement(Field, {
44
+ className: className,
45
+ dataTest: dataTest,
46
+ helpText: helpText,
47
+ validationText: validationText,
48
+ error: error,
49
+ warning: warning,
50
+ valid: valid
51
+ }, label && /*#__PURE__*/React.createElement(Label, {
52
+ required: required,
53
+ disabled: disabled,
54
+ htmlFor: name
55
+ }, label), /*#__PURE__*/React.createElement(FileInput, {
56
+ accept: accept,
57
+ buttonLabel: translate(buttonLabel),
58
+ className: className,
59
+ disabled: disabled,
60
+ error: error,
61
+ initialFocus: initialFocus,
62
+ large: large,
63
+ multiple: multiple,
64
+ name: name,
65
+ onBlur: onBlur,
66
+ onChange: onChange,
67
+ onFocus: onFocus,
68
+ small: small,
69
+ tabIndex: tabIndex,
70
+ valid: valid,
71
+ warning: warning
72
+ }), /*#__PURE__*/React.createElement(FileList, null, children ? children : /*#__PURE__*/React.createElement(FileListPlaceholder, null, translate(placeholder))));
73
+ };
71
74
 
72
75
  FileInputField.defaultProps = {
73
76
  accept: '*',
@@ -4,13 +4,7 @@ import { sharedPropTypes } from '@dhis2/ui-constants';
4
4
  import React from 'react';
5
5
  import { FileListItem } from '../index.js';
6
6
  import { FileInputField } from './file-input-field.js';
7
- const description = `
8
- The \`FileInputField\` component wraps the \`FileInput\` component in a \`Field\` wrapper to add labels, help text, and validation text.
9
-
10
- \`\`\`js
11
- import { FileInputField, FileListItem } from '@dhis2/ui'
12
- \`\`\`
13
- `;
7
+ const description = "\nThe `FileInputField` component wraps the `FileInput` component in a `Field` wrapper to add labels, help text, and validation text.\n\n```js\nimport { FileInputField, FileListItem } from '@dhis2/ui'\n```\n";
14
8
 
15
9
  const onChange = obj => console.log('onChange', obj);
16
10
 
@@ -19,7 +13,7 @@ const onRemove = () => console.log('onRemove');
19
13
  const onCancel = () => console.log('onCancel');
20
14
 
21
15
  export default {
22
- title: 'Forms/File Input/File Input Field',
16
+ title: 'File Input Field',
23
17
  component: FileInputField,
24
18
  parameters: {
25
19
  docs: {
@@ -16,12 +16,13 @@ const translate = (prop, interpolationObject) => {
16
16
  };
17
17
 
18
18
  class FileInputFieldWithList extends Component {
19
- constructor(...args) {
20
- super(...args);
19
+ constructor() {
20
+ super(...arguments);
21
21
 
22
- _defineProperty(this, "handleChange", ({
23
- files: fileList
24
- }, event) => {
22
+ _defineProperty(this, "handleChange", (_ref, event) => {
23
+ let {
24
+ files: fileList
25
+ } = _ref;
25
26
  const {
26
27
  onChange,
27
28
  name
@@ -32,9 +33,10 @@ class FileInputFieldWithList extends Component {
32
33
  }, event);
33
34
  });
34
35
 
35
- _defineProperty(this, "handleRemove", ({
36
- file: fileToRemove
37
- }, event) => {
36
+ _defineProperty(this, "handleRemove", (_ref2, event) => {
37
+ let {
38
+ file: fileToRemove
39
+ } = _ref2;
38
40
  const {
39
41
  files,
40
42
  onChange,
@@ -1,23 +1,18 @@
1
1
  import { sharedPropTypes } from '@dhis2/ui-constants';
2
2
  import React from 'react';
3
3
  import { FileInputFieldWithList } from './file-input-field-with-list.js';
4
- const description = `
5
- A FileInputField with logic for creating a dynamic list of removable files from an array of \`File\` objects.
4
+ const description = "\nA FileInputField with logic for creating a dynamic list of removable files from an array of `File` objects.\n\n```js\nimport { FileInputFieldWithList } from '@dhis2/ui'\n```\n";
5
+ const files = new Array(10).fill('dummy-file-name').map((name, i) => new File([], "".concat(name, "-").concat(i + 1, ".txt")));
6
6
 
7
- \`\`\`js
8
- import { FileInputFieldWithList } from '@dhis2/ui'
9
- \`\`\`
10
- `;
11
- const files = new Array(10).fill('dummy-file-name').map((name, i) => new File([], `${name}-${i + 1}.txt`));
12
-
13
- const onChange = ({
14
- files
15
- }) => {
7
+ const onChange = _ref => {
8
+ let {
9
+ files
10
+ } = _ref;
16
11
  console.log('files: ', files);
17
12
  };
18
13
 
19
14
  export default {
20
- title: 'Forms/File Input/File Input Field With List',
15
+ title: 'File Input Field With List',
21
16
  component: FileInputFieldWithList,
22
17
  parameters: {
23
18
  docs: {
@@ -5,8 +5,8 @@ import React, { Component } from 'react';
5
5
  import { FileListItem } from '../index.js';
6
6
 
7
7
  class FileListItemWithRemove extends Component {
8
- constructor(...args) {
9
- super(...args);
8
+ constructor() {
9
+ super(...arguments);
10
10
 
11
11
  _defineProperty(this, "handleRemove", event => {
12
12
  const {
@@ -6,40 +6,43 @@ import cx from 'classnames';
6
6
  import PropTypes from 'prop-types';
7
7
  import React from 'react';
8
8
 
9
- const FileListItem = ({
10
- className,
11
- label,
12
- onRemove,
13
- removeText,
14
- loading,
15
- onCancel,
16
- cancelText,
17
- dataTest
18
- }) => /*#__PURE__*/React.createElement("p", {
19
- "data-test": dataTest,
20
- className: _JSXStyle.dynamic([["3793849083", [spacers.dp4, colors.grey900, colors.grey700, colors.red700, colors.red800, theme.focus]]]) + " " + (cx('selected-file', className) || "")
21
- }, /*#__PURE__*/React.createElement("span", {
22
- className: _JSXStyle.dynamic([["3793849083", [spacers.dp4, colors.grey900, colors.grey700, colors.red700, colors.red800, theme.focus]]]) + " " + "icon"
23
- }, loading ? /*#__PURE__*/React.createElement(CircularLoader, {
24
- extrasmall: true
25
- }) : /*#__PURE__*/React.createElement(IconAttachment16, {
26
- color: colors.grey700
27
- })), /*#__PURE__*/React.createElement("span", {
28
- className: _JSXStyle.dynamic([["3793849083", [spacers.dp4, colors.grey900, colors.grey700, colors.red700, colors.red800, theme.focus]]]) + " " + "text"
29
- }, /*#__PURE__*/React.createElement("span", {
30
- className: _JSXStyle.dynamic([["3793849083", [spacers.dp4, colors.grey900, colors.grey700, colors.red700, colors.red800, theme.focus]]]) + " " + "label"
31
- }, label), loading && onCancel && cancelText && /*#__PURE__*/React.createElement("span", {
32
- onClick: event => onCancel({}, event),
33
- "data-test": `${dataTest}-cancel`,
34
- className: _JSXStyle.dynamic([["3793849083", [spacers.dp4, colors.grey900, colors.grey700, colors.red700, colors.red800, theme.focus]]]) + " " + "action"
35
- }, cancelText), !loading && /*#__PURE__*/React.createElement("span", {
36
- onClick: event => onRemove({}, event),
37
- "data-test": `${dataTest}-remove`,
38
- className: _JSXStyle.dynamic([["3793849083", [spacers.dp4, colors.grey900, colors.grey700, colors.red700, colors.red800, theme.focus]]]) + " " + "action"
39
- }, removeText)), /*#__PURE__*/React.createElement(_JSXStyle, {
40
- id: "3793849083",
41
- dynamic: [spacers.dp4, colors.grey900, colors.grey700, colors.red700, colors.red800, theme.focus]
42
- }, [`p.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin:0;padding-top:${spacers.dp4};}`, ".icon.__jsx-style-dynamic-selector{margin-right:4px;-webkit-box-flex:0;-webkit-flex-grow:0;-ms-flex-positive:0;flex-grow:0;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding-top:1px;}", ".text.__jsx-style-dynamic-selector{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1;}", `.label.__jsx-style-dynamic-selector{font-size:14px;color:${colors.grey900};word-break:break-all;}`, ".label.__jsx-style-dynamic-selector::after{content:' ';display:inline-block;width:12px;}", `.action.__jsx-style-dynamic-selector{font-size:12px;line-height:12px;margin-top:0;-webkit-text-decoration:underline;text-decoration:underline;cursor:pointer;color:${colors.grey700};}`, `.action.__jsx-style-dynamic-selector:hover{color:${colors.red700};}`, `.action.__jsx-style-dynamic-selector:active{color:${colors.red800};}`, `.action.__jsx-style-dynamic-selector:focus{outline:3px solid ${theme.focus};outline-offset:2px;}`]));
9
+ const FileListItem = _ref => {
10
+ let {
11
+ className,
12
+ label,
13
+ onRemove,
14
+ removeText,
15
+ loading,
16
+ onCancel,
17
+ cancelText,
18
+ dataTest
19
+ } = _ref;
20
+ return /*#__PURE__*/React.createElement("p", {
21
+ "data-test": dataTest,
22
+ className: _JSXStyle.dynamic([["3793849083", [spacers.dp4, colors.grey900, colors.grey700, colors.red700, colors.red800, theme.focus]]]) + " " + (cx('selected-file', className) || "")
23
+ }, /*#__PURE__*/React.createElement("span", {
24
+ className: _JSXStyle.dynamic([["3793849083", [spacers.dp4, colors.grey900, colors.grey700, colors.red700, colors.red800, theme.focus]]]) + " " + "icon"
25
+ }, loading ? /*#__PURE__*/React.createElement(CircularLoader, {
26
+ extrasmall: true
27
+ }) : /*#__PURE__*/React.createElement(IconAttachment16, {
28
+ color: colors.grey700
29
+ })), /*#__PURE__*/React.createElement("span", {
30
+ className: _JSXStyle.dynamic([["3793849083", [spacers.dp4, colors.grey900, colors.grey700, colors.red700, colors.red800, theme.focus]]]) + " " + "text"
31
+ }, /*#__PURE__*/React.createElement("span", {
32
+ className: _JSXStyle.dynamic([["3793849083", [spacers.dp4, colors.grey900, colors.grey700, colors.red700, colors.red800, theme.focus]]]) + " " + "label"
33
+ }, label), loading && onCancel && cancelText && /*#__PURE__*/React.createElement("span", {
34
+ onClick: event => onCancel({}, event),
35
+ "data-test": "".concat(dataTest, "-cancel"),
36
+ className: _JSXStyle.dynamic([["3793849083", [spacers.dp4, colors.grey900, colors.grey700, colors.red700, colors.red800, theme.focus]]]) + " " + "action"
37
+ }, cancelText), !loading && /*#__PURE__*/React.createElement("span", {
38
+ onClick: event => onRemove({}, event),
39
+ "data-test": "".concat(dataTest, "-remove"),
40
+ className: _JSXStyle.dynamic([["3793849083", [spacers.dp4, colors.grey900, colors.grey700, colors.red700, colors.red800, theme.focus]]]) + " " + "action"
41
+ }, removeText)), /*#__PURE__*/React.createElement(_JSXStyle, {
42
+ id: "3793849083",
43
+ dynamic: [spacers.dp4, colors.grey900, colors.grey700, colors.red700, colors.red800, theme.focus]
44
+ }, ["p.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin:0;padding-top:".concat(spacers.dp4, ";}"), ".icon.__jsx-style-dynamic-selector{margin-right:4px;-webkit-box-flex:0;-webkit-flex-grow:0;-ms-flex-positive:0;flex-grow:0;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding-top:1px;}", ".text.__jsx-style-dynamic-selector{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1;}", ".label.__jsx-style-dynamic-selector{font-size:14px;color:".concat(colors.grey900, ";word-break:break-all;}"), ".label.__jsx-style-dynamic-selector::after{content:' ';display:inline-block;width:12px;}", ".action.__jsx-style-dynamic-selector{font-size:12px;line-height:12px;margin-top:0;-webkit-text-decoration:underline;text-decoration:underline;cursor:pointer;color:".concat(colors.grey700, ";}"), ".action.__jsx-style-dynamic-selector:hover{color:".concat(colors.red700, ";}"), ".action.__jsx-style-dynamic-selector:active{color:".concat(colors.red800, ";}"), ".action.__jsx-style-dynamic-selector:focus{outline:3px solid ".concat(theme.focus, ";outline-offset:2px;}")]));
45
+ };
43
46
 
44
47
  FileListItem.defaultProps = {
45
48
  dataTest: 'dhis2-uicore-filelistitem'
@@ -3,16 +3,19 @@ import { colors, spacers } from '@dhis2/ui-constants';
3
3
  import PropTypes from 'prop-types';
4
4
  import React from 'react';
5
5
 
6
- const FileListPlaceholder = ({
7
- children,
8
- dataTest
9
- }) => /*#__PURE__*/React.createElement("p", {
10
- "data-test": dataTest,
11
- className: _JSXStyle.dynamic([["1287857385", [spacers.dp4, colors.grey700]]])
12
- }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
13
- id: "1287857385",
14
- dynamic: [spacers.dp4, colors.grey700]
15
- }, [`p.__jsx-style-dynamic-selector{margin:0;padding-top:${spacers.dp4};font-size:14px;color:${colors.grey700};}`]));
6
+ const FileListPlaceholder = _ref => {
7
+ let {
8
+ children,
9
+ dataTest
10
+ } = _ref;
11
+ return /*#__PURE__*/React.createElement("p", {
12
+ "data-test": dataTest,
13
+ className: _JSXStyle.dynamic([["1287857385", [spacers.dp4, colors.grey700]]])
14
+ }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
15
+ id: "1287857385",
16
+ dynamic: [spacers.dp4, colors.grey700]
17
+ }, ["p.__jsx-style-dynamic-selector{margin:0;padding-top:".concat(spacers.dp4, ";font-size:14px;color:").concat(colors.grey700, ";}")]));
18
+ };
16
19
 
17
20
  FileListPlaceholder.defaultProps = {
18
21
  dataTest: 'dhis2-uicore-filelistplaceholder'
@@ -2,16 +2,19 @@ import _JSXStyle from "styled-jsx/style";
2
2
  import PropTypes from 'prop-types';
3
3
  import React from 'react';
4
4
 
5
- const FileList = ({
6
- children,
7
- className,
8
- dataTest
9
- }) => /*#__PURE__*/React.createElement("div", {
10
- "data-test": dataTest,
11
- className: "jsx-2770071620" + " " + (className || "")
12
- }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
13
- id: "2770071620"
14
- }, ["div.jsx-2770071620{padding-top:4px;}", ".file-input+div.jsx-2770071620{padding-top:0;}"]));
5
+ const FileList = _ref => {
6
+ let {
7
+ children,
8
+ className,
9
+ dataTest
10
+ } = _ref;
11
+ return /*#__PURE__*/React.createElement("div", {
12
+ "data-test": dataTest,
13
+ className: "jsx-2770071620" + " " + (className || "")
14
+ }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
15
+ id: "2770071620"
16
+ }, ["div.jsx-2770071620{padding-top:4px;}", ".file-input+div.jsx-2770071620{padding-top:0;}"]));
17
+ };
15
18
 
16
19
  FileList.defaultProps = {
17
20
  dataTest: 'dhis2-uicore-filelist'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2-ui/file-input",
3
- "version": "8.2.0",
3
+ "version": "8.2.1",
4
4
  "description": "UI FileInput",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,13 +33,13 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@dhis2/prop-types": "^3.0.0-beta.1",
36
- "@dhis2-ui/button": "8.2.0",
37
- "@dhis2-ui/field": "8.2.0",
38
- "@dhis2-ui/label": "8.2.0",
39
- "@dhis2-ui/loader": "8.2.0",
40
- "@dhis2-ui/status-icon": "8.2.0",
41
- "@dhis2/ui-constants": "8.2.0",
42
- "@dhis2/ui-icons": "8.2.0",
36
+ "@dhis2-ui/button": "8.2.1",
37
+ "@dhis2-ui/field": "8.2.1",
38
+ "@dhis2-ui/label": "8.2.1",
39
+ "@dhis2-ui/loader": "8.2.1",
40
+ "@dhis2-ui/status-icon": "8.2.1",
41
+ "@dhis2/ui-constants": "8.2.1",
42
+ "@dhis2/ui-icons": "8.2.1",
43
43
  "classnames": "^2.3.1",
44
44
  "prop-types": "^15.7.2"
45
45
  },