@dreamcommerce/aurora 3.0.0-5 → 3.0.0-6
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/box/box.js +1 -1
- package/build/cjs/packages/aurora/src/components/sidebar/context/sidebar_prvider.js +62 -0
- package/build/cjs/packages/aurora/src/components/sidebar/context/sidebar_prvider.js.map +1 -0
- package/build/cjs/packages/aurora/src/index.js +4 -0
- package/build/cjs/packages/aurora/src/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/box/box.js +1 -1
- package/build/esm/packages/aurora/src/components/sidebar/context/sidebar_prvider.js +56 -38
- package/build/esm/packages/aurora/src/components/sidebar/context/sidebar_prvider.js.map +1 -1
- package/build/esm/packages/aurora/src/index.d.ts +2 -0
- package/build/esm/packages/aurora/src/index.js +2 -0
- package/build/esm/packages/aurora/src/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -33,7 +33,7 @@ var Box = function Box(_ref) {
|
|
|
33
33
|
var borderWidthWithSides = borderWidth;
|
|
34
34
|
var borderRadiusWithSides = borderRadius;
|
|
35
35
|
return /*#__PURE__*/React__default['default'].createElement(as, {
|
|
36
|
-
className: cn.cn('', (_cn = {}, _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_cn, "aurora-bg-".concat(backgroundColor), !!backgroundColor), "aurora-text-".concat(color), !!color), "aurora-border", (!!borderColor || !!borderStyle || !!borderRadius) && !borderWidth), "aurora-border-".concat(borderColor), !!borderColor), "aurora-border-".concat(borderStyle), !!borderStyle), "aurora-border-".concat(borderWidth), !!borderWidth && typeof borderWidth === 'string'), "aurora-border-t-".concat(borderWidthWithSides === null || borderWidthWithSides === void 0 ? void 0 : borderWidthWithSides.t), !!(borderWidthWithSides !== null && borderWidthWithSides !== void 0 && borderWidthWithSides.t)), "aurora-border-b-".concat(borderWidthWithSides === null || borderWidthWithSides === void 0 ? void 0 : borderWidthWithSides.b), !!(borderWidthWithSides !== null && borderWidthWithSides !== void 0 && borderWidthWithSides.b)), "aurora-border-r-".concat(borderWidthWithSides === null || borderWidthWithSides === void 0 ? void 0 : borderWidthWithSides.r), !!(borderWidthWithSides !== null && borderWidthWithSides !== void 0 && borderWidthWithSides.r)), "aurora-border-l-".concat(borderWidthWithSides === null || borderWidthWithSides === void 0 ? void 0 : borderWidthWithSides.l), !!(borderWidthWithSides !== null && borderWidthWithSides !== void 0 && borderWidthWithSides.l)),
|
|
36
|
+
className: cn.cn('', (_cn = {}, _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_cn, 'aurora-bg', !backgroundColor), "aurora-bg-".concat(backgroundColor), !!backgroundColor), "aurora-text-".concat(color), !!color), "aurora-border", (!!borderColor || !!borderStyle || !!borderRadius) && !borderWidth), "aurora-border-".concat(borderColor), !!borderColor), "aurora-border-".concat(borderStyle), !!borderStyle), "aurora-border-".concat(borderWidth), !!borderWidth && typeof borderWidth === 'string'), "aurora-border-t-".concat(borderWidthWithSides === null || borderWidthWithSides === void 0 ? void 0 : borderWidthWithSides.t), !!(borderWidthWithSides !== null && borderWidthWithSides !== void 0 && borderWidthWithSides.t)), "aurora-border-b-".concat(borderWidthWithSides === null || borderWidthWithSides === void 0 ? void 0 : borderWidthWithSides.b), !!(borderWidthWithSides !== null && borderWidthWithSides !== void 0 && borderWidthWithSides.b)), "aurora-border-r-".concat(borderWidthWithSides === null || borderWidthWithSides === void 0 ? void 0 : borderWidthWithSides.r), !!(borderWidthWithSides !== null && borderWidthWithSides !== void 0 && borderWidthWithSides.r)), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_cn, "aurora-border-l-".concat(borderWidthWithSides === null || borderWidthWithSides === void 0 ? void 0 : borderWidthWithSides.l), !!(borderWidthWithSides !== null && borderWidthWithSides !== void 0 && borderWidthWithSides.l)), "aurora-border-x-".concat(borderWidthWithSides === null || borderWidthWithSides === void 0 ? void 0 : borderWidthWithSides.x), !!(borderWidthWithSides !== null && borderWidthWithSides !== void 0 && borderWidthWithSides.x)), "aurora-border-y-".concat(borderWidthWithSides === null || borderWidthWithSides === void 0 ? void 0 : borderWidthWithSides.y), !!(borderWidthWithSides !== null && borderWidthWithSides !== void 0 && borderWidthWithSides.y)), "aurora-rounded-".concat(borderRadius), !!borderRadius && typeof borderRadius === 'string'), "aurora-rounded-t-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.t), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.t)), "aurora-rounded-b-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.b), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.b)), "aurora-rounded-r-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.r), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.r)), "aurora-rounded-l-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.l), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.l)), "aurora-rounded-tl-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.tl), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.tl)), "aurora-rounded-tr-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.tr), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.tr)), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_cn, "aurora-rounded-bl-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.bl), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.bl)), "aurora-rounded-br-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.br), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.br)), "aurora-rounded-ee-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.ee), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.ee)), "aurora-rounded-es-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.es), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.es)), "aurora-rounded-ss-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.ss), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.ss)), "aurora-rounded-se-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.se), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.se)), "aurora-rounded-s-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.s), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.s)), "aurora-rounded-e-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.e), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.e)), "aurora-shadow-".concat(shadow), !!shadow), "aurora-p-".concat(paddings === null || paddings === void 0 ? void 0 : paddings.p), !!(paddings !== null && paddings !== void 0 && paddings.p)), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_cn, "aurora-pt-".concat(paddings === null || paddings === void 0 ? void 0 : paddings.pt), !!(paddings !== null && paddings !== void 0 && paddings.pt)), "aurora-pr-".concat(paddings === null || paddings === void 0 ? void 0 : paddings.pr), !!(paddings !== null && paddings !== void 0 && paddings.pr)), "aurora-pb-".concat(paddings === null || paddings === void 0 ? void 0 : paddings.pb), !!(paddings !== null && paddings !== void 0 && paddings.pb)), "aurora-pl-".concat(paddings === null || paddings === void 0 ? void 0 : paddings.pl), !!(paddings !== null && paddings !== void 0 && paddings.pl)), "aurora-px-".concat(paddings === null || paddings === void 0 ? void 0 : paddings.px), !!(paddings !== null && paddings !== void 0 && paddings.px)), "aurora-py-".concat(paddings === null || paddings === void 0 ? void 0 : paddings.py), !!(paddings !== null && paddings !== void 0 && paddings.py)), "aurora-ps-".concat(paddings === null || paddings === void 0 ? void 0 : paddings.ps), !!(paddings !== null && paddings !== void 0 && paddings.ps)), "aurora-pe-".concat(paddings === null || paddings === void 0 ? void 0 : paddings.pe), !!(paddings !== null && paddings !== void 0 && paddings.pe)), "aurora-".concat(position), !!position))),
|
|
37
37
|
style: {
|
|
38
38
|
zIndex: zIndex,
|
|
39
39
|
width: width,
|
|
@@ -0,0 +1,62 @@
|
|
|
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 sidebar_context = require('./sidebar_context.js');
|
|
8
|
+
|
|
9
|
+
var _excluded = ["onToggle", "open", "className", "style", "children", "persistentKey"];
|
|
10
|
+
var SidebarProvider = function SidebarProvider(_ref) {
|
|
11
|
+
var onToggle = _ref.onToggle,
|
|
12
|
+
_ref$open = _ref.open,
|
|
13
|
+
openProp = _ref$open === void 0 ? true : _ref$open,
|
|
14
|
+
className = _ref.className,
|
|
15
|
+
style = _ref.style,
|
|
16
|
+
children = _ref.children,
|
|
17
|
+
persistentKey = _ref.persistentKey,
|
|
18
|
+
props = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
19
|
+
var setPersistedState = function setPersistedState(value) {
|
|
20
|
+
if (!persistentKey) return;
|
|
21
|
+
try {
|
|
22
|
+
localStorage.setItem(persistentKey, String(value));
|
|
23
|
+
} catch (error) {
|
|
24
|
+
console.error('Failed to set persisted state', error);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var _React$useState = React.useState(openProp),
|
|
28
|
+
_React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
|
|
29
|
+
_open = _React$useState2[0],
|
|
30
|
+
_setOpen = _React$useState2[1];
|
|
31
|
+
React.useEffect(function () {
|
|
32
|
+
if (openProp !== undefined && openProp !== _open) setOpen(openProp);
|
|
33
|
+
}, [openProp]);
|
|
34
|
+
React.useEffect(function () {
|
|
35
|
+
setPersistedState(_open);
|
|
36
|
+
}, []);
|
|
37
|
+
var setOpen = function setOpen(open) {
|
|
38
|
+
var nextValue = typeof open === 'function' ? open(_open) : open;
|
|
39
|
+
onToggle === null || onToggle === void 0 ? void 0 : onToggle(nextValue);
|
|
40
|
+
_setOpen(nextValue);
|
|
41
|
+
setPersistedState(nextValue);
|
|
42
|
+
};
|
|
43
|
+
var toggleSidebar = function toggleSidebar() {
|
|
44
|
+
setOpen(function (open) {
|
|
45
|
+
return !open;
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
var contextValue = React.useMemo(function () {
|
|
49
|
+
return {
|
|
50
|
+
open: _open,
|
|
51
|
+
toggleSidebar: toggleSidebar
|
|
52
|
+
};
|
|
53
|
+
}, [open, toggleSidebar]);
|
|
54
|
+
return /*#__PURE__*/React.createElement(sidebar_context.SidebarContext.Provider, {
|
|
55
|
+
value: contextValue
|
|
56
|
+
}, /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.objectSpread2({
|
|
57
|
+
style: style
|
|
58
|
+
}, props), children));
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
exports.SidebarProvider = SidebarProvider;
|
|
62
|
+
//# sourceMappingURL=sidebar_prvider.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;"}
|
|
@@ -8,8 +8,10 @@ var box_constants = require('./components/box/box_constants.js');
|
|
|
8
8
|
var box = require('./components/box/box.js');
|
|
9
9
|
var typography_constants = require('./components/typography/typography_constants.js');
|
|
10
10
|
var typography = require('./components/typography/typography.js');
|
|
11
|
+
var use_sidebar = require('./components/sidebar/hooks/use_sidebar.js');
|
|
11
12
|
var sidebar_constants = require('./components/sidebar/sidebar_constants.js');
|
|
12
13
|
var sidebar = require('./components/sidebar/sidebar.js');
|
|
14
|
+
var sidebar_prvider = require('./components/sidebar/context/sidebar_prvider.js');
|
|
13
15
|
var divider = require('./components/divider/divider.js');
|
|
14
16
|
var stack_constants = require('./components/stack/stack_constants.js');
|
|
15
17
|
var stack = require('./components/stack/stack.js');
|
|
@@ -24,8 +26,10 @@ exports.TYPOGRAPHY_COMPONENT_TYPES = typography_constants.TYPOGRAPHY_COMPONENT_T
|
|
|
24
26
|
exports.TYPOGRAPHY_TRANSFORM_TYPES = typography_constants.TYPOGRAPHY_TRANSFORM_TYPES;
|
|
25
27
|
exports.TYPOGRAPHY_WEIGHT_TYPES = typography_constants.TYPOGRAPHY_WEIGHT_TYPES;
|
|
26
28
|
exports.Typography = typography.Typography;
|
|
29
|
+
exports.useSidebar = use_sidebar.useSidebar;
|
|
27
30
|
exports.SIDEBAR_SIDE = sidebar_constants.SIDEBAR_SIDE;
|
|
28
31
|
exports.Sidebar = sidebar.Sidebar;
|
|
32
|
+
exports.SidebarProvider = sidebar_prvider.SidebarProvider;
|
|
29
33
|
exports.Divider = divider.Divider;
|
|
30
34
|
exports.STACK_ALIGN_ITEMS_TYPES = stack_constants.STACK_ALIGN_ITEMS_TYPES;
|
|
31
35
|
exports.STACK_DIRECTION_TYPES = stack_constants.STACK_DIRECTION_TYPES;
|
|
@@ -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;"}
|
|
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;"}
|
|
@@ -25,7 +25,7 @@ var Box = function Box(_ref) {
|
|
|
25
25
|
var borderWidthWithSides = borderWidth;
|
|
26
26
|
var borderRadiusWithSides = borderRadius;
|
|
27
27
|
return /*#__PURE__*/React.createElement(as, {
|
|
28
|
-
className: cn('', (_cn = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_cn, "aurora-bg-".concat(backgroundColor), !!backgroundColor), "aurora-text-".concat(color), !!color), "aurora-border", (!!borderColor || !!borderStyle || !!borderRadius) && !borderWidth), "aurora-border-".concat(borderColor), !!borderColor), "aurora-border-".concat(borderStyle), !!borderStyle), "aurora-border-".concat(borderWidth), !!borderWidth && typeof borderWidth === 'string'), "aurora-border-t-".concat(borderWidthWithSides === null || borderWidthWithSides === void 0 ? void 0 : borderWidthWithSides.t), !!(borderWidthWithSides !== null && borderWidthWithSides !== void 0 && borderWidthWithSides.t)), "aurora-border-b-".concat(borderWidthWithSides === null || borderWidthWithSides === void 0 ? void 0 : borderWidthWithSides.b), !!(borderWidthWithSides !== null && borderWidthWithSides !== void 0 && borderWidthWithSides.b)), "aurora-border-r-".concat(borderWidthWithSides === null || borderWidthWithSides === void 0 ? void 0 : borderWidthWithSides.r), !!(borderWidthWithSides !== null && borderWidthWithSides !== void 0 && borderWidthWithSides.r)), "aurora-border-l-".concat(borderWidthWithSides === null || borderWidthWithSides === void 0 ? void 0 : borderWidthWithSides.l), !!(borderWidthWithSides !== null && borderWidthWithSides !== void 0 && borderWidthWithSides.l)),
|
|
28
|
+
className: cn('', (_cn = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_cn, 'aurora-bg', !backgroundColor), "aurora-bg-".concat(backgroundColor), !!backgroundColor), "aurora-text-".concat(color), !!color), "aurora-border", (!!borderColor || !!borderStyle || !!borderRadius) && !borderWidth), "aurora-border-".concat(borderColor), !!borderColor), "aurora-border-".concat(borderStyle), !!borderStyle), "aurora-border-".concat(borderWidth), !!borderWidth && typeof borderWidth === 'string'), "aurora-border-t-".concat(borderWidthWithSides === null || borderWidthWithSides === void 0 ? void 0 : borderWidthWithSides.t), !!(borderWidthWithSides !== null && borderWidthWithSides !== void 0 && borderWidthWithSides.t)), "aurora-border-b-".concat(borderWidthWithSides === null || borderWidthWithSides === void 0 ? void 0 : borderWidthWithSides.b), !!(borderWidthWithSides !== null && borderWidthWithSides !== void 0 && borderWidthWithSides.b)), "aurora-border-r-".concat(borderWidthWithSides === null || borderWidthWithSides === void 0 ? void 0 : borderWidthWithSides.r), !!(borderWidthWithSides !== null && borderWidthWithSides !== void 0 && borderWidthWithSides.r)), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_cn, "aurora-border-l-".concat(borderWidthWithSides === null || borderWidthWithSides === void 0 ? void 0 : borderWidthWithSides.l), !!(borderWidthWithSides !== null && borderWidthWithSides !== void 0 && borderWidthWithSides.l)), "aurora-border-x-".concat(borderWidthWithSides === null || borderWidthWithSides === void 0 ? void 0 : borderWidthWithSides.x), !!(borderWidthWithSides !== null && borderWidthWithSides !== void 0 && borderWidthWithSides.x)), "aurora-border-y-".concat(borderWidthWithSides === null || borderWidthWithSides === void 0 ? void 0 : borderWidthWithSides.y), !!(borderWidthWithSides !== null && borderWidthWithSides !== void 0 && borderWidthWithSides.y)), "aurora-rounded-".concat(borderRadius), !!borderRadius && typeof borderRadius === 'string'), "aurora-rounded-t-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.t), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.t)), "aurora-rounded-b-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.b), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.b)), "aurora-rounded-r-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.r), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.r)), "aurora-rounded-l-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.l), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.l)), "aurora-rounded-tl-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.tl), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.tl)), "aurora-rounded-tr-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.tr), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.tr)), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_cn, "aurora-rounded-bl-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.bl), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.bl)), "aurora-rounded-br-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.br), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.br)), "aurora-rounded-ee-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.ee), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.ee)), "aurora-rounded-es-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.es), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.es)), "aurora-rounded-ss-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.ss), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.ss)), "aurora-rounded-se-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.se), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.se)), "aurora-rounded-s-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.s), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.s)), "aurora-rounded-e-".concat(borderRadiusWithSides === null || borderRadiusWithSides === void 0 ? void 0 : borderRadiusWithSides.e), !!(borderRadiusWithSides !== null && borderRadiusWithSides !== void 0 && borderRadiusWithSides.e)), "aurora-shadow-".concat(shadow), !!shadow), "aurora-p-".concat(paddings === null || paddings === void 0 ? void 0 : paddings.p), !!(paddings !== null && paddings !== void 0 && paddings.p)), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_cn, "aurora-pt-".concat(paddings === null || paddings === void 0 ? void 0 : paddings.pt), !!(paddings !== null && paddings !== void 0 && paddings.pt)), "aurora-pr-".concat(paddings === null || paddings === void 0 ? void 0 : paddings.pr), !!(paddings !== null && paddings !== void 0 && paddings.pr)), "aurora-pb-".concat(paddings === null || paddings === void 0 ? void 0 : paddings.pb), !!(paddings !== null && paddings !== void 0 && paddings.pb)), "aurora-pl-".concat(paddings === null || paddings === void 0 ? void 0 : paddings.pl), !!(paddings !== null && paddings !== void 0 && paddings.pl)), "aurora-px-".concat(paddings === null || paddings === void 0 ? void 0 : paddings.px), !!(paddings !== null && paddings !== void 0 && paddings.px)), "aurora-py-".concat(paddings === null || paddings === void 0 ? void 0 : paddings.py), !!(paddings !== null && paddings !== void 0 && paddings.py)), "aurora-ps-".concat(paddings === null || paddings === void 0 ? void 0 : paddings.ps), !!(paddings !== null && paddings !== void 0 && paddings.ps)), "aurora-pe-".concat(paddings === null || paddings === void 0 ? void 0 : paddings.pe), !!(paddings !== null && paddings !== void 0 && paddings.pe)), "aurora-".concat(position), !!position))),
|
|
29
29
|
style: {
|
|
30
30
|
zIndex: zIndex,
|
|
31
31
|
width: width,
|
|
@@ -1,40 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import '
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { useState, useEffect, useMemo, createElement } from 'react';
|
|
2
|
+
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2 } from '../../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
+
import { SidebarContext } from './sidebar_context.js';
|
|
4
|
+
|
|
5
|
+
var _excluded = ["onToggle", "open", "className", "style", "children", "persistentKey"];
|
|
6
|
+
var SidebarProvider = function SidebarProvider(_ref) {
|
|
7
|
+
var onToggle = _ref.onToggle,
|
|
8
|
+
_ref$open = _ref.open,
|
|
9
|
+
openProp = _ref$open === void 0 ? true : _ref$open,
|
|
10
|
+
className = _ref.className,
|
|
11
|
+
style = _ref.style,
|
|
12
|
+
children = _ref.children,
|
|
13
|
+
persistentKey = _ref.persistentKey,
|
|
14
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
15
|
+
var setPersistedState = function setPersistedState(value) {
|
|
16
|
+
if (!persistentKey) return;
|
|
17
|
+
try {
|
|
18
|
+
localStorage.setItem(persistentKey, String(value));
|
|
19
|
+
} catch (error) {
|
|
20
|
+
console.error('Failed to set persisted state', error);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var _React$useState = useState(openProp),
|
|
24
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
25
|
+
_open = _React$useState2[0],
|
|
26
|
+
_setOpen = _React$useState2[1];
|
|
27
|
+
useEffect(function () {
|
|
28
|
+
if (openProp !== undefined && openProp !== _open) setOpen(openProp);
|
|
29
|
+
}, [openProp]);
|
|
30
|
+
useEffect(function () {
|
|
31
|
+
setPersistedState(_open);
|
|
32
|
+
}, []);
|
|
33
|
+
var setOpen = function setOpen(open) {
|
|
34
|
+
var nextValue = typeof open === 'function' ? open(_open) : open;
|
|
35
|
+
onToggle === null || onToggle === void 0 ? void 0 : onToggle(nextValue);
|
|
36
|
+
_setOpen(nextValue);
|
|
37
|
+
setPersistedState(nextValue);
|
|
38
|
+
};
|
|
39
|
+
var toggleSidebar = function toggleSidebar() {
|
|
40
|
+
setOpen(function (open) {
|
|
41
|
+
return !open;
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var contextValue = useMemo(function () {
|
|
45
|
+
return {
|
|
46
|
+
open: _open,
|
|
47
|
+
toggleSidebar: toggleSidebar
|
|
15
48
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
setPersistedState(_open);
|
|
23
|
-
}, []);
|
|
24
|
-
const setOpen = (open) => {
|
|
25
|
-
const nextValue = typeof open === 'function' ? open(_open) : open;
|
|
26
|
-
onToggle?.(nextValue);
|
|
27
|
-
_setOpen(nextValue);
|
|
28
|
-
setPersistedState(nextValue);
|
|
29
|
-
};
|
|
30
|
-
const toggleSidebar = () => {
|
|
31
|
-
setOpen((open) => !open);
|
|
32
|
-
};
|
|
33
|
-
const contextValue = React.useMemo(() => ({
|
|
34
|
-
open: _open,
|
|
35
|
-
toggleSidebar
|
|
36
|
-
}), [open, toggleSidebar]);
|
|
37
|
-
return (React.createElement(SidebarContext.Provider, { value: contextValue },
|
|
38
|
-
React.createElement("div", { style: style, ...props }, children)));
|
|
49
|
+
}, [open, toggleSidebar]);
|
|
50
|
+
return /*#__PURE__*/createElement(SidebarContext.Provider, {
|
|
51
|
+
value: contextValue
|
|
52
|
+
}, /*#__PURE__*/createElement("div", _objectSpread2({
|
|
53
|
+
style: style
|
|
54
|
+
}, props), children));
|
|
39
55
|
};
|
|
40
|
-
|
|
56
|
+
|
|
57
|
+
export { SidebarProvider };
|
|
58
|
+
//# sourceMappingURL=sidebar_prvider.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;"}
|
|
@@ -6,6 +6,8 @@ export { BOX_COMPONENT_TYPES } from "./components/box/box_constants";
|
|
|
6
6
|
export { Typography } from './components/typography/typography';
|
|
7
7
|
export { TYPOGRAPHY_TRANSFORM_TYPES, TYPOGRAPHY_COMPONENT_TYPES, TYPOGRAPHY_WEIGHT_TYPES } from "./components/typography/typography_constants";
|
|
8
8
|
export { Sidebar } from './components/sidebar/sidebar';
|
|
9
|
+
export { SidebarProvider } from "./components/sidebar/context/sidebar_prvider";
|
|
10
|
+
export { useSidebar } from './components/sidebar/hooks/use_sidebar';
|
|
9
11
|
export { SIDEBAR_SIDE } from "./components/sidebar/sidebar_constants";
|
|
10
12
|
export { Divider } from './components/divider/divider';
|
|
11
13
|
export { Stack } from './components/stack/stack';
|
|
@@ -4,8 +4,10 @@ export { BOX_COMPONENT_TYPES } from './components/box/box_constants.js';
|
|
|
4
4
|
export { Box } from './components/box/box.js';
|
|
5
5
|
export { TYPOGRAPHY_COMPONENT_TYPES, TYPOGRAPHY_TRANSFORM_TYPES, TYPOGRAPHY_WEIGHT_TYPES } from './components/typography/typography_constants.js';
|
|
6
6
|
export { Typography } from './components/typography/typography.js';
|
|
7
|
+
export { useSidebar } from './components/sidebar/hooks/use_sidebar.js';
|
|
7
8
|
export { SIDEBAR_SIDE } from './components/sidebar/sidebar_constants.js';
|
|
8
9
|
export { Sidebar } from './components/sidebar/sidebar.js';
|
|
10
|
+
export { SidebarProvider } from './components/sidebar/context/sidebar_prvider.js';
|
|
9
11
|
export { Divider } from './components/divider/divider.js';
|
|
10
12
|
export { STACK_ALIGN_ITEMS_TYPES, STACK_DIRECTION_TYPES, STACK_JUSTIFY_CONTENT_TYPES, STACK_WRAP_TYPES } from './components/stack/stack_constants.js';
|
|
11
13
|
export { Stack } from './components/stack/stack.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;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|