@dreamcommerce/aurora 3.0.0-85 → 3.0.0-86
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/build/cjs/packages/aurora/src/components/accordion/components/accordion_item.js +1 -1
- package/build/cjs/packages/aurora/src/components/accordion/components/accordion_trigger.js +2 -2
- package/build/cjs/packages/aurora/src/components/select/components/select_trigger.js +1 -1
- package/build/cjs/packages/aurora/src/components/tree/components/tree_node.js +79 -0
- package/build/cjs/packages/aurora/src/components/tree/components/tree_node.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/tree/hooks/tree_hook.js +21 -0
- package/build/cjs/packages/aurora/src/components/tree/hooks/tree_hook.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/tree/hooks/tree_node_hook.js +28 -0
- package/build/cjs/packages/aurora/src/components/tree/hooks/tree_node_hook.js.map +1 -0
- package/build/cjs/packages/aurora/src/index.js +8 -4
- package/build/cjs/packages/aurora/src/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/accordion/components/accordion_item.js +1 -1
- package/build/esm/packages/aurora/src/components/accordion/components/accordion_trigger.js +2 -2
- package/build/esm/packages/aurora/src/components/select/components/select_trigger.js +1 -1
- package/build/esm/packages/aurora/src/components/tree/components/tree_node.js +68 -36
- package/build/esm/packages/aurora/src/components/tree/components/tree_node.js.map +1 -1
- package/build/esm/packages/aurora/src/components/tree/hooks/tree_hook.js +11 -8
- package/build/esm/packages/aurora/src/components/tree/hooks/tree_hook.js.map +1 -1
- package/build/esm/packages/aurora/src/components/tree/hooks/tree_node_hook.js +22 -17
- package/build/esm/packages/aurora/src/components/tree/hooks/tree_node_hook.js.map +1 -1
- package/build/esm/packages/aurora/src/index.d.ts +3 -1
- package/build/esm/packages/aurora/src/index.js +4 -2
- package/build/esm/packages/aurora/src/index.js.map +1 -1
- 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 cn = require('../../../utilities/cn.js');
|
|
8
7
|
var AccordionPrimitive = require('@radix-ui/react-accordion');
|
|
8
|
+
var cn = require('../../../utilities/cn.js');
|
|
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');
|
|
9
7
|
var AccordionPrimitive = require('@radix-ui/react-accordion');
|
|
10
8
|
var accordion_constants = require('../accordion_constants.js');
|
|
9
|
+
var css_icon_color_tokens = require('../../../constants/css_tokens/css_icon_color_tokens.js');
|
|
11
10
|
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');
|
|
8
7
|
var cn = require('../../../utilities/cn.js');
|
|
9
8
|
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,79 @@
|
|
|
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 cn = require('../../../utilities/cn.js');
|
|
8
|
+
var arrow_down_s_fill = require('../../../assets/icons/arrow_down_s_fill.js');
|
|
9
|
+
var reactTransitionGroup = require('react-transition-group');
|
|
10
|
+
var tree_hook = require('../hooks/tree_hook.js');
|
|
11
|
+
var tree_node_hook = require('../hooks/tree_node_hook.js');
|
|
12
|
+
|
|
13
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
+
|
|
15
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
16
|
+
|
|
17
|
+
var _excluded = ["children", "id", "cssClassNames", "ContentComponent", "LabelComponent", "disabled"];
|
|
18
|
+
var TreeNode = function TreeNode(_ref) {
|
|
19
|
+
var children = _ref.children,
|
|
20
|
+
id = _ref.id,
|
|
21
|
+
cssClassNames = _ref.cssClassNames,
|
|
22
|
+
ContentComponent = _ref.ContentComponent,
|
|
23
|
+
LabelComponent = _ref.LabelComponent,
|
|
24
|
+
disabled = _ref.disabled,
|
|
25
|
+
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
26
|
+
var treeApi = tree_hook.useTree();
|
|
27
|
+
var node = tree_node_hook.useTreeNode(id, rest);
|
|
28
|
+
var nodeChildrenRef = React.useRef(null);
|
|
29
|
+
var childrenCount = React.Children.count(children);
|
|
30
|
+
if (!node) return null;
|
|
31
|
+
var toggleNode = function toggleNode() {
|
|
32
|
+
treeApi.toggleNode(node.id);
|
|
33
|
+
};
|
|
34
|
+
var Label = LabelComponent ? LabelComponent === null || LabelComponent === void 0 ? void 0 : LabelComponent({
|
|
35
|
+
node: node,
|
|
36
|
+
isLeaf: !children
|
|
37
|
+
}) : (/*#__PURE__*/React__default['default'].createElement("div", {
|
|
38
|
+
tabIndex: !children ? 0 : -1,
|
|
39
|
+
className: "aurora-w-full aurora-px-2 aurora-rounded-4 hover:aurora-bg-hover"
|
|
40
|
+
}, node.label ? node.label : node.id));
|
|
41
|
+
var Content = ContentComponent ? ContentComponent === null || ContentComponent === void 0 ? void 0 : ContentComponent({
|
|
42
|
+
node: node,
|
|
43
|
+
toggleNode: toggleNode,
|
|
44
|
+
isLeaf: !childrenCount
|
|
45
|
+
}) : (/*#__PURE__*/React__default['default'].createElement("div", {
|
|
46
|
+
className: "aurora-flex aurora-items-center aurora-rounded-4 hover:aurora-bg-hover"
|
|
47
|
+
}, /*#__PURE__*/React__default['default'].createElement("button", {
|
|
48
|
+
className: "aurora-flex aurora-items-center aurora-p-1 aurora-cursor-pointer",
|
|
49
|
+
onClick: toggleNode
|
|
50
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
51
|
+
className: "aurora-flex"
|
|
52
|
+
}, /*#__PURE__*/React__default['default'].createElement(arrow_down_s_fill.ArrowDownSFillIcon, {
|
|
53
|
+
className: cn.cn('aurora-h-4 aurora-w-4 aurora-text-inverse-subtle-light -aurora-rotate-90 tree-arrow-transition', {
|
|
54
|
+
'aurora-rotate-0': node.expanded,
|
|
55
|
+
'aurora-fill-disabled': disabled
|
|
56
|
+
})
|
|
57
|
+
}))), Label));
|
|
58
|
+
return /*#__PURE__*/React__default['default'].createElement("li", {
|
|
59
|
+
role: "treeitem",
|
|
60
|
+
"aria-expanded": node.expanded
|
|
61
|
+
}, childrenCount ? Content : Label, childrenCount ? (/*#__PURE__*/React__default['default'].createElement(reactTransitionGroup.CSSTransition, {
|
|
62
|
+
unmountOnExit: true,
|
|
63
|
+
in: node.expanded,
|
|
64
|
+
timeout: 50,
|
|
65
|
+
classNames: {
|
|
66
|
+
enter: 'tree__children-enter',
|
|
67
|
+
enterActive: 'tree__children-enter-active',
|
|
68
|
+
exit: 'tree__children-exit',
|
|
69
|
+
exitActive: 'tree__children-exit-active'
|
|
70
|
+
}
|
|
71
|
+
}, /*#__PURE__*/React__default['default'].createElement("ul", {
|
|
72
|
+
className: "aurora-flex aurora-flex-col aurora-gap-2 aurora-mt-2 aurora-pl-4 aurora-scale-100 aurora-origin-top aurora-list-none aurora-will-change-auto tree__children-transition",
|
|
73
|
+
ref: nodeChildrenRef
|
|
74
|
+
}, children))) : null);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
exports.TreeNode = TreeNode;
|
|
78
|
+
exports.default = TreeNode;
|
|
79
|
+
//# sourceMappingURL=tree_node.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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var tree_context = require('../context/tree_context.js');
|
|
7
|
+
|
|
8
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
11
|
+
|
|
12
|
+
var useTree = function useTree() {
|
|
13
|
+
var context = React__default['default'].useContext(tree_context.TreeContext);
|
|
14
|
+
if (!context) {
|
|
15
|
+
throw new Error('useTree must be used within a TreeContextProvider');
|
|
16
|
+
}
|
|
17
|
+
return context;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
exports.useTree = useTree;
|
|
21
|
+
//# sourceMappingURL=tree_hook.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;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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_hook = require('./tree_hook.js');
|
|
8
|
+
|
|
9
|
+
var useTreeNode = function useTreeNode(nodeId, props) {
|
|
10
|
+
var treeApi = tree_hook.useTree();
|
|
11
|
+
React.useEffect(function () {
|
|
12
|
+
if (!treeApi.hasNode(nodeId)) treeApi.addNode(_rollupPluginBabelHelpers.objectSpread2({
|
|
13
|
+
id: nodeId
|
|
14
|
+
}, props));
|
|
15
|
+
});
|
|
16
|
+
React.useEffect(function () {
|
|
17
|
+
if (treeApi.hasNode(nodeId) && props) treeApi.updateNode(nodeId, props);
|
|
18
|
+
}, [props === null || props === void 0 ? void 0 : props.expanded]);
|
|
19
|
+
React.useEffect(function () {
|
|
20
|
+
return function () {
|
|
21
|
+
return treeApi.removeNode(nodeId);
|
|
22
|
+
};
|
|
23
|
+
}, []);
|
|
24
|
+
return treeApi.getNode(nodeId);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.useTreeNode = useTreeNode;
|
|
28
|
+
//# sourceMappingURL=tree_node_hook.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;"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var accordion_constants = require('./components/accordion/accordion_constants.js');
|
|
5
6
|
var css_background_tokens = require('./constants/css_tokens/css_background_tokens.js');
|
|
6
7
|
var css_border_color_tokens = require('./constants/css_tokens/css_border_color_tokens.js');
|
|
7
8
|
var css_border_radius_tokens = require('./constants/css_tokens/css_border_radius_tokens.js');
|
|
@@ -17,8 +18,6 @@ var css_border_style_tokens = require('./constants/css_tokens/css_border_style_t
|
|
|
17
18
|
var css_position_tokens = require('./constants/css_tokens/css_position_tokens.js');
|
|
18
19
|
var css_border_width_tokens = require('./constants/css_tokens/css_border_width_tokens.js');
|
|
19
20
|
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');
|
|
22
21
|
var accordion = require('./components/accordion/accordion.js');
|
|
23
22
|
var accordion_content = require('./components/accordion/components/accordion_content.js');
|
|
24
23
|
var accordion_item = require('./components/accordion/components/accordion_item.js');
|
|
@@ -109,9 +108,13 @@ var xhr_image_picker_control = require('./components/controls/xhr_image_picker_c
|
|
|
109
108
|
var values_syncer = require('./components/values_syncer/values_syncer.js');
|
|
110
109
|
var values_syncer_control = require('./components/controls/values_syncer_control/values_syncer_control.js');
|
|
111
110
|
var use_toggle = require('./hooks/use_toggle.js');
|
|
111
|
+
var index = require('./components/tree/index.js');
|
|
112
|
+
var tree_hook = require('./components/tree/hooks/tree_hook.js');
|
|
113
|
+
var tree_node = require('./components/tree/components/tree_node.js');
|
|
112
114
|
|
|
113
115
|
|
|
114
116
|
|
|
117
|
+
exports.ACCORDION_SIZES = accordion_constants.ACCORDION_SIZES;
|
|
115
118
|
exports.CSS_BACKGROUND_TOKENS = css_background_tokens.CSS_BACKGROUND_TOKENS;
|
|
116
119
|
exports.CSS_BORDER_COLOR_TOKENS = css_border_color_tokens.CSS_BORDER_COLOR_TOKENS;
|
|
117
120
|
exports.CSS_BORDER_RADIUS_SIDE_TOKENS = css_border_radius_tokens.CSS_BORDER_RADIUS_SIDE_TOKENS;
|
|
@@ -129,8 +132,6 @@ exports.CSS_POSITION_TOKENS = css_position_tokens.CSS_POSITION_TOKENS;
|
|
|
129
132
|
exports.CSS_BORDER_WIDTH_SIDE_TOKENS = css_border_width_tokens.CSS_BORDER_WIDTH_SIDE_TOKENS;
|
|
130
133
|
exports.CSS_BORDER_WIDTH_TOKENS = css_border_width_tokens.CSS_BORDER_WIDTH_TOKENS;
|
|
131
134
|
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;
|
|
134
135
|
exports.Accordion = accordion.Accordion;
|
|
135
136
|
exports.AccordionContent = accordion_content.AccordionContent;
|
|
136
137
|
exports.AccordionItem = accordion_item.AccordionItem;
|
|
@@ -237,4 +238,7 @@ exports.XhrImagePickerControl = xhr_image_picker_control.XhrImagePickerControl;
|
|
|
237
238
|
exports.ValuesSyncer = values_syncer.ValuesSyncer;
|
|
238
239
|
exports.ValuesSyncerControl = values_syncer_control.ValuesSyncerControl;
|
|
239
240
|
exports.useToggle = use_toggle.useToggle;
|
|
241
|
+
exports.Tree = index.Tree;
|
|
242
|
+
exports.useTree = tree_hook.useTree;
|
|
243
|
+
exports.TreeNode = tree_node.TreeNode;
|
|
240
244
|
//# sourceMappingURL=index.js.map
|
|
@@ -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;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;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 { cn } from '../../../utilities/cn.js';
|
|
4
3
|
import { Item } from '@radix-ui/react-accordion';
|
|
4
|
+
import { cn } from '../../../utilities/cn.js';
|
|
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';
|
|
5
3
|
import { Header, Trigger } from '@radix-ui/react-accordion';
|
|
6
4
|
import { ACCORDION_SIZES } from '../accordion_constants.js';
|
|
5
|
+
import { CSS_ICON_COLOR_TOKENS_VALUES } from '../../../constants/css_tokens/css_icon_color_tokens.js';
|
|
7
6
|
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';
|
|
4
3
|
import { cn } from '../../../utilities/cn.js';
|
|
5
4
|
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,39 +1,71 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import {
|
|
1
|
+
import React, { useRef, Children } from 'react';
|
|
2
|
+
import { objectWithoutProperties as _objectWithoutProperties } from '../../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
+
import { cn } from '../../../utilities/cn.js';
|
|
4
|
+
import { ArrowDownSFillIcon } from '../../../assets/icons/arrow_down_s_fill.js';
|
|
3
5
|
import { CSSTransition } from 'react-transition-group';
|
|
4
|
-
import '
|
|
5
|
-
import '
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
6
|
+
import { useTree } from '../hooks/tree_hook.js';
|
|
7
|
+
import { useTreeNode } from '../hooks/tree_node_hook.js';
|
|
8
|
+
|
|
9
|
+
var _excluded = ["children", "id", "cssClassNames", "ContentComponent", "LabelComponent", "disabled"];
|
|
10
|
+
var TreeNode = function TreeNode(_ref) {
|
|
11
|
+
var children = _ref.children,
|
|
12
|
+
id = _ref.id,
|
|
13
|
+
cssClassNames = _ref.cssClassNames,
|
|
14
|
+
ContentComponent = _ref.ContentComponent,
|
|
15
|
+
LabelComponent = _ref.LabelComponent,
|
|
16
|
+
disabled = _ref.disabled,
|
|
17
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
18
|
+
var treeApi = useTree();
|
|
19
|
+
var node = useTreeNode(id, rest);
|
|
20
|
+
var nodeChildrenRef = useRef(null);
|
|
21
|
+
var childrenCount = Children.count(children);
|
|
22
|
+
if (!node) return null;
|
|
23
|
+
var toggleNode = function toggleNode() {
|
|
24
|
+
treeApi.toggleNode(node.id);
|
|
25
|
+
};
|
|
26
|
+
var Label = LabelComponent ? LabelComponent === null || LabelComponent === void 0 ? void 0 : LabelComponent({
|
|
27
|
+
node: node,
|
|
28
|
+
isLeaf: !children
|
|
29
|
+
}) : (/*#__PURE__*/React.createElement("div", {
|
|
30
|
+
tabIndex: !children ? 0 : -1,
|
|
31
|
+
className: "aurora-w-full aurora-px-2 aurora-rounded-4 hover:aurora-bg-hover"
|
|
32
|
+
}, node.label ? node.label : node.id));
|
|
33
|
+
var Content = ContentComponent ? ContentComponent === null || ContentComponent === void 0 ? void 0 : ContentComponent({
|
|
34
|
+
node: node,
|
|
35
|
+
toggleNode: toggleNode,
|
|
36
|
+
isLeaf: !childrenCount
|
|
37
|
+
}) : (/*#__PURE__*/React.createElement("div", {
|
|
38
|
+
className: "aurora-flex aurora-items-center aurora-rounded-4 hover:aurora-bg-hover"
|
|
39
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
40
|
+
className: "aurora-flex aurora-items-center aurora-p-1 aurora-cursor-pointer",
|
|
41
|
+
onClick: toggleNode
|
|
42
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
43
|
+
className: "aurora-flex"
|
|
44
|
+
}, /*#__PURE__*/React.createElement(ArrowDownSFillIcon, {
|
|
45
|
+
className: cn('aurora-h-4 aurora-w-4 aurora-text-inverse-subtle-light -aurora-rotate-90 tree-arrow-transition', {
|
|
46
|
+
'aurora-rotate-0': node.expanded,
|
|
47
|
+
'aurora-fill-disabled': disabled
|
|
48
|
+
})
|
|
49
|
+
}))), Label));
|
|
50
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
51
|
+
role: "treeitem",
|
|
52
|
+
"aria-expanded": node.expanded
|
|
53
|
+
}, childrenCount ? Content : Label, childrenCount ? (/*#__PURE__*/React.createElement(CSSTransition, {
|
|
54
|
+
unmountOnExit: true,
|
|
55
|
+
in: node.expanded,
|
|
56
|
+
timeout: 50,
|
|
57
|
+
classNames: {
|
|
58
|
+
enter: 'tree__children-enter',
|
|
59
|
+
enterActive: 'tree__children-enter-active',
|
|
60
|
+
exit: 'tree__children-exit',
|
|
61
|
+
exitActive: 'tree__children-exit-active'
|
|
62
|
+
}
|
|
63
|
+
}, /*#__PURE__*/React.createElement("ul", {
|
|
64
|
+
className: "aurora-flex aurora-flex-col aurora-gap-2 aurora-mt-2 aurora-pl-4 aurora-scale-100 aurora-origin-top aurora-list-none aurora-will-change-auto tree__children-transition",
|
|
65
|
+
ref: nodeChildrenRef
|
|
66
|
+
}, children))) : null);
|
|
37
67
|
};
|
|
68
|
+
|
|
38
69
|
export default TreeNode;
|
|
39
|
-
|
|
70
|
+
export { TreeNode };
|
|
71
|
+
//# sourceMappingURL=tree_node.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":
|
|
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;"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TreeContext } from '
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { TreeContext } from '../context/tree_context.js';
|
|
3
|
+
|
|
4
|
+
var useTree = function useTree() {
|
|
5
|
+
var context = React.useContext(TreeContext);
|
|
6
|
+
if (!context) {
|
|
7
|
+
throw new Error('useTree must be used within a TreeContextProvider');
|
|
8
|
+
}
|
|
9
|
+
return context;
|
|
9
10
|
};
|
|
10
|
-
|
|
11
|
+
|
|
12
|
+
export { useTree };
|
|
13
|
+
//# sourceMappingURL=tree_hook.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -1,19 +1,24 @@
|
|
|
1
|
-
import { useTree } from '@auroraComponents/tree/hooks/tree_hook';
|
|
2
1
|
import { useEffect } from 'react';
|
|
3
|
-
import '
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return
|
|
2
|
+
import { objectSpread2 as _objectSpread2 } from '../../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
+
import { useTree } from './tree_hook.js';
|
|
4
|
+
|
|
5
|
+
var useTreeNode = function useTreeNode(nodeId, props) {
|
|
6
|
+
var treeApi = useTree();
|
|
7
|
+
useEffect(function () {
|
|
8
|
+
if (!treeApi.hasNode(nodeId)) treeApi.addNode(_objectSpread2({
|
|
9
|
+
id: nodeId
|
|
10
|
+
}, props));
|
|
11
|
+
});
|
|
12
|
+
useEffect(function () {
|
|
13
|
+
if (treeApi.hasNode(nodeId) && props) treeApi.updateNode(nodeId, props);
|
|
14
|
+
}, [props === null || props === void 0 ? void 0 : props.expanded]);
|
|
15
|
+
useEffect(function () {
|
|
16
|
+
return function () {
|
|
17
|
+
return treeApi.removeNode(nodeId);
|
|
18
|
+
};
|
|
19
|
+
}, []);
|
|
20
|
+
return treeApi.getNode(nodeId);
|
|
18
21
|
};
|
|
19
|
-
|
|
22
|
+
|
|
23
|
+
export { useTreeNode };
|
|
24
|
+
//# sourceMappingURL=tree_node_hook.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":
|
|
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;"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import './i18n';
|
|
2
|
-
export { Tree } from "./components/tree";
|
|
3
2
|
export * from './i18n';
|
|
4
3
|
export { Accordion } from "./components/accordion/accordion";
|
|
5
4
|
export { AccordionContent } from "./components/accordion/components/accordion_content";
|
|
@@ -111,3 +110,6 @@ export { ValuesSyncerControl } from "./components/controls/values_syncer_control
|
|
|
111
110
|
export { ValuesSyncer } from "./components/values_syncer/values_syncer";
|
|
112
111
|
export { useToggle } from "./hooks/use_toggle";
|
|
113
112
|
export { useClickOutside } from "./hooks/use_click_outside";
|
|
113
|
+
export { Tree } from "./components/tree";
|
|
114
|
+
export { TreeNode } from "./components/tree/components/tree_node";
|
|
115
|
+
export { useTree } from "./components/tree/hooks/tree_hook";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { ACCORDION_SIZES } from './components/accordion/accordion_constants.js';
|
|
1
2
|
export { CSS_BACKGROUND_TOKENS } from './constants/css_tokens/css_background_tokens.js';
|
|
2
3
|
export { CSS_BORDER_COLOR_TOKENS } from './constants/css_tokens/css_border_color_tokens.js';
|
|
3
4
|
export { CSS_BORDER_RADIUS_SIDE_TOKENS, CSS_BORDER_RADIUS_TOKENS } from './constants/css_tokens/css_border_radius_tokens.js';
|
|
@@ -13,8 +14,6 @@ export { CSS_BORDER_STYLE_TOKENS } from './constants/css_tokens/css_border_style
|
|
|
13
14
|
export { CSS_POSITION_TOKENS } from './constants/css_tokens/css_position_tokens.js';
|
|
14
15
|
export { CSS_BORDER_WIDTH_SIDE_TOKENS, CSS_BORDER_WIDTH_TOKENS } from './constants/css_tokens/css_border_width_tokens.js';
|
|
15
16
|
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';
|
|
18
17
|
export { Accordion } from './components/accordion/accordion.js';
|
|
19
18
|
export { AccordionContent } from './components/accordion/components/accordion_content.js';
|
|
20
19
|
export { AccordionItem } from './components/accordion/components/accordion_item.js';
|
|
@@ -105,4 +104,7 @@ export { XhrImagePickerControl } from './components/controls/xhr_image_picker_co
|
|
|
105
104
|
export { ValuesSyncer } from './components/values_syncer/values_syncer.js';
|
|
106
105
|
export { ValuesSyncerControl } from './components/controls/values_syncer_control/values_syncer_control.js';
|
|
107
106
|
export { useToggle } from './hooks/use_toggle.js';
|
|
107
|
+
export { Tree } from './components/tree/index.js';
|
|
108
|
+
export { useTree } from './components/tree/hooks/tree_hook.js';
|
|
109
|
+
export { TreeNode } from './components/tree/components/tree_node.js';
|
|
108
110
|
//# sourceMappingURL=index.js.map
|
|
@@ -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;"}
|
|
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;"}
|