@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
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
customColor?: string;
|
|
5
|
-
items: any;
|
|
6
|
-
startsOpen?: boolean;
|
|
7
|
-
}
|
|
8
|
-
declare const HorizontalNav: (props: HorizontalNavInterface) => React.JSX.Element;
|
|
9
|
-
export default HorizontalNav;
|
|
2
|
+
import { HorizontalNavInterface } from './types';
|
|
3
|
+
export default function HorizontalNav(props: HorizontalNavInterface): React.JSX.Element;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
.styles-module_wrapper__Q2-ac {
|
|
2
|
+
position: relative;
|
|
3
|
+
height: 5rem; /* 80px */
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.styles-module_wrapper__Q2-ac > div {
|
|
9
|
+
display: flex;
|
|
10
|
+
overflow-x: auto;
|
|
11
|
+
scrollbar-width: none;
|
|
12
|
+
-webkit-overflow-scrolling: touch;
|
|
13
|
+
-ms-overflow-style: -ms-autohiding-scrollbar;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.styles-module_wrapper__Q2-ac > div::-webkit-scrollbar {
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.styles-module_wrapper__Q2-ac ul {
|
|
21
|
+
list-style: none;
|
|
22
|
+
margin: 0;
|
|
23
|
+
padding: 0;
|
|
24
|
+
display: flex;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.styles-module_wrapper__Q2-ac ul li:not(:last-child) {
|
|
28
|
+
margin-right: 0.625rem; /* 10px */
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.styles-module_wrapper__Q2-ac ul li:last-child {
|
|
32
|
+
margin-right: 0.0625rem; /* 1px */
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.styles-module_wrapper__Q2-ac ul li a {
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
padding: 0.625rem; /* 10px */
|
|
39
|
+
color: var(--black);
|
|
40
|
+
text-transform: capitalize;
|
|
41
|
+
text-decoration: none;
|
|
42
|
+
white-space: nowrap;
|
|
43
|
+
transition-duration: var(--transitionDurationDefault);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.styles-module_wrapper__Q2-ac ul li a svg {
|
|
47
|
+
margin-right: 0.3125rem; /* 5px */
|
|
48
|
+
width: auto;
|
|
49
|
+
height: 1.5rem; /* 24px */
|
|
50
|
+
min-width: 1.5rem; /* 24px */
|
|
51
|
+
fill: var(--grey200);
|
|
52
|
+
transition-duration: var(--transitionDurationDefault);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.styles-module_wrapper__Q2-ac ul li a:hover {
|
|
56
|
+
color: var(--purple500);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.styles-module_wrapper__Q2-ac ul li a:hover svg {
|
|
60
|
+
fill: var(--purple500);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.styles-module_wrapper__Q2-ac ul li.styles-module_active__0DuQB {
|
|
64
|
+
font-weight: var(--fontWeightSemiBold);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.styles-module_wrapper__Q2-ac ul li.styles-module_active__0DuQB a {
|
|
68
|
+
color: var(--purple500);
|
|
69
|
+
pointer-events: none;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.styles-module_wrapper__Q2-ac ul li.styles-module_active__0DuQB a svg {
|
|
73
|
+
fill: var(--purple500);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.styles-module_wrapper__Q2-ac button {
|
|
77
|
+
position: absolute;
|
|
78
|
+
top: 0;
|
|
79
|
+
border-radius: 0;
|
|
80
|
+
height: 100%;
|
|
81
|
+
border-style: solid;
|
|
82
|
+
border-color: var(--grey150);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.styles-module_wrapper__Q2-ac button:hover {
|
|
86
|
+
background-color: var(--white);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.styles-module_wrapper__Q2-ac button.styles-module_back__AE3bY {
|
|
90
|
+
left: 0;
|
|
91
|
+
border-right-width: 0.0625rem; /* 1px */
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.styles-module_wrapper__Q2-ac button.styles-module_forward__sOwh3 {
|
|
95
|
+
right: 0;
|
|
96
|
+
border-left-width: 0.0625rem; /* 1px */
|
|
97
|
+
}
|
|
@@ -17,6 +17,7 @@ var ReactPlayer = _interopDefault(require('react-player'));
|
|
|
17
17
|
var uuid = require('uuid');
|
|
18
18
|
var reactBeautifulDnd = require('react-beautiful-dnd');
|
|
19
19
|
var ReactPaginate = _interopDefault(require('react-paginate'));
|
|
20
|
+
var reactIntersectionObserver = require('react-intersection-observer');
|
|
20
21
|
var throttle = _interopDefault(require('lodash.throttle'));
|
|
21
22
|
var ReactDOM = _interopDefault(require('react-dom'));
|
|
22
23
|
var Tabs = _interopDefault(require('react-responsive-tabs'));
|
|
@@ -5405,80 +5406,77 @@ const FieldWidthButton = ({
|
|
|
5405
5406
|
})));
|
|
5406
5407
|
};
|
|
5407
5408
|
|
|
5408
|
-
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
const
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
}
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5409
|
+
var styles = {"wrapper":"styles-module_wrapper__Q2-ac","active":"styles-module_active__0DuQB","back":"styles-module_back__AE3bY","forward":"styles-module_forward__sOwh3"};
|
|
5410
|
+
|
|
5411
|
+
function scroll(container, direction, speed, distance, step) {
|
|
5412
|
+
let scrollAmount = 0;
|
|
5413
|
+
const slideTimer = setInterval(function () {
|
|
5414
|
+
if (container && direction === 'left') {
|
|
5415
|
+
container.scrollLeft -= step;
|
|
5416
|
+
} else {
|
|
5417
|
+
container ? container.scrollLeft += step : null;
|
|
5418
|
+
}
|
|
5419
|
+
scrollAmount += step;
|
|
5420
|
+
if (scrollAmount >= distance) {
|
|
5421
|
+
window.clearInterval(slideTimer);
|
|
5422
|
+
}
|
|
5423
|
+
}, speed);
|
|
5424
|
+
}
|
|
5425
|
+
function HorizontalNav(props) {
|
|
5421
5426
|
const {
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
items,
|
|
5425
|
-
startsOpen = false
|
|
5427
|
+
id = 'horizontal-nav',
|
|
5428
|
+
items
|
|
5426
5429
|
} = props;
|
|
5427
|
-
const
|
|
5428
|
-
|
|
5429
|
-
|
|
5430
|
-
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
const
|
|
5435
|
-
|
|
5436
|
-
|
|
5437
|
-
|
|
5438
|
-
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
moreVisibility();
|
|
5449
|
-
for (let i = 0; i < visible.length + 20; i++) {
|
|
5450
|
-
visibleMenuRef.current.scrollWidth + 50 > ref.current.offsetWidth ? removeItem() : addItem();
|
|
5451
|
-
}
|
|
5452
|
-
};
|
|
5453
|
-
checkOverflow();
|
|
5454
|
-
if (typeof window !== 'undefined') {
|
|
5455
|
-
moreVisibility();
|
|
5456
|
-
window.addEventListener('resize', checkOverflow);
|
|
5457
|
-
return () => window.removeEventListener('resize', checkOverflow);
|
|
5458
|
-
}
|
|
5459
|
-
return;
|
|
5460
|
-
}, [ref]);
|
|
5461
|
-
return /*#__PURE__*/React__default.createElement(Wrapper$f, {
|
|
5462
|
-
ref: ref,
|
|
5463
|
-
className: className,
|
|
5464
|
-
customColor: customColor
|
|
5430
|
+
const [showBackButton, setShowBackButton] = React.useState(false);
|
|
5431
|
+
const [showForwardButton, setShowForwardButton] = React.useState(true);
|
|
5432
|
+
const forward = () => {
|
|
5433
|
+
const container = document.getElementById(id);
|
|
5434
|
+
scroll(container, 'right', 10, 200, 10);
|
|
5435
|
+
};
|
|
5436
|
+
const back = () => {
|
|
5437
|
+
const container = document.getElementById(id);
|
|
5438
|
+
scroll(container, 'left', 10, 200, 10);
|
|
5439
|
+
};
|
|
5440
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
5441
|
+
className: styles.wrapper
|
|
5442
|
+
}, showBackButton && /*#__PURE__*/React__default.createElement(Button, {
|
|
5443
|
+
className: styles.back,
|
|
5444
|
+
variant: "solid",
|
|
5445
|
+
color: "white",
|
|
5446
|
+
txtColor: "black",
|
|
5447
|
+
icon: "caret-left",
|
|
5448
|
+
action: back
|
|
5449
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
5450
|
+
id: id
|
|
5465
5451
|
}, /*#__PURE__*/React__default.createElement("ul", {
|
|
5466
|
-
className: "menu"
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
5452
|
+
className: "menu"
|
|
5453
|
+
}, items.map((item, index) =>
|
|
5454
|
+
/*#__PURE__*/
|
|
5455
|
+
// @ts-ignore
|
|
5456
|
+
React__default.createElement(reactIntersectionObserver.InView, {
|
|
5457
|
+
key: index,
|
|
5458
|
+
as: "li",
|
|
5459
|
+
className: item.active ? styles.active : undefined,
|
|
5460
|
+
threshold: 1,
|
|
5461
|
+
onChange: inView => {
|
|
5462
|
+
if (index === 0 && inView) setShowBackButton(false);
|
|
5463
|
+
if (index === 0 && !inView) setShowBackButton(true);
|
|
5464
|
+
if (index === items.length - 1 && inView) setShowForwardButton(false);
|
|
5465
|
+
if (index === items.length - 1 && !inView) setShowForwardButton(true);
|
|
5477
5466
|
}
|
|
5478
|
-
}
|
|
5479
|
-
|
|
5480
|
-
}
|
|
5481
|
-
|
|
5467
|
+
}, /*#__PURE__*/React__default.createElement("a", {
|
|
5468
|
+
href: item.url
|
|
5469
|
+
}, item.icon && /*#__PURE__*/React__default.createElement(Icon, {
|
|
5470
|
+
icon: item.icon
|
|
5471
|
+
}), item.label))))), showForwardButton && /*#__PURE__*/React__default.createElement(Button, {
|
|
5472
|
+
className: styles.forward,
|
|
5473
|
+
variant: "solid",
|
|
5474
|
+
color: "white",
|
|
5475
|
+
txtColor: "black",
|
|
5476
|
+
icon: "caret-right",
|
|
5477
|
+
action: forward
|
|
5478
|
+
}));
|
|
5479
|
+
}
|
|
5482
5480
|
|
|
5483
5481
|
const ModalOverlay = /*#__PURE__*/_styled__default.div.withConfig({
|
|
5484
5482
|
displayName: "styles__ModalOverlay",
|
|
@@ -5521,7 +5519,7 @@ const Modal = props => {
|
|
|
5521
5519
|
return;
|
|
5522
5520
|
}
|
|
5523
5521
|
}, []);
|
|
5524
|
-
return isShowing ? /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ModalOverlay, {
|
|
5522
|
+
return isShowing ? ( /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ModalOverlay, {
|
|
5525
5523
|
zIndex: zIndex
|
|
5526
5524
|
}), /*#__PURE__*/React__default.createElement(ModalWrapper, {
|
|
5527
5525
|
"aria-modal": true,
|
|
@@ -5543,7 +5541,7 @@ const Modal = props => {
|
|
|
5543
5541
|
})), children, footer && /*#__PURE__*/React__default.createElement(ModalFooter, {
|
|
5544
5542
|
closeAction: hide,
|
|
5545
5543
|
closeValue: closeValue
|
|
5546
|
-
})))), document.body) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null);
|
|
5544
|
+
})))), document.body)) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null);
|
|
5547
5545
|
};
|
|
5548
5546
|
|
|
5549
5547
|
const slideInLeft = _styled.keyframes`
|
|
@@ -5611,7 +5609,7 @@ const ModalDrawer = props => {
|
|
|
5611
5609
|
}
|
|
5612
5610
|
return;
|
|
5613
5611
|
}, []);
|
|
5614
|
-
return isShowing ? /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ModalOverlay$1, {
|
|
5612
|
+
return isShowing ? ( /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ModalOverlay$1, {
|
|
5615
5613
|
zIndex: zIndex
|
|
5616
5614
|
}), /*#__PURE__*/React__default.createElement(ModalWrapper$1, {
|
|
5617
5615
|
"aria-modal": true,
|
|
@@ -5624,10 +5622,10 @@ const ModalDrawer = props => {
|
|
|
5624
5622
|
}, /*#__PURE__*/React__default.createElement(ModalHeader$1, null, title && /*#__PURE__*/React__default.createElement("h2", null, title)), /*#__PURE__*/React__default.createElement(ModalContent, null, children), !footerHidden && (footer ? footer : /*#__PURE__*/React__default.createElement(ModalFooter, {
|
|
5625
5623
|
closeAction: hide,
|
|
5626
5624
|
closeValue: closeValue
|
|
5627
|
-
}))))), document.body) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null);
|
|
5625
|
+
}))))), document.body)) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null);
|
|
5628
5626
|
};
|
|
5629
5627
|
|
|
5630
|
-
const Wrapper$
|
|
5628
|
+
const Wrapper$f = _styled__default.div`
|
|
5631
5629
|
div {
|
|
5632
5630
|
width: 100%;
|
|
5633
5631
|
height: 100%;
|
|
@@ -5790,12 +5788,12 @@ const LoadingState = props => {
|
|
|
5790
5788
|
className: "subtitle"
|
|
5791
5789
|
}), paragraphs));
|
|
5792
5790
|
}
|
|
5793
|
-
return /*#__PURE__*/React__default.createElement(Wrapper$
|
|
5791
|
+
return /*#__PURE__*/React__default.createElement(Wrapper$f, {
|
|
5794
5792
|
type: type
|
|
5795
5793
|
}, loadingType);
|
|
5796
5794
|
};
|
|
5797
5795
|
|
|
5798
|
-
const Wrapper$
|
|
5796
|
+
const Wrapper$g = _styled__default.div`
|
|
5799
5797
|
.tab {
|
|
5800
5798
|
border-color: ${field.borderColor};
|
|
5801
5799
|
|
|
@@ -5973,7 +5971,7 @@ const TabsPanel = props => {
|
|
|
5973
5971
|
getContent: () => tab.renderer
|
|
5974
5972
|
}));
|
|
5975
5973
|
};
|
|
5976
|
-
return /*#__PURE__*/React__default.createElement(Wrapper$
|
|
5974
|
+
return /*#__PURE__*/React__default.createElement(Wrapper$g, null, /*#__PURE__*/React__default.createElement(Tabs, {
|
|
5977
5975
|
transform: false,
|
|
5978
5976
|
unmountOnExit: unmountOnExit,
|
|
5979
5977
|
selectedTabKey: selectedTabKey,
|
|
@@ -5983,7 +5981,7 @@ const TabsPanel = props => {
|
|
|
5983
5981
|
}));
|
|
5984
5982
|
};
|
|
5985
5983
|
|
|
5986
|
-
const Wrapper$
|
|
5984
|
+
const Wrapper$h = _styled__default.div`
|
|
5987
5985
|
display: flex;
|
|
5988
5986
|
flex-direction: column;
|
|
5989
5987
|
`;
|
|
@@ -6003,7 +6001,7 @@ const TabsPanel$1 = props => {
|
|
|
6003
6001
|
className = 'grid-container',
|
|
6004
6002
|
children
|
|
6005
6003
|
} = props;
|
|
6006
|
-
return /*#__PURE__*/React__default.createElement(Wrapper$
|
|
6004
|
+
return /*#__PURE__*/React__default.createElement(Wrapper$h, {
|
|
6007
6005
|
className: className
|
|
6008
6006
|
}, children);
|
|
6009
6007
|
};
|