@hexure/ui 1.13.58 → 1.13.59

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.
@@ -1,5 +1,6 @@
1
1
  import { FC, ReactNode } from 'react';
2
2
  import { AccessibleProps } from '../../utils/Accessibility';
3
+ import { TooltipProps } from '../Tooltip/Tooltip';
3
4
  export interface ButtonProps extends AccessibleProps {
4
5
  disabled?: boolean;
5
6
  children: string;
@@ -8,6 +9,10 @@ export interface ButtonProps extends AccessibleProps {
8
9
  onClick: (e?: any) => void;
9
10
  tabIndex?: number;
10
11
  loading?: boolean;
12
+ /** Tooltip Props */
13
+ toolTip?: TooltipProps;
14
+ /** Set the title of the button on hover */
15
+ title?: string;
11
16
  }
12
17
  export interface DrawerProps extends AccessibleProps {
13
18
  primaryButton?: ButtonProps;
@@ -29,6 +34,7 @@ export interface DrawerProps extends AccessibleProps {
29
34
  onClose: (e?: any) => void;
30
35
  /** Optional ID for automation purposes */
31
36
  dataItemid?: string;
37
+ bottomNotes?: string | ReactNode;
32
38
  }
33
39
  declare const Drawer: FC<DrawerProps>;
34
40
  export default Drawer;
@@ -10,6 +10,8 @@ export interface TooltipProps {
10
10
  trigger?: any;
11
11
  /** Optional ID for automation purposes */
12
12
  dataItemid?: string;
13
+ /** Override the default icon / wrapper height of 16px */
14
+ height?: string;
13
15
  }
14
16
  declare const Tooltip: FC<TooltipProps>;
15
17
  export default Tooltip;
package/dist/esm/index.js CHANGED
@@ -137,11 +137,11 @@ Copy.defaultProps = {
137
137
  type: 'default',
138
138
  };
139
139
 
140
- const Wrapper$h = styled.div `
141
- display: inline-block;
142
- position: relative;
143
- height: 16px;
144
- `;
140
+ const Wrapper$h = styled.div(props => ({
141
+ display: 'inline-block',
142
+ position: 'relative',
143
+ height: props.$height || '16px',
144
+ }));
145
145
  const StyledIcon$6 = styled(Icon) `
146
146
  width: 16px;
147
147
  height: 16px;
@@ -180,10 +180,10 @@ const positions = {
180
180
  };
181
181
  const Content$3 = styled.div(props => (Object.assign({ position: 'absolute', borderRadius: '4px', borderWidth: '1px', borderStyle: 'solid', borderColor: props.theme.PRIMARY_COLOR.Hex, background: '#ffffff', boxShadow: '0px 5px 30px -10px rgba(0, 0, 0, 0.5)', width: props.$width || '240px', padding: '10px 12px', zIndex: 9999 }, positions[props.$position])));
182
182
  Content$3.defaultProps = { theme: EditableTheme };
183
- const Tooltip = ({ children, position = 'right-top', width = '240px', trigger, dataItemid, }) => {
183
+ const Tooltip = ({ children, position = 'right-top', width = '240px', trigger, dataItemid, height, }) => {
184
184
  const [show_content, toggleContent] = useState(false);
185
185
  const baseId = dataItemid || 'tooltip';
186
- return (React.createElement(Wrapper$h, { "data-itemid": `${baseId}-wrapper`, onMouseEnter: toggleContent.bind(null, true), onMouseLeave: toggleContent.bind(null, false) },
186
+ return (React.createElement(Wrapper$h, { "$height": height, "data-itemid": `${baseId}-wrapper`, onMouseEnter: toggleContent.bind(null, true), onMouseLeave: toggleContent.bind(null, false) },
187
187
  trigger || React.createElement(StyledIcon$6, { "data-itemid": `${baseId}-icon`, path: mdiInformationOutline }),
188
188
  show_content ? (React.createElement(Content$3, { "$position": position, "$width": width, "data-itemid": `${baseId}-content` }, children && (React.createElement(Copy, { "data-itemid": `${baseId}-copy`, type: 'small' }, children)))) : null));
189
189
  };
@@ -1047,7 +1047,7 @@ const Wrapper$a = styled.div `
1047
1047
  border-width: 1px;
1048
1048
  border-style: solid;
1049
1049
  border-color: ${props => (props.$invalid ? Colors.RED.Hex : '#cccccc')};
1050
- background-color: ${props => (props.$invalid && props.$isInvalidRedBackground ? '#ffe5e5' : '#ffffff')};
1050
+ background-color: ${props => props.$invalid && props.$isInvalidRedBackground ? '#ffe5e5' : '#ffffff'};
1051
1051
  border-radius: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.borderRadius) || '4px'};
