@cloud-ru/ds-field-decorator 1.0.3 → 1.0.4-preview-fd6730e3.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud-ru/ds-field-decorator",
3
- "version": "1.0.3",
3
+ "version": "1.0.4-preview-fd6730e3.0",
4
4
  "description": "Структурная обёртка label/caption/hint/error/length для нестандартных input'ов и сложных композиций.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,10 +34,10 @@
34
34
  ],
35
35
  "dependencies": {
36
36
  "classnames": "^2.5.1",
37
- "@cloud-ru/ds-icons": "^1.0.2",
38
- "@cloud-ru/ds-tooltip": "^1.0.3",
39
- "@cloud-ru/ds-truncate-string": "^1.0.3",
40
- "@cloud-ru/ds-utils": "^1.1.0"
37
+ "@cloud-ru/ds-icons": "1.0.2",
38
+ "@cloud-ru/ds-truncate-string": "1.0.3",
39
+ "@cloud-ru/ds-tooltip": "1.0.3",
40
+ "@cloud-ru/ds-utils": "1.1.0"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public"
@@ -26,8 +26,7 @@ export function FieldDecorator({
26
26
  readonly: readOnly,
27
27
  ...rest
28
28
  }: FieldDecoratorProps) {
29
- const showLabelContent = label || required || labelTooltip;
30
- const showHeader = showLabelContent || caption;
29
+ const showHeader = label || caption;
31
30
  const hintText = error || hint;
32
31
  const isFieldActive = !disabled && !readOnly;
33
32
  const showLength = isFieldActive && Boolean(length);
@@ -18,8 +18,6 @@ export function Label({
18
18
  size = SIZE.M,
19
19
  ...rest
20
20
  }: LabelProps) {
21
- const showLabelContent = label || required || labelTooltip;
22
-
23
21
  return (
24
22
  <div
25
23
  {...extractSupportProps(rest)}
@@ -28,7 +26,7 @@ export function Label({
28
26
  data-size={size}
29
27
  data-disabled={disabled || undefined}
30
28
  >
31
- {showLabelContent && (
29
+ {label && (
32
30
  <div className={styles.labelContent}>
33
31
  <label className={styles.label} htmlFor={labelFor} data-test-id={TEST_IDS.label}>
34
32
  {label}