@dreamcommerce/aurora 3.0.0-82 → 3.0.0-84

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.
Files changed (28) hide show
  1. package/build/cjs/packages/aurora/src/components/accordion/components/accordion_item.js +1 -1
  2. package/build/cjs/packages/aurora/src/components/accordion/components/accordion_trigger.js +2 -2
  3. package/build/cjs/packages/aurora/src/components/select/components/select_trigger.js +1 -1
  4. package/build/cjs/packages/aurora/src/components/tree/constants.js +8 -0
  5. package/build/cjs/packages/aurora/src/components/tree/constants.js.map +1 -0
  6. package/build/cjs/packages/aurora/src/components/tree/context/tree_context.js +23 -0
  7. package/build/cjs/packages/aurora/src/components/tree/context/tree_context.js.map +1 -0
  8. package/build/cjs/packages/aurora/src/components/tree/context/tree_provider.js +65 -0
  9. package/build/cjs/packages/aurora/src/components/tree/context/tree_provider.js.map +1 -0
  10. package/build/cjs/packages/aurora/src/components/tree/index.js +33 -0
  11. package/build/cjs/packages/aurora/src/components/tree/index.js.map +1 -0
  12. package/build/cjs/packages/aurora/src/index.js +4 -2
  13. package/build/cjs/packages/aurora/src/index.js.map +1 -1
  14. package/build/esm/packages/aurora/src/components/accordion/components/accordion_item.js +1 -1
  15. package/build/esm/packages/aurora/src/components/accordion/components/accordion_trigger.js +2 -2
  16. package/build/esm/packages/aurora/src/components/select/components/select_trigger.js +1 -1
  17. package/build/esm/packages/aurora/src/components/tree/constants.js +4 -2
  18. package/build/esm/packages/aurora/src/components/tree/constants.js.map +1 -1
  19. package/build/esm/packages/aurora/src/components/tree/context/tree_context.js +16 -9
  20. package/build/esm/packages/aurora/src/components/tree/context/tree_context.js.map +1 -1
  21. package/build/esm/packages/aurora/src/components/tree/context/tree_provider.js +56 -28
  22. package/build/esm/packages/aurora/src/components/tree/context/tree_provider.js.map +1 -1
  23. package/build/esm/packages/aurora/src/components/tree/index.js +21 -8
  24. package/build/esm/packages/aurora/src/components/tree/index.js.map +1 -1
  25. package/build/esm/packages/aurora/src/index.d.ts +1 -0
  26. package/build/esm/packages/aurora/src/index.js +2 -1
  27. package/build/esm/packages/aurora/src/index.js.map +1 -1
  28. package/package.json +1 -1
@@ -4,8 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
  var _rollupPluginBabelHelpers = require('../../../../../../_virtual/_rollupPluginBabelHelpers.js');
7
- var AccordionPrimitive = require('@radix-ui/react-accordion');
8
7
  var cn = require('../../../utilities/cn.js');
8
+ var AccordionPrimitive = require('@radix-ui/react-accordion');
9
9
 
10
10
  var _excluded = ["className", "borderStyle"];
11
11
  var AccordionItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
@@ -4,11 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
  var _rollupPluginBabelHelpers = require('../../../../../../_virtual/_rollupPluginBabelHelpers.js');
7
+ var css_icon_color_tokens = require('../../../constants/css_tokens/css_icon_color_tokens.js');
8
+ var cn = require('../../../utilities/cn.js');
7
9
  var AccordionPrimitive = require('@radix-ui/react-accordion');
8
10
  var accordion_constants = require('../accordion_constants.js');
9
- var css_icon_color_tokens = require('../../../constants/css_tokens/css_icon_color_tokens.js');
10
11
  var accordion_context = require('../context/accordion_context.js');
11
- var cn = require('../../../utilities/cn.js');
12
12
  var arrow_right = require('../../../assets/icons/arrow_right.js');
13
13
 
14
14
  var _excluded = ["className", "children", "backgroundColor", "icon", "iconColor"];
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
  var _rollupPluginBabelHelpers = require('../../../../../../_virtual/_rollupPluginBabelHelpers.js');
7
+ var arrow_down_s_fill = require('../../../assets/icons/arrow_down_s_fill.js');
7
8
  var cn = require('../../../utilities/cn.js');
