@dreamcommerce/aurora 0.3.4-185 → 0.3.4-189

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.
@@ -15,7 +15,7 @@ var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
15
15
 
16
16
  var Radio = function (_a) {
17
17
  var _b;
18
- var id = _a.id, name = _a.name, value = _a.value, _c = _a.initiallyChecked, initiallyChecked = _c === void 0 ? false : _c, disabled = _a.disabled, onClick = _a.onClick;
18
+ var id = _a.id, name = _a.name, value = _a.value, checked = _a.checked, _c = _a.defaultChecked, defaultChecked = _c === void 0 ? false : _c, disabled = _a.disabled, onClick = _a.onClick;
19
19
  var radioClasses = classnames__default['default'](css_classes.radio, (_b = {},
20
20
  _b[css_classes.radioDisabled] = disabled,
21
21
  _b));
@@ -25,7 +25,7 @@ var Radio = function (_a) {
25
25
  }
26
26
  }
27
27
  return (React__default['default'].createElement("span", { className: classNames.classNames(radioClasses.split(' '), main_module['default']) },
28
- React__default['default'].createElement("input", { className: main_module['default'][css_classes.radioControl], id: id, name: name, type: "radio", value: value, defaultChecked: initiallyChecked, disabled: disabled, onClick: handleRadioChange }),
28
+ React__default['default'].createElement("input", { className: main_module['default'][css_classes.radioControl], id: id, name: name, type: "radio", value: value, checked: checked, defaultChecked: defaultChecked, disabled: disabled, onClick: handleRadioChange }),
29
29
  React__default['default'].createElement("label", { className: main_module['default'][css_classes.radioLabel], htmlFor: id })));
30
30
  };
31
31
 
@@ -24,11 +24,11 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
24
24
  * )
25
25
  */
