@taikai/rocket-kit 3.0.7 → 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/molecules/checkbox-group/index.d.ts +9 -2
- 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 +84 -82
- 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 +113 -82
- 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';
|
|
@@ -5268,8 +5269,12 @@ const CheckboxGroup = props => {
|
|
|
5268
5269
|
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
5269
5270
|
label: value.label,
|
|
5270
5271
|
value: value.value,
|
|
5271
|
-
checked: value.checked,
|
|
5272
|
-
onChange:
|
|
5272
|
+
checked: value.checked ?? undefined,
|
|
5273
|
+
onChange: event => {
|
|
5274
|
+
var _value$onChange;
|
|
5275
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(event);
|
|
5276
|
+
(_value$onChange = value.onChange) === null || _value$onChange === void 0 ? void 0 : _value$onChange.call(value, event);
|
|
5277
|
+
},
|
|
5273
5278
|
error: !!error,
|
|
5274
5279
|
disabled: disabled
|
|
5275
5280
|
}))) : null, error ? /*#__PURE__*/React.createElement(ErrorField, {
|
|
@@ -5392,80 +5397,106 @@ const FieldWidthButton = ({
|
|
|
5392
5397
|
})));
|
|
5393
5398
|
};
|
|
5394
5399
|
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
|
|
5398
|
-
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
|
|
5402
|
-
|
|
5403
|
-
|
|
5404
|
-
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
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) {
|
|
5408
5446
|
const {
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
items,
|
|
5412
|
-
startsOpen = false
|
|
5447
|
+
id = 'horizontal-nav',
|
|
5448
|
+
items
|
|
5413
5449
|
} = props;
|
|
5414
|
-
const
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
const
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
|
|
5429
|
-
|
|
5430
|
-
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
|
|
5435
|
-
moreVisibility();
|
|
5436
|
-
for (let i = 0; i < visible.length + 20; i++) {
|
|
5437
|
-
visibleMenuRef.current.scrollWidth + 50 > ref.current.offsetWidth ? removeItem() : addItem();
|
|
5438
|
-
}
|
|
5439
|
-
};
|
|
5440
|
-
checkOverflow();
|
|
5441
|
-
if (typeof window !== 'undefined') {
|
|
5442
|
-
moreVisibility();
|
|
5443
|
-
window.addEventListener('resize', checkOverflow);
|
|
5444
|
-
return () => window.removeEventListener('resize', checkOverflow);
|
|
5445
|
-
}
|
|
5446
|
-
return;
|
|
5447
|
-
}, [ref]);
|
|
5448
|
-
return /*#__PURE__*/React.createElement(Wrapper$f, {
|
|
5449
|
-
ref: ref,
|
|
5450
|
-
className: className,
|
|
5451
|
-
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
|
|
5452
5471
|
}, /*#__PURE__*/React.createElement("ul", {
|
|
5453
|
-
className: "menu"
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
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);
|
|
5464
5486
|
}
|
|
5465
|
-
}
|
|
5466
|
-
|
|
5467
|
-
}
|
|
5468
|
-
|
|
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
|
+
}
|
|
5469
5500
|
|
|
5470
5501
|
const ModalOverlay = /*#__PURE__*/_styled.div.withConfig({
|
|
5471
5502
|
displayName: "styles__ModalOverlay",
|
|
@@ -5508,7 +5539,7 @@ const Modal = props => {
|
|
|
5508
5539
|
return;
|
|
5509
5540
|
}
|
|
5510
5541
|
}, []);
|
|
5511
|
-
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, {
|
|
5512
5543
|
zIndex: zIndex
|
|
5513
5544
|
}), /*#__PURE__*/React.createElement(ModalWrapper, {
|
|
5514
5545
|
"aria-modal": true,
|
|
@@ -5530,7 +5561,7 @@ const Modal = props => {
|
|
|
5530
5561
|
})), children, footer && /*#__PURE__*/React.createElement(ModalFooter, {
|
|
5531
5562
|
closeAction: hide,
|
|
5532
5563
|
closeValue: closeValue
|
|
5533
|
-
})))), document.body) : /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
5564
|
+
})))), document.body)) : /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
5534
5565
|
};
|
|
5535
5566
|
|
|
5536
5567
|
const slideInLeft = keyframes`
|
|
@@ -5598,7 +5629,7 @@ const ModalDrawer = props => {
|
|
|
5598
5629
|
}
|
|
5599
5630
|
return;
|
|
5600
5631
|
}, []);
|
|
5601
|
-
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, {
|
|
5602
5633
|
zIndex: zIndex
|
|
5603
5634
|
}), /*#__PURE__*/React.createElement(ModalWrapper$1, {
|
|
5604
5635
|
"aria-modal": true,
|
|
@@ -5611,10 +5642,10 @@ const ModalDrawer = props => {
|
|
|
5611
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, {
|
|
5612
5643
|
closeAction: hide,
|
|
5613
5644
|
closeValue: closeValue
|
|
5614
|
-
}))))), document.body) : /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
5645
|
+
}))))), document.body)) : /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
5615
5646
|
};
|
|
5616
5647
|
|
|
5617
|
-
const Wrapper$
|
|
5648
|
+
const Wrapper$f = _styled.div`
|
|
5618
5649
|
div {
|
|
5619
5650
|
width: 100%;
|
|
5620
5651
|
height: 100%;
|
|
@@ -5777,12 +5808,12 @@ const LoadingState = props => {
|
|
|
5777
5808
|
className: "subtitle"
|
|
5778
5809
|
}), paragraphs));
|
|
5779
5810
|
}
|
|
5780
|
-
return /*#__PURE__*/React.createElement(Wrapper$
|
|
5811
|
+
return /*#__PURE__*/React.createElement(Wrapper$f, {
|
|
5781
5812
|
type: type
|
|
5782
5813
|
}, loadingType);
|
|
5783
5814
|
};
|
|
5784
5815
|
|
|
5785
|
-
const Wrapper$
|
|
5816
|
+
const Wrapper$g = _styled.div`
|
|
5786
5817
|
.tab {
|
|
5787
5818
|
border-color: ${field.borderColor};
|
|
5788
5819
|
|
|
@@ -5960,7 +5991,7 @@ const TabsPanel = props => {
|
|
|
5960
5991
|
getContent: () => tab.renderer
|
|
5961
5992
|
}));
|
|
5962
5993
|
};
|
|
5963
|
-
return /*#__PURE__*/React.createElement(Wrapper$
|
|
5994
|
+
return /*#__PURE__*/React.createElement(Wrapper$g, null, /*#__PURE__*/React.createElement(Tabs, {
|
|
5964
5995
|
transform: false,
|
|
5965
5996
|
unmountOnExit: unmountOnExit,
|
|
5966
5997
|
selectedTabKey: selectedTabKey,
|
|
@@ -5970,7 +6001,7 @@ const TabsPanel = props => {
|
|
|
5970
6001
|
}));
|
|
5971
6002
|
};
|
|
5972
6003
|
|
|
5973
|
-
const Wrapper$
|
|
6004
|
+
const Wrapper$h = _styled.div`
|
|
5974
6005
|
display: flex;
|
|
5975
6006
|
flex-direction: column;
|
|
5976
6007
|
`;
|
|
@@ -5990,7 +6021,7 @@ const TabsPanel$1 = props => {
|
|
|
5990
6021
|
className = 'grid-container',
|
|
5991
6022
|
children
|
|
5992
6023
|
} = props;
|
|
5993
|
-
return /*#__PURE__*/React.createElement(Wrapper$
|
|
6024
|
+
return /*#__PURE__*/React.createElement(Wrapper$h, {
|
|
5994
6025
|
className: className
|
|
5995
6026
|
}, children);
|
|
5996
6027
|
};
|