@dreamcommerce/aurora 2.10.9-2 → 2.10.9-4

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.
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var React = require('react');
6
6
  var classnames = require('classnames');
7
7
  var reactTransitionGroup = require('react-transition-group');
8
- var index = require('../../spacing/index.js');
9
8
  var css_classes = require('../css_classes.js');
10
9
  var main_module = require('../../../css/tree/main.module.less.js');
11
10
  var icon_list_arrow_down = require('../../../assets/icon_list_arrow_down.js');
@@ -17,7 +16,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
17
16
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
18
17
  var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
19
18
 
20
- const TreeNode = ({ children, id, cssClassNames, ContentComponent, LabelComponent, labelWithNoChildrenSpacingLeft, ...rest }) => {
19
+ const TreeNode = ({ children, id, cssClassNames, ContentComponent, LabelComponent, ...rest }) => {
21
20
  const treeApi = tree_hook.useTree();
22
21
  const node = tree_node_hook.useTreeNode(id, rest);
23
22
  const nodeChildrenRef = React.useRef(null);
@@ -37,9 +36,10 @@ const TreeNode = ({ children, id, cssClassNames, ContentComponent, LabelComponen
37
36
  React__default['default'].createElement(icon_list_arrow_down.IconListArrowDown, null))),
38
37
  Label));