8
9
  var SelectPrimitive = require('@radix-ui/react-select');
9
- var arrow_down_s_fill = require('../../../assets/icons/arrow_down_s_fill.js');
10
10
 
11
11
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
12
 
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var TREE_ROLE_ATTRIBUTE = 'tree';
6
+
7
+ exports.TREE_ROLE_ATTRIBUTE = TREE_ROLE_ATTRIBUTE;
8
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+
7
+ var TreeContext = /*#__PURE__*/React.createContext({
8
+ addNode: function addNode() {},
9
+ updateNode: function updateNode() {},
10
+ removeNode: function removeNode() {},
11
+ toggleNode: function toggleNode() {},
12
+ getNode: function getNode() {
13
+ return undefined;
14
+ },
15
+ hasNode: function hasNode() {
16
+ return false;
17
+ }
18
+ });
19
+ var TreeContextProvider = TreeContext.Provider;
20
+
21
+ exports.TreeContext = TreeContext;
22
+ exports.TreeContextProvider = TreeContextProvider;
23
+ //# sourceMappingURL=tree_context.js.map
@@ -0,0 +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;"}
@@ -0,0 +1,65 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var _rollupPluginBabelHelpers = require('../../../../../../_virtual/_rollupPluginBabelHelpers.js');
7
+ var tree_context = require('./tree_context.js');
8
+
9
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
+
11
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
12
+
13
+ var TreeProvider = function TreeProvider(_ref) {
14
+ var children = _ref.children;
15
+ var _useState = React.useState([]),
16
+ _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
17
+ nodes = _useState2[0],
18
+ setNodes = _useState2[1];
19
+ var value = {
20
+ addNode: function addNode(node) {
21
+ setNodes(function (nodes) {
22
+ return [].concat(_rollupPluginBabelHelpers.toConsumableArray(nodes), [node]);
23
+ });
24
+ },
25
+ updateNode: function updateNode(nodeId, node) {
26
+ setNodes(function (nodes) {
27
+ return nodes.map(function (n) {
28
+ return n.id === nodeId ? _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, n), node) : n;
29
+ });
30
+ });
31
+ },
32
+ getNode: function getNode(nodeId) {
33
+ return nodes.find(function (node) {
34
+ return node.id === nodeId;
35
+ });
36
+ },
37
+ removeNode: function removeNode(nodeId) {
38
+ setNodes(function (nodes) {
39
+ return nodes.filter(function (node) {
40
+ return node.id !== nodeId;
41
+ });
42
+ });
43
+ },
44
+ toggleNode: function toggleNode(nodeId) {
45
+ setNodes(function (nodes) {
46
+ return nodes.map(function (node) {
47
+ return node.id === nodeId ? _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, node), {}, {
48
+ expanded: !node.expanded
49
+ }) : node;
50
+ });
51
+ });
52
+ },
53
+ hasNode: function hasNode(nodeId) {
54
+ return !!nodes.find(function (node) {
55
+ return node.id === nodeId;
56
+ });
57
+ }
58
+ };
59
+ return /*#__PURE__*/React__default['default'].createElement(tree_context.TreeContextProvider, {
60
+ value: value
61
+ }, children);
62
+ };
63
+
64
+ exports.TreeProvider = TreeProvider;
65
+ //# sourceMappingURL=tree_provider.js.map
@@ -0,0 +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;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;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1,33 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var cn = require('../../utilities/cn.js');
7
+ var constants = require('./constants.js');
8
+ var tree_provider = require('./context/tree_provider.js');
9
+
10
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
+
12
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
13
+
14
+ // eslint-disable-next-line react/display-name
15
+ var Tree = /*#__PURE__*/React__default['default'].forwardRef(function (_ref, ref) {
16
+ var children = _ref.children,
17
+ cssClassNames = _ref.cssClassNames,
18
+ cssStyles = _ref.cssStyles,
19
+ onMouseEnter = _ref.onMouseEnter,
20
+ onMouseLeave = _ref.onMouseLeave;
21
+ return /*#__PURE__*/React__default['default'].createElement(tree_provider.TreeProvider, null, /*#__PURE__*/React__default['default'].createElement("ul", {
22
+ role: constants.TREE_ROLE_ATTRIBUTE,
23
+ onMouseEnter: onMouseEnter,
24
+ onMouseLeave: onMouseLeave,
25
+ ref: ref,
26
+ style: cssStyles,
27
+ className: cn.cn('aurora-list-none aurora-flex aurora-flex-col aurora-gap-2', cssClassNames)
28
+ }, children));
29
+ });
30
+
31
+ exports.Tree = Tree;
32
+ exports.default = Tree;
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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;AACA;AACA;"}
@@ -2,7 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var accordion_constants = require('./components/accordion/accordion_constants.js');
6
5
  var css_background_tokens = require('./constants/css_tokens/css_background_tokens.js');
