@mmb-digital/ds-lilly 0.0.1-alpha.326 → 0.0.1-alpha.327-NIB-4963c

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/ds-lilly.js CHANGED
@@ -104604,8 +104604,8 @@ var FileUpload_spreadArray = (undefined && undefined.__spreadArray) || function
104604
104604
 
104605
104605
 
104606
104606
  var FileUpload_FileUpload = function (_a) {
104607
- var accept = _a.accept, _b = _a.fileLimit, fileLimit = _b === void 0 ? 1 : _b, files = _a.files, _c = _a.hideImagePreview, hideImagePreview = _c === void 0 ? false : _c, maxSizeBytes = _a.maxSizeBytes, messages = _a.messages, minSizeBytes = _a.minSizeBytes, onDelete = _a.onDelete, onError = _a.onError, onSelectFile = _a.onSelectFile, onShow = _a.onShow, _d = _a.selectMultiple, selectMultiple = _d === void 0 ? false : _d, setFiles = _a.setFiles, theme = _a.theme, uploadProgress = _a.uploadProgress, _e = _a.withProgressBar, withProgressBar = _e === void 0 ? false : _e;
104608
- var _f = useDropzone({
104607
+ var accept = _a.accept, _b = _a.fileLimit, fileLimit = _b === void 0 ? 1 : _b, files = _a.files, _c = _a.hideImagePreview, hideImagePreview = _c === void 0 ? false : _c, _d = _a.hideTitle, hideTitle = _d === void 0 ? false : _d, maxSizeBytes = _a.maxSizeBytes, messages = _a.messages, minSizeBytes = _a.minSizeBytes, onDelete = _a.onDelete, onError = _a.onError, onSelectFile = _a.onSelectFile, onShow = _a.onShow, _e = _a.selectMultiple, selectMultiple = _e === void 0 ? false : _e, setFiles = _a.setFiles, theme = _a.theme, uploadProgress = _a.uploadProgress, _f = _a.withProgressBar, withProgressBar = _f === void 0 ? false : _f;
104608
+ var _g = useDropzone({
104609
104609
  getFilesFromEvent: function (event) { return applyFileLimit(event); },
104610
104610
  onDropRejected: function (files) {
104611
104611
  files.map(function (file) {
@@ -104644,7 +104644,7 @@ var FileUpload_FileUpload = function (_a) {
104644
104644
  multiple: selectMultiple,
104645
104645
  noClick: true,
104646
104646
  noKeyboard: true
104647
- }), getInputProps = _f.getInputProps, getRootProps = _f.getRootProps, isDragActive = _f.isDragActive, open = _f.open;
104647
+ }), getInputProps = _g.getInputProps, getRootProps = _g.getRootProps, isDragActive = _g.isDragActive, open = _g.open;
104648
104648
  function applyFileLimit(event) {
104649
104649
  return FileUpload_awaiter(this, void 0, void 0, function () {
104650
104650
  var tempFiles, rejected, fileList, i, file, filesWithoutError;
@@ -104677,17 +104677,26 @@ var FileUpload_FileUpload = function (_a) {
104677
104677
  var isUploadInProgress = uploadProgress &&
104678
104678
  Object.keys(uploadProgress).length !== 0 &&
104679
104679
  Object.keys(uploadProgress).find(function (key) { return uploadProgress[key] !== undefined; });
104680
+ var getTitle = function () {
104681
+ if (isDragActive) {
104682
+ return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('f-fileUpload__title') },
104683
+ messages.dragHere,
104684
+ external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('f-fileUpload__restrictions') })));
104685
+ }
104686
+ if (!hideTitle) {
104687
+ return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('f-fileUpload__title') },
104688
+ messages.move,
104689
+ external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Link, { isSmall: true, theme: "f-fileUpload__titleButton", onClick: open }, (files === null || files === void 0 ? void 0 : files.length) === 0 ? messages.select : messages.selectMore),
104690
+ external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('f-fileUpload__restrictions') }, messages.restriction)));
104691
+ }
104692
+ return null;
104693
+ };
104680
104694
  return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", FileUpload_assign({}, getRootProps(), { className: componentClassName }),
104681
104695
  ((withProgressBar && isUploadInProgress) || selectMultiple || files.length !== 1) && (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["Fragment"], null,
104682
104696
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("input", FileUpload_assign({}, getInputProps())),
104683
104697
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('f-fileUpload__dropZone') },
104684
104698
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Icon, { backgroundColor: "cloudNormal", name: isUploadInProgress ? 'loading' : 'upload', size: "xLarge", theme: "f-fileUpload__uploadIcon" }),
104685
- isDragActive ? (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('f-fileUpload__title') },
104686
- messages.dragHere,
104687
- external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('f-fileUpload__restrictions') }))) : (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('f-fileUpload__title') },
104688
- messages.move,
104689
- external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Link, { isSmall: true, theme: "f-fileUpload__titleButton", onClick: open }, (files === null || files === void 0 ? void 0 : files.length) === 0 ? messages.select : messages.selectMore),
104690
- external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('f-fileUpload__restrictions') }, messages.restriction)))))),
104699
+ getTitle()))),
104691
104700
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(FileList, { files: files, handleOnDelete: handleOnDelete, hideImagePreview: hideImagePreview, messages: messages, selectMultiple: selectMultiple, uploadProgress: uploadProgress, withProgressBar: withProgressBar, onShow: onShow })));
104692
104701
  };
