@taikai/rocket-kit 3.0.8 → 3.0.9
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/dist/organisms/horizontal-nav/index.d.ts +2 -8
- package/dist/organisms/horizontal-nav/types.d.ts +10 -0
- package/dist/rocket-kit.cjs.development.css +97 -0
- package/dist/rocket-kit.cjs.development.js +78 -80
- package/dist/rocket-kit.cjs.development.js.map +1 -1
- package/dist/rocket-kit.cjs.production.min.js +206 -206
- package/dist/rocket-kit.cjs.production.min.js.map +1 -1
- package/dist/rocket-kit.esm.js +107 -80
- package/dist/rocket-kit.esm.js.map +1 -1
- package/package.json +32 -16
- package/dist/organisms/horizontal-nav/styles.d.ts +0 -6
package/dist/rocket-kit.esm.js
CHANGED
|
@@ -8,6 +8,7 @@ import ReactPlayer from 'react-player';
|
|
|
8
8
|
import { v4 } from 'uuid';
|
|
9
9
|
import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
|
|
10
10
|
import ReactPaginate from 'react-paginate';
|
|
11
|
+
import { InView } from 'react-intersection-observer';
|
|
11
12
|
import throttle from 'lodash.throttle';
|
|
12
13
|
import ReactDOM from 'react-dom';
|
|
13
14
|
import Tabs from 'react-responsive-tabs';
|
|
@@ -5396,80 +5397,106 @@ const FieldWidthButton = ({
|
|
|
5396
5397
|
})));
|
|
5397
5398
|
};
|
|
5398
5399
|
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
|
|
5402
|
-
|
|
5403
|
-
|
|
5404
|
-
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5400
|
+
function styleInject(css, ref) {
|
|
5401
|
+
if ( ref === void 0 ) ref = {};
|
|
5402
|
+
var insertAt = ref.insertAt;
|
|
5403
|
+
|
|
5404
|
+
if (!css || typeof document === 'undefined') { return; }
|
|
5405
|
+
|
|
5406
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
5407
|
+
var style = document.createElement('style');
|
|
5408
|
+
style.type = 'text/css';
|
|
5409
|
+
|
|
5410
|
+
if (insertAt === 'top') {
|
|
5411
|
+
if (head.firstChild) {
|
|
5412
|
+
head.insertBefore(style, head.firstChild);
|
|
5413
|
+
} else {
|
|
5414
|
+
head.appendChild(style);
|
|
5415
|
+
}
|
|
5416
|
+
} else {
|
|
5417
|
+
head.appendChild(style);
|
|
5418
|
+
}
|
|
5419
|
+
|
|
5420
|
+
if (style.styleSheet) {
|
|
5421
|
+
style.styleSheet.cssText = css;
|
|
5422
|
+
} else {
|
|
5423
|
+
style.appendChild(document.createTextNode(css));
|
|
5424
|
+
}
|
|
5425
|
+
}
|
|
5426
|
+
|
|
5427
|
+
var css_248z = ".styles-module_wrapper__Q2-ac {\n position: relative;\n height: 5rem; /* 80px */\n display: flex;\n align-items: center;\n}\n\n.styles-module_wrapper__Q2-ac > div {\n display: flex;\n overflow-x: auto;\n scrollbar-width: none;\n -webkit-overflow-scrolling: touch;\n -ms-overflow-style: -ms-autohiding-scrollbar;\n}\n\n.styles-module_wrapper__Q2-ac > div::-webkit-scrollbar {\n display: none;\n}\n\n.styles-module_wrapper__Q2-ac ul {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n}\n\n.styles-module_wrapper__Q2-ac ul li:not(:last-child) {\n margin-right: 0.625rem; /* 10px */\n}\n\n.styles-module_wrapper__Q2-ac ul li:last-child {\n margin-right: 0.0625rem; /* 1px */\n}\n\n.styles-module_wrapper__Q2-ac ul li a {\n display: flex;\n align-items: center;\n padding: 0.625rem; /* 10px */\n color: var(--black);\n text-transform: capitalize;\n text-decoration: none;\n white-space: nowrap;\n transition-duration: var(--transitionDurationDefault);\n}\n\n.styles-module_wrapper__Q2-ac ul li a svg {\n margin-right: 0.3125rem; /* 5px */\n width: auto;\n height: 1.5rem; /* 24px */\n min-width: 1.5rem; /* 24px */\n fill: var(--grey200);\n transition-duration: var(--transitionDurationDefault);\n}\n\n.styles-module_wrapper__Q2-ac ul li a:hover {\n color: var(--purple500);\n}\n\n.styles-module_wrapper__Q2-ac ul li a:hover svg {\n fill: var(--purple500);\n}\n\n.styles-module_wrapper__Q2-ac ul li.styles-module_active__0DuQB {\n font-weight: var(--fontWeightSemiBold);\n}\n\n.styles-module_wrapper__Q2-ac ul li.styles-module_active__0DuQB a {\n color: var(--purple500);\n pointer-events: none;\n}\n\n.styles-module_wrapper__Q2-ac ul li.styles-module_active__0DuQB a svg {\n fill: var(--purple500);\n}\n\n.styles-module_wrapper__Q2-ac button {\n position: absolute;\n top: 0;\n border-radius: 0;\n height: 100%;\n border-style: solid;\n border-color: var(--grey150);\n}\n\n.styles-module_wrapper__Q2-ac button:hover {\n background-color: var(--white);\n}\n\n.styles-module_wrapper__Q2-ac button.styles-module_back__AE3bY {\n left: 0;\n border-right-width: 0.0625rem; /* 1px */\n}\n\n.styles-module_wrapper__Q2-ac button.styles-module_forward__sOwh3 {\n right: 0;\n border-left-width: 0.0625rem; /* 1px */\n}\n";
|
|
5428
|
+
var styles = {"wrapper":"styles-module_wrapper__Q2-ac","active":"styles-module_active__0DuQB","back":"styles-module_back__AE3bY","forward":"styles-module_forward__sOwh3"};
|
|
5429
|
+
styleInject(css_248z);
|
|
5430
|
+
|
|
5431
|
+
function scroll(container, direction, speed, distance, step) {
|
|
5432
|
+
let scrollAmount = 0;
|
|
5433
|
+
const slideTimer = setInterval(function () {
|
|
5434
|
+
if (container && direction === 'left') {
|
|
5435
|
+
container.scrollLeft -= step;
|
|
5436
|
+
} else {
|
|
5437
|
+
container ? container.scrollLeft += step : null;
|
|
5438
|
+
}
|
|
5439
|
+
scrollAmount += step;
|
|
5440
|
+
if (scrollAmount >= distance) {
|
|
5441
|
+
window.clearInterval(slideTimer);
|
|
5442
|
+
}
|
|
5443
|
+
}, speed);
|
|
5444
|
+
}
|
|
5445
|
+
function HorizontalNav(props) {
|
|
5412
5446
|
const {
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
items,
|
|
5416
|
-
startsOpen = false
|
|
5447
|
+
id = 'horizontal-nav',
|
|
5448
|
+
items
|
|
5417
5449
|
} = props;
|
|
5418
|
-
const
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
const
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
|
|
5429
|
-
|
|
5430
|
-
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
|
|
5435
|
-
|
|
5436
|
-
|
|
5437
|
-
|
|
5438
|
-
|
|
5439
|
-
moreVisibility();
|
|
5440
|
-
for (let i = 0; i < visible.length + 20; i++) {
|
|
5441
|
-
visibleMenuRef.current.scrollWidth + 50 > ref.current.offsetWidth ? removeItem() : addItem();
|
|
5442
|
-
}
|
|
5443
|
-
};
|
|
5444
|
-
checkOverflow();
|
|
5445
|
-
if (typeof window !== 'undefined') {
|
|
5446
|
-
moreVisibility();
|
|
5447
|
-
window.addEventListener('resize', checkOverflow);
|
|
5448
|
-
return () => window.removeEventListener('resize', checkOverflow);
|
|
5449
|
-
}
|
|
5450
|
-
return;
|
|
5451
|
-
}, [ref]);
|
|
5452
|
-
return /*#__PURE__*/React.createElement(Wrapper$f, {
|
|
5453
|
-
ref: ref,
|
|
5454
|
-
className: className,
|
|
5455
|
-
customColor: customColor
|
|
5450
|
+
const [showBackButton, setShowBackButton] = useState(false);
|
|
5451
|
+
const [showForwardButton, setShowForwardButton] = useState(true);
|
|
5452
|
+
const forward = () => {
|
|
5453
|
+
const container = document.getElementById(id);
|
|
5454
|
+
scroll(container, 'right', 10, 200, 10);
|
|
5455
|
+
};
|
|
5456
|
+
const back = () => {
|
|
5457
|
+
const container = document.getElementById(id);
|
|
5458
|
+
scroll(container, 'left', 10, 200, 10);
|
|
5459
|
+
};
|
|
5460
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
5461
|
+
className: styles.wrapper
|
|
5462
|
+
}, showBackButton && /*#__PURE__*/React.createElement(Button, {
|
|
5463
|
+
className: styles.back,
|
|
5464
|
+
variant: "solid",
|
|
5465
|
+
color: "white",
|
|
5466
|
+
txtColor: "black",
|
|
5467
|
+
icon: "caret-left",
|
|
5468
|
+
action: back
|
|
5469
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
5470
|
+
id: id
|
|
5456
5471
|
}, /*#__PURE__*/React.createElement("ul", {
|
|
5457
|
-
className: "menu"
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5472
|
+
className: "menu"
|
|
5473
|
+
}, items.map((item, index) =>
|
|
5474
|
+
/*#__PURE__*/
|
|
5475
|
+
// @ts-ignore
|
|
5476
|
+
React.createElement(InView, {
|
|
5477
|
+
key: index,
|
|
5478
|
+
as: "li",
|
|
5479
|
+
className: item.active ? styles.active : undefined,
|
|
5480
|
+
threshold: 1,
|
|
5481
|
+
onChange: inView => {
|
|
5482
|
+
if (index === 0 && inView) setShowBackButton(false);
|
|
5483
|
+
if (index === 0 && !inView) setShowBackButton(true);
|
|
5484
|
+
if (index === items.length - 1 && inView) setShowForwardButton(false);
|
|
5485
|
+
if (index === items.length - 1 && !inView) setShowForwardButton(true);
|
|
5468
5486
|
}
|
|
5469
|
-
}
|
|
5470
|
-
|
|
5471
|
-
}
|
|
5472
|
-
|
|
5487
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
5488
|
+
href: item.url
|
|
5489
|
+
}, item.icon && /*#__PURE__*/React.createElement(Icon, {
|
|
5490
|
+
icon: item.icon
|
|
5491
|
+
}), item.label))))), showForwardButton && /*#__PURE__*/React.createElement(Button, {
|
|
5492
|
+
className: styles.forward,
|
|
5493
|
+
variant: "solid",
|
|
5494
|
+
color: "white",
|
|
5495
|
+
txtColor: "black",
|
|
5496
|
+
icon: "caret-right",
|
|
5497
|
+
action: forward
|
|
5498
|
+
}));
|
|
5499
|
+
}
|
|
5473
5500
|
|
|
5474
5501
|
const ModalOverlay = /*#__PURE__*/_styled.div.withConfig({
|
|
5475
5502
|
displayName: "styles__ModalOverlay",
|
|
@@ -5512,7 +5539,7 @@ const Modal = props => {
|
|
|
5512
5539
|
return;
|
|
5513
5540
|
}
|
|
5514
5541
|
}, []);
|
|
5515
|
-
return isShowing ? /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ModalOverlay, {
|
|
5542
|
+
return isShowing ? ( /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ModalOverlay, {
|
|
5516
5543
|
zIndex: zIndex
|
|
5517
5544
|
}), /*#__PURE__*/React.createElement(ModalWrapper, {
|
|
5518
5545
|
"aria-modal": true,
|
|
@@ -5534,7 +5561,7 @@ const Modal = props => {
|
|
|
5534
5561
|
})), children, footer && /*#__PURE__*/React.createElement(ModalFooter, {
|
|
5535
5562
|
closeAction: hide,
|
|
5536
5563
|
closeValue: closeValue
|
|
5537
|
-
})))), document.body) : /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
5564
|
+
})))), document.body)) : /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
5538
5565
|
};
|
|
5539
5566
|
|
|
5540
5567
|
const slideInLeft = keyframes`
|
|
@@ -5602,7 +5629,7 @@ const ModalDrawer = props => {
|
|
|
5602
5629
|
}
|
|
5603
5630
|
return;
|
|
5604
5631
|
}, []);
|
|
5605
|
-
return isShowing ? /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ModalOverlay$1, {
|
|
5632
|
+
return isShowing ? ( /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ModalOverlay$1, {
|
|
5606
5633
|
zIndex: zIndex
|
|
5607
5634
|
}), /*#__PURE__*/React.createElement(ModalWrapper$1, {
|
|
5608
5635
|
"aria-modal": true,
|
|
@@ -5615,10 +5642,10 @@ const ModalDrawer = props => {
|
|
|
5615
5642
|
}, /*#__PURE__*/React.createElement(ModalHeader$1, null, title && /*#__PURE__*/React.createElement("h2", null, title)), /*#__PURE__*/React.createElement(ModalContent, null, children), !footerHidden && (footer ? footer : /*#__PURE__*/React.createElement(ModalFooter, {
|
|
5616
5643
|
closeAction: hide,
|
|
5617
5644
|
closeValue: closeValue
|
|
5618
|
-
}))))), document.body) : /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
5645
|
+
}))))), document.body)) : /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
5619
5646
|
};
|
|
5620
5647
|
|
|
5621
|
-
const Wrapper$
|
|
5648
|
+
const Wrapper$f = _styled.div`
|
|
5622
5649
|
div {
|
|
5623
5650
|
width: 100%;
|
|
5624
5651
|
height: 100%;
|
|
@@ -5781,12 +5808,12 @@ const LoadingState = props => {
|
|
|
5781
5808
|
className: "subtitle"
|
|
5782
5809
|
}), paragraphs));
|
|
5783
5810
|
}
|
|
5784
|
-
return /*#__PURE__*/React.createElement(Wrapper$
|
|
5811
|
+
return /*#__PURE__*/React.createElement(Wrapper$f, {
|
|
5785
5812
|
type: type
|
|
5786
5813
|
}, loadingType);
|
|
5787
5814
|
};
|
|
5788
5815
|
|
|
5789
|
-
const Wrapper$
|
|
5816
|
+
const Wrapper$g = _styled.div`
|
|
5790
5817
|
.tab {
|
|
5791
5818
|
border-color: ${field.borderColor};
|
|
5792
5819
|
|
|
@@ -5964,7 +5991,7 @@ const TabsPanel = props => {
|
|
|
5964
5991
|
getContent: () => tab.renderer
|
|
5965
5992
|
}));
|
|
5966
5993
|
};
|
|
5967
|
-
return /*#__PURE__*/React.createElement(Wrapper$
|
|
5994
|
+
return /*#__PURE__*/React.createElement(Wrapper$g, null, /*#__PURE__*/React.createElement(Tabs, {
|
|
5968
5995
|
transform: false,
|
|
5969
5996
|
unmountOnExit: unmountOnExit,
|
|
5970
5997
|
selectedTabKey: selectedTabKey,
|
|
@@ -5974,7 +6001,7 @@ const TabsPanel = props => {
|
|
|
5974
6001
|
}));
|
|
5975
6002
|
};
|
|
5976
6003
|
|
|
5977
|
-
const Wrapper$
|
|
6004
|
+
const Wrapper$h = _styled.div`
|
|
5978
6005
|
display: flex;
|
|
5979
6006
|
flex-direction: column;
|
|
5980
6007
|
`;
|
|
@@ -5994,7 +6021,7 @@ const TabsPanel$1 = props => {
|
|
|
5994
6021
|
className = 'grid-container',
|
|
5995
6022
|
children
|
|
5996
6023
|
} = props;
|
|
5997
|
-
return /*#__PURE__*/React.createElement(Wrapper$
|
|
6024
|
+
return /*#__PURE__*/React.createElement(Wrapper$h, {
|
|
5998
6025
|
className: className
|
|
5999
6026
|
}, children);
|
|
6000
6027
|
};
|