39
38
  return (React__default['default'].createElement("li", { role: "treeitem", "aria-expanded": node.expanded, className: classnames__default['default'](main_module['default'][css_classes.TREE_NODE_CSS_CLASSES.treeNode], css_classes.TREE_NODE_CSS_CLASSES.treeNode, cssClassNames, {
40
- [css_classes.TREE_NODE_CSS_CLASSES.treeNodeExpanded]: node.expanded
39
+ [css_classes.TREE_NODE_CSS_CLASSES.treeNodeExpanded]: node.expanded,
40
+ [css_classes.TREE_NODE_CSS_CLASSES.treeNodeWithoutChildren]: !childrenCount
41
41
  }) },
42
- childrenCount ? (Content) : (React__default['default'].createElement(index['default'], { as: "div", "pl-xs": labelWithNoChildrenSpacingLeft }, Label)),
42
+ childrenCount ? Content : Label,
43
43
  childrenCount ? (React__default['default'].createElement(reactTransitionGroup.CSSTransition, { unmountOnExit: true, in: node.expanded, timeout: 250, classNames: {
44
44
  enter: main_module['default'][css_classes.TREE_NODE_CSS_CLASSES.treeNodeChildrenEnter],
45
45
  enterActive: main_module['default'][css_classes.TREE_NODE_CSS_CLASSES.treeNodeChildrenEnterActive],
@@ -23,7 +23,8 @@ const TREE_NODE_CSS_CLASSES = {
23
23
  treeNodeChildrenExitDone: `${treeNodeBaseCssClass}__children-exit-done`,
24
24
  treeNodeExpanded: `${treeNodeBaseCssClass}_expanded`,
25
25
  treeNodeDisabled: `${treeNodeBaseCssClass}_disabled`,
26
- treeNodeFocused: `${treeNodeBaseCssClass}_focused`
26
+ treeNodeFocused: `${treeNodeBaseCssClass}_focused`,
27
+ treeNodeWithoutChildren: `${treeNodeBaseCssClass}_without-children`
27
28
  };
28
29
 
29
30
  exports.TREE_CSS_CLASSES = TREE_CSS_CLASSES;
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- export declare type TSpacingRange = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
2
+ declare type TSpacingRange = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
3
3
  export interface ISpacingProps {
4
4
  as: string;
5
5
  children: ReactNode;
@@ -44,3 +44,4 @@ export interface ISpacingProps {
44
44
  'pb-xl'?: TSpacingRange;
45
45
  'pl-xl'?: TSpacingRange;
46
46
  }
47
+ export {};
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import { ITreeNode } from "../context/tree_context";
3
3
  import { TPropsWithChildren } from "../../../typings/general";
4
- import { TSpacingRange } from "../../spacing/types";
5
4
  declare type TTreeContentComponentProps = {
6
5
  node: ITreeNode;
7
6
  toggleNode: () => void;
@@ -17,7 +16,6 @@ declare type TTreeNodeProps = TPropsWithChildren<ITreeNode & {
17
16
  expandIcon?: React.ReactNode;
18
17
  LabelComponent?: (props: TTreeLabelComponentProps) => React.ReactNode;
19
18
  ContentComponent?: (props: TTreeContentComponentProps) => React.ReactNode;
20
- labelWithNoChildrenSpacingLeft?: TSpacingRange;
21
19
  }>;
22
- export declare const TreeNode: ({ children, id, cssClassNames, ContentComponent, LabelComponent, labelWithNoChildrenSpacingLeft, ...rest }: TTreeNodeProps) => JSX.Element | null;
20
+ export declare const TreeNode: ({ children, id, cssClassNames, ContentComponent, LabelComponent, ...rest }: TTreeNodeProps) => JSX.Element | null;
23
21
  export default TreeNode;
@@ -1,14 +1,13 @@
1
1
  import React, { useRef, Children } from 'react';
2
2
  import classnames from 'classnames';
3
3
  import { CSSTransition } from 'react-transition-group';
4
- import Spacing from '../../spacing/index.js';
5
4
  import { TREE_NODE_CSS_CLASSES } from '../css_classes.js';
6
5
  import cssClasses from '../../../css/tree/main.module.less.js';
7
6
  import { IconListArrowDown } from '../../../assets/icon_list_arrow_down.js';
8
7
  import { useTree } from '../hooks/tree_hook.js';
9
8
  import { useTreeNode } from '../hooks/tree_node_hook.js';
10
9
 
11
- const TreeNode = ({ children, id, cssClassNames, ContentComponent, LabelComponent, labelWithNoChildrenSpacingLeft, ...rest }) => {
10
+ const TreeNode = ({ children, id, cssClassNames, ContentComponent, LabelComponent, ...rest }) => {
12
11
  const treeApi = useTree();
13
12
  const node = useTreeNode(id, rest);
14
13
  const nodeChildrenRef = useRef(null);
@@ -28,9 +27,10 @@ const TreeNode = ({ children, id, cssClassNames, ContentComponent, LabelComponen
28
27
  React.createElement(IconListArrowDown, null))),
29
28
  Label));
30
29
  return (React.createElement("li", { role: "treeitem", "aria-expanded": node.expanded, className: classnames(cssClasses[TREE_NODE_CSS_CLASSES.treeNode], TREE_NODE_CSS_CLASSES.treeNode, cssClassNames, {
31
- [TREE_NODE_CSS_CLASSES.treeNodeExpanded]: node.expanded
30
+ [TREE_NODE_CSS_CLASSES.treeNodeExpanded]: node.expanded,
31
+ [TREE_NODE_CSS_CLASSES.treeNodeWithoutChildren]: !childrenCount
32
32
  }) },
33
- childrenCount ? (Content) : (React.createElement(Spacing, { as: "div", "pl-xs": labelWithNoChildrenSpacingLeft }, Label)),
33
+ childrenCount ? Content : Label,
34
34
  childrenCount ? (React.createElement(CSSTransition, { unmountOnExit: true, in: node.expanded, timeout: 250, classNames: {
35
35
  enter: cssClasses[TREE_NODE_CSS_CLASSES.treeNodeChildrenEnter],
36
36
  enterActive: cssClasses[TREE_NODE_CSS_CLASSES.treeNodeChildrenEnterActive],
@@ -18,4 +18,5 @@ export declare const TREE_NODE_CSS_CLASSES: {
18
18
  readonly treeNodeExpanded: "tree-node_expanded";
19
19
  readonly treeNodeDisabled: "tree-node_disabled";
20
20
  readonly treeNodeFocused: "tree-node_focused";
21
+ readonly treeNodeWithoutChildren: "tree-node_without-children";
21
22
  };
@@ -19,7 +19,8 @@ const TREE_NODE_CSS_CLASSES = {
19
19
  treeNodeChildrenExitDone: `${treeNodeBaseCssClass}__children-exit-done`,
20
20
  treeNodeExpanded: `${treeNodeBaseCssClass}_expanded`,
21
21
  treeNodeDisabled: `${treeNodeBaseCssClass}_disabled`,
22
- treeNodeFocused: `${treeNodeBaseCssClass}_focused`
22
+ treeNodeFocused: `${treeNodeBaseCssClass}_focused`,
23
+ treeNodeWithoutChildren: `${treeNodeBaseCssClass}_without-children`
23
24
  };
24
25
 
25
26
  export { TREE_CSS_CLASSES, TREE_NODE_CSS_CLASSES };
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@dreamcommerce/aurora",
3
3
  "packageManager": "yarn@3.2.0",
4
4
  "sideEffects": false,
5
- "version": "2.10.9-2",
5
+ "version": "2.10.9-4",
6
6
  "description": "aurora",
7
7
  "author": "k0ssak",
8
8
  "license": "MIT",