104693
104702
 
@@ -104769,7 +104778,7 @@ var Input2_assign = (undefined && undefined.__assign) || function () {
104769
104778
 
104770
104779
 
104771
104780
  var Input2 = function (_a) {
104772
- var _b = _a.allowLeadingZeros, allowLeadingZeros = _b === void 0 ? true : _b, _c = _a.allowNegative, allowNegative = _c === void 0 ? false : _c, autocomplete = _a.autocomplete, autofocus = _a.autofocus, _d = _a.decimalLimit, decimalLimit = _d === void 0 ? 0 : _d, _e = _a.decimalSeparator, decimalSeparator = _e === void 0 ? ',' : _e, error = _a.error, help = _a.help, _f = _a.integerPlaces, integerPlaces = _f === void 0 ? 0 : _f, isDisabled = _a.isDisabled, label = _a.label, labelTooltip = _a.labelTooltip, maxCharCounter = _a.maxCharCounter, maxLength = _a.maxLength, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onFocus = _a.onFocus, onPaste = _a.onPaste, placeholder = _a.placeholder, prefix = _a.prefix, prefixIconName = _a.prefixIconName, _g = _a.showPassword, showPassword = _g === void 0 ? true : _g, showPasswordTooltip = _a.showPasswordTooltip, suffixIconName = _a.suffixIconName, testId = _a.testId, theme = _a.theme, _h = _a.thousandSeparator, thousandSeparator = _h === void 0 ? '' : _h, _j = _a.type, type = _j === void 0 ? 'text' : _j, unit = _a.unit, outerValue = _a.value;
104781
+ var _b = _a.allowLeadingZeros, allowLeadingZeros = _b === void 0 ? true : _b, _c = _a.allowNegative, allowNegative = _c === void 0 ? false : _c, autocomplete = _a.autocomplete, autofocus = _a.autofocus, _d = _a.decimalLimit, decimalLimit = _d === void 0 ? 0 : _d, _e = _a.decimalSeparator, decimalSeparator = _e === void 0 ? ',' : _e, error = _a.error, help = _a.help, inputMode = _a.inputMode, _f = _a.integerPlaces, integerPlaces = _f === void 0 ? 0 : _f, isDisabled = _a.isDisabled, label = _a.label, labelTooltip = _a.labelTooltip, maxCharCounter = _a.maxCharCounter, maxLength = _a.maxLength, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onFocus = _a.onFocus, onPaste = _a.onPaste, placeholder = _a.placeholder, prefix = _a.prefix, prefixIconName = _a.prefixIconName, _g = _a.showPassword, showPassword = _g === void 0 ? true : _g, showPasswordTooltip = _a.showPasswordTooltip, suffixIconName = _a.suffixIconName, testId = _a.testId, theme = _a.theme, _h = _a.thousandSeparator, thousandSeparator = _h === void 0 ? '' : _h, _j = _a.type, type = _j === void 0 ? 'text' : _j, unit = _a.unit, outerValue = _a.value;
104773
104782
  var minusCharacter = '-';
104774
104783
  var _k = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(outerValue || ''), value = _k[0], setValue = _k[1];
104775
104784
  var _l = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(false), isPasswordVisible = _l[0], setIsPasswordVisible = _l[1];
@@ -104877,7 +104886,7 @@ var Input2 = function (_a) {
104877
104886
  };
104878
104887
  var getInputMode = function () {
104879
104888
  if (type === 'number') {
104880
- return 'numeric';
104889
+ return decimalLimit ? 'decimal' : 'numeric';
104881
104890
  }
104882
104891
  else {
104883
104892
  return type;
@@ -104903,7 +104912,7 @@ var Input2 = function (_a) {
104903
104912
  }), "data-testid": testId },
104904
104913
  prefixIconName && (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("span", { className: classBinder_cx('f-controlPrefix') },
104905
104914
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Icon, { name: "search", size: "small", theme: "f-controlPrefix__icon" }))),
104906
- external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("input", { "aria-describedby": name + "_help", "aria-errormessage": error ? name + "_errorMessage" : undefined, "aria-invalid": !!error, "aria-labelledby": name + "_label", autoComplete: autocomplete ? 'on' : 'off', autoFocus: autofocus, className: classBinder_cx("f-control2 f-control2__" + (value ? 'value' : 'placeholder')), "data-testid": testId, disabled: isDisabled, id: name, inputMode: getInputMode(), maxLength: maxLength, name: name, placeholder: placeholder, type: getInputType(), value: value, onBlur: handleOnBlur, onChange: handleOnChange, onFocus: onFocus, onPaste: handleOnPaste }),
104915
+ external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("input", { "aria-describedby": name + "_help", "aria-errormessage": error ? name + "_errorMessage" : undefined, "aria-invalid": !!error, "aria-labelledby": name + "_label", autoComplete: autocomplete ? 'on' : 'off', autoFocus: autofocus, className: classBinder_cx("f-control2 f-control2__" + (value ? 'value' : 'placeholder')), "data-testid": testId, disabled: isDisabled, id: name, inputMode: inputMode || getInputMode(), lang: decimalSeparator === ',' ? 'cs' : 'en', maxLength: maxLength, name: name, placeholder: placeholder, type: getInputType(), value: value, onBlur: handleOnBlur, onChange: handleOnChange, onFocus: onFocus, onPaste: handleOnPaste }),
104907
104916
  type === 'password' && showPassword && (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(ShowPasswordIcon, { isPasswordVisible: isPasswordVisible, showPasswordTooltip: showPasswordTooltip, togglePasswordVisibility: togglePasswordVisibility })),
104908
104917
  suffixIconName && (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("span", { className: classBinder_cx('f-controlSuffix') },
104909
104918
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Icon, { name: suffixIconName, size: "small", theme: "f-controlSuffix__icon" })))),
@@ -10,6 +10,8 @@ export interface FileUploadPropsType extends ComponentPropsType {
10
10
  fileLimit?: number;
11
11
  /** Hides preview for the chosen file if it's an image. */
12
12
  hideImagePreview?: boolean;
13
+ /** Hides title and restrictions */
14
+ hideTitle?: boolean;
13
15
  /** Maximum file size (in bytes) */
14
16
  maxSizeBytes?: number;
15
17
  /** Set of all used text messages. */
@@ -69,5 +71,5 @@ export declare type FileType = {
69
71
  /** List of all errors */
70
72
  errors?: FileError[];
71
73
  };
72
- export declare const FileUpload: ({ accept, fileLimit, files, hideImagePreview, maxSizeBytes, messages, minSizeBytes, onDelete, onError, onSelectFile, onShow, selectMultiple, setFiles, theme, uploadProgress, withProgressBar }: FileUploadPropsType) => JSX.Element;
74
+ export declare const FileUpload: ({ accept, fileLimit, files, hideImagePreview, hideTitle, maxSizeBytes, messages, minSizeBytes, onDelete, onError, onSelectFile, onShow, selectMultiple, setFiles, theme, uploadProgress, withProgressBar }: FileUploadPropsType) => JSX.Element;
73
75
  //# sourceMappingURL=FileUpload.d.ts.map
@@ -13,6 +13,8 @@ export interface Input2PropsType extends FormField2PropsType {
13
13
  decimalLimit?: number;
14
14
  /** Symbol to separate decimal numbers. */
15
15
  decimalSeparator?: string;
16
+ /** Hint at the type of data that might be entered by the user while editing the element or its contents. */
17
+ inputMode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
16
18
  /** Limit for numbers before decimal symbol. */
17
19
  integerPlaces?: number;
18
20
  /** Sets maximum value length. */
@@ -39,5 +41,5 @@ export interface Input2PropsType extends FormField2PropsType {
39
41
  value?: string;
40
42
  }
41
43
  export declare type Input2TypeType = 'text' | 'number' | 'password' | 'tel' | 'email' | 'search';
42
- export declare const Input2: ({ allowLeadingZeros, allowNegative, autocomplete, autofocus, decimalLimit, decimalSeparator, error, help, integerPlaces, isDisabled, label, labelTooltip, maxCharCounter, maxLength, name, onBlur, onChange, onFocus, onPaste, placeholder, prefix, prefixIconName, showPassword, showPasswordTooltip, suffixIconName, testId, theme, thousandSeparator, type, unit, value: outerValue }: Input2PropsType) => JSX.Element;
44
+ export declare const Input2: ({ allowLeadingZeros, allowNegative, autocomplete, autofocus, decimalLimit, decimalSeparator, error, help, inputMode, integerPlaces, isDisabled, label, labelTooltip, maxCharCounter, maxLength, name, onBlur, onChange, onFocus, onPaste, placeholder, prefix, prefixIconName, showPassword, showPasswordTooltip, suffixIconName, testId, theme, thousandSeparator, type, unit, value: outerValue }: Input2PropsType) => JSX.Element;
43
45
  //# sourceMappingURL=Input2.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmb-digital/ds-lilly",
3
- "version": "0.0.1-alpha.326",
3
+ "version": "0.0.1-alpha.327-NIB-4963c",
4
4
  "description": "MMB LILLY design system",
5
5
  "license": "UNLICENSED",
6
6
  "sideEffects": false,