@cloud-ru/ds-attachment 1.0.5-preview-04507fc5.0 → 1.1.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-attachment",
3
- "version": "1.0.5-preview-04507fc5.0",
3
+ "version": "1.1.0",
4
4
  "description": "Пакет компонентов для отображения прикреплённых файлов — Attachment (горизонтальный) и AttachmentSquare (квадратный).",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,15 +34,15 @@
34
34
  ],
35
35
  "dependencies": {
36
36
  "classnames": "^2.5.1",
37
- "@cloud-ru/ds-button": "1.0.1",
38
- "@cloud-ru/ds-field-decorator": "1.0.2",
39
- "@cloud-ru/ds-card": "1.0.5-preview-04507fc5.0",
40
- "@cloud-ru/ds-icons": "1.0.1",
41
- "@cloud-ru/ds-icon-predefined": "1.0.1",
42
- "@cloud-ru/ds-loader": "1.0.1",
43
- "@cloud-ru/ds-truncate-string": "1.0.2",
44
- "@cloud-ru/ds-utils": "1.1.0",
45
- "@cloud-ru/ds-materials": "1.0.1"
37
+ "@cloud-ru/ds-button": "^1.0.1",
38
+ "@cloud-ru/ds-card": "^1.0.5",
39
+ "@cloud-ru/ds-icon-predefined": "^1.0.1",
40
+ "@cloud-ru/ds-field-decorator": "^1.0.3",
41
+ "@cloud-ru/ds-icons": "^1.0.2",
42
+ "@cloud-ru/ds-loader": "^1.0.1",
43
+ "@cloud-ru/ds-materials": "^1.0.1",
44
+ "@cloud-ru/ds-truncate-string": "^1.0.3",
45
+ "@cloud-ru/ds-utils": "^1.1.0"
46
46
  },
47
47
  "publishConfig": {
48
48
  "access": "public"
@@ -27,6 +27,7 @@ export function Attachment({
27
27
  onRetry,
28
28
  size = 's',
29
29
  truncate,
30
+ fullWidth = true,
30
31
  className,
31
32
  ...rest
32
33
  }: AttachmentProps) {
@@ -52,6 +53,7 @@ export function Attachment({
52
53
  multiSelect
53
54
  interactive={interactive}
54
55
  className={cn(styles.root, className)}
56
+ data-full-width={fullWidth || undefined}
55
57
  data-attachment-error={hasError || undefined}
56
58
  aria-busy={isLoading || undefined}
57
59
  >
@@ -8,6 +8,11 @@ $sizes: 's', 'm';
8
8
  display: inline-block;
9
9
  width: fit-content;
10
10
  max-width: 100%;
11
+
12
+ &[data-full-width] {
13
+ display: block;
14
+ width: 100%;
15
+ }
11
16
  }
12
17
 
13
18
  .composition {
package/src/types.ts CHANGED
@@ -54,6 +54,11 @@ export type AttachmentSquareProps = WithSupportProps<{
54
54
  }>;
55
55
 
56
56
  export type AttachmentProps = AttachmentSquareProps & {
57
+ /**
58
+ * Растянуть карточку на всю ширину контейнера. Выключенная — ужимается по содержимому.
59
+ * @default true
60
+ */
61
+ fullWidth?: boolean;
57
62
  truncate?: {
58
63
  /**
59
64
  * Максимальное кол-во строк заголовка