7
6
  var css_border_color_tokens = require('./constants/css_tokens/css_border_color_tokens.js');
8
7
  var css_border_radius_tokens = require('./constants/css_tokens/css_border_radius_tokens.js');
@@ -18,6 +17,8 @@ var css_border_style_tokens = require('./constants/css_tokens/css_border_style_t
18
17
  var css_position_tokens = require('./constants/css_tokens/css_position_tokens.js');
19
18
  var css_border_width_tokens = require('./constants/css_tokens/css_border_width_tokens.js');
20
19
  var css_icon_color_tokens = require('./constants/css_tokens/css_icon_color_tokens.js');
20
+ var index = require('./components/tree/index.js');
21
+ var accordion_constants = require('./components/accordion/accordion_constants.js');
21
22
  var accordion = require('./components/accordion/accordion.js');
22
23
  var accordion_content = require('./components/accordion/components/accordion_content.js');
23
24
  var accordion_item = require('./components/accordion/components/accordion_item.js');
@@ -111,7 +112,6 @@ var use_toggle = require('./hooks/use_toggle.js');
111
112
 
112
113
 
113
114
 
114
- exports.ACCORDION_SIZES = accordion_constants.ACCORDION_SIZES;
115
115
  exports.CSS_BACKGROUND_TOKENS = css_background_tokens.CSS_BACKGROUND_TOKENS;
116
116
  exports.CSS_BORDER_COLOR_TOKENS = css_border_color_tokens.CSS_BORDER_COLOR_TOKENS;
117
117
  exports.CSS_BORDER_RADIUS_SIDE_TOKENS = css_border_radius_tokens.CSS_BORDER_RADIUS_SIDE_TOKENS;
@@ -129,6 +129,8 @@ exports.CSS_POSITION_TOKENS = css_position_tokens.CSS_POSITION_TOKENS;
129
129
  exports.CSS_BORDER_WIDTH_SIDE_TOKENS = css_border_width_tokens.CSS_BORDER_WIDTH_SIDE_TOKENS;
130
130
  exports.CSS_BORDER_WIDTH_TOKENS = css_border_width_tokens.CSS_BORDER_WIDTH_TOKENS;
131
131
  exports.CSS_ICON_COLOR_TOKENS_VALUES = css_icon_color_tokens.CSS_ICON_COLOR_TOKENS_VALUES;
132
+ exports.Tree = index.Tree;
133
+ exports.ACCORDION_SIZES = accordion_constants.ACCORDION_SIZES;
132
134
  exports.Accordion = accordion.Accordion;
133
135
  exports.AccordionContent = accordion_content.AccordionContent;
134
136
  exports.AccordionItem = accordion_item.AccordionItem;
@@ -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;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;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;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;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;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;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;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;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;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;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;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;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;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;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,7 +1,7 @@
1
1
  import { forwardRef, createElement } from 'react';
2
2
  import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2, defineProperty as _defineProperty } from '../../../../../../_virtual/_rollupPluginBabelHelpers.js';
3
- import { Item } from '@radix-ui/react-accordion';
4
3
  import { cn } from '../../../utilities/cn.js';
4
+ import { Item } from '@radix-ui/react-accordion';
5
5
 
6
6
  var _excluded = ["className", "borderStyle"];
7
7
  var AccordionItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
@@ -1,10 +1,10 @@
1
1
  import { forwardRef, useContext, createElement } from 'react';
2
2
  import { objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, objectSpread2 as _objectSpread2 } from '../../../../../../_virtual/_rollupPluginBabelHelpers.js';