26
26
  var ControlRadio = function (_a) {
27
- var id = _a.id, label = _a.label, hint = _a.hint, name = _a.name, value = _a.value, initiallyChecked = _a.initiallyChecked, disabled = _a.disabled, onClick = _a.onClick, errors = _a.errors;
27
+ var id = _a.id, label = _a.label, hint = _a.hint, name = _a.name, value = _a.value, defaultChecked = _a.defaultChecked, checked = _a.checked, disabled = _a.disabled, onClick = _a.onClick, errors = _a.errors;
28
28
  return (React__default['default'].createElement(index['default'], { errors: errors, name: name, id: id },
29
29
  React__default['default'].createElement(index['default'].Content, null,
30
30
  React__default['default'].createElement(index['default'].Element, { type: "radio" },
31
- React__default['default'].createElement(index['default'].Radio, { id: id, name: name, value: value, initiallyChecked: initiallyChecked, disabled: disabled, onClick: onClick }),
31
+ React__default['default'].createElement(index['default'].Radio, { id: id, name: name, value: value, defaultChecked: defaultChecked, checked: checked, disabled: disabled, onClick: onClick }),
32
32
  React__default['default'].createElement(index$1['default'], { htmlFor: id },
33
33
  label,
34
34
  " ",
@@ -12,14 +12,14 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
12
12
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
13
13
 
14
14
  var ControlRadioGroup = function (_a) {
15
- var id = _a.id, name = _a.name, onClick = _a.onClick, initiallyCheckedValue = _a.initiallyCheckedValue, label = _a.label, hint = _a.hint, options = _a.options, errors = _a.errors, isRequired = _a.isRequired;
15
+ var id = _a.id, name = _a.name, onClick = _a.onClick, checkedValue = _a.checkedValue, defaultCheckedValue = _a.defaultCheckedValue, label = _a.label, hint = _a.hint, options = _a.options, errors = _a.errors, isRequired = _a.isRequired;
16
16
  return (React__default['default'].createElement(index['default'], { errors: errors, name: name, id: id },
17
17
  (label || hint) && (React__default['default'].createElement(index['default'].Label, { id: id, isRequired: isRequired },
18
18
  label,
19
19
  hint && React__default['default'].createElement(index$1['default'], { spacingLeft: true, hint: hint }))),
20
- options.map(function (_a, optionIndex) {
20
+ options.map(function (_a) {
21
21
  var value = _a.value, label = _a.label, hint = _a.hint, disabled = _a.disabled;
22
- return (React__default['default'].createElement(index$2['default'], { key: "RadioGroup".concat(id, "-RadioElement-").concat(optionIndex), label: label, id: "RadioGroup".concat(id, "-Radio-").concat(optionIndex), value: value, hint: hint, disabled: disabled, name: name, initiallyChecked: value === initiallyCheckedValue, onClick: onClick }));
22
+ return (React__default['default'].createElement(index$2['default'], { key: "RadioGroup".concat(id, "-RadioElement-").concat(value), label: label, id: "RadioGroup".concat(id, "-Radio-").concat(value), value: value, hint: hint, disabled: disabled, name: name, defaultChecked: defaultCheckedValue ? defaultCheckedValue === value : undefined, checked: checkedValue ? checkedValue === value : undefined, onClick: onClick }));
23
23
  }),
24
24
  React__default['default'].createElement(index['default'].Errors, null)));
25
25
  };
@@ -6,13 +6,11 @@ var React = require('react');
6
6
 
7
7
  var useFilePicker = function (_a) {
8
8
  var onChange = _a.onChange, initialFile = _a.initialFile;
9
- var _b = React.useState(initialFile || null), file = _b[0], setFile = _b[1];
9
+ var _b = React.useState(initialFile), file = _b[0], setFile = _b[1];
10
10
  var _c = React.useState(false), isDragOver = _c[0], setDragOver = _c[1];
11
11
  var _d = React.useState(true), isPreview = _d[0], setPreview = _d[1];
12
12
  React.useEffect(function () {
13
- if (initialFile) {
14
- setFile(initialFile);
15
- }
13
+ setFile(initialFile);
16
14
  }, [initialFile]);
17
15
  var onDropFile = function (event) {
18
16
  event.stopPropagation();
@@ -33,7 +31,7 @@ var useFilePicker = function (_a) {
33
31
  });
34
32
  }
35
33
  else {
36
- setFile(null);
34
+ setFile(undefined);
37
35
  }
38
36
  setPreview(true);
39
37
  onChange === null || onChange === void 0 ? void 0 : onChange(files);
@@ -50,7 +48,7 @@ var useFilePicker = function (_a) {
50
48
  setDragOver(false);
51
49
  };
52
50
  var onFileDelete = function () {
53
- setFile(null);
51
+ setFile(undefined);
54
52
  setPreview(true);
55
53
  onChange === null || onChange === void 0 ? void 0 : onChange(null);
56
54
  };
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -6,7 +6,7 @@ import { classNames } from '../../../utilities/styles/classNames.js';
6
6
 
7
7
  var Radio = function (_a) {
8
8
  var _b;
9
- var id = _a.id, name = _a.name, value = _a.value, _c = _a.initiallyChecked, initiallyChecked = _c === void 0 ? false : _c, disabled = _a.disabled, onClick = _a.onClick;
9
+ var id = _a.id, name = _a.name, value = _a.value, checked = _a.checked, _c = _a.defaultChecked, defaultChecked = _c === void 0 ? false : _c, disabled = _a.disabled, onClick = _a.onClick;
10
10
  var radioClasses = classnames(radio, (_b = {},
11
11
  _b[radioDisabled] = disabled,
12
12
  _b));
@@ -16,7 +16,7 @@ var Radio = function (_a) {
16
16
  }
17
17
  }
18
18
  return (React.createElement("span", { className: classNames(radioClasses.split(' '), cssStyles) },
19
- React.createElement("input", { className: cssStyles[radioControl], id: id, name: name, type: "radio", value: value, defaultChecked: initiallyChecked, disabled: disabled, onClick: handleRadioChange }),
19
+ React.createElement("input", { className: cssStyles[radioControl], id: id, name: name, type: "radio", value: value, checked: checked, defaultChecked: defaultChecked, disabled: disabled, onClick: handleRadioChange }),
20
20
  React.createElement("label", { className: cssStyles[radioLabel], htmlFor: id })));
21
21
  };
22
22
 
@@ -16,11 +16,11 @@ import Hint from '../../../hint/index.js';
16
16
  * )
17
17
  */
18
18
  var ControlRadio = function (_a) {
19
- var id = _a.id, label = _a.label, hint = _a.hint, name = _a.name, value = _a.value, initiallyChecked = _a.initiallyChecked, disabled = _a.disabled, onClick = _a.onClick, errors = _a.errors;
19
+ var id = _a.id, label = _a.label, hint = _a.hint, name = _a.name, value = _a.value, defaultChecked = _a.defaultChecked, checked = _a.checked, disabled = _a.disabled, onClick = _a.onClick, errors = _a.errors;
20
20
  return (React.createElement(Control, { errors: errors, name: name, id: id },
21
21
  React.createElement(Control.Content, null,
22
22
  React.createElement(Control.Element, { type: "radio" },
23
- React.createElement(Control.Radio, { id: id, name: name, value: value, initiallyChecked: initiallyChecked, disabled: disabled, onClick: onClick }),
23
+ React.createElement(Control.Radio, { id: id, name: name, value: value, defaultChecked: defaultChecked, checked: checked, disabled: disabled, onClick: onClick }),
24
24
  React.createElement(Label, { htmlFor: id },
25
25
  label,
26
26
  " ",
@@ -4,14 +4,14 @@ import Hint from '../../../hint/index.js';
4
4
  import ControlRadio from '../control_radio/index.js';
5
5
 
6
6
  var ControlRadioGroup = function (_a) {
7
- var id = _a.id, name = _a.name, onClick = _a.onClick, initiallyCheckedValue = _a.initiallyCheckedValue, label = _a.label, hint = _a.hint, options = _a.options, errors = _a.errors, isRequired = _a.isRequired;
7
+ var id = _a.id, name = _a.name, onClick = _a.onClick, checkedValue = _a.checkedValue, defaultCheckedValue = _a.defaultCheckedValue, label = _a.label, hint = _a.hint, options = _a.options, errors = _a.errors, isRequired = _a.isRequired;
8
8
  return (React.createElement(Control, { errors: errors, name: name, id: id },
9
9
  (label || hint) && (React.createElement(Control.Label, { id: id, isRequired: isRequired },
10
10
  label,
11
11
  hint && React.createElement(Hint, { spacingLeft: true, hint: hint }))),
12
- options.map(function (_a, optionIndex) {
12
+ options.map(function (_a) {
13
13
  var value = _a.value, label = _a.label, hint = _a.hint, disabled = _a.disabled;
14
- return (React.createElement(ControlRadio, { key: "RadioGroup".concat(id, "-RadioElement-").concat(optionIndex), label: label, id: "RadioGroup".concat(id, "-Radio-").concat(optionIndex), value: value, hint: hint, disabled: disabled, name: name, initiallyChecked: value === initiallyCheckedValue, onClick: onClick }));
14
+ return (React.createElement(ControlRadio, { key: "RadioGroup".concat(id, "-RadioElement-").concat(value), label: label, id: "RadioGroup".concat(id, "-Radio-").concat(value), value: value, hint: hint, disabled: disabled, name: name, defaultChecked: defaultCheckedValue ? defaultCheckedValue === value : undefined, checked: checkedValue ? checkedValue === value : undefined, onClick: onClick }));
15
15
  }),
16
16
  React.createElement(Control.Errors, null)));
17
17
  };
@@ -95,7 +95,6 @@ export interface IControlCheckboxProps extends ICheckboxProps, IControlCommonPro
95
95
  }
96
96
  export interface IRadioProps extends InputHTMLAttributes<HTMLInputElement> {
97
97
  id: string;
98
- initiallyChecked?: boolean;
99
98
  onClick?(event: React.MouseEvent<HTMLInputElement>): void;
100
99
  }
101
100
  export interface IControlRadioProps extends IRadioProps, IControlCommonProps {
@@ -110,7 +109,8 @@ export interface IControlRadioGroupOption {
110
109
  export interface IControlRadioGroup extends IControlCommonProps {
111
110
  options: IControlRadioGroupOption[];
112
111
  onClick?(event: React.MouseEvent<HTMLInputElement>): void;
113
- initiallyCheckedValue?: string;
112
+ checkedValue?: string;
113
+ defaultCheckedValue?: string;
114
114
  id: string;
115
115
  name: string;
116
116
  label: string;
@@ -32,7 +32,7 @@ export interface IUseFilePicker {
32
32
  onFileChange: (event: ChangeEvent<HTMLInputElement>) => void;
33
33
  onFileDelete: () => void;
34
34
  onPreviewError: () => void;
35
- file: TFilePickerFile | null;
35
+ file: TFilePickerFile | undefined;
36
36
  isPreview: boolean;
37
37
  isDragOver: boolean;
38
38
  }
@@ -2,13 +2,11 @@ import { useState, useEffect } from 'react';
2
2
 
3
3
  var useFilePicker = function (_a) {
4
4
  var onChange = _a.onChange, initialFile = _a.initialFile;
5
- var _b = useState(initialFile || null), file = _b[0], setFile = _b[1];
5
+ var _b = useState(initialFile), file = _b[0], setFile = _b[1];
6
6
  var _c = useState(false), isDragOver = _c[0], setDragOver = _c[1];
7
7
  var _d = useState(true), isPreview = _d[0], setPreview = _d[1];
8
8
  useEffect(function () {
9
- if (initialFile) {
10
- setFile(initialFile);
11
- }
9
+ setFile(initialFile);
12
10
  }, [initialFile]);
13
11
  var onDropFile = function (event) {
14
12
  event.stopPropagation();
@@ -29,7 +27,7 @@ var useFilePicker = function (_a) {
29
27
  });
30
28
  }
31
29
  else {
32
- setFile(null);
30
+ setFile(undefined);
33
31
  }
34
32
  setPreview(true);
35
33
  onChange === null || onChange === void 0 ? void 0 : onChange(files);
@@ -46,7 +44,7 @@ var useFilePicker = function (_a) {
46
44
  setDragOver(false);
47
45
  };
48
46
  var onFileDelete = function () {
49
- setFile(null);
47
+ setFile(undefined);
50
48
  setPreview(true);
51
49
  onChange === null || onChange === void 0 ? void 0 : onChange(null);
52
50
  };
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@dreamcommerce/aurora",
3
3
  "packageManager": "yarn@3.1.1",
4
4
  "sideEffects": false,
5
- "version": "0.3.4-185",
5
+ "version": "0.3.4-189",
6
6
  "description": "aurora",
7
7
  "author": "k0ssak",
8
8
  "license": "MIT",