@cloud-ru/ds-tree 1.0.45-preview-de7dadcf.0 → 1.0.45-preview-2e992735.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-tree",
3
- "version": "1.0.45-preview-de7dadcf.0",
3
+ "version": "1.0.45-preview-2e992735.0",
4
4
  "description": "Иерархический список с раскрывающимися узлами, выбором (single/multiple), кастомными иконками, контекстными действиями и асинхронной подгрузкой потомков.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -35,15 +35,15 @@
35
35
  "dependencies": {
36
36
  "classnames": "^2.5.1",
37
37
  "react-transition-state": "^2.4.0",
38
- "@cloud-ru/ds-button": "1.0.5",
39
- "@cloud-ru/ds-icons": "1.7.2",
40
- "@cloud-ru/ds-materials": "2.0.2",
41
- "@cloud-ru/ds-loader": "1.0.4",
42
- "@cloud-ru/ds-toggles": "1.1.15",
43
- "@cloud-ru/ds-truncate-string": "1.0.19",
38
+ "@cloud-ru/ds-button": "1.0.6-preview-2e992735.0",
39
+ "@cloud-ru/ds-icons": "1.7.3-preview-2e992735.0",
40
+ "@cloud-ru/ds-list": "3.1.2-preview-2e992735.0",
41
+ "@cloud-ru/ds-loader": "1.0.5-preview-2e992735.0",
42
+ "@cloud-ru/ds-materials": "2.0.3-preview-2e992735.0",
43
+ "@cloud-ru/ds-truncate-string": "1.0.20-preview-2e992735.0",
44
44
  "@cloud-ru/ds-typography": "1.0.2",
45
- "@cloud-ru/ds-utils": "1.3.0",
46
- "@cloud-ru/ds-list": "3.1.2-preview-de7dadcf.0"
45
+ "@cloud-ru/ds-toggles": "1.1.16-preview-2e992735.0",
46
+ "@cloud-ru/ds-utils": "1.3.1-preview-2e992735.0"
47
47
  },
48
48
  "publishConfig": {
49
49
  "access": "public"
@@ -35,6 +35,7 @@ $line-width: var(--tree-line-width, #{base.$sn-density-icon-s});
35
35
  }
36
36
 
37
37
  &[data-horizontal] {
38
+ align-self: stretch;
38
39
  box-sizing: border-box;
39
40
 
40
41
  &::after {
@@ -278,33 +278,35 @@ export const TreeNode = forwardRef<HTMLDivElement, TreeNodeComponentProps>(
278
278
  data-size={size}
279
279
  ref={ref}
280
280
  >
281
- {parentNode && <TreeLine halfWidth horizontal visible={showLines} data-test-id={TEST_IDS.line} />}
282
-
283
- <div className={styles.treeNodeExpandButtonWrapper}>
284
- {isExpandable ? (
285
- <>
286
- <button
287
- type='button'
288
- onClick={onChevronClick}
289
- data-expanded={isExpanded || undefined}
290
- className={styles.treeNodeExpandButton}
291
- tabIndex={-1}
292
- data-test-id={TEST_IDS.chevron}
293
- aria-label={isExpanded ? 'Collapse' : 'Expand'}
294
- >
295
- <span
296
- className={styles.treeNodeExpandButtonStateLayer}
297
- aria-hidden
298
- data-state='emptyNeutralOnBackground'
299
- />
300
- {loading ? <Spinner size={CONTROL_SIZE_BY_TREE_SIZE[size]} /> : <ChevronRightSVG />}
301
- </button>
302
- <TreeLine visible={isExpanded && showLines} />
303
- </>
304
- ) : (
305
- <div className={styles.treeNodeExpandButtonSpacer} aria-hidden />
306
- )}
307
- </div>
281
+ {parentNode && <TreeLine halfWidth={isExpandable} horizontal visible={showLines} />}
282
+
283
+ {(isExpandable || !parentNode) && (
284
+ <div className={styles.treeNodeExpandButtonWrapper}>
285
+ {isExpandable ? (
286
+ <>
287
+ <button
288
+ type='button'
289
+ onClick={onChevronClick}
290
+ data-expanded={isExpanded || undefined}
291
+ className={styles.treeNodeExpandButton}
292
+ tabIndex={-1}
293
+ data-test-id={TEST_IDS.chevron}
294
+ aria-label={isExpanded ? 'Collapse' : 'Expand'}
295
+ >
296
+ <span
297
+ className={styles.treeNodeExpandButtonStateLayer}
298
+ aria-hidden
299
+ data-state='emptyNeutralOnBackground'
300
+ />
301
+ {loading ? <Spinner size={CONTROL_SIZE_BY_TREE_SIZE[size]} /> : <ChevronRightSVG />}
302
+ </button>
303
+ <TreeLine visible={isExpanded && showLines} />
304
+ </>
305
+ ) : (
306
+ <div className={styles.treeNodeExpandButtonSpacer} aria-hidden />
307
+ )}
308
+ </div>
309
+ )}
308
310
 
309
311
  <div
310
312
  role='treeitem'
@@ -243,6 +243,10 @@ $icon-size-by-size: (
243
243
  @include base.composite-var(base.$base-styles, 'sn', 'regular', 'body', $size);
244
244
  }
245
245
 
246
+ .treeNodeTitle {
247
+ @include base.composite-var(tree.$tree, 'anatomy', 'size', $size, 'treeItem', 'contentWrapper', 'textWrapper');
248
+ }
249
+
246
250
  .treeNodeCheckboxWrap,
247
251
  .treeNodeExpandButtonWrapper {
248
252
  width: $centered-width;