3
+ import { CSS_ICON_COLOR_TOKENS_VALUES } from '../../../constants/css_tokens/css_icon_color_tokens.js';
4
+ import { cn } from '../../../utilities/cn.js';
3
5
  import { Header, Trigger } from '@radix-ui/react-accordion';
4
6
  import { ACCORDION_SIZES } from '../accordion_constants.js';
5
- import { CSS_ICON_COLOR_TOKENS_VALUES } from '../../../constants/css_tokens/css_icon_color_tokens.js';
6
7
  import { AccordionContext } from '../context/accordion_context.js';
7
- import { cn } from '../../../utilities/cn.js';
8
8
  import { ArrowRightIcon } from '../../../assets/icons/arrow_right.js';
9
9
 
10
10
  var _excluded = ["className", "children", "backgroundColor", "icon", "iconColor"];
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../../../../../../_virtual/_rollupPluginBabelHelpers.js';
3
+ import { ArrowDownSFillIcon } from '../../../assets/icons/arrow_down_s_fill.js';
3
4
  import { cn } from '../../../utilities/cn.js';
4
5
  import { Trigger, Icon } from '@radix-ui/react-select';
5
- import { ArrowDownSFillIcon } from '../../../assets/icons/arrow_down_s_fill.js';
6
6
 
7
7
  var _excluded = ["className", "hasError", "children"];
8
8
  var SelectTrigger = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
@@ -1,2 +1,4 @@
1
- export const TREE_ROLE_ATTRIBUTE = 'tree';
2
- //# sourceMappingURL=constants.js.map
1
+ var TREE_ROLE_ATTRIBUTE = 'tree';
2
+
3
+ export { TREE_ROLE_ATTRIBUTE };
4
+ //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../src/components/tree/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;"}
@@ -1,11 +1,18 @@
1
1
  import { createContext } from 'react';
