@hexure/ui 1.13.38 → 1.13.40
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 +286 -302
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/Accordion/Accordion.d.ts +1 -0
- package/dist/cjs/types/components/ActionDialog/ActionDialog.d.ts +2 -0
- package/dist/cjs/types/components/Alert/Alert.d.ts +2 -0
- package/dist/cjs/types/components/AppHeader/AppHeader.d.ts +2 -0
- package/dist/cjs/types/components/AppMenu/AppMenu.d.ts +2 -0
- package/dist/cjs/types/components/BulkActionBar/BulkActionBar.d.ts +2 -0
- package/dist/cjs/types/components/Button/Button.d.ts +2 -0
- package/dist/cjs/types/components/ButtonMenu/ButtonMenu.d.ts +2 -0
- package/dist/cjs/types/components/Checkbox/Checkbox.d.ts +2 -0
- package/dist/cjs/types/components/Checklist/Checklist.d.ts +2 -0
- package/dist/cjs/types/components/Copy/Copy.d.ts +3 -1
- package/dist/cjs/types/components/DatePicker/DatePicker.d.ts +2 -0
- package/dist/cjs/types/components/Drawer/Drawer.d.ts +2 -0
- package/dist/cjs/types/components/Field/Field.d.ts +2 -0
- package/dist/cjs/types/components/FieldGroup/FieldGroup.d.ts +2 -0
- package/dist/cjs/types/components/FileUpload/FileUpload.d.ts +2 -0
- package/dist/cjs/types/components/Heading/Heading.d.ts +2 -0
- package/dist/cjs/types/components/Input/Input.d.ts +2 -0
- package/dist/cjs/types/components/Link/Link.d.ts +2 -0
- package/dist/cjs/types/components/Loader/Loader.d.ts +5 -1
- package/dist/cjs/types/components/Logo/Logo.d.ts +2 -0
- package/dist/cjs/types/components/Modal/Modal.d.ts +2 -0
- package/dist/cjs/types/components/MoreMenu/MoreMenu.d.ts +2 -0
- package/dist/cjs/types/components/Multiselect/MultiSelect.d.ts +2 -0
- package/dist/cjs/types/components/PageHeader/PageHeader.d.ts +2 -0
- package/dist/cjs/types/components/Pagination/Pagination.d.ts +2 -0
- package/dist/cjs/types/components/ProgressBar/ProgressBar.d.ts +4 -2
- package/dist/cjs/types/components/Radio/Radio.d.ts +2 -0
- package/dist/cjs/types/components/RadioList/RadioList.d.ts +2 -0
- package/dist/cjs/types/components/Select/Select.d.ts +2 -0
- package/dist/cjs/types/components/Table/Table.d.ts +2 -0
- package/dist/cjs/types/components/Tabs/Tabs.d.ts +2 -0
- package/dist/cjs/types/components/Tag/Tag.d.ts +2 -0
- package/dist/cjs/types/components/Toast/Toast.d.ts +2 -0
- package/dist/cjs/types/components/Toggle/Toggle.d.ts +2 -0
- package/dist/cjs/types/components/Tooltip/Tooltip.d.ts +2 -0
- package/dist/cjs/types/components/ZeroState/ZeroState.d.ts +2 -0
- package/dist/esm/index.js +286 -302
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Accordion/Accordion.d.ts +1 -0
- package/dist/esm/types/components/ActionDialog/ActionDialog.d.ts +2 -0
- package/dist/esm/types/components/Alert/Alert.d.ts +2 -0
- package/dist/esm/types/components/AppHeader/AppHeader.d.ts +2 -0
- package/dist/esm/types/components/AppMenu/AppMenu.d.ts +2 -0
- package/dist/esm/types/components/BulkActionBar/BulkActionBar.d.ts +2 -0
- package/dist/esm/types/components/Button/Button.d.ts +2 -0
- package/dist/esm/types/components/ButtonMenu/ButtonMenu.d.ts +2 -0
- package/dist/esm/types/components/Checkbox/Checkbox.d.ts +2 -0
- package/dist/esm/types/components/Checklist/Checklist.d.ts +2 -0
- package/dist/esm/types/components/Copy/Copy.d.ts +3 -1
- package/dist/esm/types/components/DatePicker/DatePicker.d.ts +2 -0
- package/dist/esm/types/components/Drawer/Drawer.d.ts +2 -0
- package/dist/esm/types/components/Field/Field.d.ts +2 -0
- package/dist/esm/types/components/FieldGroup/FieldGroup.d.ts +2 -0
- package/dist/esm/types/components/FileUpload/FileUpload.d.ts +2 -0
- package/dist/esm/types/components/Heading/Heading.d.ts +2 -0
- package/dist/esm/types/components/Input/Input.d.ts +2 -0
- package/dist/esm/types/components/Link/Link.d.ts +2 -0
- package/dist/esm/types/components/Loader/Loader.d.ts +5 -1
- package/dist/esm/types/components/Logo/Logo.d.ts +2 -0
- package/dist/esm/types/components/Modal/Modal.d.ts +2 -0
- package/dist/esm/types/components/MoreMenu/MoreMenu.d.ts +2 -0
- package/dist/esm/types/components/Multiselect/MultiSelect.d.ts +2 -0
- package/dist/esm/types/components/PageHeader/PageHeader.d.ts +2 -0
- package/dist/esm/types/components/Pagination/Pagination.d.ts +2 -0
- package/dist/esm/types/components/ProgressBar/ProgressBar.d.ts +4 -2
- package/dist/esm/types/components/Radio/Radio.d.ts +2 -0
- package/dist/esm/types/components/RadioList/RadioList.d.ts +2 -0
- package/dist/esm/types/components/Select/Select.d.ts +2 -0
- package/dist/esm/types/components/Table/Table.d.ts +2 -0
- package/dist/esm/types/components/Tabs/Tabs.d.ts +2 -0
- package/dist/esm/types/components/Tag/Tag.d.ts +2 -0
- package/dist/esm/types/components/Toast/Toast.d.ts +2 -0
- package/dist/esm/types/components/Toggle/Toggle.d.ts +2 -0
- package/dist/esm/types/components/Tooltip/Tooltip.d.ts +2 -0
- package/dist/esm/types/components/ZeroState/ZeroState.d.ts +2 -0
- package/dist/index.d.ts +76 -3
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -87,24 +87,6 @@ const EditableTheme = {
|
|
|
87
87
|
PRIMARY_COLOR: Colors.PRIMARY,
|
|
88
88
|
};
|
|
89
89
|
|
|
90
|
-
const generateUniqueId = (() => {
|
|
91
|
-
return (prefix = 'id') => {
|
|
92
|
-
const counterKey = `${prefix}-counter`;
|
|
93
|
-
const idKey = `${prefix}-id`;
|
|
94
|
-
const existingId = localStorage.getItem(idKey);
|
|
95
|
-
if (existingId) {
|
|
96
|
-
return existingId;
|
|
97
|
-
}
|
|
98
|
-
let counter = parseInt(localStorage.getItem(counterKey) || '0', 10);
|
|
99
|
-
counter += 1;
|
|
100
|
-
localStorage.setItem(counterKey, counter.toString());
|
|
101
|
-
const counterString = counter.toString().padStart(4, '0');
|
|
102
|
-
const uniqueId = `${prefix}-${counterString}`;
|
|
103
|
-
localStorage.setItem(idKey, uniqueId);
|
|
104
|
-
return uniqueId;
|
|
105
|
-
};
|
|
106
|
-
})();
|
|
107
|
-
|
|
108
90
|
const Header$3 = styled.div `
|
|
109
91
|
display: flex;
|
|
110
92
|
align-items: center;
|
|
@@ -125,13 +107,13 @@ const Title$2 = styled.div `
|
|
|
125
107
|
box-sizing: border-box;
|
|
126
108
|
`;
|
|
127
109
|
const Accordion = (_a) => {
|
|
128
|
-
var { title, children, open, onClick } = _a, accessibleProps = __rest(_a, ["title", "children", "open", "onClick"]);
|
|
129
|
-
const
|
|
110
|
+
var { id, title, children, open, onClick } = _a, accessibleProps = __rest(_a, ["id", "title", "children", "open", "onClick"]);
|
|
111
|
+
const baseId = id || 'accordion';
|
|
130
112
|
return (React.createElement(React.Fragment, null,
|
|
131
|
-
React.createElement(Header$3, Object.assign({ id: `${
|
|
132
|
-
React.createElement(Title$2, { id: `${
|
|
133
|
-
React.createElement(Icon, { color: Colors.BLACK.Hex, id: `${
|
|
134
|
-
open ? React.createElement("div", { id: `${
|
|
113
|
+
React.createElement(Header$3, Object.assign({ id: `${baseId}-header`, onClick: onClick }, accessibleProps),
|
|
114
|
+
React.createElement(Title$2, { id: `${baseId}-title` }, title),
|
|
115
|
+
React.createElement(Icon, { color: Colors.BLACK.Hex, id: `${baseId}-icon`, path: open ? js.mdiChevronUp : js.mdiChevronDown, size: '24px' })),
|
|
116
|
+
open ? React.createElement("div", { id: `${baseId}-content` }, children) : null));
|
|
135
117
|
};
|
|
136
118
|
|
|
137
119
|
const StyledComponent = styled.p `
|
|
@@ -149,9 +131,9 @@ const StyledComponent = styled.p `
|
|
|
149
131
|
box-sizing: border-box;
|
|
150
132
|
`;
|
|
151
133
|
const Copy = (_a) => {
|
|
152
|
-
var { children, align = '', margin = '', padding = '', type = 'default', color = 'BLACK' } = _a, accessibleProps = __rest(_a, ["children", "align", "margin", "padding", "type", "color"]);
|
|
153
|
-
const
|
|
154
|
-
return (React.createElement(StyledComponent, Object.assign({ "$align": align, "$color": color, "$margin": margin, "$padding": padding, "$type": type, id: `${
|
|
134
|
+
var { children, align = '', margin = '', padding = '', type = 'default', color = 'BLACK', id } = _a, accessibleProps = __rest(_a, ["children", "align", "margin", "padding", "type", "color", "id"]);
|
|
135
|
+
const baseId = id || 'copy';
|
|
136
|
+
return (React.createElement(StyledComponent, Object.assign({ "$align": align, "$color": color, "$margin": margin, "$padding": padding, "$type": type, id: `${baseId}-styled-component` }, accessibleProps), children));
|
|
155
137
|
};
|
|
156
138
|
Copy.defaultProps = {
|
|
157
139
|
type: 'default',
|
|
@@ -200,12 +182,12 @@ const positions = {
|
|
|
200
182
|
};
|
|
201
183
|
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])));
|
|
202
184
|
Content$3.defaultProps = { theme: EditableTheme };
|
|
203
|
-
const Tooltip = ({ children, position = 'right-top', width = '240px', trigger, }) => {
|
|
185
|
+
const Tooltip = ({ children, position = 'right-top', width = '240px', trigger, id, }) => {
|
|
204
186
|
const [show_content, toggleContent] = React.useState(false);
|
|
205
|
-
const
|
|
206
|
-
return (React.createElement(Wrapper$h, { id: `${
|
|
207
|
-
trigger || React.createElement(StyledIcon$6, { id: `${
|
|
208
|
-
show_content ? (React.createElement(Content$3, { "$position": position, "$width": width, id: `${
|
|
187
|
+
const baseId = id || 'tooltip';
|
|
188
|
+
return (React.createElement(Wrapper$h, { id: `${baseId}-wrapper`, onMouseEnter: toggleContent.bind(null, true), onMouseLeave: toggleContent.bind(null, false) },
|
|
189
|
+
trigger || React.createElement(StyledIcon$6, { id: `${baseId}-icon`, path: js.mdiInformationOutline }),
|
|
190
|
+
show_content ? (React.createElement(Content$3, { "$position": position, "$width": width, id: `${baseId}-content` }, children && (React.createElement(Copy, { id: `${baseId}-copy`, type: 'small' }, children)))) : null));
|
|
209
191
|
};
|
|
210
192
|
|
|
211
193
|
const StyledButton = styled.button `
|
|
@@ -285,7 +267,7 @@ const Badge$1 = styled.span `
|
|
|
285
267
|
margin-right: ${props => (props.$small ? '-5px' : '-10px')};
|
|
286
268
|
`;
|
|
287
269
|
const Button = (_a) => {
|
|
288
|
-
var { badge, children, disabled = false, icon, isForm = false, loading = false, margin = '', onClick, small = false, format = 'primary', iconPosition = 'after', toolTip, title = '' } = _a, accessibleProps = __rest(_a, ["badge", "children", "disabled", "icon", "isForm", "loading", "margin", "onClick", "small", "format", "iconPosition", "toolTip", "title"]);
|
|
270
|
+
var { badge, children, disabled = false, icon, isForm = false, loading = false, margin = '', onClick, small = false, format = 'primary', iconPosition = 'after', toolTip, title = '', id } = _a, accessibleProps = __rest(_a, ["badge", "children", "disabled", "icon", "isForm", "loading", "margin", "onClick", "small", "format", "iconPosition", "toolTip", "title", "id"]);
|
|
289
271
|
const theme = React.useContext(styled.ThemeContext) || EditableTheme;
|
|
290
272
|
const has_children = children && children.length > 0;
|
|
291
273
|
const button_type_mapping = {
|
|
@@ -319,12 +301,12 @@ const Button = (_a) => {
|
|
|
319
301
|
},
|
|
320
302
|
};
|
|
321
303
|
const format_styles = button_type_mapping[format];
|
|
322
|
-
const
|
|
323
|
-
const button_view = (React.createElement(StyledButton, Object.assign({ "$bg_color": format_styles.background_color, "$border_color": format_styles.border_color, "$disabled": disabled || loading, "$hasChildren": !!has_children, "$iconPosition": iconPosition, "$margin": margin, "$small": small, disabled: disabled || loading, onClick: disabled || loading ? undefined : onClick, title: title, type: isForm ? 'submit' : undefined }, accessibleProps, { id: `${
|
|
324
|
-
children ? (React.createElement(Label$5, { "$content_color": format_styles.content_color, "$small": small, id: `${
|
|
325
|
-
icon && !badge ? (React.createElement(StyledIcon$5, { "$hasChildren": !!has_children, id: `${
|
|
326
|
-
React.createElement(Icon, { color: format ? format_styles === null || format_styles === void 0 ? void 0 : format_styles.content_color : '#fff', id: `${
|
|
327
|
-
badge && !icon ? (React.createElement(Badge$1, { "$bg_color": format_styles.badge_bg_color, "$content_color": format_styles.badge_content_color, "$small": small, id: `${
|
|
304
|
+
const baseId = id || 'button';
|
|
305
|
+
const button_view = (React.createElement(StyledButton, Object.assign({ "$bg_color": format_styles.background_color, "$border_color": format_styles.border_color, "$disabled": disabled || loading, "$hasChildren": !!has_children, "$iconPosition": iconPosition, "$margin": margin, "$small": small, disabled: disabled || loading, onClick: disabled || loading ? undefined : onClick, title: title, type: isForm ? 'submit' : undefined }, accessibleProps, { id: `${baseId}-styled-button` }),
|
|
306
|
+
children ? (React.createElement(Label$5, { "$content_color": format_styles.content_color, "$small": small, id: `${baseId}-label` }, children)) : null,
|
|
307
|
+
icon && !badge ? (React.createElement(StyledIcon$5, { "$hasChildren": !!has_children, id: `${baseId}-icon` },
|
|
308
|
+
React.createElement(Icon, { color: format ? format_styles === null || format_styles === void 0 ? void 0 : format_styles.content_color : '#fff', id: `${baseId}-icon-svg`, path: loading ? js.mdiLoading : icon, size: small ? '20px' : '24px', spin: loading }))) : null,
|
|
309
|
+
badge && !icon ? (React.createElement(Badge$1, { "$bg_color": format_styles.badge_bg_color, "$content_color": format_styles.badge_content_color, "$small": small, id: `${baseId}-badge` }, badge)) : null));
|
|
328
310
|
if (toolTip && Object.keys(toolTip).length) {
|
|
329
311
|
return (React.createElement(Tooltip, Object.assign({}, toolTip, { trigger: (toolTip === null || toolTip === void 0 ? void 0 : toolTip.trigger) || button_view }), toolTip === null || toolTip === void 0 ? void 0 : toolTip.children));
|
|
330
312
|
}
|
|
@@ -362,17 +344,17 @@ const H3 = styled.h3 `
|
|
|
362
344
|
box-sizing: border-box;
|
|
363
345
|
`;
|
|
364
346
|
const Heading = (_a) => {
|
|
365
|
-
var { bold, children, margin, padding, type } = _a, accessibleProps = __rest(_a, ["bold", "children", "margin", "padding", "type"]);
|
|
366
|
-
const
|
|
347
|
+
var { bold, children, margin, padding, type, id } = _a, accessibleProps = __rest(_a, ["bold", "children", "margin", "padding", "type", "id"]);
|
|
348
|
+
const baseId = id || 'heading';
|
|
367
349
|
switch (type) {
|
|
368
350
|
case 'secondary': {
|
|
369
|
-
return (React.createElement(H2, Object.assign({ "$bold": bold, "$margin": margin, "$padding": padding }, accessibleProps, { id: `${
|
|
351
|
+
return (React.createElement(H2, Object.assign({ "$bold": bold, "$margin": margin, "$padding": padding }, accessibleProps, { id: `${baseId}-h2` }), children));
|
|
370
352
|
}
|
|
371
353
|
case 'tertiary': {
|
|
372
|
-
return (React.createElement(H3, Object.assign({ "$bold": bold, "$margin": margin, "$padding": padding }, accessibleProps, { id: `${
|
|
354
|
+
return (React.createElement(H3, Object.assign({ "$bold": bold, "$margin": margin, "$padding": padding }, accessibleProps, { id: `${baseId}-h3` }), children));
|
|
373
355
|
}
|
|
374
356
|
default: {
|
|
375
|
-
return (React.createElement(H1, Object.assign({ "$bold": bold, "$margin": margin, "$padding": padding }, accessibleProps, { id: `${
|
|
357
|
+
return (React.createElement(H1, Object.assign({ "$bold": bold, "$margin": margin, "$padding": padding }, accessibleProps, { id: `${baseId}-h1` }), children));
|
|
376
358
|
}
|
|
377
359
|
}
|
|
378
360
|
};
|
|
@@ -404,16 +386,16 @@ const Buttons$1 = styled.div `
|
|
|
404
386
|
box-sizing: border-box;
|
|
405
387
|
`;
|
|
406
388
|
const ActionDialog = (_a) => {
|
|
407
|
-
var { description, title, primaryButton, secondaryButton, tertiaryButton, style = {} } = _a, accessibleProps = __rest(_a, ["description", "title", "primaryButton", "secondaryButton", "tertiaryButton", "style"]);
|
|
408
|
-
const
|
|
409
|
-
return (React.createElement(Wrapper$g, Object.assign({}, accessibleProps, { id: `${
|
|
410
|
-
React.createElement(Container$4, { "$customStyle": style, id: `${
|
|
411
|
-
title ? (React.createElement(Heading, { id: `${
|
|
412
|
-
description ? (React.createElement(Copy, { align: 'center', id: `${
|
|
413
|
-
primaryButton || secondaryButton || tertiaryButton ? (React.createElement(Buttons$1, { id: `${
|
|
414
|
-
tertiaryButton ? (React.createElement(Button, Object.assign({}, tertiaryButton, { format: tertiaryButton.format || 'secondary', id: `${
|
|
415
|
-
secondaryButton ? (React.createElement(Button, Object.assign({}, secondaryButton, { format: secondaryButton.format || 'secondary', id: `${
|
|
416
|
-
primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { format: primaryButton.format || 'primary', id: `${
|
|
389
|
+
var { description, title, primaryButton, secondaryButton, tertiaryButton, style = {}, id } = _a, accessibleProps = __rest(_a, ["description", "title", "primaryButton", "secondaryButton", "tertiaryButton", "style", "id"]);
|
|
390
|
+
const baseId = id || 'action-dialog';
|
|
391
|
+
return (React.createElement(Wrapper$g, Object.assign({}, accessibleProps, { id: `${baseId}-wrapper` }),
|
|
392
|
+
React.createElement(Container$4, { "$customStyle": style, id: `${baseId}-container`, open: true },
|
|
393
|
+
title ? (React.createElement(Heading, { id: `${baseId}-title`, margin: '0px 0px 20px 0px', type: 'secondary' }, title)) : null,
|
|
394
|
+
description ? (React.createElement(Copy, { align: 'center', id: `${baseId}-description` }, description)) : null,
|
|
395
|
+
primaryButton || secondaryButton || tertiaryButton ? (React.createElement(Buttons$1, { id: `${baseId}-buttons` },
|
|
396
|
+
tertiaryButton ? (React.createElement(Button, Object.assign({}, tertiaryButton, { format: tertiaryButton.format || 'secondary', id: `${baseId}-tertiary-button` }))) : null,
|
|
397
|
+
secondaryButton ? (React.createElement(Button, Object.assign({}, secondaryButton, { format: secondaryButton.format || 'secondary', id: `${baseId}-secondary-button` }))) : null,
|
|
398
|
+
primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { format: primaryButton.format || 'primary', id: `${baseId}-primary-button` }))) : null)) : null)));
|
|
417
399
|
};
|
|
418
400
|
|
|
419
401
|
const Wrapper$f = styled.div `
|
|
@@ -440,9 +422,9 @@ const Action$1 = styled.div `
|
|
|
440
422
|
`;
|
|
441
423
|
Action$1.defaultProps = { theme: EditableTheme };
|
|
442
424
|
const Alert = (_a) => {
|
|
443
|
-
var { action, type = 'info', title, description, small = false } = _a, accessibleProps = __rest(_a, ["action", "type", "title", "description", "small"]);
|
|
425
|
+
var { action, type = 'info', title, description, small = false, id } = _a, accessibleProps = __rest(_a, ["action", "type", "title", "description", "small", "id"]);
|
|
444
426
|
const theme = React.useContext(styled.ThemeContext) || EditableTheme;
|
|
445
|
-
const
|
|
427
|
+
const baseId = id || 'alert';
|
|
446
428
|
const type_mapping = {
|
|
447
429
|
info: {
|
|
448
430
|
color: theme.PRIMARY_COLOR.Hex,
|
|
@@ -461,12 +443,12 @@ const Alert = (_a) => {
|
|
|
461
443
|
icon: js.mdiCheckboxMarkedCircleOutline,
|
|
462
444
|
},
|
|
463
445
|
};
|
|
464
|
-
return (React.createElement(Wrapper$f, Object.assign({}, accessibleProps, { "$small": small, id: `${
|
|
465
|
-
React.createElement(StyledIcon$4, { color: type_mapping[type].color, id: `${
|
|
466
|
-
React.createElement("div", { id: `${
|
|
467
|
-
title && !small ? (React.createElement(Heading, { bold: true, id: `${
|
|
468
|
-
description ? (React.createElement(Copy, { id: `${
|
|
469
|
-
action && !small ? (React.createElement(Action$1, { id: `${
|
|
446
|
+
return (React.createElement(Wrapper$f, Object.assign({}, accessibleProps, { "$small": small, id: `${baseId}-wrapper`, style: { borderLeftColor: type_mapping[type].color } }),
|
|
447
|
+
React.createElement(StyledIcon$4, { color: type_mapping[type].color, id: `${baseId}-icon`, path: type_mapping[type].icon, size: small ? '20px' : '30px' }),
|
|
448
|
+
React.createElement("div", { id: `${baseId}-content` },
|
|
449
|
+
title && !small ? (React.createElement(Heading, { bold: true, id: `${baseId}-title`, margin: '2px 0 0 0', type: 'tertiary' }, title)) : null,
|
|
450
|
+
description ? (React.createElement(Copy, { id: `${baseId}-description`, margin: small ? '' : '6px 0 0 0 !important' }, description)) : null,
|
|
451
|
+
action && !small ? (React.createElement(Action$1, { id: `${baseId}-action`, onClick: action.onClick }, action.label)) : null)));
|
|
470
452
|
};
|
|
471
453
|
|
|
472
454
|
const colorMapping = {
|
|
@@ -492,23 +474,23 @@ const colorMapping = {
|
|
|
492
474
|
},
|
|
493
475
|
};
|
|
494
476
|
const Logo = (_a) => {
|
|
495
|
-
var { type = 'standard_full', height = '50px' } = _a, accessibleProps = __rest(_a, ["type", "height"]);
|
|
477
|
+
var { type = 'standard_full', height = '50px', id } = _a, accessibleProps = __rest(_a, ["type", "height", "id"]);
|
|
496
478
|
const type_parts = type.split('_');
|
|
497
|
-
const
|
|
479
|
+
const baseId = id || 'logo';
|
|
498
480
|
switch (type_parts[0]) {
|
|
499
481
|
case 'mark':
|
|
500
|
-
return (React.createElement("svg", Object.assign({ fill: 'none', height: height, viewBox: '0 0 58 51', width: '100%', xmlns: 'http://www.w3.org/2000/svg' }, accessibleProps, { id: `${
|
|
501
|
-
React.createElement("path", { d: 'M43.9348 -1.14441e-05H13.3724L0 25.2376L7.27148 38.0136L14.1215 50.0487H43.1856L57.3077 25.2376L43.9348 -1.14441e-05ZM38.206 9.49903L46.459 25.0743L37.6507 40.5497H19.6567L15.5417 33.3199L10.8487 25.0743L19.1013 9.49903H38.206Z', fill: type_parts[1], id: `${
|
|
482
|
+
return (React.createElement("svg", Object.assign({ fill: 'none', height: height, viewBox: '0 0 58 51', width: '100%', xmlns: 'http://www.w3.org/2000/svg' }, accessibleProps, { id: `${baseId}-svg` }),
|
|
483
|
+
React.createElement("path", { d: 'M43.9348 -1.14441e-05H13.3724L0 25.2376L7.27148 38.0136L14.1215 50.0487H43.1856L57.3077 25.2376L43.9348 -1.14441e-05ZM38.206 9.49903L46.459 25.0743L37.6507 40.5497H19.6567L15.5417 33.3199L10.8487 25.0743L19.1013 9.49903H38.206Z', fill: type_parts[1], id: `${baseId}-path` })));
|
|
502
484
|
default:
|
|
503
|
-
return (React.createElement("svg", Object.assign({ fill: 'none', height: height, preserveAspectRatio: 'xMidYMid meet', viewBox: '0 0 236 50', width: '100%', xmlns: 'http://www.w3.org/2000/svg' }, accessibleProps, { id: `${
|
|
504
|
-
React.createElement("path", { d: 'M230.794 29.59H219.306L214.279 39.0907L217.012 43.9001L219.587 48.4308H230.512L235.821 39.0907L230.794 29.59V29.59ZM228.641 33.1659L231.743 39.0292L228.432 44.8549H221.668L220.121 42.1332L218.356 39.0292L221.459 33.1659H228.641Z', fill: colorMapping[type_parts[1]].fill_3, id: `${
|
|
505
|
-
React.createElement("path", { d: 'M211.662 42.6033L199.206 42.6319C196.339 42.6319 193.862 41.6095 191.846 39.5923C189.828 37.5755 188.805 35.0985 188.805 32.2321C188.805 29.3656 189.828 26.8886 191.846 24.8718C193.848 22.8332 196.325 21.7975 199.206 21.7975C202.072 21.7975 204.549 22.8199 206.566 24.8374C207.613 25.8847 208.391 27.093 208.944 28.5312L209.253 29.3327H197.87L196.325 32.2579L197.921 35.0969H211.458L215.015 28.6192C214.296 25.5702 212.835 22.9293 210.672 20.7657C207.531 17.6257 203.674 16.0333 199.206 16.0333C194.737 16.0333 190.88 17.6257 187.739 20.7657C184.555 23.9501 183.007 27.7011 183.007 32.2321C183.007 36.7001 184.599 40.5577 187.739 43.6981C190.88 46.8384 194.737 48.4308 199.206 48.4308H210.095L214.745 48.3297L211.662 42.6033', fill: colorMapping[type_parts[1]].fill_1, id: `${
|
|
506
|
-
React.createElement("path", { d: 'M160.945 19.133L158.826 20.8384C155.734 23.9359 154.141 27.8058 154.141 32.2967L154.141 47.7903L156.985 49.407L159.939 47.8778L159.94 32.2967C159.94 29.6632 160.778 27.3706 162.432 25.4846C162.615 25.2739 162.811 25.0666 163.018 24.8639C163.074 24.8155 164.138 24.0061 164.811 23.5592C166.321 22.5576 168.076 21.9876 170.024 21.8632L170.166 21.8621C172.923 21.8621 175.32 22.7325 177.301 24.4494L180.146 23.0088L180.246 19.3426C177.44 17.1664 174.132 16.0633 170.408 16.0633C166.909 16.0633 163.725 17.0962 160.945 19.133', fill: colorMapping[type_parts[1]].fill_1, id: `${
|
|
507
|
-
React.createElement("path", { d: 'M131.392 50C135.884 50 139.753 48.4076 142.893 45.2676C146.033 42.1269 147.626 38.2581 147.626 33.7668V18.1124L144.782 16.4964L141.827 18.0251V33.7668C141.827 36.6932 140.792 39.1936 138.745 41.2034C136.684 43.1927 134.128 44.2013 131.151 44.2013L131.01 44.2002H131.81L131.669 44.2013C128.692 44.2013 126.136 43.1927 124.074 41.2034C122.028 39.1936 120.993 36.6932 120.993 33.7668V18.0251L118.038 16.4964L115.194 18.1124V33.7668C115.194 38.2581 116.786 42.1269 119.926 45.2676C123.067 48.4076 126.936 50 131.427 50H131.392Z', fill: colorMapping[type_parts[1]].fill_1, id: `${
|
|
508
|
-
React.createElement("path", { d: 'M93.8353 26.9933L97.8468 31.2421L100.788 28.1521L107.791 20.4534L106.753 17.3567L103.584 16.5678', fill: colorMapping[type_parts[1]].fill_2, id: `${
|
|
509
|
-
React.createElement("path", { d: 'M80.7509 16.5677L77.5821 17.3564L76.5441 20.4534L83.5514 28.1568L88.1484 32.9862L76.5412 45.2133L77.5187 48.3175C79.525 48.9571 80.359 49.1805 80.6985 49.2584L92.195 37.238L103.636 49.2584C103.976 49.1805 104.81 48.9571 106.817 48.3175L107.794 45.2133L80.7509 16.5677', fill: colorMapping[type_parts[1]].fill_1, id: `${
|
|
510
|
-
React.createElement("path", { d: 'M67.8498 45.479C67.5109 44.893 66.7322 43.5486 66.2043 42.6319H55.1965C52.3299 42.6319 49.8532 41.6095 47.8364 39.5923C45.819 37.5755 44.7966 35.0985 44.7966 32.2321C44.7966 29.3656 45.819 26.8886 47.8364 24.8718C49.8388 22.8332 52.316 21.7975 55.1965 21.7975C58.0632 21.7975 60.5398 22.8199 62.5565 24.8374C63.6038 25.8847 64.3824 27.093 64.9357 28.5312L65.2435 29.3327H53.8141C53.231 30.2171 52.5673 31.6476 52.303 32.2354L53.912 35.0969H67.474L71.0059 28.6192C70.2872 25.5702 68.8261 22.9293 66.6625 20.7657C63.5219 17.6257 59.6649 16.0333 55.1965 16.0333C50.7283 16.0333 46.8708 17.6257 43.7303 20.7657C40.546 23.9501 38.9979 27.7011 38.9979 32.2321C38.9979 36.7001 40.5903 40.5577 43.7303 43.6981C46.8708 46.8384 50.7283 48.4308 55.1965 48.4308H66.0873C66.9322 47.0737 67.5668 45.977 67.8498 45.479', fill: colorMapping[type_parts[1]].fill_1, id: `${
|
|
511
|
-
React.createElement("path", { d: 'M27.6655 20.7443C26.9235 20.002 26.2307 19.4097 25.608 18.9831C22.7338 17.0113 19.5684 16.0117 16.1992 16.0117C13.6229 16.0117 11.1676 16.5943 8.9002 17.7442C8.1016 18.1264 7.38657 18.6118 6.73074 19.0799L5.88805 19.6819C5.85364 19.711 5.81716 19.7449 5.78223 19.7749L5.77618 17.9067C5.78246 17.9022 5.7892 17.8965 5.79554 17.8921L5.72168 1.52402L2.84058 1.54784e-05L0 1.6145V24.9966V30.8918C0.0184614 30.8508 0.0393993 30.8108 0.0580857 30.7698C0.0216133 31.2417 0 31.7206 0 32.2105V47.6757L2.84688 49.2499C4.7412 48.3293 5.4988 47.9164 5.79866 47.7385V32.2105C5.79866 29.3439 6.82128 26.8672 8.83853 24.8504C10.8415 22.8118 13.319 21.7759 16.1992 21.7759C19.0796 21.7759 21.557 22.8118 23.5635 24.8538C25.3441 26.6351 26.3374 28.7976 26.5963 31.4625C26.6263 31.6669 26.6339 40.3058 26.6339 47.6694C27.2825 48.0147 28.6127 48.8167 29.5141 49.3059C29.9448 49.0814 32.0589 47.8425 32.3979 47.6669V32.2105C32.3979 27.6795 30.8499 23.9285 27.6655 20.7443Z', fill: colorMapping[type_parts[1]].fill_1, id: `${
|
|
485
|
+
return (React.createElement("svg", Object.assign({ fill: 'none', height: height, preserveAspectRatio: 'xMidYMid meet', viewBox: '0 0 236 50', width: '100%', xmlns: 'http://www.w3.org/2000/svg' }, accessibleProps, { id: `${baseId}-svg` }),
|
|
486
|
+
React.createElement("path", { d: 'M230.794 29.59H219.306L214.279 39.0907L217.012 43.9001L219.587 48.4308H230.512L235.821 39.0907L230.794 29.59V29.59ZM228.641 33.1659L231.743 39.0292L228.432 44.8549H221.668L220.121 42.1332L218.356 39.0292L221.459 33.1659H228.641Z', fill: colorMapping[type_parts[1]].fill_3, id: `${baseId}-path-1` }),
|
|
487
|
+
React.createElement("path", { d: 'M211.662 42.6033L199.206 42.6319C196.339 42.6319 193.862 41.6095 191.846 39.5923C189.828 37.5755 188.805 35.0985 188.805 32.2321C188.805 29.3656 189.828 26.8886 191.846 24.8718C193.848 22.8332 196.325 21.7975 199.206 21.7975C202.072 21.7975 204.549 22.8199 206.566 24.8374C207.613 25.8847 208.391 27.093 208.944 28.5312L209.253 29.3327H197.87L196.325 32.2579L197.921 35.0969H211.458L215.015 28.6192C214.296 25.5702 212.835 22.9293 210.672 20.7657C207.531 17.6257 203.674 16.0333 199.206 16.0333C194.737 16.0333 190.88 17.6257 187.739 20.7657C184.555 23.9501 183.007 27.7011 183.007 32.2321C183.007 36.7001 184.599 40.5577 187.739 43.6981C190.88 46.8384 194.737 48.4308 199.206 48.4308H210.095L214.745 48.3297L211.662 42.6033', fill: colorMapping[type_parts[1]].fill_1, id: `${baseId}-path-2` }),
|
|
488
|
+
React.createElement("path", { d: 'M160.945 19.133L158.826 20.8384C155.734 23.9359 154.141 27.8058 154.141 32.2967L154.141 47.7903L156.985 49.407L159.939 47.8778L159.94 32.2967C159.94 29.6632 160.778 27.3706 162.432 25.4846C162.615 25.2739 162.811 25.0666 163.018 24.8639C163.074 24.8155 164.138 24.0061 164.811 23.5592C166.321 22.5576 168.076 21.9876 170.024 21.8632L170.166 21.8621C172.923 21.8621 175.32 22.7325 177.301 24.4494L180.146 23.0088L180.246 19.3426C177.44 17.1664 174.132 16.0633 170.408 16.0633C166.909 16.0633 163.725 17.0962 160.945 19.133', fill: colorMapping[type_parts[1]].fill_1, id: `${baseId}-path-3` }),
|
|
489
|
+
React.createElement("path", { d: 'M131.392 50C135.884 50 139.753 48.4076 142.893 45.2676C146.033 42.1269 147.626 38.2581 147.626 33.7668V18.1124L144.782 16.4964L141.827 18.0251V33.7668C141.827 36.6932 140.792 39.1936 138.745 41.2034C136.684 43.1927 134.128 44.2013 131.151 44.2013L131.01 44.2002H131.81L131.669 44.2013C128.692 44.2013 126.136 43.1927 124.074 41.2034C122.028 39.1936 120.993 36.6932 120.993 33.7668V18.0251L118.038 16.4964L115.194 18.1124V33.7668C115.194 38.2581 116.786 42.1269 119.926 45.2676C123.067 48.4076 126.936 50 131.427 50H131.392Z', fill: colorMapping[type_parts[1]].fill_1, id: `${baseId}-path-4` }),
|
|
490
|
+
React.createElement("path", { d: 'M93.8353 26.9933L97.8468 31.2421L100.788 28.1521L107.791 20.4534L106.753 17.3567L103.584 16.5678', fill: colorMapping[type_parts[1]].fill_2, id: `${baseId}-path-5` }),
|
|
491
|
+
React.createElement("path", { d: 'M80.7509 16.5677L77.5821 17.3564L76.5441 20.4534L83.5514 28.1568L88.1484 32.9862L76.5412 45.2133L77.5187 48.3175C79.525 48.9571 80.359 49.1805 80.6985 49.2584L92.195 37.238L103.636 49.2584C103.976 49.1805 104.81 48.9571 106.817 48.3175L107.794 45.2133L80.7509 16.5677', fill: colorMapping[type_parts[1]].fill_1, id: `${baseId}-path-6` }),
|
|
492
|
+
React.createElement("path", { d: 'M67.8498 45.479C67.5109 44.893 66.7322 43.5486 66.2043 42.6319H55.1965C52.3299 42.6319 49.8532 41.6095 47.8364 39.5923C45.819 37.5755 44.7966 35.0985 44.7966 32.2321C44.7966 29.3656 45.819 26.8886 47.8364 24.8718C49.8388 22.8332 52.316 21.7975 55.1965 21.7975C58.0632 21.7975 60.5398 22.8199 62.5565 24.8374C63.6038 25.8847 64.3824 27.093 64.9357 28.5312L65.2435 29.3327H53.8141C53.231 30.2171 52.5673 31.6476 52.303 32.2354L53.912 35.0969H67.474L71.0059 28.6192C70.2872 25.5702 68.8261 22.9293 66.6625 20.7657C63.5219 17.6257 59.6649 16.0333 55.1965 16.0333C50.7283 16.0333 46.8708 17.6257 43.7303 20.7657C40.546 23.9501 38.9979 27.7011 38.9979 32.2321C38.9979 36.7001 40.5903 40.5577 43.7303 43.6981C46.8708 46.8384 50.7283 48.4308 55.1965 48.4308H66.0873C66.9322 47.0737 67.5668 45.977 67.8498 45.479', fill: colorMapping[type_parts[1]].fill_1, id: `${baseId}-path-7` }),
|
|
493
|
+
React.createElement("path", { d: 'M27.6655 20.7443C26.9235 20.002 26.2307 19.4097 25.608 18.9831C22.7338 17.0113 19.5684 16.0117 16.1992 16.0117C13.6229 16.0117 11.1676 16.5943 8.9002 17.7442C8.1016 18.1264 7.38657 18.6118 6.73074 19.0799L5.88805 19.6819C5.85364 19.711 5.81716 19.7449 5.78223 19.7749L5.77618 17.9067C5.78246 17.9022 5.7892 17.8965 5.79554 17.8921L5.72168 1.52402L2.84058 1.54784e-05L0 1.6145V24.9966V30.8918C0.0184614 30.8508 0.0393993 30.8108 0.0580857 30.7698C0.0216133 31.2417 0 31.7206 0 32.2105V47.6757L2.84688 49.2499C4.7412 48.3293 5.4988 47.9164 5.79866 47.7385V32.2105C5.79866 29.3439 6.82128 26.8672 8.83853 24.8504C10.8415 22.8118 13.319 21.7759 16.1992 21.7759C19.0796 21.7759 21.557 22.8118 23.5635 24.8538C25.3441 26.6351 26.3374 28.7976 26.5963 31.4625C26.6263 31.6669 26.6339 40.3058 26.6339 47.6694C27.2825 48.0147 28.6127 48.8167 29.5141 49.3059C29.9448 49.0814 32.0589 47.8425 32.3979 47.6669V32.2105C32.3979 27.6795 30.8499 23.9285 27.6655 20.7443Z', fill: colorMapping[type_parts[1]].fill_1, id: `${baseId}-path-8` })));
|
|
512
494
|
}
|
|
513
495
|
};
|
|
514
496
|
|
|
@@ -535,11 +517,11 @@ const Buttons = styled.div `
|
|
|
535
517
|
column-gap: 10px;
|
|
536
518
|
flex-direction: reverse;
|
|
537
519
|
`;
|
|
538
|
-
const AppHeader = ({ logoUrl, buttons = [] }) => {
|
|
539
|
-
const
|
|
540
|
-
return (React.createElement(Container$3, { id: `${
|
|
541
|
-
React.createElement(LogoWrapper, { id: `${
|
|
542
|
-
React.createElement(Buttons, { id: `${
|
|
520
|
+
const AppHeader = ({ logoUrl, buttons = [], id }) => {
|
|
521
|
+
const baseId = id || 'app-header';
|
|
522
|
+
return (React.createElement(Container$3, { id: `${baseId}-container` },
|
|
523
|
+
React.createElement(LogoWrapper, { id: `${baseId}-logo-wrapper` }, logoUrl ? (React.createElement(Image, { id: `${baseId}-logo`, src: logoUrl })) : (React.createElement(Logo, { height: '30px', id: `${baseId}-default-logo` }))),
|
|
524
|
+
React.createElement(Buttons, { id: `${baseId}-buttons` }, buttons.map((b, i) => (React.createElement(Button, Object.assign({ key: i }, b, { id: `${baseId}-button-${i}` })))))));
|
|
543
525
|
};
|
|
544
526
|
|
|
545
527
|
const Wrapper$e = styled.div `
|
|
@@ -568,13 +550,13 @@ const Remove$1 = styled.div `
|
|
|
568
550
|
align-items: center;
|
|
569
551
|
`;
|
|
570
552
|
const Tag = (_a) => {
|
|
571
|
-
var { children, color = 'PRIMARY', removable, onClick } = _a, accessibleProps = __rest(_a, ["children", "color", "removable", "onClick"]);
|
|
572
|
-
const
|
|
573
|
-
return (React.createElement(Wrapper$e, Object.assign({ "$color": color, "$removable": removable, onClick: onClick }, accessibleProps, { id: `${
|
|
574
|
-
React.createElement(Content$2, { id: `${
|
|
575
|
-
React.createElement(Label$4, { "$color": color, id: `${
|
|
576
|
-
removable ? (React.createElement(Remove$1, { id: `${
|
|
577
|
-
React.createElement(Icon, { color: color === 'SUBTLE_GRAY' ? '#000000' : '#ffffff', id: `${
|
|
553
|
+
var { children, color = 'PRIMARY', removable, onClick, id } = _a, accessibleProps = __rest(_a, ["children", "color", "removable", "onClick", "id"]);
|
|
554
|
+
const baseId = id || 'tag';
|
|
555
|
+
return (React.createElement(Wrapper$e, Object.assign({ "$color": color, "$removable": removable, onClick: onClick }, accessibleProps, { id: `${baseId}-wrapper` }),
|
|
556
|
+
React.createElement(Content$2, { id: `${baseId}-content` },
|
|
557
|
+
React.createElement(Label$4, { "$color": color, id: `${baseId}-label` }, children),
|
|
558
|
+
removable ? (React.createElement(Remove$1, { id: `${baseId}-remove` },
|
|
559
|
+
React.createElement(Icon, { color: color === 'SUBTLE_GRAY' ? '#000000' : '#ffffff', id: `${baseId}-icon`, path: js.mdiClose, size: '15px' }))) : null)));
|
|
578
560
|
};
|
|
579
561
|
|
|
580
562
|
const SidebarContainer = styled.div `
|
|
@@ -664,30 +646,30 @@ const FooterInfo = styled.div `
|
|
|
664
646
|
const SidebarMenuContainer = styled.div `
|
|
665
647
|
flex-grow: 1;
|
|
666
648
|
`;
|
|
667
|
-
const AppMenu = ({ menu, isCollapsed, footerTag, defaultWidth = '280px' }) => {
|
|
649
|
+
const AppMenu = ({ menu, isCollapsed, footerTag, defaultWidth = '280px', id, }) => {
|
|
668
650
|
const theme = React.useContext(styled.ThemeContext) || EditableTheme;
|
|
669
651
|
const [collapsed, toggleCollapse] = React.useState(isCollapsed);
|
|
670
|
-
const
|
|
671
|
-
return (React.createElement(SidebarContainer, { "$isOpen": !collapsed, "$width": defaultWidth, id: `${
|
|
672
|
-
React.createElement(SidebarMenuContainer, { id: `${
|
|
673
|
-
const navItemId =
|
|
652
|
+
const baseId = id || 'app-menu';
|
|
653
|
+
return (React.createElement(SidebarContainer, { "$isOpen": !collapsed, "$width": defaultWidth, id: `${baseId}-sidebar-container` },
|
|
654
|
+
React.createElement(SidebarMenuContainer, { id: `${baseId}-sidebar-menu-container` }, menu.map((nav_item, navIndex) => {
|
|
655
|
+
const navItemId = `${baseId}-nav-item-${navIndex}`;
|
|
674
656
|
return (React.createElement(React.Fragment, { key: navItemId },
|
|
675
657
|
React.createElement(MenuWrapper$1, { "$active": !!nav_item.is_active, "$color": theme.PRIMARY_COLOR, id: `${navItemId}-menu-wrapper`, onClick: nav_item.onClick, title: collapsed ? (nav_item === null || nav_item === void 0 ? void 0 : nav_item.title) || nav_item.label : '' },
|
|
676
658
|
React.createElement(MenuIcon, { "$active": !!nav_item.is_active, id: `${navItemId}-menu-icon`, path: nav_item.icon }),
|
|
677
659
|
collapsed ? null : (React.createElement(MenuLabel, { "$active": nav_item.is_active, "$color": theme.PRIMARY_COLOR, id: `${navItemId}-menu-label` }, nav_item.label))),
|
|
678
660
|
nav_item.is_active && nav_item.menu && !collapsed ? (React.createElement(SubMenu, { id: `${navItemId}-sub-menu` }, nav_item.menu.map((menu_item, menuIndex) => {
|
|
679
|
-
const menuItemId =
|
|
661
|
+
const menuItemId = `${navItemId}-menu-item-${menuIndex}`;
|
|
680
662
|
return (React.createElement(SubMenuItem, { "$active": menu_item.is_active, "$color": theme.PRIMARY_COLOR, id: `${menuItemId}-sub-menu-item`, key: menuItemId, onClick: menu_item.onClick }, menu_item.label));
|
|
681
663
|
}))) : null));
|
|
682
664
|
})),
|
|
683
|
-
React.createElement(Footer, { id: `${
|
|
684
|
-
collapsed ? null : (React.createElement(FooterInfo, { id: `${
|
|
685
|
-
footerTag ? React.createElement(Tag, { id: `${
|
|
686
|
-
React.createElement(Copy, { id: `${
|
|
665
|
+
React.createElement(Footer, { id: `${baseId}-footer` },
|
|
666
|
+
collapsed ? null : (React.createElement(FooterInfo, { id: `${baseId}-footer-info` },
|
|
667
|
+
footerTag ? React.createElement(Tag, { id: `${baseId}-footer-tag` }, footerTag) : null,
|
|
668
|
+
React.createElement(Copy, { id: `${baseId}-footer-copy`, margin: '8px 0 0 0', type: 'small' },
|
|
687
669
|
"\u00A9 ",
|
|
688
670
|
new Date().getFullYear(),
|
|
689
671
|
" Hexure"))),
|
|
690
|
-
React.createElement(Button, { icon: collapsed ? js.mdiChevronRight : js.mdiChevronLeft, id: `${
|
|
672
|
+
React.createElement(Button, { icon: collapsed ? js.mdiChevronRight : js.mdiChevronLeft, id: `${baseId}-collapse-button`, onClick: (e) => {
|
|
691
673
|
e.preventDefault();
|
|
692
674
|
toggleCollapse(!collapsed);
|
|
693
675
|
}, small: true }))));
|
|
@@ -762,19 +744,19 @@ const ErrorMsg = styled.span `
|
|
|
762
744
|
margin-left: 8px;
|
|
763
745
|
`;
|
|
764
746
|
const BulkActionBar = (_a) => {
|
|
765
|
-
var { actions = [], errorMsg, onClear, selectedCount = 0 } = _a, accessibleProps = __rest(_a, ["actions", "errorMsg", "onClear", "selectedCount"]);
|
|
766
|
-
const
|
|
767
|
-
return (React.createElement(Wrapper$d, Object.assign({}, accessibleProps, { id: `${
|
|
768
|
-
React.createElement(Left, { id: `${
|
|
769
|
-
React.createElement(Info$1, { id: `${
|
|
770
|
-
React.createElement(Selected, { id: `${
|
|
747
|
+
var { actions = [], errorMsg, onClear, selectedCount = 0, id } = _a, accessibleProps = __rest(_a, ["actions", "errorMsg", "onClear", "selectedCount", "id"]);
|
|
748
|
+
const baseId = id || 'bulk-action-bar';
|
|
749
|
+
return (React.createElement(Wrapper$d, Object.assign({}, accessibleProps, { id: `${baseId}-wrapper` }),
|
|
750
|
+
React.createElement(Left, { id: `${baseId}-left` },
|
|
751
|
+
React.createElement(Info$1, { id: `${baseId}-info` },
|
|
752
|
+
React.createElement(Selected, { id: `${baseId}-selected` },
|
|
771
753
|
selectedCount,
|
|
772
754
|
" Selected"),
|
|
773
|
-
onClear ? (React.createElement(Clear, { id: `${
|
|
774
|
-
React.createElement(Actions$1, { id: `${
|
|
775
|
-
errorMsg ? (React.createElement(Error$1, { id: `${
|
|
776
|
-
React.createElement(Icon, { color: Colors.RED.Hex, id: `${
|
|
777
|
-
React.createElement(ErrorMsg, { id: `${
|
|
755
|
+
onClear ? (React.createElement(Clear, { id: `${baseId}-clear`, onClick: onClear }, "Clear")) : null),
|
|
756
|
+
React.createElement(Actions$1, { id: `${baseId}-actions` }, actions.map((action, i) => (React.createElement(Button, Object.assign({}, action, { id: `${baseId}-action-${i}`, key: i, small: true })))))),
|
|
757
|
+
errorMsg ? (React.createElement(Error$1, { id: `${baseId}-error` },
|
|
758
|
+
React.createElement(Icon, { color: Colors.RED.Hex, id: `${baseId}-error-icon`, path: js.mdiInformationOutline, size: '20px' }),
|
|
759
|
+
React.createElement(ErrorMsg, { id: `${baseId}-error-msg` }, errorMsg))) : null));
|
|
778
760
|
};
|
|
779
761
|
|
|
780
762
|
const Wrapper$c = styled.div `
|
|
@@ -822,11 +804,11 @@ Title$1.defaultProps = {
|
|
|
822
804
|
disabled: false,
|
|
823
805
|
};
|
|
824
806
|
const MoreMenu = (_a) => {
|
|
825
|
-
var { maxHeight, menuItems = [] } = _a, accessibleProps = __rest(_a, ["maxHeight", "menuItems"]);
|
|
826
|
-
const
|
|
827
|
-
return (React.createElement(Wrapper$c, Object.assign({ "$maxHeight": maxHeight }, accessibleProps, { id: `${
|
|
807
|
+
var { maxHeight, menuItems = [], id } = _a, accessibleProps = __rest(_a, ["maxHeight", "menuItems", "id"]);
|
|
808
|
+
const baseId = id || 'more-menu';
|
|
809
|
+
return (React.createElement(Wrapper$c, Object.assign({ "$maxHeight": maxHeight }, accessibleProps, { id: `${baseId}-wrapper` }), menuItems.map((item, i) => {
|
|
828
810
|
var _a;
|
|
829
|
-
const itemId =
|
|
811
|
+
const itemId = `${baseId}-menu-item-${i}`;
|
|
830
812
|
return (React.createElement(MenuItem, { id: `${itemId}-menu-item`, key: i, onClick: item.onClick },
|
|
831
813
|
item.icon ? (React.createElement(Icon, { color: item.disabled ? Colors.LIGHT_GRAY.Hex : Colors.MEDIUM_GRAY.Hex, id: `${itemId}-icon`, path: item.icon, size: '20px' })) : null,
|
|
832
814
|
React.createElement(Title$1, { disabled: (_a = item.disabled) !== null && _a !== void 0 ? _a : false, id: `${itemId}-title` }, item.label)));
|
|
@@ -845,11 +827,11 @@ const StyledMoreMenu = styled(MoreMenu) `
|
|
|
845
827
|
max-height: ${props => props.maxHeight};
|
|
846
828
|
z-index: 10;
|
|
847
829
|
`;
|
|
848
|
-
const ButtonMenu = ({ disabled, label, maxHeight, menuItems, small, position = 'bottomLeft', format = 'primary', menuWidth = '200px', enableHover = true, enableClick = false, show = false, }) => {
|
|
830
|
+
const ButtonMenu = ({ disabled, label, maxHeight, menuItems, small, position = 'bottomLeft', format = 'primary', menuWidth = '200px', enableHover = true, enableClick = false, show = false, id, }) => {
|
|
849
831
|
const [showMenu, toggleMenu] = React.useState(false);
|
|
850
832
|
const [menuPosition, setMenuPosition] = React.useState({ top: '0px', left: '0px' });
|
|
851
833
|
const menuWrapperRef = React.useRef(null);
|
|
852
|
-
const
|
|
834
|
+
const baseId = id || 'button-menu';
|
|
853
835
|
React.useEffect(() => {
|
|
854
836
|
toggleMenu(show);
|
|
855
837
|
}, [show]);
|
|
@@ -915,9 +897,9 @@ const ButtonMenu = ({ disabled, label, maxHeight, menuItems, small, position = '
|
|
|
915
897
|
setMenuPosition({ top: `${top}px`, left: `${left}px` });
|
|
916
898
|
}
|
|
917
899
|
}, [showMenu, position, menuWidth]);
|
|
918
|
-
return (React.createElement(MenuWrapper, { id: `${
|
|
919
|
-
React.createElement(Button, { disabled: disabled, format: format, icon: js.mdiDotsHorizontal, id: `${
|
|
920
|
-
showMenu && (React.createElement(StyledMoreMenu, { "$left": menuPosition.left, "$menuWidth": menuWidth, "$top": menuPosition.top, id: `${
|
|
900
|
+
return (React.createElement(MenuWrapper, { id: `${baseId}-menu-wrapper`, onClick: handleClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ref: menuWrapperRef },
|
|
901
|
+
React.createElement(Button, { disabled: disabled, format: format, icon: js.mdiDotsHorizontal, id: `${baseId}-button`, small: small }, label),
|
|
902
|
+
showMenu && (React.createElement(StyledMoreMenu, { "$left": menuPosition.left, "$menuWidth": menuWidth, "$top": menuPosition.top, id: `${baseId}-more-menu`, maxHeight: maxHeight, menuItems: menuItems }))));
|
|
921
903
|
};
|
|
922
904
|
|
|
923
905
|
const Wrapper$b = styled.label `
|
|
@@ -999,12 +981,12 @@ const Label$3 = styled.span `
|
|
|
999
981
|
box-sizing: border-box;
|
|
1000
982
|
`;
|
|
1001
983
|
const Checkbox = (_a) => {
|
|
1002
|
-
var { children, color, disabled, checked, onChange, invalid, tooltip, tabIndex } = _a, accessibleProps = __rest(_a, ["children", "color", "disabled", "checked", "onChange", "invalid", "tooltip", "tabIndex"]);
|
|
1003
|
-
const
|
|
1004
|
-
return (React.createElement(Wrapper$b, Object.assign({ "$disabled": disabled }, accessibleProps, { id: `${
|
|
1005
|
-
React.createElement(Input$2, { checked: checked, disabled: disabled, id: `${
|
|
1006
|
-
React.createElement(Check$1, { "$invalid": invalid, id: `${
|
|
1007
|
-
children ? (React.createElement(Label$3, { color: color, id: `${
|
|
984
|
+
var { children, color, disabled, checked, onChange, invalid, tooltip, tabIndex, id } = _a, accessibleProps = __rest(_a, ["children", "color", "disabled", "checked", "onChange", "invalid", "tooltip", "tabIndex", "id"]);
|
|
985
|
+
const baseId = id || 'checkbox';
|
|
986
|
+
return (React.createElement(Wrapper$b, Object.assign({ "$disabled": disabled }, accessibleProps, { id: `${baseId}-wrapper` }),
|
|
987
|
+
React.createElement(Input$2, { checked: checked, disabled: disabled, id: `${baseId}-input`, name: accessibleProps.name, onChange: disabled ? undefined : onChange, tabIndex: disabled ? -1 : tabIndex, type: 'checkbox' }),
|
|
988
|
+
React.createElement(Check$1, { "$invalid": invalid, id: `${baseId}-check` }),
|
|
989
|
+
children ? (React.createElement(Label$3, { color: color, id: `${baseId}-label` },
|
|
1008
990
|
children,
|
|
1009
991
|
tooltip ? React.createElement(Tooltip, Object.assign({}, tooltip)) : null)) : null));
|
|
1010
992
|
};
|
|
@@ -1019,9 +1001,10 @@ const Options$1 = styled.div `
|
|
|
1019
1001
|
box-sizing: border-box;
|
|
1020
1002
|
`;
|
|
1021
1003
|
const Checklist = (_a) => {
|
|
1022
|
-
var { disabled, onChange, options, selected = [], showSelectAll } = _a, accessibleProps = __rest(_a, ["disabled", "onChange", "options", "selected", "showSelectAll"]);
|
|
1004
|
+
var { disabled, onChange, options, selected = [], showSelectAll, id } = _a, accessibleProps = __rest(_a, ["disabled", "onChange", "options", "selected", "showSelectAll", "id"]);
|
|
1023
1005
|
const values = options.map((option) => option.value);
|
|
1024
1006
|
const selected_options = options.filter(o => selected.includes(o.value));
|
|
1007
|
+
const baseId = id || 'checklist';
|
|
1025
1008
|
const handleToggleAll = () => {
|
|
1026
1009
|
if (selected_options.length === options.length) {
|
|
1027
1010
|
triggerChange([]);
|
|
@@ -1045,14 +1028,13 @@ const Checklist = (_a) => {
|
|
|
1045
1028
|
},
|
|
1046
1029
|
});
|
|
1047
1030
|
};
|
|
1048
|
-
const id = generateUniqueId('checklist');
|
|
1049
1031
|
return (React.createElement(React.Fragment, null,
|
|
1050
|
-
showSelectAll && values.length ? (React.createElement(SelectAll, { id: `${
|
|
1051
|
-
React.createElement(Checkbox, { checked: selected.length === values.length, disabled: disabled, id: `${
|
|
1052
|
-
React.createElement(Options$1, { id: `${
|
|
1032
|
+
showSelectAll && values.length ? (React.createElement(SelectAll, { id: `${baseId}-select-all` },
|
|
1033
|
+
React.createElement(Checkbox, { checked: selected.length === values.length, disabled: disabled, id: `${baseId}-checkbox-select-all`, onChange: handleToggleAll }, "Select All"))) : null,
|
|
1034
|
+
React.createElement(Options$1, { id: `${baseId}-options` }, options.map((option, i) => {
|
|
1053
1035
|
const label = `${option.label || option.value}`;
|
|
1054
1036
|
const checked = selected.includes(option.value);
|
|
1055
|
-
const optionId =
|
|
1037
|
+
const optionId = `${baseId}-option-${i}`;
|
|
1056
1038
|
return (React.createElement(Checkbox, Object.assign({ id: `${optionId}-checkbox`, key: i }, accessibleProps, { checked: checked, color: option.color, disabled: disabled, onChange: handleChange.bind(null, option) }), label));
|
|
1057
1039
|
}))));
|
|
1058
1040
|
};
|
|
@@ -1121,10 +1103,10 @@ const SearchInput$1 = styled.input `
|
|
|
1121
1103
|
white-space: nowrap;
|
|
1122
1104
|
`;
|
|
1123
1105
|
const Select = (_a) => {
|
|
1124
|
-
var { options, optionGroups, placeholder = '--Select-One--', readOnly, invalid, searchable = false, value: propValue, onChange, style, tabIndex } = _a, accessibleProps = __rest(_a, ["options", "optionGroups", "placeholder", "readOnly", "invalid", "searchable", "value", "onChange", "style", "tabIndex"]);
|
|
1106
|
+
var { options, optionGroups, placeholder = '--Select-One--', readOnly, invalid, searchable = false, value: propValue, onChange, style, tabIndex, id } = _a, accessibleProps = __rest(_a, ["options", "optionGroups", "placeholder", "readOnly", "invalid", "searchable", "value", "onChange", "style", "tabIndex", "id"]);
|
|
1125
1107
|
const [searchTerm, setSearchTerm] = React.useState('');
|
|
1126
1108
|
const [value, setValue] = React.useState(propValue || '');
|
|
1127
|
-
const
|
|
1109
|
+
const baseId = id || 'select';
|
|
1128
1110
|
// Update the value when the prop changes
|
|
1129
1111
|
React.useEffect(() => {
|
|
1130
1112
|
setValue(propValue || '');
|
|
@@ -1144,15 +1126,15 @@ const Select = (_a) => {
|
|
|
1144
1126
|
const filteredOptionGroups = searchable
|
|
1145
1127
|
? optionGroups === null || optionGroups === void 0 ? void 0 : optionGroups.map(group => (Object.assign(Object.assign({}, group), { options: group.options.filter(option => { var _a; return (_a = option.label) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(searchTerm.toLowerCase()); }) })))
|
|
1146
1128
|
: optionGroups;
|
|
1147
|
-
return (React.createElement(Wrapper$a, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, id: `${
|
|
1148
|
-
searchable && (React.createElement(SearchInput$1, Object.assign({ id: `${
|
|
1149
|
-
React.createElement(Trigger$1, Object.assign({ disabled: readOnly, id: `${
|
|
1150
|
-
placeholder && !value && (React.createElement("option", { disabled: true, id: `${
|
|
1129
|
+
return (React.createElement(Wrapper$a, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, id: `${baseId}-wrapper` },
|
|
1130
|
+
searchable && (React.createElement(SearchInput$1, Object.assign({ id: `${baseId}-search-input`, onChange: handleSearch, placeholder: placeholder, tabIndex: readOnly ? -1 : tabIndex, type: 'text', value: searchTerm }, accessibleProps))),
|
|
1131
|
+
React.createElement(Trigger$1, Object.assign({ disabled: readOnly, id: `${baseId}-trigger`, onChange: handleChange, placeholder: placeholder, tabIndex: readOnly ? -1 : tabIndex, value: value }, accessibleProps),
|
|
1132
|
+
placeholder && !value && (React.createElement("option", { disabled: true, id: `${baseId}-placeholder`, value: '' }, placeholder)),
|
|
1151
1133
|
filteredOptionGroups &&
|
|
1152
|
-
filteredOptionGroups.map((group, i) => (React.createElement("optgroup", { id: `${
|
|
1134
|
+
filteredOptionGroups.map((group, i) => (React.createElement("optgroup", { id: `${baseId}-optgroup-${i}`, key: i, label: group.label || `Group ${i}` }, group.options.map((option, j) => (React.createElement("option", { id: `${baseId}-option-${i}-${j}`, key: j, style: { color: option.color }, value: option.value }, option.label || option.value)))))),
|
|
1153
1135
|
filteredOptions &&
|
|
1154
|
-
filteredOptions.map((option, i) => (React.createElement("option", { id: `${
|
|
1155
|
-
React.createElement(IconWrapper$2, { color: Colors.BLACK.Hex, id: `${
|
|
1136
|
+
filteredOptions.map((option, i) => (React.createElement("option", { id: `${baseId}-option-${i}`, key: i, style: { color: option.color }, value: option.value }, option.label || option.value)))),
|
|
1137
|
+
React.createElement(IconWrapper$2, { color: Colors.BLACK.Hex, id: `${baseId}-icon`, path: js.mdiChevronDown, size: '22px' })));
|
|
1156
1138
|
};
|
|
1157
1139
|
|
|
1158
1140
|
const DatePickerWrapper = styled.div `
|
|
@@ -1165,7 +1147,7 @@ const Middle = styled.div `
|
|
|
1165
1147
|
`;
|
|
1166
1148
|
const DatePicker = ({ readOnly = false, invalid = false, maxDate = null, minDate = null, date,
|
|
1167
1149
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1168
|
-
onChange = () => { }, style, }) => {
|
|
1150
|
+
onChange = () => { }, style, id, }) => {
|
|
1169
1151
|
const [selectedDay, setSelectedDay] = React.useState(date ? dayjs(date).date().toString() : '');
|
|
1170
1152
|
const [selectedMonth, setSelectedMonth] = React.useState(date ? (dayjs(date).month() + 1).toString() : '');
|
|
1171
1153
|
const [selectedYear, setSelectedYear] = React.useState(date ? dayjs(date).year().toString() : '');
|
|
@@ -1242,13 +1224,13 @@ onChange = () => { }, style, }) => {
|
|
|
1242
1224
|
setSelectedYear(e.target.value);
|
|
1243
1225
|
setDDate(new_date);
|
|
1244
1226
|
};
|
|
1245
|
-
const
|
|
1227
|
+
const baseId = id || 'date-picker';
|
|
1246
1228
|
return (React.createElement(React.Fragment, null,
|
|
1247
|
-
React.createElement(DatePickerWrapper, { "$style": style, id: `${
|
|
1248
|
-
React.createElement(Select, { id: `${
|
|
1249
|
-
React.createElement(Middle, { id: `${
|
|
1250
|
-
React.createElement(Select, { id: `${
|
|
1251
|
-
React.createElement(Select, { id: `${
|
|
1229
|
+
React.createElement(DatePickerWrapper, { "$style": style, id: `${baseId}-wrapper` },
|
|
1230
|
+
React.createElement(Select, { id: `${baseId}-month-select`, invalid: invalid, onChange: handleMonthChange, options: months, placeholder: 'Select Month', readOnly: readOnly, style: { borderRadius: '4px 0px 0px 4px', flexGrow: 3 }, value: selectedMonth }),
|
|
1231
|
+
React.createElement(Middle, { id: `${baseId}-middle` },
|
|
1232
|
+
React.createElement(Select, { id: `${baseId}-day-select`, invalid: invalid, onChange: handleDayChange, options: dayOptions, placeholder: 'Select Day', readOnly: readOnly, style: { borderRadius: '0px' }, value: selectedDay })),
|
|
1233
|
+
React.createElement(Select, { id: `${baseId}-year-select`, invalid: invalid, onChange: handleYearChange, options: years, placeholder: 'Select Year', readOnly: readOnly, style: { borderRadius: '0px 4px 4px 0px', flexGrow: 2 }, value: selectedYear }))));
|
|
1252
1234
|
};
|
|
1253
1235
|
|
|
1254
1236
|
const Scrim$1 = styled.div `
|
|
@@ -1311,7 +1293,7 @@ const ButtonBar$1 = styled.div `
|
|
|
1311
1293
|
background: #fff;
|
|
1312
1294
|
`;
|
|
1313
1295
|
const Drawer = (_a) => {
|
|
1314
|
-
var { children, description, title, onClose, primaryButton, position = 'fixed', secondaryButton, tertiaryButton, scrim = 'dark', width } = _a, accessibleProps = __rest(_a, ["children", "description", "title", "onClose", "primaryButton", "position", "secondaryButton", "tertiaryButton", "scrim", "width"]);
|
|
1296
|
+
var { children, description, title, onClose, primaryButton, position = 'fixed', secondaryButton, tertiaryButton, scrim = 'dark', width, id } = _a, accessibleProps = __rest(_a, ["children", "description", "title", "onClose", "primaryButton", "position", "secondaryButton", "tertiaryButton", "scrim", "width", "id"]);
|
|
1315
1297
|
React.useEffect(() => {
|
|
1316
1298
|
document.onkeydown = e => {
|
|
1317
1299
|
if (e.key === 'Escape') {
|
|
@@ -1321,22 +1303,22 @@ const Drawer = (_a) => {
|
|
|
1321
1303
|
return function cleanup() {
|
|
1322
1304
|
document.onkeydown = null;
|
|
1323
1305
|
};
|
|
1324
|
-
}, []);
|
|
1325
|
-
const
|
|
1306
|
+
}, [onClose]);
|
|
1307
|
+
const baseId = id || 'drawer';
|
|
1326
1308
|
return (React.createElement(React.Fragment, null,
|
|
1327
|
-
React.createElement(Container$2, Object.assign({}, accessibleProps, { "$position": position, "$width": width, id: `${
|
|
1328
|
-
React.createElement(Header$2, { id: `${
|
|
1329
|
-
React.createElement("div", { id: `${
|
|
1330
|
-
title ? (React.createElement(Heading, { id: `${
|
|
1331
|
-
description ? (React.createElement(Copy, { color: 'GRAY', id: `${
|
|
1332
|
-
React.createElement(Close$1, { id: `${
|
|
1333
|
-
React.createElement(Button, { format: 'secondary', icon: js.mdiClose, id: `${
|
|
1334
|
-
React.createElement(ContentWrapper$1, { id: `${
|
|
1335
|
-
primaryButton || secondaryButton || tertiaryButton ? (React.createElement(ButtonBar$1, { id: `${
|
|
1336
|
-
tertiaryButton ? (React.createElement(Button, Object.assign({}, tertiaryButton, { format: tertiaryButton.format || 'secondary', id: `${
|
|
1337
|
-
secondaryButton ? (React.createElement(Button, Object.assign({}, secondaryButton, { format: secondaryButton.format || 'secondary', id: `${
|
|
1338
|
-
primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { format: primaryButton.format || 'primary', id: `${
|
|
1339
|
-
scrim ? (React.createElement(Scrim$1, { "$position": position, "$scrim": scrim, id: `${
|
|
1309
|
+
React.createElement(Container$2, Object.assign({}, accessibleProps, { "$position": position, "$width": width, id: `${baseId}-container` }),
|
|
1310
|
+
React.createElement(Header$2, { id: `${baseId}-header` },
|
|
1311
|
+
React.createElement("div", { id: `${baseId}-header-content` },
|
|
1312
|
+
title ? (React.createElement(Heading, { id: `${baseId}-title`, type: 'secondary' }, title)) : null,
|
|
1313
|
+
description ? (React.createElement(Copy, { color: 'GRAY', id: `${baseId}-description` }, description)) : null),
|
|
1314
|
+
React.createElement(Close$1, { id: `${baseId}-close`, onClick: onClose },
|
|
1315
|
+
React.createElement(Button, { format: 'secondary', icon: js.mdiClose, id: `${baseId}-close-button`, small: true }))),
|
|
1316
|
+
React.createElement(ContentWrapper$1, { id: `${baseId}-content-wrapper` }, children),
|
|
1317
|
+
primaryButton || secondaryButton || tertiaryButton ? (React.createElement(ButtonBar$1, { id: `${baseId}-button-bar` },
|
|
1318
|
+
tertiaryButton ? (React.createElement(Button, Object.assign({}, tertiaryButton, { format: tertiaryButton.format || 'secondary', id: `${baseId}-tertiary-button` }))) : null,
|
|
1319
|
+
secondaryButton ? (React.createElement(Button, Object.assign({}, secondaryButton, { format: secondaryButton.format || 'secondary', id: `${baseId}-secondary-button` }))) : null,
|
|
1320
|
+
primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { format: primaryButton.format || 'primary', id: `${baseId}-primary-button` }))) : null)) : null),
|
|
1321
|
+
scrim ? (React.createElement(Scrim$1, { "$position": position, "$scrim": scrim, id: `${baseId}-scrim`, onClick: onClose })) : null));
|
|
1340
1322
|
};
|
|
1341
1323
|
|
|
1342
1324
|
const Wrapper$9 = styled.div(props => (Object.assign({ margin: '0px 0px 18px 0px' }, props.$customStyle)));
|
|
@@ -1388,18 +1370,18 @@ const Validation = styled.div `
|
|
|
1388
1370
|
box-sizing: border-box;
|
|
1389
1371
|
`;
|
|
1390
1372
|
const Field = (_a) => {
|
|
1391
|
-
var { action, children, validationText, label, description, required, htmlFor, style = {}, tooltip } = _a, accessibleProps = __rest(_a, ["action", "children", "validationText", "label", "description", "required", "htmlFor", "style", "tooltip"]);
|
|
1392
|
-
const
|
|
1393
|
-
return (React.createElement(Wrapper$9, Object.assign({ "$customStyle": style }, accessibleProps, { id: `${
|
|
1394
|
-
React.createElement(LabelRow, { id: `${
|
|
1395
|
-
label || required || tooltip ? (React.createElement(Label$2, { htmlFor: htmlFor, id: `${
|
|
1373
|
+
var { action, children, validationText, label, description, required, htmlFor, style = {}, tooltip, id } = _a, accessibleProps = __rest(_a, ["action", "children", "validationText", "label", "description", "required", "htmlFor", "style", "tooltip", "id"]);
|
|
1374
|
+
const baseId = id || 'field';
|
|
1375
|
+
return (React.createElement(Wrapper$9, Object.assign({ "$customStyle": style }, accessibleProps, { id: `${baseId}-wrapper` }),
|
|
1376
|
+
React.createElement(LabelRow, { id: `${baseId}-label-row` },
|
|
1377
|
+
label || required || tooltip ? (React.createElement(Label$2, { htmlFor: htmlFor, id: `${baseId}-label` },
|
|
1396
1378
|
label,
|
|
1397
|
-
required ? React.createElement(Required, { id: `${
|
|
1379
|
+
required ? React.createElement(Required, { id: `${baseId}-required` }, "*") : null,
|
|
1398
1380
|
tooltip ? React.createElement(Tooltip, Object.assign({}, tooltip)) : null)) : null,
|
|
1399
|
-
action ? (React.createElement(Action, { id: action.id || `${
|
|
1400
|
-
description ? React.createElement(Description, { id: `${
|
|
1401
|
-
React.createElement("div", { id: `${
|
|
1402
|
-
validationText ? React.createElement(Validation, { id: `${
|
|
1381
|
+
action ? (React.createElement(Action, { id: action.id || `${baseId}-action`, onClick: action.onClick }, action.label)) : null),
|
|
1382
|
+
description ? React.createElement(Description, { id: `${baseId}-description` }, description) : null,
|
|
1383
|
+
React.createElement("div", { id: `${baseId}-children` }, children),
|
|
1384
|
+
validationText ? (React.createElement(Validation, { id: `${baseId}-validation` }, validationText)) : null));
|
|
1403
1385
|
};
|
|
1404
1386
|
|
|
1405
1387
|
const Wrapper$8 = styled.fieldset `
|
|
@@ -1431,11 +1413,11 @@ const Content$1 = styled.div `
|
|
|
1431
1413
|
border-radius: 8px;
|
|
1432
1414
|
background: #fcfcfc;
|
|
1433
1415
|
`;
|
|
1434
|
-
const FieldGroup = ({ children, label }) => {
|
|
1435
|
-
const
|
|
1436
|
-
return (React.createElement(Wrapper$8, { id: `${
|
|
1437
|
-
React.createElement(Label$1, { id: `${
|
|
1438
|
-
React.createElement(Content$1, { id: `${
|
|
1416
|
+
const FieldGroup = ({ children, label, id }) => {
|
|
1417
|
+
const baseId = id || 'field-group';
|
|
1418
|
+
return (React.createElement(Wrapper$8, { id: `${baseId}-wrapper` },
|
|
1419
|
+
React.createElement(Label$1, { id: `${baseId}-label` }, label),
|
|
1420
|
+
React.createElement(Content$1, { id: `${baseId}-content` }, children)));
|
|
1439
1421
|
};
|
|
1440
1422
|
|
|
1441
1423
|
const Dropzone = styled.div `
|
|
@@ -1509,7 +1491,7 @@ const Remove = styled(Icon) `
|
|
|
1509
1491
|
fill: ${Colors.RED.Hex} !important;
|
|
1510
1492
|
}
|
|
1511
1493
|
`;
|
|
1512
|
-
const FileUpload = ({ accept, onChange, onError, maxFiles = 10, maxSize = 2, value = [], message, tooltipInfo = '', validateFile, }) => {
|
|
1494
|
+
const FileUpload = ({ accept, onChange, onError, maxFiles = 10, maxSize = 2, value = [], message, tooltipInfo = '', validateFile, id, }) => {
|
|
1513
1495
|
const inputRef = React.useRef(null);
|
|
1514
1496
|
const [files, setFiles] = React.useState(value || []);
|
|
1515
1497
|
const [dragging, setDragging] = React.useState(false);
|
|
@@ -1608,24 +1590,24 @@ const FileUpload = ({ accept, onChange, onError, maxFiles = 10, maxSize = 2, val
|
|
|
1608
1590
|
setAllowMoreFiles(false);
|
|
1609
1591
|
}
|
|
1610
1592
|
}, [files]);
|
|
1611
|
-
const
|
|
1593
|
+
const baseId = id || 'file-upload';
|
|
1612
1594
|
return (React.createElement(React.Fragment, null,
|
|
1613
|
-
React.createElement("input", { accept: accept, id: `${
|
|
1614
|
-
React.createElement(Dropzone, { "$dragging": dragging, id: `${
|
|
1615
|
-
files.length ? (React.createElement(Files, { id: `${
|
|
1616
|
-
const fileId =
|
|
1595
|
+
React.createElement("input", { accept: accept, id: `${baseId}-input`, multiple: true, onChange: allowMoreFiles ? handleChange : undefined, ref: inputRef, style: { display: 'none' }, type: 'file' }),
|
|
1596
|
+
React.createElement(Dropzone, { "$dragging": dragging, id: `${baseId}-dropzone`, onDragEnter: allowMoreFiles ? handleDrag : undefined, onDragLeave: allowMoreFiles ? handleDrag : undefined, onDragOver: allowMoreFiles ? handleDrag : undefined, onDrop: allowMoreFiles ? handleDrop : undefined, value: files ? files : [] },
|
|
1597
|
+
files.length ? (React.createElement(Files, { id: `${baseId}-files` }, files.map((file, index) => {
|
|
1598
|
+
const fileId = `${baseId}-file-${index}`;
|
|
1617
1599
|
return (React.createElement(File, { id: `${fileId}-file`, key: file.name },
|
|
1618
1600
|
React.createElement(Copy, { id: `${fileId}-file-name`, type: 'bold' }, file.name),
|
|
1619
1601
|
React.createElement(Remove, { id: `${fileId}-remove`, onClick: handleRemove.bind(null, file), path: js.mdiMinusCircle })));
|
|
1620
1602
|
}))) : null,
|
|
1621
|
-
allowMoreFiles ? (React.createElement(ClickZone, { id: `${
|
|
1622
|
-
files.length ? null : (React.createElement(IconWrapper$1, { "$dragging": dragging, id: `${
|
|
1623
|
-
React.createElement(StyledIcon$3, { id: `${
|
|
1624
|
-
React.createElement(Content, { id: `${
|
|
1625
|
-
React.createElement(Copy, { align: 'center', id: `${
|
|
1626
|
-
message ? (React.createElement(MessageDiv, { id: `${
|
|
1627
|
-
React.createElement(Copy, { align: 'center', color: 'GRAY', id: `${
|
|
1628
|
-
tooltipInfo && (React.createElement("span", { id: `${
|
|
1603
|
+
allowMoreFiles ? (React.createElement(ClickZone, { id: `${baseId}-click-zone`, onClick: triggerFileExplorer },
|
|
1604
|
+
files.length ? null : (React.createElement(IconWrapper$1, { "$dragging": dragging, id: `${baseId}-icon-wrapper` },
|
|
1605
|
+
React.createElement(StyledIcon$3, { id: `${baseId}-icon`, path: js.mdiFolderPlusOutline }))),
|
|
1606
|
+
React.createElement(Content, { id: `${baseId}-content` },
|
|
1607
|
+
React.createElement(Copy, { align: 'center', id: `${baseId}-copy`, type: 'bold' }, "Drag & drop files here or click to select files"),
|
|
1608
|
+
message ? (React.createElement(MessageDiv, { id: `${baseId}-message-div` },
|
|
1609
|
+
React.createElement(Copy, { align: 'center', color: 'GRAY', id: `${baseId}-message` }, message),
|
|
1610
|
+
tooltipInfo && (React.createElement("span", { id: `${baseId}-tooltip` },
|
|
1629
1611
|
React.createElement(Tooltip, { children: tooltipInfo, position: 'left-center' }))))) : null))) : null)));
|
|
1630
1612
|
};
|
|
1631
1613
|
|
|
@@ -1848,7 +1830,7 @@ const Loader$1 = styled.div `
|
|
|
1848
1830
|
const Input$1 = (_a) => {
|
|
1849
1831
|
var { format, suffix, height, invalid, loading, max, maxLength, min, onBlur, onChange, onFocus, onKeyDown,
|
|
1850
1832
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1851
|
-
onSuggestedSelect = () => { }, placeholder, readOnly, showCharCount, step, style, suggestedValues, showErrorTextColor = false, type = 'text', value = '', innerRef = null, tabIndex, isAutoComplete = false } = _a, accessibleProps = __rest(_a, ["format", "suffix", "height", "invalid", "loading", "max", "maxLength", "min", "onBlur", "onChange", "onFocus", "onKeyDown", "onSuggestedSelect", "placeholder", "readOnly", "showCharCount", "step", "style", "suggestedValues", "showErrorTextColor", "type", "value", "innerRef", "tabIndex", "isAutoComplete"]);
|
|
1833
|
+
onSuggestedSelect = () => { }, placeholder, readOnly, showCharCount, step, style, suggestedValues, showErrorTextColor = false, type = 'text', value = '', innerRef = null, tabIndex, isAutoComplete = false, id } = _a, accessibleProps = __rest(_a, ["format", "suffix", "height", "invalid", "loading", "max", "maxLength", "min", "onBlur", "onChange", "onFocus", "onKeyDown", "onSuggestedSelect", "placeholder", "readOnly", "showCharCount", "step", "style", "suggestedValues", "showErrorTextColor", "type", "value", "innerRef", "tabIndex", "isAutoComplete", "id"]);
|
|
1852
1834
|
const [show_options, setShowOptions] = React.useState(false);
|
|
1853
1835
|
const [internalValue, setInternalValue] = React.useState(value);
|
|
1854
1836
|
const [internalSuggestedValues, setInternalSuggestedValues] = React.useState(suggestedValues || []);
|
|
@@ -1920,8 +1902,8 @@ const Input$1 = (_a) => {
|
|
|
1920
1902
|
if (format === 'ssn' && type !== 'password') {
|
|
1921
1903
|
formatted_value = formatAsSsn(internalValue);
|
|
1922
1904
|
}
|
|
1923
|
-
const
|
|
1924
|
-
return type === 'textarea' ? (React.createElement(StyledWrapper, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, "$suggestions": show_options && !!internalSuggestedValues.length, id: `${
|
|
1905
|
+
const baseId = id || 'input';
|
|
1906
|
+
return type === 'textarea' ? (React.createElement(StyledWrapper, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, "$suggestions": show_options && !!internalSuggestedValues.length, id: `${baseId}-wrapper` },
|
|
1925
1907
|
React.createElement(StyledTextArea, Object.assign({ "$height": height, "$invalid": invalid, "$readOnly": readOnly, "$showErrorTextColor": showErrorTextColor, maxLength: maxLength, onBlur: readOnly
|
|
1926
1908
|
? e => e.preventDefault()
|
|
1927
1909
|
: e => {
|
|
@@ -1936,12 +1918,12 @@ const Input$1 = (_a) => {
|
|
|
1936
1918
|
setShowOptions(true);
|
|
1937
1919
|
if (onFocus)
|
|
1938
1920
|
onFocus(e);
|
|
1939
|
-
}, onKeyDown: readOnly ? e => e.preventDefault() : onKeyDown, placeholder: placeholder, readOnly: readOnly, ref: innerRef, tabIndex: readOnly ? -1 : tabIndex, value: formatted_value }, accessibleProps, { id: `${
|
|
1940
|
-
loading ? (React.createElement(Loader$1, { id: `${
|
|
1921
|
+
}, onKeyDown: readOnly ? e => e.preventDefault() : onKeyDown, placeholder: placeholder, readOnly: readOnly, ref: innerRef, tabIndex: readOnly ? -1 : tabIndex, value: formatted_value }, accessibleProps, { id: `${baseId}-textarea` })),
|
|
1922
|
+
loading ? (React.createElement(Loader$1, { id: `${baseId}-loader` },
|
|
1941
1923
|
React.createElement(Icon, { color: Colors.MEDIUM_GRAY.Hex, path: js.mdiLoading, size: '20px', spin: true }))) : null,
|
|
1942
|
-
showCharCount ? (React.createElement(CharacterCount, { id: `${
|
|
1924
|
+
showCharCount ? (React.createElement(CharacterCount, { id: `${baseId}-char-count` },
|
|
1943
1925
|
internalValue.length,
|
|
1944
|
-
maxLength ? ` / ${maxLength}` : null)) : null)) : (React.createElement(StyledWrapper, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, "$suggestions": show_options && !!internalSuggestedValues.length, id: `${
|
|
1926
|
+
maxLength ? ` / ${maxLength}` : null)) : null)) : (React.createElement(StyledWrapper, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, "$suggestions": show_options && !!internalSuggestedValues.length, id: `${baseId}-wrapper` },
|
|
1945
1927
|
React.createElement(StyledInput, Object.assign({ "$height": height, "$invalid": invalid, "$readOnly": readOnly, "$showErrorTextColor": showErrorTextColor, max: max, maxLength: maxLength, min: min, onBlur: readOnly
|
|
1946
1928
|
? e => e.preventDefault()
|
|
1947
1929
|
: e => {
|
|
@@ -1958,20 +1940,20 @@ const Input$1 = (_a) => {
|
|
|
1958
1940
|
setIsFocused(true);
|
|
1959
1941
|
if (onFocus)
|
|
1960
1942
|
onFocus(e);
|
|
1961
|
-
}, onKeyDown: readOnly ? e => e.preventDefault() : onKeyDown, placeholder: placeholder, readOnly: readOnly, ref: innerRef, step: step, tabIndex: readOnly ? -1 : tabIndex, type: type, value: format === 'currency_decimal' && internalValue ? `$${formatted_value}` : formatted_value }, accessibleProps, { id: `${
|
|
1962
|
-
loading ? (React.createElement(Loader$1, { id: `${
|
|
1943
|
+
}, onKeyDown: readOnly ? e => e.preventDefault() : onKeyDown, placeholder: placeholder, readOnly: readOnly, ref: innerRef, step: step, tabIndex: readOnly ? -1 : tabIndex, type: type, value: format === 'currency_decimal' && internalValue ? `$${formatted_value}` : formatted_value }, accessibleProps, { id: `${baseId}-input` })),
|
|
1944
|
+
loading ? (React.createElement(Loader$1, { id: `${baseId}-loader` },
|
|
1963
1945
|
React.createElement(Icon, { color: Colors.MEDIUM_GRAY.Hex, path: js.mdiLoading, size: '20px', spin: true }))) : null,
|
|
1964
|
-
showCharCount ? (React.createElement(CharacterCount, { id: `${
|
|
1946
|
+
showCharCount ? (React.createElement(CharacterCount, { id: `${baseId}-char-count` },
|
|
1965
1947
|
internalValue.length,
|
|
1966
1948
|
maxLength ? ` / ${maxLength}` : null)) : null,
|
|
1967
|
-
suffix && React.createElement(StyledSuffix, { id: `${
|
|
1968
|
-
show_options && internalSuggestedValues.length ? (React.createElement(SuggestedValues, { id: `${
|
|
1969
|
-
isAutoComplete ? null : (React.createElement(SuggestedSummary, { id: `${
|
|
1949
|
+
suffix && React.createElement(StyledSuffix, { id: `${baseId}-suffix` }, suffix),
|
|
1950
|
+
show_options && internalSuggestedValues.length ? (React.createElement(SuggestedValues, { id: `${baseId}-suggested-values` },
|
|
1951
|
+
isAutoComplete ? null : (React.createElement(SuggestedSummary, { id: `${baseId}-suggested-summary` },
|
|
1970
1952
|
internalSuggestedValues.length,
|
|
1971
1953
|
" Results Match \"",
|
|
1972
1954
|
internalValue,
|
|
1973
1955
|
"\"")),
|
|
1974
|
-
internalSuggestedValues.map((suggestedValue, index) => (React.createElement(SuggestedValue, { id: `${
|
|
1956
|
+
internalSuggestedValues.map((suggestedValue, index) => (React.createElement(SuggestedValue, { id: `${baseId}-suggested-value-${index}`, key: index, onClick: () => {
|
|
1975
1957
|
handleInputChange({ target: { value: suggestedValue } });
|
|
1976
1958
|
onSuggestedSelect();
|
|
1977
1959
|
setShowOptions(false);
|
|
@@ -1985,7 +1967,7 @@ const Wrapper$7 = styled.a `
|
|
|
1985
1967
|
letter-spacing: ${props => (props.$small ? '1px' : '0px')};
|
|
1986
1968
|
font-weight: 500;
|
|
1987
1969
|
font-style: normal;
|
|
1988
|
-
text-decoration:
|
|
1970
|
+
text-decoration: none;
|
|
1989
1971
|
font-family: 'Roboto', Helvetica, Arial, sans-serif;
|
|
1990
1972
|
margin: 0px;
|
|
1991
1973
|
padding: 0px;
|
|
@@ -1994,9 +1976,9 @@ const Wrapper$7 = styled.a `
|
|
|
1994
1976
|
`;
|
|
1995
1977
|
Wrapper$7.defaultProps = { theme: EditableTheme };
|
|
1996
1978
|
const Link = (_a) => {
|
|
1997
|
-
var { children, onClick, small } = _a, accessibleProps = __rest(_a, ["children", "onClick", "small"]);
|
|
1998
|
-
const
|
|
1999
|
-
return (React.createElement(Wrapper$7, Object.assign({ "$small": small, onClick: onClick }, accessibleProps, { id: `${
|
|
1979
|
+
var { children, onClick, small, id } = _a, accessibleProps = __rest(_a, ["children", "onClick", "small", "id"]);
|
|
1980
|
+
const baseId = id || 'link';
|
|
1981
|
+
return (React.createElement(Wrapper$7, Object.assign({ "$small": small, onClick: onClick }, accessibleProps, { id: `${baseId}-wrapper` }), children));
|
|
2000
1982
|
};
|
|
2001
1983
|
|
|
2002
1984
|
const dash = styled.keyframes `
|
|
@@ -2029,10 +2011,10 @@ const Path = styled.path `
|
|
|
2029
2011
|
-webkit-animation: ${dash} 1.1s ease-in-out infinite;
|
|
2030
2012
|
animation: ${dash} 1.1s ease-in-out infinite;
|
|
2031
2013
|
`;
|
|
2032
|
-
const Loader = () => {
|
|
2033
|
-
const
|
|
2034
|
-
return (React.createElement(Spinner, { id: `${
|
|
2035
|
-
React.createElement(Path, { d: 'M7.21487 1.2868C7.88431 0.9044 8.73031 0.9044 9.39974 1.2868L9.40283 1.28856L14.4613 4.20761C15.1684 4.598 15.5746 5.33558 15.5746 6.11465V8.99996V11.8853C15.5746 12.6507 15.1632 13.3848 14.4617 13.7721L9.37973 16.7132C8.71029 17.0956 7.86428 17.0956 7.19485 16.7132L7.19088 16.7109L2.11279 13.772C1.40602 13.3816 1 12.6441 1 11.8653V8.98995V6.11465C1 5.31458 1.44381 4.59039 2.10827 4.21051L7.21487 1.2868Z', fill: 'none', id: `${
|
|
2014
|
+
const Loader = ({ id }) => {
|
|
2015
|
+
const baseId = id || 'loader';
|
|
2016
|
+
return (React.createElement(Spinner, { id: `${baseId}-spinner`, viewBox: '0 0 16 18' },
|
|
2017
|
+
React.createElement(Path, { d: 'M7.21487 1.2868C7.88431 0.9044 8.73031 0.9044 9.39974 1.2868L9.40283 1.28856L14.4613 4.20761C15.1684 4.598 15.5746 5.33558 15.5746 6.11465V8.99996V11.8853C15.5746 12.6507 15.1632 13.3848 14.4617 13.7721L9.37973 16.7132C8.71029 17.0956 7.86428 17.0956 7.19485 16.7132L7.19088 16.7109L2.11279 13.772C1.40602 13.3816 1 12.6441 1 11.8653V8.98995V6.11465C1 5.31458 1.44381 4.59039 2.10827 4.21051L7.21487 1.2868Z', fill: 'none', id: `${baseId}-path`, strokeWidth: '2' })));
|
|
2036
2018
|
};
|
|
2037
2019
|
|
|
2038
2020
|
const Steps = styled.div `
|
|
@@ -2083,10 +2065,10 @@ const StepLine = styled.div `
|
|
|
2083
2065
|
background-color: ${props => (props.$active ? Colors.PRIMARY.Hex : Colors.MEDIUM_GRAY.Hex)};
|
|
2084
2066
|
transition: background-color 0.5s ease-in-out;
|
|
2085
2067
|
`;
|
|
2086
|
-
const ProgressBar = ({ steps, showStepLine = false }) => {
|
|
2087
|
-
const
|
|
2088
|
-
return (React.createElement(Steps, { id: `${
|
|
2089
|
-
const stepId =
|
|
2068
|
+
const ProgressBar = ({ steps, showStepLine = false, id }) => {
|
|
2069
|
+
const baseId = id || 'progress-bar';
|
|
2070
|
+
return (React.createElement(Steps, { id: `${baseId}-steps` }, steps.map((step, i) => {
|
|
2071
|
+
const stepId = `${baseId}-step-${i}`;
|
|
2090
2072
|
return (React.createElement(React.Fragment, { key: i },
|
|
2091
2073
|
i !== 0 && showStepLine && React.createElement(StepLine, { "$active": step.active, id: `${stepId}-line` }),
|
|
2092
2074
|
React.createElement(Step, { id: `${stepId}-step` },
|
|
@@ -2167,7 +2149,7 @@ const ButtonContainer = styled.div `
|
|
|
2167
2149
|
margin: 0 10px;
|
|
2168
2150
|
`;
|
|
2169
2151
|
const Modal = (_a) => {
|
|
2170
|
-
var { children, title, onClose, maxWidth, fullscreen, steps, primaryButton, secondaryButton, tertiaryButton, quarternaryButton } = _a, accessibleProps = __rest(_a, ["children", "title", "onClose", "maxWidth", "fullscreen", "steps", "primaryButton", "secondaryButton", "tertiaryButton", "quarternaryButton"]);
|
|
2152
|
+
var { children, title, onClose, maxWidth, fullscreen, steps, primaryButton, secondaryButton, tertiaryButton, quarternaryButton, id } = _a, accessibleProps = __rest(_a, ["children", "title", "onClose", "maxWidth", "fullscreen", "steps", "primaryButton", "secondaryButton", "tertiaryButton", "quarternaryButton", "id"]);
|
|
2171
2153
|
React.useEffect(() => {
|
|
2172
2154
|
document.onkeydown = e => {
|
|
2173
2155
|
if (e.key === 'Escape') {
|
|
@@ -2177,36 +2159,36 @@ const Modal = (_a) => {
|
|
|
2177
2159
|
return function cleanup() {
|
|
2178
2160
|
document.onkeydown = null;
|
|
2179
2161
|
};
|
|
2180
|
-
}, []);
|
|
2181
|
-
const
|
|
2182
|
-
return (React.createElement(Wrapper$6, { id: `${
|
|
2183
|
-
React.createElement(Container$1, Object.assign({ "$fullscreen": fullscreen, "$maxWidth": maxWidth, open: true }, accessibleProps, { id: `${
|
|
2184
|
-
React.createElement(Header$1, { id: `${
|
|
2185
|
-
title ? (React.createElement(Heading, { id: `${
|
|
2186
|
-
React.createElement(Close, { id: `${
|
|
2187
|
-
React.createElement(CloseMsg, { id: `${
|
|
2188
|
-
React.createElement(Icon, { color: Colors.BLACK.Hex, id: `${
|
|
2162
|
+
}, [onClose]);
|
|
2163
|
+
const baseId = id || 'modal';
|
|
2164
|
+
return (React.createElement(Wrapper$6, { id: `${baseId}-wrapper` },
|
|
2165
|
+
React.createElement(Container$1, Object.assign({ "$fullscreen": fullscreen, "$maxWidth": maxWidth, open: true }, accessibleProps, { id: `${baseId}-container` }),
|
|
2166
|
+
React.createElement(Header$1, { id: `${baseId}-header` },
|
|
2167
|
+
title ? (React.createElement(Heading, { id: `${baseId}-title`, type: 'secondary' }, title)) : null,
|
|
2168
|
+
React.createElement(Close, { id: `${baseId}-close`, onClick: onClose },
|
|
2169
|
+
React.createElement(CloseMsg, { id: `${baseId}-close-msg` }, "(Esc)"),
|
|
2170
|
+
React.createElement(Icon, { color: Colors.BLACK.Hex, id: `${baseId}-close-icon`, path: js.mdiClose, size: '24px' }))),
|
|
2189
2171
|
steps ? React.createElement(ProgressBar, { steps: steps }) : null,
|
|
2190
|
-
React.createElement(ContentWrapper, { id: `${
|
|
2191
|
-
primaryButton || secondaryButton || tertiaryButton || quarternaryButton ? (React.createElement(ButtonBar, { id: `${
|
|
2192
|
-
tertiaryButton || quarternaryButton ? (React.createElement("div", { id: `${
|
|
2172
|
+
React.createElement(ContentWrapper, { id: `${baseId}-content-wrapper` }, children),
|
|
2173
|
+
primaryButton || secondaryButton || tertiaryButton || quarternaryButton ? (React.createElement(ButtonBar, { id: `${baseId}-button-bar` },
|
|
2174
|
+
tertiaryButton || quarternaryButton ? (React.createElement("div", { id: `${baseId}-left-buttons`, style: {
|
|
2193
2175
|
marginRight: 'auto',
|
|
2194
2176
|
paddingRight: 40,
|
|
2195
2177
|
display: 'flex',
|
|
2196
2178
|
alignItems: 'center',
|
|
2197
2179
|
} },
|
|
2198
|
-
tertiaryButton ? (React.createElement(Button, Object.assign({}, tertiaryButton, { format: tertiaryButton.format || 'secondary', id: `${
|
|
2199
|
-
quarternaryButton ? (React.createElement(ButtonContainer, { id: `${
|
|
2200
|
-
React.createElement(Button, Object.assign({}, quarternaryButton, { format: quarternaryButton.format || 'secondary', id: `${
|
|
2201
|
-
primaryButton || secondaryButton ? (React.createElement("div", { id: `${
|
|
2180
|
+
tertiaryButton ? (React.createElement(Button, Object.assign({}, tertiaryButton, { format: tertiaryButton.format || 'secondary', id: `${baseId}-tertiary-button` }))) : null,
|
|
2181
|
+
quarternaryButton ? (React.createElement(ButtonContainer, { id: `${baseId}-quarternary-button-container` },
|
|
2182
|
+
React.createElement(Button, Object.assign({}, quarternaryButton, { format: quarternaryButton.format || 'secondary', id: `${baseId}-quarternary-button` })))) : null)) : null,
|
|
2183
|
+
primaryButton || secondaryButton ? (React.createElement("div", { id: `${baseId}-right-buttons`, style: {
|
|
2202
2184
|
marginLeft: 'auto',
|
|
2203
2185
|
paddingLeft: 40,
|
|
2204
2186
|
display: 'flex',
|
|
2205
2187
|
alignItems: 'center',
|
|
2206
2188
|
} },
|
|
2207
|
-
secondaryButton ? (React.createElement(ButtonContainer, { id: `${
|
|
2208
|
-
React.createElement(Button, Object.assign({}, secondaryButton, { format: secondaryButton.format || 'secondary', id: `${
|
|
2209
|
-
primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { format: primaryButton.format || 'primary', id: `${
|
|
2189
|
+
secondaryButton ? (React.createElement(ButtonContainer, { id: `${baseId}-secondary-button-container` },
|
|
2190
|
+
React.createElement(Button, Object.assign({}, secondaryButton, { format: secondaryButton.format || 'secondary', id: `${baseId}-secondary-button` })))) : null,
|
|
2191
|
+
primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { format: primaryButton.format || 'primary', id: `${baseId}-primary-button` }))) : null)) : null)) : null)));
|
|
2210
2192
|
};
|
|
2211
2193
|
|
|
2212
2194
|
const Wrapper$5 = styled.div `
|
|
@@ -2295,23 +2277,23 @@ const SearchInput = styled.input `
|
|
|
2295
2277
|
white-space: nowrap;
|
|
2296
2278
|
`;
|
|
2297
2279
|
const MultiSelect = (_a) => {
|
|
2298
|
-
var { readOnly, displayCount = 3, invalid, onChange, options = [], selected = [], showSelectAll, searchable = false, style } = _a, accessibleProps = __rest(_a, ["readOnly", "displayCount", "invalid", "onChange", "options", "selected", "showSelectAll", "searchable", "style"]);
|
|
2280
|
+
var { readOnly, displayCount = 3, invalid, onChange, options = [], selected = [], showSelectAll, searchable = false, style, id } = _a, accessibleProps = __rest(_a, ["readOnly", "displayCount", "invalid", "onChange", "options", "selected", "showSelectAll", "searchable", "style", "id"]);
|
|
2299
2281
|
const [showOptions, setShowOptions] = React.useState(false);
|
|
2300
2282
|
const selected_options = options.filter(o => selected.includes(o.value));
|
|
2301
2283
|
const [filter, setFilter] = React.useState('');
|
|
2302
|
-
const
|
|
2284
|
+
const baseId = id || 'multiselect';
|
|
2303
2285
|
// Filter the options based on the filter state
|
|
2304
2286
|
const filteredOptions = options.filter(o => { var _a, _b; return ((_a = o.label) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(filter)) || ((_b = o.value) === null || _b === void 0 ? void 0 : _b.toString().toLowerCase().includes(filter)); });
|
|
2305
|
-
return (React.createElement(Wrapper$5, { "$style": style, id: `${
|
|
2306
|
-
searchable && (React.createElement(SearchInput, { id: `${
|
|
2307
|
-
React.createElement(Trigger, Object.assign({ "$invalid": invalid, "$readOnly": readOnly, "$showOptions": showOptions, id: `${
|
|
2308
|
-
React.createElement(Value, { id: `${
|
|
2287
|
+
return (React.createElement(Wrapper$5, { "$style": style, id: `${baseId}-wrapper` },
|
|
2288
|
+
searchable && (React.createElement(SearchInput, { id: `${baseId}-search-input`, onChange: e => setFilter(e.target.value), onClick: () => setShowOptions(!showOptions), placeholder: `${showSelectAll ? options.length : selected_options.length} Selected`, type: 'text', value: filter })),
|
|
2289
|
+
React.createElement(Trigger, Object.assign({ "$invalid": invalid, "$readOnly": readOnly, "$showOptions": showOptions, id: `${baseId}-trigger`, onClick: readOnly ? undefined : setShowOptions.bind(null, !showOptions) }, accessibleProps),
|
|
2290
|
+
React.createElement(Value, { id: `${baseId}-value` }, selected.length > 0 && selected.length <= displayCount
|
|
2309
2291
|
? selected_options.map(o => o.label || o.value).join(', ')
|
|
2310
2292
|
: `${selected_options.length} Selected`),
|
|
2311
|
-
React.createElement(Icon, { color: Colors.BLACK.Hex, id: `${
|
|
2312
|
-
showOptions ? (React.createElement(Options, { id: `${
|
|
2313
|
-
React.createElement(Checklist, { id: `${
|
|
2314
|
-
showOptions ? (React.createElement(Scrim, { id: `${
|
|
2293
|
+
React.createElement(Icon, { color: Colors.BLACK.Hex, id: `${baseId}-icon`, path: showOptions ? js.mdiChevronUp : js.mdiChevronDown, size: '22px' })),
|
|
2294
|
+
showOptions ? (React.createElement(Options, { id: `${baseId}-options` },
|
|
2295
|
+
React.createElement(Checklist, { id: `${baseId}-checklist`, onChange: onChange, options: filteredOptions, selected: selected, showSelectAll: showSelectAll }))) : null,
|
|
2296
|
+
showOptions ? (React.createElement(Scrim, { id: `${baseId}-scrim`, onClick: setShowOptions.bind(null, !showOptions) })) : null));
|
|
2315
2297
|
};
|
|
2316
2298
|
|
|
2317
2299
|
const Wrapper$4 = styled.div `
|
|
@@ -2344,27 +2326,27 @@ const Actions = styled.div `
|
|
|
2344
2326
|
align-items: center;
|
|
2345
2327
|
gap: 8px;
|
|
2346
2328
|
`;
|
|
2347
|
-
const PageHeader = ({ title = '', breadcrumbs, actions, buttonMenu, tag }) => {
|
|
2329
|
+
const PageHeader = ({ title = '', breadcrumbs, actions, buttonMenu, tag, id, }) => {
|
|
2348
2330
|
const { format = 'primary', menuItems = [], label = '', enableHover = true, enableClick = false, show = false, } = buttonMenu || {};
|
|
2349
|
-
const
|
|
2350
|
-
return (React.createElement(Wrapper$4, { id: `${
|
|
2351
|
-
React.createElement(Info, { id: `${
|
|
2352
|
-
React.createElement(Title, { id: `${
|
|
2353
|
-
React.createElement(Heading, { id: `${
|
|
2354
|
-
tag ? React.createElement(Tag, Object.assign({}, tag, { id: `${
|
|
2355
|
-
breadcrumbs ? (React.createElement(Breadcrumbs, { id: `${
|
|
2356
|
-
const crumbId =
|
|
2331
|
+
const baseId = id || 'page-header';
|
|
2332
|
+
return (React.createElement(Wrapper$4, { id: `${baseId}-wrapper` },
|
|
2333
|
+
React.createElement(Info, { id: `${baseId}-info` },
|
|
2334
|
+
React.createElement(Title, { id: `${baseId}-title` },
|
|
2335
|
+
React.createElement(Heading, { id: `${baseId}-heading`, type: 'secondary' }, title),
|
|
2336
|
+
tag ? React.createElement(Tag, Object.assign({}, tag, { id: `${baseId}-tag` })) : null),
|
|
2337
|
+
breadcrumbs ? (React.createElement(Breadcrumbs, { id: `${baseId}-breadcrumbs` }, breadcrumbs.map((crumb, i) => {
|
|
2338
|
+
const crumbId = `${baseId}-breadcrumb-${i}`;
|
|
2357
2339
|
return (React.createElement(React.Fragment, { key: i },
|
|
2358
2340
|
crumb.onClick ? (React.createElement(Link, { id: `${crumbId}-link`, onClick: crumb.onClick, small: true }, crumb.label)) : (React.createElement(Copy, { id: `${crumbId}-copy`, type: 'small' }, crumb.label)),
|
|
2359
2341
|
i + 1 < breadcrumbs.length ? (React.createElement(Icon.Icon, { id: `${crumbId}-icon`, path: js.mdiChevronRight, size: '14px' })) : null));
|
|
2360
2342
|
}))) : null),
|
|
2361
|
-
actions ? (React.createElement(Actions, { id: `${
|
|
2343
|
+
actions ? (React.createElement(Actions, { id: `${baseId}-actions` },
|
|
2362
2344
|
actions.map((action, i) => {
|
|
2363
2345
|
const { label } = action, buttonProps = __rest(action, ["label"]);
|
|
2364
|
-
const actionId =
|
|
2346
|
+
const actionId = `${baseId}-action-${i}`;
|
|
2365
2347
|
return (React.createElement(Button, Object.assign({}, buttonProps, { id: `${actionId}-button`, key: i, small: true }), label));
|
|
2366
2348
|
}),
|
|
2367
|
-
menuItems.length ? (React.createElement(ButtonMenu, { enableClick: enableClick, enableHover: enableHover, format: format, label: label, menuItems: menuItems, show: show, small: true })) : null)) : null));
|
|
2349
|
+
menuItems.length ? (React.createElement(ButtonMenu, { enableClick: enableClick, enableHover: enableHover, format: format, id: `${baseId}-button-menu`, label: label, menuItems: menuItems, show: show, small: true })) : null)) : null));
|
|
2368
2350
|
};
|
|
2369
2351
|
|
|
2370
2352
|
const Wrapper$3 = styled.nav `
|
|
@@ -2374,7 +2356,7 @@ const Wrapper$3 = styled.nav `
|
|
|
2374
2356
|
column-gap: 10px;
|
|
2375
2357
|
`;
|
|
2376
2358
|
const Pagination = (_a) => {
|
|
2377
|
-
var { currentPage = 1, onClick, pageCount = 0 } = _a, accessibleProps = __rest(_a, ["currentPage", "onClick", "pageCount"]);
|
|
2359
|
+
var { currentPage = 1, onClick, pageCount = 0, id } = _a, accessibleProps = __rest(_a, ["currentPage", "onClick", "pageCount", "id"]);
|
|
2378
2360
|
const is_first_page = currentPage === 1;
|
|
2379
2361
|
const is_last_page = currentPage === pageCount;
|
|
2380
2362
|
const handlePrevClick = () => {
|
|
@@ -2393,14 +2375,14 @@ const Pagination = (_a) => {
|
|
|
2393
2375
|
onClick(new_page);
|
|
2394
2376
|
}
|
|
2395
2377
|
};
|
|
2396
|
-
const
|
|
2397
|
-
return (React.createElement(Wrapper$3, Object.assign({}, accessibleProps, { id: `${
|
|
2398
|
-
React.createElement(Button, { disabled: is_first_page, icon: js.mdiChevronLeft, id: `${
|
|
2399
|
-
React.createElement(Select, { id: `${
|
|
2378
|
+
const baseId = id || 'pagination';
|
|
2379
|
+
return (React.createElement(Wrapper$3, Object.assign({}, accessibleProps, { id: `${baseId}-wrapper` }),
|
|
2380
|
+
React.createElement(Button, { disabled: is_first_page, icon: js.mdiChevronLeft, id: `${baseId}-prev-button`, onClick: handlePrevClick, small: true }),
|
|
2381
|
+
React.createElement(Select, { id: `${baseId}-select`, onChange: handlePageChange, options: Array.from(Array(pageCount).keys(), p => p + 1).map(p => ({
|
|
2400
2382
|
label: `Page ${p}`,
|
|
2401
2383
|
value: `${p}`,
|
|
2402
2384
|
})), value: `${currentPage}` }),
|
|
2403
|
-
React.createElement(Button, { disabled: is_last_page, icon: js.mdiChevronRight, id: `${
|
|
2385
|
+
React.createElement(Button, { disabled: is_last_page, icon: js.mdiChevronRight, id: `${baseId}-next-button`, onClick: handleNextClick, small: true })));
|
|
2404
2386
|
};
|
|
2405
2387
|
|
|
2406
2388
|
const Wrapper$2 = styled.label `
|
|
@@ -2479,21 +2461,23 @@ const Label = styled.span `
|
|
|
2479
2461
|
margin-left: 6px;
|
|
2480
2462
|
`;
|
|
2481
2463
|
const Radio = (_a) => {
|
|
2482
|
-
var { children, disabled, checked, onChange, value, invalid, tooltip, tabIndex } = _a, accessibleProps = __rest(_a, ["children", "disabled", "checked", "onChange", "value", "invalid", "tooltip", "tabIndex"]);
|
|
2483
|
-
const
|
|
2484
|
-
return (React.createElement(Wrapper$2, Object.assign({}, accessibleProps, { id: `${
|
|
2485
|
-
React.createElement(Input, { checked: checked, disabled: disabled, id: `${
|
|
2486
|
-
React.createElement(Check, { "$invalid": invalid, id: `${
|
|
2487
|
-
React.createElement(Label, { id: `${
|
|
2464
|
+
var { children, disabled, checked, onChange, value, invalid, tooltip, tabIndex, id } = _a, accessibleProps = __rest(_a, ["children", "disabled", "checked", "onChange", "value", "invalid", "tooltip", "tabIndex", "id"]);
|
|
2465
|
+
const baseId = id || 'radio';
|
|
2466
|
+
return (React.createElement(Wrapper$2, Object.assign({}, accessibleProps, { id: `${baseId}-wrapper` }),
|
|
2467
|
+
React.createElement(Input, { checked: checked, disabled: disabled, id: `${baseId}-input`, name: accessibleProps.name, onChange: disabled ? undefined : onChange, tabIndex: disabled ? -1 : tabIndex, type: 'radio', value: value }),
|
|
2468
|
+
React.createElement(Check, { "$invalid": invalid, id: `${baseId}-check` }),
|
|
2469
|
+
React.createElement(Label, { id: `${baseId}-label` },
|
|
2488
2470
|
children,
|
|
2489
2471
|
tooltip ? React.createElement(Tooltip, Object.assign({}, tooltip)) : null)));
|
|
2490
2472
|
};
|
|
2491
2473
|
|
|
2492
2474
|
const RadioList = (_a) => {
|
|
2493
|
-
var { disabled, onChange, options, value } = _a, accessibleProps = __rest(_a, ["disabled", "onChange", "options", "value"]);
|
|
2494
|
-
|
|
2475
|
+
var { disabled, onChange, options, value, id } = _a, accessibleProps = __rest(_a, ["disabled", "onChange", "options", "value", "id"]);
|
|
2476
|
+
const baseId = id || 'radio-list';
|
|
2477
|
+
return (React.createElement(React.Fragment, null, options.map((option, index) => {
|
|
2495
2478
|
const label = option.label || option.value;
|
|
2496
|
-
|
|
2479
|
+
const optionId = `${baseId}-option-${index}`;
|
|
2480
|
+
return (React.createElement(Radio, Object.assign({ checked: value === option.value, disabled: disabled, id: optionId, key: option.value, onChange: onChange, value: option.value }, accessibleProps), label));
|
|
2497
2481
|
})));
|
|
2498
2482
|
};
|
|
2499
2483
|
|
|
@@ -2561,21 +2545,21 @@ const StyledIcon$1 = styled(Icon) `
|
|
|
2561
2545
|
`;
|
|
2562
2546
|
StyledIcon$1.defaultProps = { theme: EditableTheme };
|
|
2563
2547
|
const Table = (_a) => {
|
|
2564
|
-
var { columns = [], data = [], sortBy, sortDirection, hideHeaders, onRowClick, onSortChange, tableLayout } = _a, accessibleProps = __rest(_a, ["columns", "data", "sortBy", "sortDirection", "hideHeaders", "onRowClick", "onSortChange", "tableLayout"]);
|
|
2565
|
-
const
|
|
2566
|
-
return (React.createElement(StyledTable, Object.assign({ "$tableLayout": tableLayout }, accessibleProps, { id: `${
|
|
2567
|
-
hideHeaders ? null : (React.createElement("thead", { id: `${
|
|
2568
|
-
React.createElement("tr", { id: `${
|
|
2569
|
-
const columnId =
|
|
2548
|
+
var { columns = [], data = [], sortBy, sortDirection, hideHeaders, onRowClick, onSortChange, tableLayout, id } = _a, accessibleProps = __rest(_a, ["columns", "data", "sortBy", "sortDirection", "hideHeaders", "onRowClick", "onSortChange", "tableLayout", "id"]);
|
|
2549
|
+
const baseId = id || 'table';
|
|
2550
|
+
return (React.createElement(StyledTable, Object.assign({ "$tableLayout": tableLayout }, accessibleProps, { id: `${baseId}-styled-table` }),
|
|
2551
|
+
hideHeaders ? null : (React.createElement("thead", { id: `${baseId}-thead` },
|
|
2552
|
+
React.createElement("tr", { id: `${baseId}-header-row` }, columns.map((column, i) => {
|
|
2553
|
+
const columnId = `${baseId}-column-${i}`;
|
|
2570
2554
|
return (React.createElement(Header, { "$isSortable": column.isSortable, "$width": column.width, id: `${columnId}-header`, key: i, onClick: onSortChange === null || onSortChange === void 0 ? void 0 : onSortChange.bind(null, column.id) },
|
|
2571
2555
|
column.label,
|
|
2572
2556
|
column.isSortable && sortBy === column.id ? (React.createElement(IconWrapper, { id: `${columnId}-icon-wrapper` },
|
|
2573
2557
|
React.createElement(StyledIcon$1, { id: `${columnId}-icon`, path: sortDirection === 'asc' ? js.mdiChevronUp : js.mdiChevronDown, size: '20px' }))) : null));
|
|
2574
2558
|
})))),
|
|
2575
|
-
data.length ? (React.createElement("tbody", { id: `${
|
|
2576
|
-
const rowId =
|
|
2559
|
+
data.length ? (React.createElement("tbody", { id: `${baseId}-tbody` }, data.map((row, i) => {
|
|
2560
|
+
const rowId = `${baseId}-row-${i}`;
|
|
2577
2561
|
return (React.createElement(Row, { "$bgColor": i % 2 === 0 ? '#ffffff' : '#f9f9f9', "$isClickable": !!onRowClick, id: `${rowId}-row`, key: i, onClick: onRowClick ? onRowClick.bind(null, row) : undefined }, columns.map((column, j) => {
|
|
2578
|
-
const columnId =
|
|
2562
|
+
const columnId = `${baseId}-column-${j}`;
|
|
2579
2563
|
return (React.createElement(Column, { "$align": columns[j].align, "$width": columns[j].width, id: `${columnId}-column`, key: j }, column.render ? column.render(row) : row[column.id] || 'N/A'));
|
|
2580
2564
|
})));
|
|
2581
2565
|
}))) : null));
|
|
@@ -2631,11 +2615,11 @@ const Badge = styled.div `
|
|
|
2631
2615
|
`;
|
|
2632
2616
|
Badge.defaultProps = { theme: EditableTheme };
|
|
2633
2617
|
const Tabs = (_a) => {
|
|
2634
|
-
var { tabs } = _a, accessibleProps = __rest(_a, ["tabs"]);
|
|
2635
|
-
const
|
|
2636
|
-
return (React.createElement(Wrapper$1, Object.assign({}, accessibleProps, { id: `${
|
|
2618
|
+
var { tabs, id } = _a, accessibleProps = __rest(_a, ["tabs", "id"]);
|
|
2619
|
+
const baseId = id || 'tabs';
|
|
2620
|
+
return (React.createElement(Wrapper$1, Object.assign({}, accessibleProps, { id: `${baseId}-wrapper` }), tabs.map((_a, i) => {
|
|
2637
2621
|
var { isActive, label, badgeCount, errorBadge, onClick } = _a, accessibleProps = __rest(_a, ["isActive", "label", "badgeCount", "errorBadge", "onClick"]);
|
|
2638
|
-
const tabId =
|
|
2622
|
+
const tabId = `${baseId}-tab-${i}`;
|
|
2639
2623
|
return (React.createElement(Tab, Object.assign({ "$isActive": isActive || false, key: i, onClick: isActive ? undefined : onClick }, accessibleProps, { id: `${tabId}-tab` }),
|
|
2640
2624
|
badgeCount ? (React.createElement(Badge, { "$isError": errorBadge || false, id: `${tabId}-badge` }, badgeCount)) : null,
|
|
2641
2625
|
label));
|
|
@@ -2666,12 +2650,12 @@ const Handle = styled.div `
|
|
|
2666
2650
|
box-sizing: border-box;
|
|
2667
2651
|
`;
|
|
2668
2652
|
const Toggle = (_a) => {
|
|
2669
|
-
var { onClick, on } = _a, accessibleProps = __rest(_a, ["onClick", "on"]);
|
|
2670
|
-
const
|
|
2671
|
-
return (React.createElement(Track, Object.assign({ "$on": on, onClick: onClick }, accessibleProps, { id: `${
|
|
2672
|
-
React.createElement("input", { checked: on, id: `${
|
|
2673
|
-
React.createElement(Handle, { "$on": on, id: `${
|
|
2674
|
-
React.createElement(Icon, { color: on ? Colors.GREEN.Hex : Colors.BLACK.Hex, id: `${
|
|
2653
|
+
var { onClick, on, id } = _a, accessibleProps = __rest(_a, ["onClick", "on", "id"]);
|
|
2654
|
+
const baseId = id || 'toggle';
|
|
2655
|
+
return (React.createElement(Track, Object.assign({ "$on": on, onClick: onClick }, accessibleProps, { id: `${baseId}-track` }),
|
|
2656
|
+
React.createElement("input", { checked: on, id: `${baseId}-input`, name: accessibleProps.name, type: 'hidden' }),
|
|
2657
|
+
React.createElement(Handle, { "$on": on, id: `${baseId}-handle` },
|
|
2658
|
+
React.createElement(Icon, { color: on ? Colors.GREEN.Hex : Colors.BLACK.Hex, id: `${baseId}-icon`, path: on ? js.mdiCheck : js.mdiClose, size: '16px' }))));
|
|
2675
2659
|
};
|
|
2676
2660
|
Toggle.defaultProps = {};
|
|
2677
2661
|
|
|
@@ -2701,15 +2685,15 @@ const StyledIcon = styled.div `
|
|
|
2701
2685
|
background: #f5f5f5;
|
|
2702
2686
|
`;
|
|
2703
2687
|
const ZeroState = (_a) => {
|
|
2704
|
-
var { icon, title, description, action } = _a, accessibleProps = __rest(_a, ["icon", "title", "description", "action"]);
|
|
2705
|
-
const
|
|
2706
|
-
return (React.createElement(Container, Object.assign({}, accessibleProps, { id: `${
|
|
2707
|
-
React.createElement(StyledIcon, { id: `${
|
|
2708
|
-
React.createElement(Icon, { color: Colors.MEDIUM_GRAY.Hex, id: `${
|
|
2709
|
-
React.createElement(Wrapper, { id: `${
|
|
2710
|
-
React.createElement(Heading, { children: title, id: `${
|
|
2711
|
-
description && (React.createElement(Copy, { align: 'center', children: description, color: 'GRAY', id: `${
|
|
2712
|
-
action && (React.createElement(Button, { children: action.children, disabled: action.disabled, format: action.format, icon: action.icon, id: `${
|
|
2688
|
+
var { icon, title, description, action, id } = _a, accessibleProps = __rest(_a, ["icon", "title", "description", "action", "id"]);
|
|
2689
|
+
const baseId = id || 'zero-state';
|
|
2690
|
+
return (React.createElement(Container, Object.assign({}, accessibleProps, { id: `${baseId}-container` }),
|
|
2691
|
+
React.createElement(StyledIcon, { id: `${baseId}-icon-wrapper` },
|
|
2692
|
+
React.createElement(Icon, { color: Colors.MEDIUM_GRAY.Hex, id: `${baseId}-icon`, path: icon, size: '40px' })),
|
|
2693
|
+
React.createElement(Wrapper, { id: `${baseId}-wrapper` },
|
|
2694
|
+
React.createElement(Heading, { children: title, id: `${baseId}-heading`, type: 'tertiary' }),
|
|
2695
|
+
description && (React.createElement(Copy, { align: 'center', children: description, color: 'GRAY', id: `${baseId}-description`, type: 'default' }))),
|
|
2696
|
+
action && (React.createElement(Button, { children: action.children, disabled: action.disabled, format: action.format, icon: action.icon, id: `${baseId}-button`, onClick: action.onClick }))));
|
|
2713
2697
|
};
|
|
2714
2698
|
|
|
2715
2699
|
exports.Accordion = Accordion;
|