1052
1052
  flex-grow: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.flexGrow) || 0};
1053
1053
  box-sizing: border-box;
@@ -1291,9 +1291,14 @@ const ButtonBar$1 = styled.div `
1291
1291
  gap: 10px;
1292
1292
  flex-shrink: 0;
1293
1293
  background: #fff;
1294
+ flex-direction: column;
1295
+ `;
1296
+ const ButtonBarNote = styled.div `
1297
+ display: flex;
1298
+ gap: 10px;
1294
1299
  `;
1295
1300
  const Drawer = (_a) => {
1296
- var { children, description, title, onClose, primaryButton, position = 'fixed', secondaryButton, tertiaryButton, scrim = 'dark', width, dataItemid } = _a, accessibleProps = __rest(_a, ["children", "description", "title", "onClose", "primaryButton", "position", "secondaryButton", "tertiaryButton", "scrim", "width", "dataItemid"]);
1301
+ var { children, description, title, onClose, primaryButton, position = 'fixed', secondaryButton, tertiaryButton, scrim = 'dark', width, dataItemid, bottomNotes } = _a, accessibleProps = __rest(_a, ["children", "description", "title", "onClose", "primaryButton", "position", "secondaryButton", "tertiaryButton", "scrim", "width", "dataItemid", "bottomNotes"]);
1297
1302
  useEffect(() => {
1298
1303
  document.onkeydown = e => {
1299
1304
  if (e.key === 'Escape') {
@@ -1315,9 +1320,11 @@ const Drawer = (_a) => {
1315
1320
  React.createElement(Button, { dataItemid: `${baseId}-close-button`, format: 'secondary', icon: mdiClose, small: true }))),
1316
1321
  React.createElement(ContentWrapper$1, { "data-itemid": `${baseId}-content-wrapper` }, children),
1317
1322
  primaryButton || secondaryButton || tertiaryButton ? (React.createElement(ButtonBar$1, { "data-itemid": `${baseId}-button-bar` },
1318
- tertiaryButton ? (React.createElement(Button, Object.assign({}, tertiaryButton, { "data-itemid": `${baseId}-tertiary-button`, format: tertiaryButton.format || 'secondary' }))) : null,
1319
- secondaryButton ? (React.createElement(Button, Object.assign({}, secondaryButton, { "data-itemid": `${baseId}-secondary-button`, format: secondaryButton.format || 'secondary' }))) : null,
1320
- primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { "data-itemid": `${baseId}-primary-button`, format: primaryButton.format || 'primary' }))) : null)) : null),
1323
+ React.createElement(Copy, { "data-itemid": `${baseId}-button-bar-notes`, type: 'small' }, bottomNotes),
1324
+ React.createElement(ButtonBarNote, null,
1325
+ tertiaryButton ? (React.createElement(Button, Object.assign({}, tertiaryButton, { "data-itemid": `${baseId}-tertiary-button`, format: tertiaryButton.format || 'secondary' }))) : null,
1326
+ secondaryButton ? (React.createElement(Button, Object.assign({}, secondaryButton, { "data-itemid": `${baseId}-secondary-button`, format: secondaryButton.format || 'secondary' }))) : null,
1327
+ primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { "data-itemid": `${baseId}-primary-button`, format: primaryButton.format || 'primary' }))) : null))) : null),
1321
1328
  scrim ? (React.createElement(Scrim$1, { "$position": position, "$scrim": scrim, "data-itemid": `${baseId}-scrim`, onClick: onClose })) : null));
1322
1329
  };
1323
1330