2
- export const TreeContext = createContext({
3
- addNode: () => { },
4
- updateNode: () => { },
5
- removeNode: () => { },
6
- toggleNode: () => { },
7
- getNode: () => undefined,
8
- hasNode: () => false
2
+
3
+ var TreeContext = /*#__PURE__*/createContext({
4
+ addNode: function addNode() {},
5
+ updateNode: function updateNode() {},
6
+ removeNode: function removeNode() {},
7
+ toggleNode: function toggleNode() {},
8
+ getNode: function getNode() {
9
+ return undefined;
10
+ },
11
+ hasNode: function hasNode() {
12
+ return false;
13
+ }
9
14
  });
10
- export const TreeContextProvider = TreeContext.Provider;
11
- //# sourceMappingURL=tree_context.js.map
15
+ var TreeContextProvider = TreeContext.Provider;
16
+
17
+ export { TreeContext, TreeContextProvider };
18
+ //# sourceMappingURL=tree_context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tree_context.js","sourceRoot":"","sources":["../../../../../../../../src/components/tree/context/tree_context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAkBtC,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAe;IACnD,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;IACjB,UAAU,EAAE,GAAG,EAAE,GAAE,CAAC;IACpB,UAAU,EAAE,GAAG,EAAE,GAAE,CAAC;IACpB,UAAU,EAAE,GAAG,EAAE,GAAE,CAAC;IACpB,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS;IACxB,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK;CACvB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,CAAC,QAAQ,CAAC"}
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;"}
@@ -1,29 +1,57 @@
1
- import { TreeContextProvider } from '@auroraComponents/tree/context/tree_context';
2
- import { useState } from 'react';
3
- import React from 'react';
4
- import '@auroraTypings/general';
5
- export const TreeProvider = ({ children }) => {
6
- const [nodes, setNodes] = useState([]);
7
- const value = {
8
- addNode(node) {
9
- setNodes((nodes) => [...nodes, node]);
10
- },
11
- updateNode(nodeId, node) {
12
- setNodes((nodes) => nodes.map((n) => (n.id === nodeId ? { ...n, ...node } : n)));
13
- },
14
- getNode(nodeId) {
15
- return nodes.find((node) => node.id === nodeId);
16
- },
17
- removeNode(nodeId) {
18
- setNodes((nodes) => nodes.filter((node) => node.id !== nodeId));
19
- },
20
- toggleNode(nodeId) {
21
- setNodes((nodes) => nodes.map((node) => (node.id === nodeId ? { ...node, expanded: !node.expanded } : node)));
22
- },
23
- hasNode(nodeId) {
24
- return !!nodes.find((node) => node.id === nodeId);
25
- }
26
- };
27
- return React.createElement(TreeContextProvider, { value: value }, children);
1
+ import React, { useState } from 'react';
2
+ import { slicedToArray as _slicedToArray, toConsumableArray as _toConsumableArray, objectSpread2 as _objectSpread2 } from '../../../../../../_virtual/_rollupPluginBabelHelpers.js';
3
+ import { TreeContextProvider } from './tree_context.js';
4
+
5
+ var TreeProvider = function TreeProvider(_ref) {
6
+ var children = _ref.children;
7
+ var _useState = useState([]),
8
+ _useState2 = _slicedToArray(_useState, 2),
9
+ nodes = _useState2[0],
10
+ setNodes = _useState2[1];
11
+ var value = {
12
+ addNode: function addNode(node) {
13
+ setNodes(function (nodes) {
14
+ return [].concat(_toConsumableArray(nodes), [node]);
15
+ });
16
+ },
17
+ updateNode: function updateNode(nodeId, node) {
18
+ setNodes(function (nodes) {
19
+ return nodes.map(function (n) {
20
+ return n.id === nodeId ? _objectSpread2(_objectSpread2({}, n), node) : n;
21
+ });
22
+ });
23
+ },
24
+ getNode: function getNode(nodeId) {
25
+ return nodes.find(function (node) {
26
+ return node.id === nodeId;
27
+ });
28
+ },
29
+ removeNode: function removeNode(nodeId) {
30
+ setNodes(function (nodes) {
31
+ return nodes.filter(function (node) {
32
+ return node.id !== nodeId;
33
+ });
34
+ });
35
+ },
36
+ toggleNode: function toggleNode(nodeId) {
37
+ setNodes(function (nodes) {
38
+ return nodes.map(function (node) {
39
+ return node.id === nodeId ? _objectSpread2(_objectSpread2({}, node), {}, {
40
+ expanded: !node.expanded
41
+ }) : node;
42
+ });
43
+ });
44
+ },
45
+ hasNode: function hasNode(nodeId) {
46
+ return !!nodes.find(function (node) {
47
+ return node.id === nodeId;
48
+ });
49
+ }
50
+ };
51
+ return /*#__PURE__*/React.createElement(TreeContextProvider, {
52
+ value: value
53
+ }, children);
28
54
  };
29
- //# sourceMappingURL=tree_provider.js.map
55
+
56
+ export { TreeProvider };
57
+ //# sourceMappingURL=tree_provider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tree_provider.js","sourceRoot":"","sources":["../../../../../../../../src/components/tree/context/tree_provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAa,MAAM,6CAA6C,CAAC;AAC3G,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAmC,wBAAwB,CAAC;AAE5D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,QAAQ,EAAsB,EAAE,EAAE;IAC7D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAc,EAAE,CAAC,CAAC;IAEpD,MAAM,KAAK,GAAiB;QACxB,OAAO,CAAC,IAAe;YACnB,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;QAC1C,CAAC;QACD,UAAU,CAAC,MAAc,EAAE,IAAwB;YAC/C,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACrF,CAAC;QACD,OAAO,CAAC,MAAc;YAClB,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC,CAAC;QACpD,CAAC;QACD,UAAU,CAAC,MAAc;YACrB,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC,CAAC,CAAC;QACpE,CAAC;QACD,UAAU,CAAC,MAAc;YACrB,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClH,CAAC;QACD,OAAO,CAAC,MAAc;YAClB,OAAO,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC,CAAC;QACtD,CAAC;KACJ,CAAC;IAEF,OAAO,oBAAC,mBAAmB,IAAC,KAAK,EAAE,KAAK,IAAG,QAAQ,CAAuB,CAAC;AAC/E,CAAC,CAAC"}
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;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,12 +1,25 @@
1
1
  import React from 'react';
2
- import '@auroraTypings/general';
3
- import { TREE_ROLE_ATTRIBUTE } from './constants';
4
- import { TreeProvider } from '@auroraComponents/tree/context/tree_provider';
5
- import { cn } from '@auroraUtilities/cn';
2
+ import { cn } from '../../utilities/cn.js';
3
+ import { TREE_ROLE_ATTRIBUTE } from './constants.js';
4
+ import { TreeProvider } from './context/tree_provider.js';
5
+
6
6
  // eslint-disable-next-line react/display-name
7
- export const Tree = React.forwardRef(({ children, cssClassNames, cssStyles, onMouseEnter, onMouseLeave }, ref) => {
8
- return (React.createElement(TreeProvider, null,
9
- React.createElement("ul", { role: TREE_ROLE_ATTRIBUTE, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, ref: ref, style: cssStyles, className: cn('aurora-list-none aurora-flex aurora-flex-col aurora-gap-2', cssClassNames) }, children)));
7
+ var Tree = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
8
+ var children = _ref.children,
9
+ cssClassNames = _ref.cssClassNames,
10
+ cssStyles = _ref.cssStyles,
11
+ onMouseEnter = _ref.onMouseEnter,
12
+ onMouseLeave = _ref.onMouseLeave;
13
+ return /*#__PURE__*/React.createElement(TreeProvider, null, /*#__PURE__*/React.createElement("ul", {
14
+ role: TREE_ROLE_ATTRIBUTE,
15
+ onMouseEnter: onMouseEnter,
16
+ onMouseLeave: onMouseLeave,
17
+ ref: ref,
18
+ style: cssStyles,
19
+ className: cn('aurora-list-none aurora-flex aurora-flex-col aurora-gap-2', cssClassNames)
20
+ }, children));
10
21
  });
22
+
11
23
  export default Tree;
12
- //# sourceMappingURL=index.js.map
24
+ export { Tree };
25
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/components/tree/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAmC,wBAAwB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;AAC5E,OAAO,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AASzC,8CAA8C;AAC9C,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAChC,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAkC,EAAE,GAAgC,EAAE,EAAE;IACrI,OAAO,CACH,oBAAC,YAAY;QACT,4BACI,IAAI,EAAE,mBAAmB,EACzB,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,SAAS,EAChB,SAAS,EAAE,EAAE,CAAC,2DAA2D,EAAE,aAAa,CAAC,IAExF,QAAQ,CACR,CACM,CAClB,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,eAAe,IAAI,CAAC"}
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;"}
@@ -1,4 +1,5 @@
1
1
  import './i18n';
2
+ export { Tree } from "./components/tree";
2
3
  export * from './i18n';
3
4
  export { Accordion } from "./components/accordion/accordion";
4
5
  export { AccordionContent } from "./components/accordion/components/accordion_content";
@@ -1,4 +1,3 @@
1
- export { ACCORDION_SIZES } from './components/accordion/accordion_constants.js';
2
1
  export { CSS_BACKGROUND_TOKENS } from './constants/css_tokens/css_background_tokens.js';
3
2
  export { CSS_BORDER_COLOR_TOKENS } from './constants/css_tokens/css_border_color_tokens.js';
4
3
  export { CSS_BORDER_RADIUS_SIDE_TOKENS, CSS_BORDER_RADIUS_TOKENS } from './constants/css_tokens/css_border_radius_tokens.js';
@@ -14,6 +13,8 @@ export { CSS_BORDER_STYLE_TOKENS } from './constants/css_tokens/css_border_style
14
13
  export { CSS_POSITION_TOKENS } from './constants/css_tokens/css_position_tokens.js';
15
14
  export { CSS_BORDER_WIDTH_SIDE_TOKENS, CSS_BORDER_WIDTH_TOKENS } from './constants/css_tokens/css_border_width_tokens.js';
16
15
  export { CSS_ICON_COLOR_TOKENS_VALUES } from './constants/css_tokens/css_icon_color_tokens.js';
16
+ export { Tree } from './components/tree/index.js';
17
+ export { ACCORDION_SIZES } from './components/accordion/accordion_constants.js';
17
18
  export { Accordion } from './components/accordion/accordion.js';
18
19
  export { AccordionContent } from './components/accordion/components/accordion_content.js';
19
20
  export { AccordionItem } from './components/accordion/components/accordion_item.js';
@@ -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;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;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;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;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;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;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": "3.0.0-82",
5
+ "version": "3.0.0-84",
6
6
  "description": "aurora",
7
7
  "author": "zefirek",
8
8
  "license": "MIT",