@hexure/ui 1.13.1 → 1.13.3
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/cjs/index.js +85 -29
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/ButtonMenu/ButtonMenu.d.ts +3 -1
- package/dist/cjs/types/components/FileUpload/FileUpload.d.ts +1 -0
- package/dist/esm/index.js +85 -29
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/ButtonMenu/ButtonMenu.d.ts +3 -1
- package/dist/esm/types/components/FileUpload/FileUpload.d.ts +1 -0
- package/dist/index.d.ts +85 -82
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -301,7 +301,7 @@ Heading.defaultProps = {
|
|
|
301
301
|
type: 'primary',
|
|
302
302
|
};
|
|
303
303
|
|
|
304
|
-
const Wrapper$
|
|
304
|
+
const Wrapper$h = styled.div `
|
|
305
305
|
position: fixed;
|
|
306
306
|
top: 0;
|
|
307
307
|
right: 0;
|
|
@@ -325,7 +325,7 @@ const Buttons$1 = styled.div `
|
|
|
325
325
|
`;
|
|
326
326
|
const ActionDialog = (_a) => {
|
|
327
327
|
var { description, title, primaryButton, secondaryButton, tertiaryButton, style = {} } = _a, accessibleProps = __rest(_a, ["description", "title", "primaryButton", "secondaryButton", "tertiaryButton", "style"]);
|
|
328
|
-
return (React.createElement(Wrapper$
|
|
328
|
+
return (React.createElement(Wrapper$h, Object.assign({}, accessibleProps),
|
|
329
329
|
React.createElement(Container$4, { "$customStyle": style, open: true },
|
|
330
330
|
title ? (React.createElement(Heading, { margin: '0px 0px 20px 0px', type: 'secondary' }, title)) : null,
|
|
331
331
|
description ? React.createElement(Copy, { align: 'center' }, description) : null,
|
|
@@ -335,7 +335,7 @@ const ActionDialog = (_a) => {
|
|
|
335
335
|
primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { format: primaryButton.format || 'primary' }))) : null)) : null)));
|
|
336
336
|
};
|
|
337
337
|
|
|
338
|
-
const Wrapper$
|
|
338
|
+
const Wrapper$g = styled.div `
|
|
339
339
|
border: 1px solid #f1f1f1;
|
|
340
340
|
border-radius: 4px;
|
|
341
341
|
border-left-width: 4px;
|
|
@@ -379,7 +379,7 @@ const Alert = (_a) => {
|
|
|
379
379
|
icon: js.mdiCheckboxMarkedCircleOutline,
|
|
380
380
|
},
|
|
381
381
|
};
|
|
382
|
-
return (React.createElement(Wrapper$
|
|
382
|
+
return (React.createElement(Wrapper$g, Object.assign({}, accessibleProps, { "$small": small, style: { borderLeftColor: type_mapping[type].color } }),
|
|
383
383
|
React.createElement(StyledIcon$5, { color: type_mapping[type].color, path: type_mapping[type].icon, size: small ? '20px' : '30px' }),
|
|
384
384
|
React.createElement("div", null,
|
|
385
385
|
title && !small ? (React.createElement(Heading, { bold: true, margin: '2px 0 0 0', type: 'tertiary' }, title)) : null,
|
|
@@ -458,7 +458,7 @@ const AppHeader = ({ logoUrl, buttons = [] }) => {
|
|
|
458
458
|
React.createElement(Buttons, null, buttons.map((b, i) => (React.createElement(Button, Object.assign({ key: i }, b)))))));
|
|
459
459
|
};
|
|
460
460
|
|
|
461
|
-
const Wrapper$
|
|
461
|
+
const Wrapper$f = styled.div `
|
|
462
462
|
display: inline-block;
|
|
463
463
|
border-radius: 4px;
|
|
464
464
|
padding: 4px 6px;
|
|
@@ -485,7 +485,7 @@ const Remove$1 = styled.div `
|
|
|
485
485
|
`;
|
|
486
486
|
const Tag = (_a) => {
|
|
487
487
|
var { children, color = 'PRIMARY', removable, onClick } = _a, accessibleProps = __rest(_a, ["children", "color", "removable", "onClick"]);
|
|
488
|
-
return (React.createElement(Wrapper$
|
|
488
|
+
return (React.createElement(Wrapper$f, Object.assign({ "$color": color, "$removable": removable, onClick: onClick }, accessibleProps),
|
|
489
489
|
React.createElement(Content$3, null,
|
|
490
490
|
React.createElement(Label$4, { "$color": color }, children),
|
|
491
491
|
removable ? (React.createElement(Remove$1, null,
|
|
@@ -500,7 +500,7 @@ const SidebarContainer = styled.div `
|
|
|
500
500
|
padding: 12px 0px;
|
|
501
501
|
width: ${props => (props.$isOpen ? props.$width : '60px')};
|
|
502
502
|
`;
|
|
503
|
-
const MenuWrapper = styled.div `
|
|
503
|
+
const MenuWrapper$1 = styled.div `
|
|
504
504
|
display: flex;
|
|
505
505
|
align-items: center;
|
|
506
506
|
border-left-width: 4px;
|
|
@@ -582,7 +582,7 @@ const AppMenu = ({ menu, isCollapsed, footerTag, defaultWidth = '280px' }) => {
|
|
|
582
582
|
return (React.createElement(SidebarContainer, { "$isOpen": !collapsed, "$width": defaultWidth },
|
|
583
583
|
React.createElement(SidebarMenuContainer, null, menu.map(nav_item => {
|
|
584
584
|
return (React.createElement(React.Fragment, { key: nav_item.label },
|
|
585
|
-
React.createElement(MenuWrapper, { "$active": !!nav_item.is_active, "$color": theme.PRIMARY_COLOR, onClick: nav_item.onClick },
|
|
585
|
+
React.createElement(MenuWrapper$1, { "$active": !!nav_item.is_active, "$color": theme.PRIMARY_COLOR, onClick: nav_item.onClick },
|
|
586
586
|
React.createElement(MenuIcon, { "$active": !!nav_item.is_active, path: nav_item.icon }),
|
|
587
587
|
collapsed ? null : (React.createElement(MenuLabel, { "$active": nav_item.is_active, "$color": theme.PRIMARY_COLOR }, nav_item.label))),
|
|
588
588
|
nav_item.is_active && nav_item.menu && !collapsed ? (React.createElement(SubMenu, null, nav_item.menu.map(menu_item => (React.createElement(SubMenuItem, { "$active": menu_item.is_active, "$color": theme.PRIMARY_COLOR, key: menu_item.label, onClick: menu_item.onClick }, menu_item.label))))) : null));
|
|
@@ -600,7 +600,7 @@ const AppMenu = ({ menu, isCollapsed, footerTag, defaultWidth = '280px' }) => {
|
|
|
600
600
|
}, small: true }))));
|
|
601
601
|
};
|
|
602
602
|
|
|
603
|
-
const Wrapper$
|
|
603
|
+
const Wrapper$e = styled.div `
|
|
604
604
|
border: 1px solid ${props => props.theme.PRIMARY_COLOR.Hex};
|
|
605
605
|
border-radius: 8px;
|
|
606
606
|
box-sizing: border-box;
|
|
@@ -609,7 +609,7 @@ const Wrapper$f = styled.div `
|
|
|
609
609
|
justify-content: space-between;
|
|
610
610
|
padding: 16px 20px;
|
|
611
611
|
`;
|
|
612
|
-
Wrapper$
|
|
612
|
+
Wrapper$e.defaultProps = { theme: EditableTheme };
|
|
613
613
|
const Left = styled.div `
|
|
614
614
|
box-sizing: border-box;
|
|
615
615
|
display: flex;
|
|
@@ -670,7 +670,7 @@ const ErrorMsg = styled.span `
|
|
|
670
670
|
`;
|
|
671
671
|
const BulkActionBar = (_a) => {
|
|
672
672
|
var { actions = [], errorMsg, onClear, selectedCount = 0 } = _a, accessibleProps = __rest(_a, ["actions", "errorMsg", "onClear", "selectedCount"]);
|
|
673
|
-
return (React.createElement(Wrapper$
|
|
673
|
+
return (React.createElement(Wrapper$e, Object.assign({}, accessibleProps),
|
|
674
674
|
React.createElement(Left, null,
|
|
675
675
|
React.createElement(Info$1, null,
|
|
676
676
|
React.createElement(Selected, null,
|
|
@@ -683,7 +683,7 @@ const BulkActionBar = (_a) => {
|
|
|
683
683
|
React.createElement(ErrorMsg, null, errorMsg))) : null));
|
|
684
684
|
};
|
|
685
685
|
|
|
686
|
-
const Wrapper$
|
|
686
|
+
const Wrapper$d = styled.div `
|
|
687
687
|
background: #fff;
|
|
688
688
|
border-radius: 8px;
|
|
689
689
|
box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.2);
|
|
@@ -724,30 +724,77 @@ const Title$1 = styled.span `
|
|
|
724
724
|
`;
|
|
725
725
|
const MoreMenu = (_a) => {
|
|
726
726
|
var { maxHeight, menuItems = [] } = _a, accessibleProps = __rest(_a, ["maxHeight", "menuItems"]);
|
|
727
|
-
return (React.createElement(Wrapper$
|
|
727
|
+
return (React.createElement(Wrapper$d, Object.assign({ "$maxHeight": maxHeight }, accessibleProps), menuItems.map((item, i) => {
|
|
728
728
|
return (React.createElement(MenuItem, { key: i, onClick: item.onClick },
|
|
729
729
|
item.icon ? (React.createElement(Icon, { color: Colors.MEDIUM_GRAY.Hex, path: item.icon, size: '20px' })) : null,
|
|
730
730
|
React.createElement(Title$1, null, item.label)));
|
|
731
731
|
})));
|
|
732
732
|
};
|
|
733
733
|
|
|
734
|
-
const
|
|
734
|
+
const MenuWrapper = styled.div `
|
|
735
735
|
position: relative;
|
|
736
736
|
display: inline-block;
|
|
737
737
|
`;
|
|
738
738
|
const StyledMoreMenu = styled(MoreMenu) `
|
|
739
739
|
position: absolute;
|
|
740
|
-
right: ${props => (props.$position === 'right' ? '0px' : 'auto')};
|
|
741
|
-
left: ${props => (props.$position === 'left' ? '0px' : 'auto')};
|
|
742
|
-
top: ${props => (props.$small ? '30px' : '40px')};
|
|
743
740
|
width: ${props => props.$menuWidth};
|
|
741
|
+
max-height: ${props => props.maxHeight};
|
|
744
742
|
z-index: 10;
|
|
743
|
+
|
|
744
|
+
${props => {
|
|
745
|
+
switch (props.$position) {
|
|
746
|
+
case 'top':
|
|
747
|
+
return `
|
|
748
|
+
bottom: 100%;
|
|
749
|
+
left: 0;
|
|
750
|
+
transform: translateY(-5px); /* Adjust this value as needed */
|
|
751
|
+
`;
|
|
752
|
+
case 'bottom':
|
|
753
|
+
return `
|
|
754
|
+
top: 100%;
|
|
755
|
+
left: 0;
|
|
756
|
+
transform: translateY(5px); /* Adjust this value as needed */
|
|
757
|
+
`;
|
|
758
|
+
case 'left':
|
|
759
|
+
return `
|
|
760
|
+
right: 100%;
|
|
761
|
+
top: 0;
|
|
762
|
+
transform: translateX(-5px); /* Adjust this value as needed */
|
|
763
|
+
`;
|
|
764
|
+
case 'right':
|
|
765
|
+
return `
|
|
766
|
+
left: 100%;
|
|
767
|
+
top: 0;
|
|
768
|
+
transform: translateX(5px); /* Adjust this value as needed */
|
|
769
|
+
`;
|
|
770
|
+
default:
|
|
771
|
+
return `
|
|
772
|
+
top: 0;
|
|
773
|
+
left: 0;
|
|
774
|
+
`;
|
|
775
|
+
}
|
|
776
|
+
}}
|
|
745
777
|
`;
|
|
746
|
-
const ButtonMenu = ({ disabled, label, maxHeight, menuItems, small, position = 'right', format = 'primary', menuWidth = '200px', }) => {
|
|
747
|
-
const [
|
|
748
|
-
|
|
778
|
+
const ButtonMenu = ({ disabled, label, maxHeight, menuItems, small, position = 'right', format = 'primary', menuWidth = '200px', enableHover = true, enableClick = false, }) => {
|
|
779
|
+
const [showMenu, toggleMenu] = React.useState(false);
|
|
780
|
+
const handleMouseEnter = () => {
|
|
781
|
+
if (!disabled && enableHover) {
|
|
782
|
+
toggleMenu(true);
|
|
783
|
+
}
|
|
784
|
+
};
|
|
785
|
+
const handleMouseLeave = () => {
|
|
786
|
+
if (!disabled && enableHover) {
|
|
787
|
+
toggleMenu(false);
|
|
788
|
+
}
|
|
789
|
+
};
|
|
790
|
+
const handleClick = () => {
|
|
791
|
+
if (enableClick) {
|
|
792
|
+
toggleMenu(!showMenu);
|
|
793
|
+
}
|
|
794
|
+
};
|
|
795
|
+
return (React.createElement(MenuWrapper, { onClick: handleClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
|
|
749
796
|
React.createElement(Button, { disabled: disabled, format: format, icon: js.mdiDotsHorizontal, small: small }, label),
|
|
750
|
-
|
|
797
|
+
showMenu && (React.createElement(StyledMoreMenu, { "$menuWidth": menuWidth, "$position": position, "$small": small, maxHeight: maxHeight, menuItems: menuItems }))));
|
|
751
798
|
};
|
|
752
799
|
|
|
753
800
|
const Wrapper$c = styled.div `
|
|
@@ -846,6 +893,7 @@ const Input$2 = styled.input `
|
|
|
846
893
|
const Check$1 = styled.span `
|
|
847
894
|
height: 17px;
|
|
848
895
|
width: 17px;
|
|
896
|
+
min-width: 17px;
|
|
849
897
|
background-color: #fff;
|
|
850
898
|
border-width: 2px;
|
|
851
899
|
border-style: solid;
|
|
@@ -873,7 +921,7 @@ const Label$3 = styled.span `
|
|
|
873
921
|
font-size: ${FontSizes.DEFAULT};
|
|
874
922
|
font-weight: 400;
|
|
875
923
|
line-height: 1.6em;
|
|
876
|
-
color: ${props => props.color || Colors.BLACK.Hex}
|
|
924
|
+
color: ${props => props.color || Colors.BLACK.Hex};
|
|
877
925
|
margin-left: 6px;
|
|
878
926
|
box-sizing: border-box;
|
|
879
927
|
`;
|
|
@@ -1203,13 +1251,13 @@ const Drawer = (_a) => {
|
|
|
1203
1251
|
React.createElement(Button, { format: 'secondary', icon: js.mdiClose, small: true }))),
|
|
1204
1252
|
React.createElement(ContentWrapper$1, null, children),
|
|
1205
1253
|
primaryButton || secondaryButton || tertiaryButton ? (React.createElement(ButtonBar$1, null,
|
|
1206
|
-
tertiaryButton ? React.createElement(Button, Object.assign({}, tertiaryButton, { format: tertiaryButton.format || 'secondary' })) : null,
|
|
1207
|
-
secondaryButton ? React.createElement(Button, Object.assign({}, secondaryButton, { format: secondaryButton.format || 'secondary' })) : null,
|
|
1208
|
-
primaryButton ? React.createElement(Button, Object.assign({}, primaryButton, { format: primaryButton.format || 'primary' })) : null)) : null),
|
|
1254
|
+
tertiaryButton ? (React.createElement(Button, Object.assign({}, tertiaryButton, { format: tertiaryButton.format || 'secondary' }))) : null,
|
|
1255
|
+
secondaryButton ? (React.createElement(Button, Object.assign({}, secondaryButton, { format: secondaryButton.format || 'secondary' }))) : null,
|
|
1256
|
+
primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { format: primaryButton.format || 'primary' }))) : null)) : null),
|
|
1209
1257
|
scrim ? React.createElement(Scrim$1, { "$position": position, "$scrim": scrim, onClick: onClose }) : null));
|
|
1210
1258
|
};
|
|
1211
1259
|
|
|
1212
|
-
const Wrapper$9 = styled.div(props => (Object.assign({ margin: '0px 0px 18px 0px' },
|
|
1260
|
+
const Wrapper$9 = styled.div(props => (Object.assign({ margin: '0px 0px 18px 0px' }, props.$customStyle)));
|
|
1213
1261
|
const LabelRow = styled.div `
|
|
1214
1262
|
display: flex;
|
|
1215
1263
|
align-items: center;
|
|
@@ -1352,6 +1400,11 @@ const Files = styled.div `
|
|
|
1352
1400
|
gap: 10px;
|
|
1353
1401
|
margin: 20px;
|
|
1354
1402
|
`;
|
|
1403
|
+
const MessageDiv = styled.div `
|
|
1404
|
+
display: flex;
|
|
1405
|
+
align-items: center;
|
|
1406
|
+
justify-content: center;
|
|
1407
|
+
`;
|
|
1355
1408
|
const File = styled.div `
|
|
1356
1409
|
display: flex;
|
|
1357
1410
|
padding: 10px;
|
|
@@ -1371,7 +1424,7 @@ const Remove = styled(Icon) `
|
|
|
1371
1424
|
fill: ${Colors.RED.Hex} !important;
|
|
1372
1425
|
}
|
|
1373
1426
|
`;
|
|
1374
|
-
const FileUpload = ({ accept, onChange, onError, maxFiles = 10, maxSize = 2, value = [], message, validateFile, }) => {
|
|
1427
|
+
const FileUpload = ({ accept, onChange, onError, maxFiles = 10, maxSize = 2, value = [], message, tooltipInfo = '', validateFile, }) => {
|
|
1375
1428
|
const inputRef = React.useRef(null);
|
|
1376
1429
|
const [files, setFiles] = React.useState(value || []);
|
|
1377
1430
|
const [dragging, setDragging] = React.useState(false);
|
|
@@ -1483,7 +1536,10 @@ const FileUpload = ({ accept, onChange, onError, maxFiles = 10, maxSize = 2, val
|
|
|
1483
1536
|
React.createElement(StyledIcon$3, { path: js.mdiFolderPlusOutline }))),
|
|
1484
1537
|
React.createElement(Content, null,
|
|
1485
1538
|
React.createElement(Copy, { align: 'center', type: 'bold' }, "Drag & drop files here or click to select files"),
|
|
1486
|
-
message ? (React.createElement(
|
|
1539
|
+
message ? (React.createElement(MessageDiv, null,
|
|
1540
|
+
React.createElement(Copy, { align: 'center', color: 'GRAY' }, message),
|
|
1541
|
+
tooltipInfo && (React.createElement("span", null,
|
|
1542
|
+
React.createElement(Tooltip, { children: tooltipInfo, position: 'left-center' }))))) : null))) : null)));
|
|
1487
1543
|
};
|
|
1488
1544
|
|
|
1489
1545
|
const getAgesFromDob = (dob) => {
|
|
@@ -1904,7 +1960,7 @@ const StepLine = styled.div `
|
|
|
1904
1960
|
const ProgressBar = ({ steps, showStepLine = false }) => {
|
|
1905
1961
|
return (React.createElement(Steps, null, steps.map((step, i) => {
|
|
1906
1962
|
return (React.createElement(React.Fragment, null,
|
|
1907
|
-
i !== 0 && showStepLine &&
|
|
1963
|
+
i !== 0 && showStepLine && React.createElement(StepLine, { "$active": step.active }),
|
|
1908
1964
|
React.createElement(Step, { key: i },
|
|
1909
1965
|
step.complete ? (React.createElement(StyledIcon$2, { path: js.mdiCheckboxMarkedCircleOutline, size: '32px' })) : (React.createElement(StepIndicator, { "$active": step.active }, i + 1)),
|
|
1910
1966
|
React.createElement(StepLabel, null, step.label))));
|