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