@itcase/forms 1.1.9 → 1.1.10

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.
@@ -94,6 +94,11 @@
94
94
  padding: 12px 0 0 0;
95
95
  grid-column-start: 2;
96
96
  align-self: flex-start;
97
+ white-space: wrap;
98
+ &-inner {
99
+ display: inline-block;
100
+ @mixin word-wrap;
101
+ }
97
102
  }
98
103
  &-remove {
99
104
  width: 100%;
@@ -22,6 +22,8 @@ var fileSelector = require('file-selector');
22
22
  var castArray = require('lodash/castArray');
23
23
  var reactDropzone = require('react-dropzone');
24
24
  var common = require('@itcase/common');
25
+ var Button = require('@itcase/ui/components/Button');
26
+ var Group$1 = require('@itcase/ui/components/Group');
25
27
  var Loader = require('@itcase/ui/components/Loader');
26
28
  var Title = require('@itcase/ui/components/Title');
27
29
  var Input = require('@itcase/ui/components/Input');
@@ -32,8 +34,6 @@ var Switch = require('@itcase/ui/components/Switch');
32
34
  var Textarea = require('@itcase/ui/components/Textarea');
33
35
  var reactImask = require('react-imask');
34
36
  var Chips = require('@itcase/ui/components/Chips');
35
- var Button = require('@itcase/ui/components/Button');
36
- var Group$1 = require('@itcase/ui/components/Group');
37
37
  var Notification = require('@itcase/ui/components/Notification');
38
38
  var createDecorator = require('final-form-focus');
39
39
 
@@ -870,10 +870,8 @@ const defaultDropzoneProps = {
870
870
  hintTitle: 'Перетащите изображение или выберите файл с компьютера',
871
871
  hintTitleTextColor: 'surfaceTextPrimary',
872
872
  hintTitleTextSize: 'm',
873
- removeThumbText: 'удалить',
874
- removeThumbTextColor: 'errorTextPrimary',
875
- removeThumbTextHoverColor: 'errorTextPrimaryHover',
876
- removeThumbTextSize: 's',
873
+ removeThumbAppearance: 'dangerPrimary sizeM',
874
+ removeThumbShape: 'rounded',
877
875
  shape: 'rounded',
878
876
  showFilename: true,
879
877
  thumbBorderColor: 'surfaceBorderTertiary',
@@ -1052,10 +1050,9 @@ const FileInputDropzone = /*#__PURE__*/React__default.default.memo(function File
1052
1050
  hintTitleTextSize,
1053
1051
  hintTitleTextWeight,
1054
1052
  hintTitleTextWrap,
1053
+ removeThumbAppearance,
1054
+ removeThumbShape,
1055
1055
  removeThumbText,
1056
- removeThumbTextColor,
1057
- removeThumbTextHoverColor,
1058
- removeThumbTextSize,
1059
1056
  removeThumbTextWeight,
1060
1057
  shapeClass,
1061
1058
  thumbBorderColorClass,
@@ -1069,11 +1066,11 @@ const FileInputDropzone = /*#__PURE__*/React__default.default.memo(function File
1069
1066
  thumbNameTextWrap
1070
1067
  } = propsGenerator;
1071
1068
  return /*#__PURE__*/React__default.default.createElement(React__default.default.Fragment, null, /*#__PURE__*/React__default.default.createElement("div", getRootProps({
1072
- className: `form-dropzone__dropzone dropzone ${className} thumbColumn form-dropzone__dropzone_size_${size} ${shapeClass}`
1069
+ className: `form-dropzone__dropzone dropzone ${className} form-dropzone__dropzone_size_${size} ${shapeClass}`
1073
1070
  }), /*#__PURE__*/React__default.default.createElement("input", Object.assign({}, getInputProps(), {
1074
1071
  name: inputName
1075
1072
  })), /*#__PURE__*/React__default.default.createElement("div", {
1076
- className: clsx__default.default('form-dropzone__dropzone-wrapper', thumbColumn && `form-dropzone__dropzone-wrapper_column_${thumbColumn}`, fillClass, fillHoverClass, borderWidthClass, borderColorClass, borderColorHoverClass, borderTypeClass)
1073
+ className: clsx__default.default('form-dropzone__dropzone-wrapper', thumbColumn && `form-dropzone__dropzone-wrapper_column_${thumbColumn}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, borderColorClass && `border-color_${borderColorClass}`, borderColorHoverClass && `border-color_hover_${borderColorHoverClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderTypeClass)
1077
1074
  }, filesList.map((file, index) => /*#__PURE__*/React__default.default.createElement("aside", {
1078
1075
  className: clsx__default.default('form-dropzone__thumb', fillClass, thumbDirectionClass, thumbBorderWidthClass, thumbBorderColorClass, thumbBorderColorHoverClass, thumbBorderTypeClass),
1079
1076
  key: file.id || `${file.name}_${index}`
@@ -1108,15 +1105,15 @@ const FileInputDropzone = /*#__PURE__*/React__default.default.memo(function File
1108
1105
  itemFill: "surfaceItemAccent",
1109
1106
  set: "simple"
1110
1107
  })), /*#__PURE__*/React__default.default.createElement("div", {
1111
- className: "form-dropzone__thumb-remove",
1112
- onClick: event => removeFile(event, index)
1113
- }, /*#__PURE__*/React__default.default.createElement(Text.Text, {
1108
+ className: clsx__default.default('form-dropzone__thumb-remove')
1109
+ }, /*#__PURE__*/React__default.default.createElement(Button.Button, {
1114
1110
  className: "form-dropzone__thumb-remove-text",
1115
- size: removeThumbTextSize,
1116
- textColor: removeThumbTextColor,
1117
- textColorHover: removeThumbTextHoverColor,
1118
- textWeight: removeThumbTextWeight
1119
- }, removeThumbText || 'Удалить')))), !filesList.length ? /*#__PURE__*/React__default.default.createElement("div", {
1111
+ appearance: removeThumbAppearance,
1112
+ label: removeThumbText || 'Удалить',
1113
+ labelTextWeight: removeThumbTextWeight,
1114
+ shape: removeThumbShape,
1115
+ onClick: event => removeFile(event, index)
1116
+ })))), !filesList.length ? /*#__PURE__*/React__default.default.createElement("div", {
1120
1117
  className: "form-dropzone__hint"
1121
1118
  }, /*#__PURE__*/React__default.default.createElement(Text.Text, {
1122
1119
  className: "form-dropzone__hint-title",
@@ -1124,7 +1121,7 @@ const FileInputDropzone = /*#__PURE__*/React__default.default.memo(function File
1124
1121
  textColor: hintTitleTextColor,
1125
1122
  textWeight: hintTitleTextWeight,
1126
1123
  textWrap: hintTitleTextWrap
1127
- }, hintTitle || 'Select a file or drag in form'), /*#__PURE__*/React__default.default.createElement(Text.Text, {
1124
+ }, hintTitle || 'Select a file or drag in form'), hintDescription && /*#__PURE__*/React__default.default.createElement(Text.Text, {
1128
1125
  className: "form-dropzone__hint-text",
1129
1126
  size: hintDescriptionTextSize,
1130
1127
  textColor: hintDescriptionTextColor,
@@ -1138,7 +1135,7 @@ const FileInputDropzone = /*#__PURE__*/React__default.default.memo(function File
1138
1135
  textColor: hintTitleTextColor,
1139
1136
  textWeight: hintTitleTextWeight,
1140
1137
  textWrap: hintTitleTextWrap
1141
- }, hintTitle || 'Select a file or drag in form'), /*#__PURE__*/React__default.default.createElement(Text.Text, {
1138
+ }, hintTitle || 'Select a file or drag in form'), hintDescription && /*#__PURE__*/React__default.default.createElement(Text.Text, {
1142
1139
  className: "form-dropzone__hint-text",
1143
1140
  size: hintDescriptionTextSize,
1144
1141
  textColor: hintDescriptionTextColor,
@@ -1255,8 +1252,8 @@ const FileInput = /*#__PURE__*/React__default.default.memo(function FileInput(pr
1255
1252
  borderColorHover,
1256
1253
  borderType,
1257
1254
  borderWidth,
1258
- errorMessageTextColor = 'errorTextPrimary',
1259
- errorMessageTextSize = 's',
1255
+ errorMessageTextColor,
1256
+ errorMessageTextSize,
1260
1257
  errorMessageTextWeight,
1261
1258
  hintDescriptionTextColor,
1262
1259
  hintDescriptionTextSize,
@@ -1266,11 +1263,10 @@ const FileInput = /*#__PURE__*/React__default.default.memo(function FileInput(pr
1266
1263
  hintTitleTextSize,
1267
1264
  hintTitleTextWeight,
1268
1265
  hintTitleTextWrap,
1266
+ removeThumbAppearance,
1269
1267
  removeThumbText,
1270
- removeThumbTextColor,
1271
- removeThumbTextHoverColor,
1272
- removeThumbTextSize,
1273
1268
  removeThumbTextWeight,
1269
+ removeThumbShape,
1274
1270
  shape,
1275
1271
  thumbBorderColor,
1276
1272
  thumbBorderColorHover,
@@ -1361,11 +1357,10 @@ const FileInput = /*#__PURE__*/React__default.default.memo(function FileInput(pr
1361
1357
  inputName: input.name,
1362
1358
  inputValue: input.value,
1363
1359
  metaTouched: meta.touched,
1360
+ removeThumbAppearance: removeThumbAppearance,
1364
1361
  removeThumbText: removeThumbText,
1365
- removeThumbTextColor: removeThumbTextColor,
1366
- removeThumbTextHoverColor: removeThumbTextHoverColor,
1367
- removeThumbTextSize: removeThumbTextSize,
1368
1362
  removeThumbTextWeight: removeThumbTextWeight,
1363
+ removeThumbShape: removeThumbShape,
1369
1364
  shape: shape,
1370
1365
  showFilename: showFilename,
1371
1366
  thumbBorderColor: thumbBorderColor,
@@ -21,6 +21,8 @@ import { fromEvent } from 'file-selector';
21
21
  import castArray from 'lodash/castArray';
22
22
  import { useDropzone, ErrorCode } from 'react-dropzone';
23
23
  import { createFileFromDataURL } from '@itcase/common';
24
+ import { Button } from '@itcase/ui/components/Button';
25
+ import { Group as Group$1 } from '@itcase/ui/components/Group';
24
26
  import { Loader } from '@itcase/ui/components/Loader';
25
27
  import { Title } from '@itcase/ui/components/Title';
26
28
  import { Input } from '@itcase/ui/components/Input';
@@ -31,8 +33,6 @@ import { Switch } from '@itcase/ui/components/Switch';
31
33
  import { Textarea } from '@itcase/ui/components/Textarea';
32
34
  import { useIMask } from 'react-imask';
33
35
  import { Chips } from '@itcase/ui/components/Chips';
34
- import { Button } from '@itcase/ui/components/Button';
35
- import { Group as Group$1 } from '@itcase/ui/components/Group';
36
36
  import { NotificationItem } from '@itcase/ui/components/Notification';
37
37
  import createDecorator from 'final-form-focus';
38
38
 
@@ -859,10 +859,8 @@ const defaultDropzoneProps = {
859
859
  hintTitle: 'Перетащите изображение или выберите файл с компьютера',
860
860
  hintTitleTextColor: 'surfaceTextPrimary',
861
861
  hintTitleTextSize: 'm',
862
- removeThumbText: 'удалить',
863
- removeThumbTextColor: 'errorTextPrimary',
864
- removeThumbTextHoverColor: 'errorTextPrimaryHover',
865
- removeThumbTextSize: 's',
862
+ removeThumbAppearance: 'dangerPrimary sizeM',
863
+ removeThumbShape: 'rounded',
866
864
  shape: 'rounded',
867
865
  showFilename: true,
868
866
  thumbBorderColor: 'surfaceBorderTertiary',
@@ -1041,10 +1039,9 @@ const FileInputDropzone = /*#__PURE__*/React$1.memo(function FileInputDropzone(p
1041
1039
  hintTitleTextSize,
1042
1040
  hintTitleTextWeight,
1043
1041
  hintTitleTextWrap,
1042
+ removeThumbAppearance,
1043
+ removeThumbShape,
1044
1044
  removeThumbText,
1045
- removeThumbTextColor,
1046
- removeThumbTextHoverColor,
1047
- removeThumbTextSize,
1048
1045
  removeThumbTextWeight,
1049
1046
  shapeClass,
1050
1047
  thumbBorderColorClass,
@@ -1058,11 +1055,11 @@ const FileInputDropzone = /*#__PURE__*/React$1.memo(function FileInputDropzone(p
1058
1055
  thumbNameTextWrap
1059
1056
  } = propsGenerator;
1060
1057
  return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement("div", getRootProps({
1061
- className: `form-dropzone__dropzone dropzone ${className} thumbColumn form-dropzone__dropzone_size_${size} ${shapeClass}`
1058
+ className: `form-dropzone__dropzone dropzone ${className} form-dropzone__dropzone_size_${size} ${shapeClass}`
1062
1059
  }), /*#__PURE__*/React$1.createElement("input", Object.assign({}, getInputProps(), {
1063
1060
  name: inputName
1064
1061
  })), /*#__PURE__*/React$1.createElement("div", {
1065
- className: clsx('form-dropzone__dropzone-wrapper', thumbColumn && `form-dropzone__dropzone-wrapper_column_${thumbColumn}`, fillClass, fillHoverClass, borderWidthClass, borderColorClass, borderColorHoverClass, borderTypeClass)
1062
+ className: clsx('form-dropzone__dropzone-wrapper', thumbColumn && `form-dropzone__dropzone-wrapper_column_${thumbColumn}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, borderColorClass && `border-color_${borderColorClass}`, borderColorHoverClass && `border-color_hover_${borderColorHoverClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderTypeClass)
1066
1063
  }, filesList.map((file, index) => /*#__PURE__*/React$1.createElement("aside", {
1067
1064
  className: clsx('form-dropzone__thumb', fillClass, thumbDirectionClass, thumbBorderWidthClass, thumbBorderColorClass, thumbBorderColorHoverClass, thumbBorderTypeClass),
1068
1065
  key: file.id || `${file.name}_${index}`
@@ -1097,15 +1094,15 @@ const FileInputDropzone = /*#__PURE__*/React$1.memo(function FileInputDropzone(p
1097
1094
  itemFill: "surfaceItemAccent",
1098
1095
  set: "simple"
1099
1096
  })), /*#__PURE__*/React$1.createElement("div", {
1100
- className: "form-dropzone__thumb-remove",
1101
- onClick: event => removeFile(event, index)
1102
- }, /*#__PURE__*/React$1.createElement(Text, {
1097
+ className: clsx('form-dropzone__thumb-remove')
1098
+ }, /*#__PURE__*/React$1.createElement(Button, {
1103
1099
  className: "form-dropzone__thumb-remove-text",
1104
- size: removeThumbTextSize,
1105
- textColor: removeThumbTextColor,
1106
- textColorHover: removeThumbTextHoverColor,
1107
- textWeight: removeThumbTextWeight
1108
- }, removeThumbText || 'Удалить')))), !filesList.length ? /*#__PURE__*/React$1.createElement("div", {
1100
+ appearance: removeThumbAppearance,
1101
+ label: removeThumbText || 'Удалить',
1102
+ labelTextWeight: removeThumbTextWeight,
1103
+ shape: removeThumbShape,
1104
+ onClick: event => removeFile(event, index)
1105
+ })))), !filesList.length ? /*#__PURE__*/React$1.createElement("div", {
1109
1106
  className: "form-dropzone__hint"
1110
1107
  }, /*#__PURE__*/React$1.createElement(Text, {
1111
1108
  className: "form-dropzone__hint-title",
@@ -1113,7 +1110,7 @@ const FileInputDropzone = /*#__PURE__*/React$1.memo(function FileInputDropzone(p
1113
1110
  textColor: hintTitleTextColor,
1114
1111
  textWeight: hintTitleTextWeight,
1115
1112
  textWrap: hintTitleTextWrap
1116
- }, hintTitle || 'Select a file or drag in form'), /*#__PURE__*/React$1.createElement(Text, {
1113
+ }, hintTitle || 'Select a file or drag in form'), hintDescription && /*#__PURE__*/React$1.createElement(Text, {
1117
1114
  className: "form-dropzone__hint-text",
1118
1115
  size: hintDescriptionTextSize,
1119
1116
  textColor: hintDescriptionTextColor,
@@ -1127,7 +1124,7 @@ const FileInputDropzone = /*#__PURE__*/React$1.memo(function FileInputDropzone(p
1127
1124
  textColor: hintTitleTextColor,
1128
1125
  textWeight: hintTitleTextWeight,
1129
1126
  textWrap: hintTitleTextWrap
1130
- }, hintTitle || 'Select a file or drag in form'), /*#__PURE__*/React$1.createElement(Text, {
1127
+ }, hintTitle || 'Select a file or drag in form'), hintDescription && /*#__PURE__*/React$1.createElement(Text, {
1131
1128
  className: "form-dropzone__hint-text",
1132
1129
  size: hintDescriptionTextSize,
1133
1130
  textColor: hintDescriptionTextColor,
@@ -1244,8 +1241,8 @@ const FileInput = /*#__PURE__*/React$1.memo(function FileInput(props) {
1244
1241
  borderColorHover,
1245
1242
  borderType,
1246
1243
  borderWidth,
1247
- errorMessageTextColor = 'errorTextPrimary',
1248
- errorMessageTextSize = 's',
1244
+ errorMessageTextColor,
1245
+ errorMessageTextSize,
1249
1246
  errorMessageTextWeight,
1250
1247
  hintDescriptionTextColor,
1251
1248
  hintDescriptionTextSize,
@@ -1255,11 +1252,10 @@ const FileInput = /*#__PURE__*/React$1.memo(function FileInput(props) {
1255
1252
  hintTitleTextSize,
1256
1253
  hintTitleTextWeight,
1257
1254
  hintTitleTextWrap,
1255
+ removeThumbAppearance,
1258
1256
  removeThumbText,
1259
- removeThumbTextColor,
1260
- removeThumbTextHoverColor,
1261
- removeThumbTextSize,
1262
1257
  removeThumbTextWeight,
1258
+ removeThumbShape,
1263
1259
  shape,
1264
1260
  thumbBorderColor,
1265
1261
  thumbBorderColorHover,
@@ -1350,11 +1346,10 @@ const FileInput = /*#__PURE__*/React$1.memo(function FileInput(props) {
1350
1346
  inputName: input.name,
1351
1347
  inputValue: input.value,
1352
1348
  metaTouched: meta.touched,
1349
+ removeThumbAppearance: removeThumbAppearance,
1353
1350
  removeThumbText: removeThumbText,
1354
- removeThumbTextColor: removeThumbTextColor,
1355
- removeThumbTextHoverColor: removeThumbTextHoverColor,
1356
- removeThumbTextSize: removeThumbTextSize,
1357
1351
  removeThumbTextWeight: removeThumbTextWeight,
1352
+ removeThumbShape: removeThumbShape,
1358
1353
  shape: shape,
1359
1354
  showFilename: showFilename,
1360
1355
  thumbBorderColor: thumbBorderColor,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/forms",
3
- "version": "1.1.9",
3
+ "version": "1.1.10",
4
4
  "description": "Forms fields, inputs, etc.",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -32,13 +32,13 @@
32
32
  "registry": "https://registry.npmjs.org/"
33
33
  },
34
34
  "dependencies": {
35
- "@itcase/common": "^1.2.23",
35
+ "@itcase/common": "^1.2.26",
36
36
  "@itcase/config": "^1.0.47",
37
37
  "@itcase/icons": "^1.1.1",
38
- "@itcase/storybook-config": "^1.1.10",
38
+ "@itcase/storybook-config": "^1.1.12",
39
39
  "@itcase/tokens-am": "^1.1.9",
40
40
  "@itcase/tokens-baikal": "^1.1.9",
41
- "@itcase/ui": "^1.8.13",
41
+ "@itcase/ui": "^1.8.19",
42
42
  "axios": "^1.9.0",
43
43
  "clsx": "^2.1.1",
44
44
  "final-form": "^4.20.10",
@@ -56,9 +56,9 @@
56
56
  "react-select": "^5.10.1"
57
57
  },
58
58
  "devDependencies": {
59
- "@itcase/lint": "^1.1.9",
60
- "@babel/core": "^7.27.3",
61
- "@babel/eslint-parser": "^7.27.1",
59
+ "@itcase/lint": "^1.1.10",
60
+ "@babel/core": "^7.27.4",
61
+ "@babel/eslint-parser": "^7.27.5",
62
62
  "@babel/preset-env": "^7.27.2",
63
63
  "@babel/preset-react": "^7.27.1",
64
64
  "@commitlint/cli": "^19.8.1",
@@ -76,15 +76,15 @@
76
76
  "babel-plugin-inline-react-svg": "^2.0.2",
77
77
  "babel-plugin-transform-react-remove-prop-types": "^0.4.24",
78
78
  "conventional-changelog-conventionalcommits": "^9.0.0",
79
- "eslint": "9.27.0",
79
+ "eslint": "9.28.0",
80
80
  "husky": "^9.1.7",
81
81
  "lint-staged": "^16.1.0",
82
- "postcss": "^8.5.3",
82
+ "postcss": "^8.5.4",
83
83
  "prettier": "3.5.3",
84
84
  "rollup": "^4.41.1",
85
85
  "rollup-plugin-peer-deps-external": "^2.2.4",
86
86
  "semantic-release": "^24.2.5",
87
- "stylelint": "^16.19.1",
87
+ "stylelint": "^16.20.0",
88
88
  "typescript": "^5.8.3",
89
89
  "yup": "^1.6.1"
90
90
  }