@itcase/forms 1.1.36 → 1.1.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@
7
7
  outline: 0;
8
8
  @mixin easing easeOutQuart, all, 0.2s;
9
9
  &_size {
10
- @each $size in normal, compact {
10
+ @each $size in xl, l, m, s {
11
11
  &_$(size) {
12
12
  ^^&-wrapper {
13
13
  padding: var(--fileinput-size-$(size)-padding);
@@ -19,6 +19,7 @@
19
19
  display: grid;
20
20
  gap: 16px;
21
21
  grid-template-columns: repeat(3, minmax(0, 1fr));
22
+ transition: var(--fileinput-transition);
22
23
  }
23
24
  ^&__hint {
24
25
  width: 100%;
@@ -91,10 +92,10 @@
91
92
  }
92
93
  &-name {
93
94
  width: 100%;
95
+ white-space: wrap;
94
96
  padding: 12px 0 0 0;
95
- grid-column-start: 2;
96
97
  align-self: flex-start;
97
- white-space: wrap;
98
+ grid-column-start: 2;
98
99
  &-inner {
99
100
  display: inline-block;
100
101
  @mixin word-wrap;
@@ -116,7 +117,7 @@
116
117
  .form-dropzone {
117
118
  &_shape {
118
119
  &_rounded {
119
- @each $size in normal, compact {
120
+ @each $size in xl, l, m, s {
120
121
  &.form-dropzone__dropzone_size_$(size) {
121
122
  & .form-dropzone__dropzone-wrapper {
122
123
  border-radius: var(--fileinput-size-$(size)-shape-rounded);
@@ -155,4 +156,5 @@
155
156
  :root {
156
157
  --fileinput-size-normal-padding: 16px 16px;
157
158
  --fileinput-size-normal-shape-rounded: 6px;
159
+ --fileinput-transition: all 0.2s ease 0s;
158
160
  }
@@ -1,13 +1,17 @@
1
1
  .form-field {
2
2
  &-switch {
3
3
  width: 100%;
4
- flex-direction: row;
5
4
  padding: 8px 0;
5
+ display: grid !important;
6
+ grid-template-columns: 1fr auto;
6
7
  ^&__label {
7
- flex: 1;
8
8
  display: flex;
9
+ flex: 1;
9
10
  align-items: center;
10
11
  }
12
+ ^&__message {
13
+ grid-column: 1 / span 2;
14
+ }
11
15
  }
12
16
  }
13
17
 
@@ -59,7 +59,7 @@
59
59
  padding: 0 4px;
60
60
  position: absolute;
61
61
  display: flex;
62
- top: 0;
62
+ top: 4px;
63
63
  z-index: 2;
64
64
  transform: scale(1) translate(8px, 20px);
65
65
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
@@ -132,8 +132,8 @@ function useYupValidationSchema(schema, language) {
132
132
  function useFieldValidationState(props) {
133
133
  const {
134
134
  fieldProps = {},
135
- meta = {},
136
- input = {}
135
+ input = {},
136
+ meta = {}
137
137
  } = props;
138
138
  // Determines if there's a submission error that hasn't been rectified since the last submission.
139
139
  const submitError = !meta.modifiedSinceLastSubmit && meta.submitError;
@@ -179,10 +179,10 @@ function useFieldValidationState(props) {
179
179
  }, [meta.error, submitError]);
180
180
  return {
181
181
  errorKey,
182
- successKey,
182
+ errorMessage,
183
183
  isErrorState,
184
- isValidState,
185
- errorMessage
184
+ successKey,
185
+ isValidState
186
186
  };
187
187
  }
188
188
 
@@ -371,13 +371,13 @@ function FieldWrapperBase(props) {
371
371
  const errorTextColor = props[`${errorKey}MessageTextColor`];
372
372
  const errorTextWeight = props[`${errorKey}MessageTextWeight`];
373
373
  return /*#__PURE__*/React__default.default.createElement(Tag, {
374
- dataTestId: `${inputName}Field`,
375
- dataTour: dataTour,
376
374
  className: clsx__default.default(formFieldClass, 'form__item', 'form-field', type && `form-field_type_${type}`, sizeClass, fillClass, shapeClass, isDisabled && `form-field_state_disabled`, isHidden && `form-field_state_hidden`, directionClass, widthClass),
375
+ "data-test-id": `${inputName}Field`,
376
+ "data-tour": dataTour,
377
377
  style: formFieldStyles
378
378
  }, before, (label || labelHidden) && /*#__PURE__*/React__default.default.createElement("div", {
379
- dataTestId: `${inputName}FieldLabel`,
380
379
  className: clsx__default.default('form-field__label'),
380
+ "data-test-id": `${inputName}FieldLabel`,
381
381
  htmlFor: id
382
382
  }, /*#__PURE__*/React__default.default.createElement(Text.Text, {
383
383
  size: labelTextSize,
@@ -386,8 +386,8 @@ function FieldWrapperBase(props) {
386
386
  sizeMobile: labelTextSizeMobile,
387
387
  sizeTablet: labelTextSizeTablet
388
388
  }, label, labelHidden && '\u00A0')), desc && /*#__PURE__*/React__default.default.createElement("div", {
389
- dataTestId: `${inputName}FieldDesc`,
390
- className: "form-field__desc"
389
+ className: "form-field__desc",
390
+ "data-test-id": `${inputName}FieldDesc`
391
391
  }, /*#__PURE__*/React__default.default.createElement(Text.Text, {
392
392
  size: descTextSize,
393
393
  textColor: descTextColor,
@@ -403,8 +403,8 @@ function FieldWrapperBase(props) {
403
403
  size: dividerSize,
404
404
  fill: dividerFill
405
405
  })), showMessage && /*#__PURE__*/React__default.default.createElement("div", {
406
- dataTestId: `${inputName}FieldMessage`,
407
- className: "form-field__message"
406
+ className: "form-field__message",
407
+ "data-test-id": `${inputName}FieldMessage`
408
408
  }, isErrorState && errorMessage && /*#__PURE__*/React__default.default.createElement(Text.Text, {
409
409
  id: `${inputName}-error`,
410
410
  dataTestId: `${inputName}FieldMessageError`,
@@ -443,8 +443,9 @@ function FieldWrapper(props) {
443
443
 
444
444
  const defaultDropzoneProps = {
445
445
  fill: 'surfaceSecondary',
446
- borderColor: 'surfaceBorderTertiary',
447
- borderColorHover: 'surfaceBorderQuaternary',
446
+ fillHover: 'surfaceTertiary',
447
+ // borderColor: 'surfaceBorderTertiary',
448
+ // borderColorHover: 'surfaceBorderQuaternary',
448
449
  hintTitle: 'Перетащите изображение или выберите файл с компьютера',
449
450
  hintTitleTextColor: 'surfaceTextPrimary',
450
451
  hintTitleTextSize: 'm',
@@ -1834,7 +1835,7 @@ const defaultSegmentedProps = {
1834
1835
  // Error
1835
1836
  errorAppearance: 'errorPrimary sizeM solid rounded',
1836
1837
  // Required
1837
- requiredAppearance: 'requirePrimary sizeM solid rounded'
1838
+ requiredAppearance: 'warningPrimary sizeM solid rounded'
1838
1839
  };
1839
1840
 
1840
1841
  function FormFieldSegmented(props) {
@@ -1920,6 +1921,8 @@ const defaultSelectProps = {
1920
1921
  // useValidationAppearanceInputProps
1921
1922
  // Error
1922
1923
  errorAppearance: 'errorPrimary sizeM solid rounded',
1924
+ // Success
1925
+ successAppearance: 'successPrimary sizeM solid rounded',
1923
1926
  // Required
1924
1927
  requiredAppearance: 'requirePrimary sizeM solid rounded'
1925
1928
  };
@@ -2042,6 +2045,8 @@ const defaultSwitchProps = {
2042
2045
  // useValidationAppearanceInputProps
2043
2046
  // Error
2044
2047
  errorAppearance: 'errorPrimary sizeL solid rounded',
2048
+ // Success
2049
+ successAppearance: 'successPrimary sizeL solid rounded',
2045
2050
  // Required
2046
2051
  requiredAppearance: 'requirePrimary sizeL solid rounded'
2047
2052
  };
@@ -2125,6 +2130,8 @@ const defaultTextareaProps = {
2125
2130
  // useValidationAppearanceInputProps
2126
2131
  // Error
2127
2132
  errorAppearance: 'errorPrimary sizeM solid rounded',
2133
+ // Success
2134
+ successAppearance: 'successPrimary sizeM solid rounded',
2128
2135
  // Required
2129
2136
  requiredAppearance: 'requirePrimary sizeM solid rounded'
2130
2137
  };
@@ -121,8 +121,8 @@ function useYupValidationSchema(schema, language) {
121
121
  function useFieldValidationState(props) {
122
122
  const {
123
123
  fieldProps = {},
124
- meta = {},
125
- input = {}
124
+ input = {},
125
+ meta = {}
126
126
  } = props;
127
127
  // Determines if there's a submission error that hasn't been rectified since the last submission.
128
128
  const submitError = !meta.modifiedSinceLastSubmit && meta.submitError;
@@ -168,10 +168,10 @@ function useFieldValidationState(props) {
168
168
  }, [meta.error, submitError]);
169
169
  return {
170
170
  errorKey,
171
- successKey,
171
+ errorMessage,
172
172
  isErrorState,
173
- isValidState,
174
- errorMessage
173
+ successKey,
174
+ isValidState
175
175
  };
176
176
  }
177
177
 
@@ -360,13 +360,13 @@ function FieldWrapperBase(props) {
360
360
  const errorTextColor = props[`${errorKey}MessageTextColor`];
361
361
  const errorTextWeight = props[`${errorKey}MessageTextWeight`];
362
362
  return /*#__PURE__*/React.createElement(Tag, {
363
- dataTestId: `${inputName}Field`,
364
- dataTour: dataTour,
365
363
  className: clsx(formFieldClass, 'form__item', 'form-field', type && `form-field_type_${type}`, sizeClass, fillClass, shapeClass, isDisabled && `form-field_state_disabled`, isHidden && `form-field_state_hidden`, directionClass, widthClass),
364
+ "data-test-id": `${inputName}Field`,
365
+ "data-tour": dataTour,
366
366
  style: formFieldStyles
367
367
  }, before, (label || labelHidden) && /*#__PURE__*/React.createElement("div", {
368
- dataTestId: `${inputName}FieldLabel`,
369
368
  className: clsx('form-field__label'),
369
+ "data-test-id": `${inputName}FieldLabel`,
370
370
  htmlFor: id
371
371
  }, /*#__PURE__*/React.createElement(Text, {
372
372
  size: labelTextSize,
@@ -375,8 +375,8 @@ function FieldWrapperBase(props) {
375
375
  sizeMobile: labelTextSizeMobile,
376
376
  sizeTablet: labelTextSizeTablet
377
377
  }, label, labelHidden && '\u00A0')), desc && /*#__PURE__*/React.createElement("div", {
378
- dataTestId: `${inputName}FieldDesc`,
379
- className: "form-field__desc"
378
+ className: "form-field__desc",
379
+ "data-test-id": `${inputName}FieldDesc`
380
380
  }, /*#__PURE__*/React.createElement(Text, {
381
381
  size: descTextSize,
382
382
  textColor: descTextColor,
@@ -392,8 +392,8 @@ function FieldWrapperBase(props) {
392
392
  size: dividerSize,
393
393
  fill: dividerFill
394
394
  })), showMessage && /*#__PURE__*/React.createElement("div", {
395
- dataTestId: `${inputName}FieldMessage`,
396
- className: "form-field__message"
395
+ className: "form-field__message",
396
+ "data-test-id": `${inputName}FieldMessage`
397
397
  }, isErrorState && errorMessage && /*#__PURE__*/React.createElement(Text, {
398
398
  id: `${inputName}-error`,
399
399
  dataTestId: `${inputName}FieldMessageError`,
@@ -432,8 +432,9 @@ function FieldWrapper(props) {
432
432
 
433
433
  const defaultDropzoneProps = {
434
434
  fill: 'surfaceSecondary',
435
- borderColor: 'surfaceBorderTertiary',
436
- borderColorHover: 'surfaceBorderQuaternary',
435
+ fillHover: 'surfaceTertiary',
436
+ // borderColor: 'surfaceBorderTertiary',
437
+ // borderColorHover: 'surfaceBorderQuaternary',
437
438
  hintTitle: 'Перетащите изображение или выберите файл с компьютера',
438
439
  hintTitleTextColor: 'surfaceTextPrimary',
439
440
  hintTitleTextSize: 'm',
@@ -1823,7 +1824,7 @@ const defaultSegmentedProps = {
1823
1824
  // Error
1824
1825
  errorAppearance: 'errorPrimary sizeM solid rounded',
1825
1826
  // Required
1826
- requiredAppearance: 'requirePrimary sizeM solid rounded'
1827
+ requiredAppearance: 'warningPrimary sizeM solid rounded'
1827
1828
  };
1828
1829
 
1829
1830
  function FormFieldSegmented(props) {
@@ -1909,6 +1910,8 @@ const defaultSelectProps = {
1909
1910
  // useValidationAppearanceInputProps
1910
1911
  // Error
1911
1912
  errorAppearance: 'errorPrimary sizeM solid rounded',
1913
+ // Success
1914
+ successAppearance: 'successPrimary sizeM solid rounded',
1912
1915
  // Required
1913
1916
  requiredAppearance: 'requirePrimary sizeM solid rounded'
1914
1917
  };
@@ -2031,6 +2034,8 @@ const defaultSwitchProps = {
2031
2034
  // useValidationAppearanceInputProps
2032
2035
  // Error
2033
2036
  errorAppearance: 'errorPrimary sizeL solid rounded',
2037
+ // Success
2038
+ successAppearance: 'successPrimary sizeL solid rounded',
2034
2039
  // Required
2035
2040
  requiredAppearance: 'requirePrimary sizeL solid rounded'
2036
2041
  };
@@ -2114,6 +2119,8 @@ const defaultTextareaProps = {
2114
2119
  // useValidationAppearanceInputProps
2115
2120
  // Error
2116
2121
  errorAppearance: 'errorPrimary sizeM solid rounded',
2122
+ // Success
2123
+ successAppearance: 'successPrimary sizeM solid rounded',
2117
2124
  // Required
2118
2125
  requiredAppearance: 'requirePrimary sizeM solid rounded'
2119
2126
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/forms",
3
- "version": "1.1.36",
3
+ "version": "1.1.38",
4
4
  "description": "Forms fields, inputs, etc.",
5
5
  "keywords": [],
6
6
  "license": "MIT",