@hexure/ui 1.13.31 → 1.13.33
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 +438 -377
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/Button/Button.d.ts +1 -0
- package/dist/cjs/types/components/ProgressBar/ProgressBar.d.ts +0 -1
- package/dist/cjs/types/utils/GenerateUniqueIds.d.ts +1 -0
- package/dist/esm/index.js +390 -329
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Button/Button.d.ts +1 -0
- package/dist/esm/types/components/ProgressBar/ProgressBar.d.ts +0 -1
- package/dist/esm/types/utils/GenerateUniqueIds.d.ts +1 -0
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
- /package/dist/cjs/types/components/{MultiSelect → Multiselect}/MultiSelect.d.ts +0 -0
- /package/dist/cjs/types/components/{MultiSelect → Multiselect}/index.d.ts +0 -0
- /package/dist/esm/types/components/{MultiSelect → Multiselect}/MultiSelect.d.ts +0 -0
- /package/dist/esm/types/components/{MultiSelect → Multiselect}/index.d.ts +0 -0
package/dist/cjs/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var React = require('react');
|
|
4
|
-
var styled = require('styled-components');
|
|
5
|
-
var Icon = require('@mdi/react');
|
|
6
|
-
var js = require('@mdi/js');
|
|
7
|
-
var dayjs = require('dayjs');
|
|
8
|
-
var Numeral = require('numeral');
|
|
9
|
-
var Moment = require('moment');
|
|
10
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var styled = require('styled-components');
|
|
5
|
+
var Icon = require('@mdi/react');
|
|
6
|
+
var js = require('@mdi/js');
|
|
7
|
+
var dayjs = require('dayjs');
|
|
8
|
+
var Numeral = require('numeral');
|
|
9
|
+
var Moment = require('moment');
|
|
10
|
+
|
|
11
11
|
/******************************************************************************
|
|
12
12
|
Copyright (c) Microsoft Corporation.
|
|
13
13
|
|
|
@@ -21,22 +21,22 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
21
21
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
22
22
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
23
23
|
PERFORMANCE OF THIS SOFTWARE.
|
|
24
|
-
***************************************************************************** */
|
|
25
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
26
|
-
|
|
27
|
-
function __rest(s, e) {
|
|
28
|
-
var t = {};
|
|
29
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
30
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
32
|
-
}
|
|
33
|
-
return t;
|
|
34
|
-
}
|
|
35
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
36
|
-
var e = new Error(message);
|
|
37
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
38
|
-
};
|
|
39
|
-
|
|
24
|
+
***************************************************************************** */
|
|
25
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
26
|
+
|
|
27
|
+
function __rest(s, e) {
|
|
28
|
+
var t = {};
|
|
29
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
30
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
32
|
+
}
|
|
33
|
+
return t;
|
|
34
|
+
}
|
|
35
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
36
|
+
var e = new Error(message);
|
|
37
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
40
|
const Colors = {
|
|
41
41
|
PRIMARY: {
|
|
42
42
|
Hex: '#0193D7',
|
|
@@ -85,8 +85,17 @@ const FontSizes = {
|
|
|
85
85
|
};
|
|
86
86
|
const EditableTheme = {
|
|
87
87
|
PRIMARY_COLOR: Colors.PRIMARY,
|
|
88
|
-
};
|
|
89
|
-
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
//function to generate unique ids
|
|
91
|
+
const generateUniqueId = (() => {
|
|
92
|
+
let counter = 0;
|
|
93
|
+
return (prefix = 'id') => {
|
|
94
|
+
counter += 1;
|
|
95
|
+
return `${prefix}-${counter}`;
|
|
96
|
+
};
|
|
97
|
+
})();
|
|
98
|
+
|
|
90
99
|
const Header$3 = styled.div `
|
|
91
100
|
display: flex;
|
|
92
101
|
align-items: center;
|
|
@@ -108,13 +117,14 @@ const Title$2 = styled.div `
|
|
|
108
117
|
`;
|
|
109
118
|
const Accordion = (_a) => {
|
|
110
119
|
var { title, children, open, onClick } = _a, accessibleProps = __rest(_a, ["title", "children", "open", "onClick"]);
|
|
120
|
+
const id = generateUniqueId('accordion');
|
|
111
121
|
return (React.createElement(React.Fragment, null,
|
|
112
|
-
React.createElement(Header$3, Object.assign({ onClick: onClick }, accessibleProps),
|
|
113
|
-
React.createElement(Title$2,
|
|
114
|
-
React.createElement(Icon, { color: Colors.BLACK.Hex, path: open ? js.mdiChevronUp : js.mdiChevronDown, size: '24px' })),
|
|
115
|
-
open ? children : null));
|
|
116
|
-
};
|
|
117
|
-
|
|
122
|
+
React.createElement(Header$3, Object.assign({ id: `${id}-header`, onClick: onClick }, accessibleProps),
|
|
123
|
+
React.createElement(Title$2, { id: `${id}-title` }, title),
|
|
124
|
+
React.createElement(Icon, { color: Colors.BLACK.Hex, id: `${id}-icon`, path: open ? js.mdiChevronUp : js.mdiChevronDown, size: '24px' })),
|
|
125
|
+
open ? React.createElement("div", { id: `${id}-content` }, children) : null));
|
|
126
|
+
};
|
|
127
|
+
|
|
118
128
|
const StyledComponent = styled.p `
|
|
119
129
|
color: ${props => Colors[props.$color || 'BLACK'].Hex};
|
|
120
130
|
font-size: ${props => (props.$type === 'small' ? FontSizes.SMALL : FontSizes.DEFAULT)};
|
|
@@ -129,13 +139,15 @@ const StyledComponent = styled.p `
|
|
|
129
139
|
text-align: ${props => props.$align || 'left'};
|
|
130
140
|
box-sizing: border-box;
|
|
131
141
|
`;
|
|
132
|
-
const Copy = (
|
|
133
|
-
|
|
142
|
+
const Copy = (_a) => {
|
|
143
|
+
var { children, align = '', margin = '', padding = '', type = 'default', color = 'BLACK' } = _a, accessibleProps = __rest(_a, ["children", "align", "margin", "padding", "type", "color"]);
|
|
144
|
+
const id = generateUniqueId('copy');
|
|
145
|
+
return (React.createElement(StyledComponent, Object.assign({ "$align": align, "$color": color, "$margin": margin, "$padding": padding, "$type": type, id: `${id}-styled-component` }, accessibleProps), children));
|
|
134
146
|
};
|
|
135
147
|
Copy.defaultProps = {
|
|
136
148
|
type: 'default',
|
|
137
|
-
};
|
|
138
|
-
|
|
149
|
+
};
|
|
150
|
+
|
|
139
151
|
const Wrapper$h = styled.div `
|
|
140
152
|
display: inline-block;
|
|
141
153
|
position: relative;
|
|
@@ -181,11 +193,12 @@ const Content$3 = styled.div(props => (Object.assign({ position: 'absolute', bor
|
|
|
181
193
|
Content$3.defaultProps = { theme: EditableTheme };
|
|
182
194
|
const Tooltip = ({ children, position = 'right-top', width = '240px', trigger, }) => {
|
|
183
195
|
const [show_content, toggleContent] = React.useState(false);
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
};
|
|
188
|
-
|
|
196
|
+
const id = generateUniqueId('tooltip');
|
|
197
|
+
return (React.createElement(Wrapper$h, { id: `${id}-wrapper`, onMouseEnter: toggleContent.bind(null, true), onMouseLeave: toggleContent.bind(null, false) },
|
|
198
|
+
trigger || React.createElement(StyledIcon$6, { id: `${id}-icon`, path: js.mdiInformationOutline }),
|
|
199
|
+
show_content ? (React.createElement(Content$3, { "$position": position, "$width": width, id: `${id}-content` }, children && (React.createElement(Copy, { id: `${id}-copy`, type: 'small' }, children)))) : null));
|
|
200
|
+
};
|
|
201
|
+
|
|
189
202
|
const StyledButton = styled.button `
|
|
190
203
|
height: ${props => (props.$small ? '30px' : '40px')};
|
|
191
204
|
line-height: 1em;
|
|
@@ -217,6 +230,8 @@ const StyledButton = styled.button `
|
|
|
217
230
|
display: flex;
|
|
218
231
|
align-items: center;
|
|
219
232
|
justify-content: center;
|
|
233
|
+
gap: ${props => (props.$iconPosition === 'before' ? '8px' : '0px')};
|
|
234
|
+
flex-direction: ${props => (props.$iconPosition === 'before' ? 'row-reverse' : 'row')};
|
|
220
235
|
opacity: ${props => (props.$disabled ? 0.6 : 0.9)};
|
|
221
236
|
border-width: 1px;
|
|
222
237
|
border-style: solid;
|
|
@@ -261,7 +276,7 @@ const Badge$1 = styled.span `
|
|
|
261
276
|
margin-right: ${props => (props.$small ? '-5px' : '-10px')};
|
|
262
277
|
`;
|
|
263
278
|
const Button = (_a) => {
|
|
264
|
-
var { badge, children, disabled = false, icon, isForm = false, loading = false, margin = '', onClick, small = false, format = 'primary', toolTip, title = '' } = _a, accessibleProps = __rest(_a, ["badge", "children", "disabled", "icon", "isForm", "loading", "margin", "onClick", "small", "format", "toolTip", "title"]);
|
|
279
|
+
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"]);
|
|
265
280
|
const theme = React.useContext(styled.ThemeContext) || EditableTheme;
|
|
266
281
|
const has_children = children && children.length > 0;
|
|
267
282
|
const button_type_mapping = {
|
|
@@ -295,17 +310,18 @@ const Button = (_a) => {
|
|
|
295
310
|
},
|
|
296
311
|
};
|
|
297
312
|
const format_styles = button_type_mapping[format];
|
|
298
|
-
const
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
313
|
+
const id = generateUniqueId('button');
|
|
314
|
+
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: `${id}-styled-button` }),
|
|
315
|
+
children ? (React.createElement(Label$5, { "$content_color": format_styles.content_color, "$small": small, id: `${id}-label` }, children)) : null,
|
|
316
|
+
icon && !badge ? (React.createElement(StyledIcon$5, { "$hasChildren": !!has_children, id: `${id}-icon` },
|
|
317
|
+
React.createElement(Icon, { color: format ? format_styles === null || format_styles === void 0 ? void 0 : format_styles.content_color : '#fff', id: `${id}-icon-svg`, path: loading ? js.mdiLoading : icon, size: small ? '20px' : '24px', spin: loading }))) : null,
|
|
318
|
+
badge && !icon ? (React.createElement(Badge$1, { "$bg_color": format_styles.badge_bg_color, "$content_color": format_styles.badge_content_color, "$small": small, id: `${id}-badge` }, badge)) : null));
|
|
303
319
|
if (toolTip && Object.keys(toolTip).length) {
|
|
304
320
|
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));
|
|
305
321
|
}
|
|
306
322
|
return button_view;
|
|
307
|
-
};
|
|
308
|
-
|
|
323
|
+
};
|
|
324
|
+
|
|
309
325
|
const H1 = styled.h1 `
|
|
310
326
|
color: ${Colors.BLACK.Hex};
|
|
311
327
|
font-size: 30px;
|
|
@@ -338,23 +354,24 @@ const H3 = styled.h3 `
|
|
|
338
354
|
`;
|
|
339
355
|
const Heading = (_a) => {
|
|
340
356
|
var { bold, children, margin, padding, type } = _a, accessibleProps = __rest(_a, ["bold", "children", "margin", "padding", "type"]);
|
|
357
|
+
const id = generateUniqueId('heading');
|
|
341
358
|
switch (type) {
|
|
342
359
|
case 'secondary': {
|
|
343
|
-
return (React.createElement(H2, Object.assign({ "$bold": bold, "$margin": margin, "$padding": padding }, accessibleProps), children));
|
|
360
|
+
return (React.createElement(H2, Object.assign({ "$bold": bold, "$margin": margin, "$padding": padding }, accessibleProps, { id: `${id}-h2` }), children));
|
|
344
361
|
}
|
|
345
362
|
case 'tertiary': {
|
|
346
|
-
return (React.createElement(H3, Object.assign({ "$bold": bold, "$margin": margin, "$padding": padding }, accessibleProps), children));
|
|
363
|
+
return (React.createElement(H3, Object.assign({ "$bold": bold, "$margin": margin, "$padding": padding }, accessibleProps, { id: `${id}-h3` }), children));
|
|
347
364
|
}
|
|
348
365
|
default: {
|
|
349
|
-
return (React.createElement(H1, Object.assign({ "$bold": bold, "$margin": margin, "$padding": padding }, accessibleProps), children));
|
|
366
|
+
return (React.createElement(H1, Object.assign({ "$bold": bold, "$margin": margin, "$padding": padding }, accessibleProps, { id: `${id}-h1` }), children));
|
|
350
367
|
}
|
|
351
368
|
}
|
|
352
369
|
};
|
|
353
370
|
Heading.defaultProps = {
|
|
354
371
|
bold: false,
|
|
355
372
|
type: 'primary',
|
|
356
|
-
};
|
|
357
|
-
|
|
373
|
+
};
|
|
374
|
+
|
|
358
375
|
const Wrapper$g = styled.div `
|
|
359
376
|
position: fixed;
|
|
360
377
|
top: 0;
|
|
@@ -379,16 +396,17 @@ const Buttons$1 = styled.div `
|
|
|
379
396
|
`;
|
|
380
397
|
const ActionDialog = (_a) => {
|
|
381
398
|
var { description, title, primaryButton, secondaryButton, tertiaryButton, style = {} } = _a, accessibleProps = __rest(_a, ["description", "title", "primaryButton", "secondaryButton", "tertiaryButton", "style"]);
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
};
|
|
391
|
-
|
|
399
|
+
const id = generateUniqueId('action-dialog');
|
|
400
|
+
return (React.createElement(Wrapper$g, Object.assign({}, accessibleProps, { id: `${id}-wrapper` }),
|
|
401
|
+
React.createElement(Container$4, { "$customStyle": style, id: `${id}-container`, open: true },
|
|
402
|
+
title ? (React.createElement(Heading, { id: `${id}-title`, margin: '0px 0px 20px 0px', type: 'secondary' }, title)) : null,
|
|
403
|
+
description ? (React.createElement(Copy, { align: 'center', id: `${id}-description` }, description)) : null,
|
|
404
|
+
primaryButton || secondaryButton || tertiaryButton ? (React.createElement(Buttons$1, { id: `${id}-buttons` },
|
|
405
|
+
tertiaryButton ? (React.createElement(Button, Object.assign({}, tertiaryButton, { format: tertiaryButton.format || 'secondary', id: `${id}-tertiary-button` }))) : null,
|
|
406
|
+
secondaryButton ? (React.createElement(Button, Object.assign({}, secondaryButton, { format: secondaryButton.format || 'secondary', id: `${id}-secondary-button` }))) : null,
|
|
407
|
+
primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { format: primaryButton.format || 'primary', id: `${id}-primary-button` }))) : null)) : null)));
|
|
408
|
+
};
|
|
409
|
+
|
|
392
410
|
const Wrapper$f = styled.div `
|
|
393
411
|
border: 1px solid #f1f1f1;
|
|
394
412
|
border-radius: 4px;
|
|
@@ -415,6 +433,7 @@ Action$1.defaultProps = { theme: EditableTheme };
|
|
|
415
433
|
const Alert = (_a) => {
|
|
416
434
|
var { action, type = 'info', title, description, small = false } = _a, accessibleProps = __rest(_a, ["action", "type", "title", "description", "small"]);
|
|
417
435
|
const theme = React.useContext(styled.ThemeContext) || EditableTheme;
|
|
436
|
+
const id = generateUniqueId('alert');
|
|
418
437
|
const type_mapping = {
|
|
419
438
|
info: {
|
|
420
439
|
color: theme.PRIMARY_COLOR.Hex,
|
|
@@ -433,14 +452,14 @@ const Alert = (_a) => {
|
|
|
433
452
|
icon: js.mdiCheckboxMarkedCircleOutline,
|
|
434
453
|
},
|
|
435
454
|
};
|
|
436
|
-
return (React.createElement(Wrapper$f, Object.assign({}, accessibleProps, { "$small": small, style: { borderLeftColor: type_mapping[type].color } }),
|
|
437
|
-
React.createElement(StyledIcon$4, { color: type_mapping[type].color, path: type_mapping[type].icon, size: small ? '20px' : '30px' }),
|
|
438
|
-
React.createElement("div",
|
|
439
|
-
title && !small ? (React.createElement(Heading, { bold: true, margin: '2px 0 0 0', type: 'tertiary' }, title)) : null,
|
|
440
|
-
description ? (React.createElement(Copy, { margin: small ? '' : '6px 0 0 0 !important' }, description)) : null,
|
|
441
|
-
action && !small ? React.createElement(Action$1, { onClick: action.onClick }, action.label) : null)));
|
|
442
|
-
};
|
|
443
|
-
|
|
455
|
+
return (React.createElement(Wrapper$f, Object.assign({}, accessibleProps, { "$small": small, id: `${id}-wrapper`, style: { borderLeftColor: type_mapping[type].color } }),
|
|
456
|
+
React.createElement(StyledIcon$4, { color: type_mapping[type].color, id: `${id}-icon`, path: type_mapping[type].icon, size: small ? '20px' : '30px' }),
|
|
457
|
+
React.createElement("div", { id: `${id}-content` },
|
|
458
|
+
title && !small ? (React.createElement(Heading, { bold: true, id: `${id}-title`, margin: '2px 0 0 0', type: 'tertiary' }, title)) : null,
|
|
459
|
+
description ? (React.createElement(Copy, { id: `${id}-description`, margin: small ? '' : '6px 0 0 0 !important' }, description)) : null,
|
|
460
|
+
action && !small ? (React.createElement(Action$1, { id: `${id}-action`, onClick: action.onClick }, action.label)) : null)));
|
|
461
|
+
};
|
|
462
|
+
|
|
444
463
|
const colorMapping = {
|
|
445
464
|
black: {
|
|
446
465
|
fill_1: '#000000',
|
|
@@ -466,23 +485,24 @@ const colorMapping = {
|
|
|
466
485
|
const Logo = (_a) => {
|
|
467
486
|
var { type = 'standard_full', height = '50px' } = _a, accessibleProps = __rest(_a, ["type", "height"]);
|
|
468
487
|
const type_parts = type.split('_');
|
|
488
|
+
const id = generateUniqueId('logo');
|
|
469
489
|
switch (type_parts[0]) {
|
|
470
490
|
case 'mark':
|
|
471
|
-
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),
|
|
472
|
-
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] })));
|
|
491
|
+
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: `${id}-svg` }),
|
|
492
|
+
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: `${id}-path` })));
|
|
473
493
|
default:
|
|
474
|
-
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),
|
|
475
|
-
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 }),
|
|
476
|
-
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 }),
|
|
477
|
-
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 }),
|
|
478
|
-
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 }),
|
|
479
|
-
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 }),
|
|
480
|
-
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 }),
|
|
481
|
-
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 }),
|
|
482
|
-
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 })));
|
|
494
|
+
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: `${id}-svg` }),
|
|
495
|
+
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: `${id}-path-1` }),
|
|
496
|
+
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: `${id}-path-2` }),
|
|
497
|
+
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: `${id}-path-3` }),
|
|
498
|
+
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: `${id}-path-4` }),
|
|
499
|
+
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: `${id}-path-5` }),
|
|
500
|
+
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: `${id}-path-6` }),
|
|
501
|
+
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: `${id}-path-7` }),
|
|
502
|
+
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: `${id}-path-8` })));
|
|
483
503
|
}
|
|
484
|
-
};
|
|
485
|
-
|
|
504
|
+
};
|
|
505
|
+
|
|
486
506
|
const Container$3 = styled.header `
|
|
487
507
|
width: 100%;
|
|
488
508
|
display: flex;
|
|
@@ -507,11 +527,12 @@ const Buttons = styled.div `
|
|
|
507
527
|
flex-direction: reverse;
|
|
508
528
|
`;
|
|
509
529
|
const AppHeader = ({ logoUrl, buttons = [] }) => {
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
React.createElement(
|
|
513
|
-
};
|
|
514
|
-
|
|
530
|
+
const id = generateUniqueId('app-header');
|
|
531
|
+
return (React.createElement(Container$3, { id: `${id}-container` },
|
|
532
|
+
React.createElement(LogoWrapper, { id: `${id}-logo-wrapper` }, logoUrl ? (React.createElement(Image, { id: `${id}-logo`, src: logoUrl })) : (React.createElement(Logo, { height: '30px', id: `${id}-default-logo` }))),
|
|
533
|
+
React.createElement(Buttons, { id: `${id}-buttons` }, buttons.map((b, i) => (React.createElement(Button, Object.assign({ key: i }, b, { id: `${id}-button-${i}` })))))));
|
|
534
|
+
};
|
|
535
|
+
|
|
515
536
|
const Wrapper$e = styled.div `
|
|
516
537
|
display: inline-block;
|
|
517
538
|
border-radius: 4px;
|
|
@@ -539,13 +560,14 @@ const Remove$1 = styled.div `
|
|
|
539
560
|
`;
|
|
540
561
|
const Tag = (_a) => {
|
|
541
562
|
var { children, color = 'PRIMARY', removable, onClick } = _a, accessibleProps = __rest(_a, ["children", "color", "removable", "onClick"]);
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
};
|
|
548
|
-
|
|
563
|
+
const id = generateUniqueId('tag');
|
|
564
|
+
return (React.createElement(Wrapper$e, Object.assign({ "$color": color, "$removable": removable, onClick: onClick }, accessibleProps, { id: `${id}-wrapper` }),
|
|
565
|
+
React.createElement(Content$2, { id: `${id}-content` },
|
|
566
|
+
React.createElement(Label$4, { "$color": color, id: `${id}-label` }, children),
|
|
567
|
+
removable ? (React.createElement(Remove$1, { id: `${id}-remove` },
|
|
568
|
+
React.createElement(Icon, { color: color === 'SUBTLE_GRAY' ? '#000000' : '#ffffff', id: `${id}-icon`, path: js.mdiClose, size: '15px' }))) : null)));
|
|
569
|
+
};
|
|
570
|
+
|
|
549
571
|
const SidebarContainer = styled.div `
|
|
550
572
|
border-right: 1px solid ${Colors.LIGHT_GRAY.Hex};
|
|
551
573
|
display: flex;
|
|
@@ -636,27 +658,32 @@ const SidebarMenuContainer = styled.div `
|
|
|
636
658
|
const AppMenu = ({ menu, isCollapsed, footerTag, defaultWidth = '280px' }) => {
|
|
637
659
|
const theme = React.useContext(styled.ThemeContext) || EditableTheme;
|
|
638
660
|
const [collapsed, toggleCollapse] = React.useState(isCollapsed);
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
661
|
+
const id = generateUniqueId('app-menu');
|
|
662
|
+
return (React.createElement(SidebarContainer, { "$isOpen": !collapsed, "$width": defaultWidth, id: `${id}-sidebar-container` },
|
|
663
|
+
React.createElement(SidebarMenuContainer, { id: `${id}-sidebar-menu-container` }, menu.map((nav_item, navIndex) => {
|
|
664
|
+
const navItemId = generateUniqueId(`nav-item-${navIndex}`);
|
|
665
|
+
return (React.createElement(React.Fragment, { key: navItemId },
|
|
666
|
+
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 : '' },
|
|
667
|
+
React.createElement(MenuIcon, { "$active": !!nav_item.is_active, id: `${navItemId}-menu-icon`, path: nav_item.icon }),
|
|
668
|
+
collapsed ? null : (React.createElement(MenuLabel, { "$active": nav_item.is_active, "$color": theme.PRIMARY_COLOR, id: `${navItemId}-menu-label` }, nav_item.label))),
|
|
669
|
+
nav_item.is_active && nav_item.menu && !collapsed ? (React.createElement(SubMenu, { id: `${navItemId}-sub-menu` }, nav_item.menu.map((menu_item, menuIndex) => {
|
|
670
|
+
const menuItemId = generateUniqueId(`menu-item-${menuIndex}`);
|
|
671
|
+
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));
|
|
672
|
+
}))) : null));
|
|
646
673
|
})),
|
|
647
|
-
React.createElement(Footer,
|
|
648
|
-
collapsed ? null : (React.createElement(FooterInfo,
|
|
649
|
-
footerTag ? React.createElement(Tag,
|
|
650
|
-
React.createElement(Copy, { margin: '8px 0 0 0', type: 'small' },
|
|
674
|
+
React.createElement(Footer, { id: `${id}-footer` },
|
|
675
|
+
collapsed ? null : (React.createElement(FooterInfo, { id: `${id}-footer-info` },
|
|
676
|
+
footerTag ? React.createElement(Tag, { id: `${id}-footer-tag` }, footerTag) : null,
|
|
677
|
+
React.createElement(Copy, { id: `${id}-footer-copy`, margin: '8px 0 0 0', type: 'small' },
|
|
651
678
|
"\u00A9 ",
|
|
652
679
|
new Date().getFullYear(),
|
|
653
680
|
" Hexure"))),
|
|
654
|
-
React.createElement(Button, { icon: collapsed ? js.mdiChevronRight : js.mdiChevronLeft, onClick: (e) => {
|
|
681
|
+
React.createElement(Button, { icon: collapsed ? js.mdiChevronRight : js.mdiChevronLeft, id: `${id}-collapse-button`, onClick: (e) => {
|
|
655
682
|
e.preventDefault();
|
|
656
683
|
toggleCollapse(!collapsed);
|
|
657
684
|
}, small: true }))));
|
|
658
|
-
};
|
|
659
|
-
|
|
685
|
+
};
|
|
686
|
+
|
|
660
687
|
const Wrapper$d = styled.div `
|
|
661
688
|
border: 1px solid ${props => props.theme.PRIMARY_COLOR.Hex};
|
|
662
689
|
border-radius: 8px;
|
|
@@ -727,19 +754,20 @@ const ErrorMsg = styled.span `
|
|
|
727
754
|
`;
|
|
728
755
|
const BulkActionBar = (_a) => {
|
|
729
756
|
var { actions = [], errorMsg, onClear, selectedCount = 0 } = _a, accessibleProps = __rest(_a, ["actions", "errorMsg", "onClear", "selectedCount"]);
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
757
|
+
const id = generateUniqueId('bulk-action-bar');
|
|
758
|
+
return (React.createElement(Wrapper$d, Object.assign({}, accessibleProps, { id: `${id}-wrapper` }),
|
|
759
|
+
React.createElement(Left, { id: `${id}-left` },
|
|
760
|
+
React.createElement(Info$1, { id: `${id}-info` },
|
|
761
|
+
React.createElement(Selected, { id: `${id}-selected` },
|
|
734
762
|
selectedCount,
|
|
735
763
|
" Selected"),
|
|
736
|
-
onClear ? React.createElement(Clear, { onClick: onClear }, "Clear") : null),
|
|
737
|
-
React.createElement(Actions$1,
|
|
738
|
-
errorMsg ? (React.createElement(Error$1,
|
|
739
|
-
React.createElement(Icon, { color: Colors.RED.Hex, path: js.mdiInformationOutline, size: '20px' }),
|
|
740
|
-
React.createElement(ErrorMsg,
|
|
741
|
-
};
|
|
742
|
-
|
|
764
|
+
onClear ? (React.createElement(Clear, { id: `${id}-clear`, onClick: onClear }, "Clear")) : null),
|
|
765
|
+
React.createElement(Actions$1, { id: `${id}-actions` }, actions.map((action, i) => (React.createElement(Button, Object.assign({}, action, { id: `${id}-action-${i}`, key: i, small: true })))))),
|
|
766
|
+
errorMsg ? (React.createElement(Error$1, { id: `${id}-error` },
|
|
767
|
+
React.createElement(Icon, { color: Colors.RED.Hex, id: `${id}-error-icon`, path: js.mdiInformationOutline, size: '20px' }),
|
|
768
|
+
React.createElement(ErrorMsg, { id: `${id}-error-msg` }, errorMsg))) : null));
|
|
769
|
+
};
|
|
770
|
+
|
|
743
771
|
const Wrapper$c = styled.div `
|
|
744
772
|
background: #fff;
|
|
745
773
|
border-radius: 8px;
|
|
@@ -786,20 +814,22 @@ Title$1.defaultProps = {
|
|
|
786
814
|
};
|
|
787
815
|
const MoreMenu = (_a) => {
|
|
788
816
|
var { maxHeight, menuItems = [] } = _a, accessibleProps = __rest(_a, ["maxHeight", "menuItems"]);
|
|
789
|
-
|
|
817
|
+
const id = generateUniqueId('more-menu');
|
|
818
|
+
return (React.createElement(Wrapper$c, Object.assign({ "$maxHeight": maxHeight }, accessibleProps, { id: `${id}-wrapper` }), menuItems.map((item, i) => {
|
|
790
819
|
var _a;
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
React.createElement(
|
|
820
|
+
const itemId = generateUniqueId(`menu-item-${i}`);
|
|
821
|
+
return (React.createElement(MenuItem, { id: `${itemId}-menu-item`, key: i, onClick: item.onClick },
|
|
822
|
+
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,
|
|
823
|
+
React.createElement(Title$1, { disabled: (_a = item.disabled) !== null && _a !== void 0 ? _a : false, id: `${itemId}-title` }, item.label)));
|
|
794
824
|
})));
|
|
795
|
-
};
|
|
796
|
-
|
|
825
|
+
};
|
|
826
|
+
|
|
797
827
|
const MenuWrapper = styled.div `
|
|
798
|
-
position: relative;
|
|
828
|
+
position: relative;
|
|
799
829
|
display: inline-block;
|
|
800
830
|
`;
|
|
801
831
|
const StyledMoreMenu = styled(MoreMenu) `
|
|
802
|
-
position: absolute;
|
|
832
|
+
position: absolute;
|
|
803
833
|
top: ${props => props.$top};
|
|
804
834
|
left: ${props => props.$left};
|
|
805
835
|
width: ${props => props.$menuWidth};
|
|
@@ -810,6 +840,7 @@ const ButtonMenu = ({ disabled, label, maxHeight, menuItems, small, position = '
|
|
|
810
840
|
const [showMenu, toggleMenu] = React.useState(false);
|
|
811
841
|
const [menuPosition, setMenuPosition] = React.useState({ top: '0px', left: '0px' });
|
|
812
842
|
const menuWrapperRef = React.useRef(null);
|
|
843
|
+
const id = generateUniqueId('button-menu');
|
|
813
844
|
React.useEffect(() => {
|
|
814
845
|
toggleMenu(show);
|
|
815
846
|
}, [show]);
|
|
@@ -875,11 +906,11 @@ const ButtonMenu = ({ disabled, label, maxHeight, menuItems, small, position = '
|
|
|
875
906
|
setMenuPosition({ top: `${top}px`, left: `${left}px` });
|
|
876
907
|
}
|
|
877
908
|
}, [showMenu, position, menuWidth]);
|
|
878
|
-
return (React.createElement(MenuWrapper, { onClick: handleClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ref: menuWrapperRef },
|
|
879
|
-
React.createElement(Button, { disabled: disabled, format: format, icon: js.mdiDotsHorizontal, small: small }, label),
|
|
880
|
-
showMenu && (React.createElement(StyledMoreMenu, { "$left": menuPosition.left, "$menuWidth": menuWidth, "$top": menuPosition.top, maxHeight: maxHeight, menuItems: menuItems }))));
|
|
881
|
-
};
|
|
882
|
-
|
|
909
|
+
return (React.createElement(MenuWrapper, { id: `${id}-menu-wrapper`, onClick: handleClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ref: menuWrapperRef },
|
|
910
|
+
React.createElement(Button, { disabled: disabled, format: format, icon: js.mdiDotsHorizontal, id: `${id}-button`, small: small }, label),
|
|
911
|
+
showMenu && (React.createElement(StyledMoreMenu, { "$left": menuPosition.left, "$menuWidth": menuWidth, "$top": menuPosition.top, id: `${id}-more-menu`, maxHeight: maxHeight, menuItems: menuItems }))));
|
|
912
|
+
};
|
|
913
|
+
|
|
883
914
|
const Wrapper$b = styled.label `
|
|
884
915
|
border-radius: 4px;
|
|
885
916
|
padding: 4px 0px 4px 6px;
|
|
@@ -960,14 +991,15 @@ const Label$3 = styled.span `
|
|
|
960
991
|
`;
|
|
961
992
|
const Checkbox = (_a) => {
|
|
962
993
|
var { children, color, disabled, checked, onChange, invalid, tooltip, tabIndex } = _a, accessibleProps = __rest(_a, ["children", "color", "disabled", "checked", "onChange", "invalid", "tooltip", "tabIndex"]);
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
React.createElement(
|
|
966
|
-
|
|
994
|
+
const id = generateUniqueId('checkbox');
|
|
995
|
+
return (React.createElement(Wrapper$b, Object.assign({ "$disabled": disabled }, accessibleProps, { id: `${id}-wrapper` }),
|
|
996
|
+
React.createElement(Input$2, { checked: checked, disabled: disabled, id: `${id}-input`, name: accessibleProps.name, onChange: disabled ? undefined : onChange, tabIndex: disabled ? -1 : tabIndex, type: 'checkbox' }),
|
|
997
|
+
React.createElement(Check$1, { "$invalid": invalid, id: `${id}-check` }),
|
|
998
|
+
children ? (React.createElement(Label$3, { color: color, id: `${id}-label` },
|
|
967
999
|
children,
|
|
968
1000
|
tooltip ? React.createElement(Tooltip, Object.assign({}, tooltip)) : null)) : null));
|
|
969
|
-
};
|
|
970
|
-
|
|
1001
|
+
};
|
|
1002
|
+
|
|
971
1003
|
const SelectAll = styled.div `
|
|
972
1004
|
padding: 8px 12px;
|
|
973
1005
|
border-bottom: 1px solid ${Colors.LIGHT_GRAY.Hex};
|
|
@@ -1004,16 +1036,18 @@ const Checklist = (_a) => {
|
|
|
1004
1036
|
},
|
|
1005
1037
|
});
|
|
1006
1038
|
};
|
|
1039
|
+
const id = generateUniqueId('checklist');
|
|
1007
1040
|
return (React.createElement(React.Fragment, null,
|
|
1008
|
-
showSelectAll && values.length ? (React.createElement(SelectAll,
|
|
1009
|
-
React.createElement(Checkbox, { checked: selected.length === values.length, disabled: disabled, onChange: handleToggleAll }, "Select All"))) : null,
|
|
1010
|
-
React.createElement(Options$1,
|
|
1041
|
+
showSelectAll && values.length ? (React.createElement(SelectAll, { id: `${id}-select-all` },
|
|
1042
|
+
React.createElement(Checkbox, { checked: selected.length === values.length, disabled: disabled, id: `${id}-checkbox-select-all`, onChange: handleToggleAll }, "Select All"))) : null,
|
|
1043
|
+
React.createElement(Options$1, { id: `${id}-options` }, options.map((option, i) => {
|
|
1011
1044
|
const label = `${option.label || option.value}`;
|
|
1012
1045
|
const checked = selected.includes(option.value);
|
|
1013
|
-
|
|
1046
|
+
const optionId = generateUniqueId('option');
|
|
1047
|
+
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));
|
|
1014
1048
|
}))));
|
|
1015
|
-
};
|
|
1016
|
-
|
|
1049
|
+
};
|
|
1050
|
+
|
|
1017
1051
|
const Wrapper$a = styled.div `
|
|
1018
1052
|
border-radius: 4px;
|
|
1019
1053
|
height: 40px;
|
|
@@ -1045,7 +1079,7 @@ const Trigger$1 = styled.select `
|
|
|
1045
1079
|
font-size: ${FontSizes.DEFAULT};
|
|
1046
1080
|
font-weight: 400;
|
|
1047
1081
|
font-family: ${FontStyles.DEFAULT};
|
|
1048
|
-
line-height:
|
|
1082
|
+
line-height: 3.1em;
|
|
1049
1083
|
background-color: transparent;
|
|
1050
1084
|
background-image: none;
|
|
1051
1085
|
width: 100%;
|
|
@@ -1081,6 +1115,7 @@ const Select = (_a) => {
|
|
|
1081
1115
|
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"]);
|
|
1082
1116
|
const [searchTerm, setSearchTerm] = React.useState('');
|
|
1083
1117
|
const [value, setValue] = React.useState(propValue || '');
|
|
1118
|
+
const id = generateUniqueId('select');
|
|
1084
1119
|
// Update the value when the prop changes
|
|
1085
1120
|
React.useEffect(() => {
|
|
1086
1121
|
setValue(propValue || '');
|
|
@@ -1100,17 +1135,17 @@ const Select = (_a) => {
|
|
|
1100
1135
|
const filteredOptionGroups = searchable
|
|
1101
1136
|
? 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()); }) })))
|
|
1102
1137
|
: optionGroups;
|
|
1103
|
-
return (React.createElement(Wrapper$a, { "$invalid": invalid, "$readOnly": readOnly, "$style": style },
|
|
1104
|
-
searchable && (React.createElement(SearchInput$1, Object.assign({ onChange: handleSearch, placeholder: placeholder, tabIndex: readOnly ? -1 : tabIndex, type: 'text', value: searchTerm }, accessibleProps))),
|
|
1105
|
-
React.createElement(Trigger$1, Object.assign({ disabled: readOnly, onChange: handleChange, placeholder: placeholder, tabIndex: readOnly ? -1 : tabIndex, value: value }, accessibleProps),
|
|
1106
|
-
placeholder && !value && (React.createElement("option", { disabled: true, value: '' }, placeholder)),
|
|
1138
|
+
return (React.createElement(Wrapper$a, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, id: `${id}-wrapper` },
|
|
1139
|
+
searchable && (React.createElement(SearchInput$1, Object.assign({ id: `${id}-search-input`, onChange: handleSearch, placeholder: placeholder, tabIndex: readOnly ? -1 : tabIndex, type: 'text', value: searchTerm }, accessibleProps))),
|
|
1140
|
+
React.createElement(Trigger$1, Object.assign({ disabled: readOnly, id: `${id}-trigger`, onChange: handleChange, placeholder: placeholder, tabIndex: readOnly ? -1 : tabIndex, value: value }, accessibleProps),
|
|
1141
|
+
placeholder && !value && (React.createElement("option", { disabled: true, id: `${id}-placeholder`, value: '' }, placeholder)),
|
|
1107
1142
|
filteredOptionGroups &&
|
|
1108
|
-
filteredOptionGroups.map((group, i) => (React.createElement("optgroup", { key: i, label: group.label || `Group ${i}` }, group.options.map((option,
|
|
1143
|
+
filteredOptionGroups.map((group, i) => (React.createElement("optgroup", { id: `${id}-optgroup-${i}`, key: i, label: group.label || `Group ${i}` }, group.options.map((option, j) => (React.createElement("option", { id: `${id}-option-${i}-${j}`, key: j, style: { color: option.color }, value: option.value }, option.label || option.value)))))),
|
|
1109
1144
|
filteredOptions &&
|
|
1110
|
-
filteredOptions.map((option, i) => (React.createElement("option", { key: i, style: { color: option.color }, value: option.value }, option.label || option.value)))),
|
|
1111
|
-
React.createElement(IconWrapper$2, { color: Colors.BLACK.Hex, path: js.mdiChevronDown, size: '22px' })));
|
|
1112
|
-
};
|
|
1113
|
-
|
|
1145
|
+
filteredOptions.map((option, i) => (React.createElement("option", { id: `${id}-option-${i}`, key: i, style: { color: option.color }, value: option.value }, option.label || option.value)))),
|
|
1146
|
+
React.createElement(IconWrapper$2, { color: Colors.BLACK.Hex, id: `${id}-icon`, path: js.mdiChevronDown, size: '22px' })));
|
|
1147
|
+
};
|
|
1148
|
+
|
|
1114
1149
|
const DatePickerWrapper = styled.div `
|
|
1115
1150
|
display: flex;
|
|
1116
1151
|
width: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.width) || 'auto'};
|
|
@@ -1192,14 +1227,15 @@ onChange = () => { }, style, }) => {
|
|
|
1192
1227
|
setSelectedYear(e.target.value);
|
|
1193
1228
|
setDDate(new_date);
|
|
1194
1229
|
};
|
|
1230
|
+
const id = generateUniqueId('date-picker');
|
|
1195
1231
|
return (React.createElement(React.Fragment, null,
|
|
1196
|
-
React.createElement(DatePickerWrapper, { "$style": style },
|
|
1197
|
-
React.createElement(Select, { invalid: invalid, onChange: handleMonthChange, options: months, placeholder: 'Select Month', readOnly: readOnly, style: { borderRadius: '4px 0px 0px 4px', flexGrow: 3 }, value: selectedMonth }),
|
|
1198
|
-
React.createElement(Middle,
|
|
1199
|
-
React.createElement(Select, { invalid: invalid, onChange: handleDayChange, options: dayOptions, placeholder: 'Select Day', readOnly: readOnly, style: { borderRadius: '0px' }, value: selectedDay })),
|
|
1200
|
-
React.createElement(Select, { invalid: invalid, onChange: handleYearChange, options: years, placeholder: 'Select Year', readOnly: readOnly, style: { borderRadius: '0px 4px 4px 0px', flexGrow: 2 }, value: selectedYear }))));
|
|
1201
|
-
};
|
|
1202
|
-
|
|
1232
|
+
React.createElement(DatePickerWrapper, { "$style": style, id: `${id}-wrapper` },
|
|
1233
|
+
React.createElement(Select, { id: `${id}-month-select`, invalid: invalid, onChange: handleMonthChange, options: months, placeholder: 'Select Month', readOnly: readOnly, style: { borderRadius: '4px 0px 0px 4px', flexGrow: 3 }, value: selectedMonth }),
|
|
1234
|
+
React.createElement(Middle, { id: `${id}-middle` },
|
|
1235
|
+
React.createElement(Select, { id: `${id}-day-select`, invalid: invalid, onChange: handleDayChange, options: dayOptions, placeholder: 'Select Day', readOnly: readOnly, style: { borderRadius: '0px' }, value: selectedDay })),
|
|
1236
|
+
React.createElement(Select, { id: `${id}-year-select`, invalid: invalid, onChange: handleYearChange, options: years, placeholder: 'Select Year', readOnly: readOnly, style: { borderRadius: '0px 4px 4px 0px', flexGrow: 2 }, value: selectedYear }))));
|
|
1237
|
+
};
|
|
1238
|
+
|
|
1203
1239
|
const Scrim$1 = styled.div `
|
|
1204
1240
|
position: ${({ $position }) => $position};
|
|
1205
1241
|
top: 0;
|
|
@@ -1271,22 +1307,23 @@ const Drawer = (_a) => {
|
|
|
1271
1307
|
document.onkeydown = null;
|
|
1272
1308
|
};
|
|
1273
1309
|
}, []);
|
|
1310
|
+
const id = generateUniqueId('drawer');
|
|
1274
1311
|
return (React.createElement(React.Fragment, null,
|
|
1275
|
-
React.createElement(Container$2, Object.assign({}, accessibleProps, { "$position": position, "$width": width }),
|
|
1276
|
-
React.createElement(Header$2,
|
|
1277
|
-
React.createElement("div",
|
|
1278
|
-
title ? React.createElement(Heading, { type: 'secondary' }, title) : null,
|
|
1279
|
-
description ? React.createElement(Copy, { color: 'GRAY' }, description) : null),
|
|
1280
|
-
React.createElement(Close$1, { onClick: onClose },
|
|
1281
|
-
React.createElement(Button, { format: 'secondary', icon: js.mdiClose, small: true }))),
|
|
1282
|
-
React.createElement(ContentWrapper$1,
|
|
1283
|
-
primaryButton || secondaryButton || tertiaryButton ? (React.createElement(ButtonBar$1,
|
|
1284
|
-
tertiaryButton ? (React.createElement(Button, Object.assign({}, tertiaryButton, { format: tertiaryButton.format || 'secondary' }))) : null,
|
|
1285
|
-
secondaryButton ? (React.createElement(Button, Object.assign({}, secondaryButton, { format: secondaryButton.format || 'secondary' }))) : null,
|
|
1286
|
-
primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { format: primaryButton.format || 'primary' }))) : null)) : null),
|
|
1287
|
-
scrim ? React.createElement(Scrim$1, { "$position": position, "$scrim": scrim, onClick: onClose }) : null));
|
|
1288
|
-
};
|
|
1289
|
-
|
|
1312
|
+
React.createElement(Container$2, Object.assign({}, accessibleProps, { "$position": position, "$width": width, id: `${id}-container` }),
|
|
1313
|
+
React.createElement(Header$2, { id: `${id}-header` },
|
|
1314
|
+
React.createElement("div", { id: `${id}-header-content` },
|
|
1315
|
+
title ? (React.createElement(Heading, { id: `${id}-title`, type: 'secondary' }, title)) : null,
|
|
1316
|
+
description ? (React.createElement(Copy, { color: 'GRAY', id: `${id}-description` }, description)) : null),
|
|
1317
|
+
React.createElement(Close$1, { id: `${id}-close`, onClick: onClose },
|
|
1318
|
+
React.createElement(Button, { format: 'secondary', icon: js.mdiClose, id: `${id}-close-button`, small: true }))),
|
|
1319
|
+
React.createElement(ContentWrapper$1, { id: `${id}-content-wrapper` }, children),
|
|
1320
|
+
primaryButton || secondaryButton || tertiaryButton ? (React.createElement(ButtonBar$1, { id: `${id}-button-bar` },
|
|
1321
|
+
tertiaryButton ? (React.createElement(Button, Object.assign({}, tertiaryButton, { format: tertiaryButton.format || 'secondary', id: `${id}-tertiary-button` }))) : null,
|
|
1322
|
+
secondaryButton ? (React.createElement(Button, Object.assign({}, secondaryButton, { format: secondaryButton.format || 'secondary', id: `${id}-secondary-button` }))) : null,
|
|
1323
|
+
primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { format: primaryButton.format || 'primary', id: `${id}-primary-button` }))) : null)) : null),
|
|
1324
|
+
scrim ? (React.createElement(Scrim$1, { "$position": position, "$scrim": scrim, id: `${id}-scrim`, onClick: onClose })) : null));
|
|
1325
|
+
};
|
|
1326
|
+
|
|
1290
1327
|
const Wrapper$9 = styled.div(props => (Object.assign({ margin: '0px 0px 18px 0px' }, props.$customStyle)));
|
|
1291
1328
|
const LabelRow = styled.div `
|
|
1292
1329
|
display: flex;
|
|
@@ -1337,18 +1374,19 @@ const Validation = styled.div `
|
|
|
1337
1374
|
`;
|
|
1338
1375
|
const Field = (_a) => {
|
|
1339
1376
|
var { action, children, validationText, label, description, required, htmlFor, style = {}, tooltip } = _a, accessibleProps = __rest(_a, ["action", "children", "validationText", "label", "description", "required", "htmlFor", "style", "tooltip"]);
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1377
|
+
const id = generateUniqueId('field');
|
|
1378
|
+
return (React.createElement(Wrapper$9, Object.assign({ "$customStyle": style }, accessibleProps, { id: `${id}-wrapper` }),
|
|
1379
|
+
React.createElement(LabelRow, { id: `${id}-label-row` },
|
|
1380
|
+
React.createElement(Label$2, { htmlFor: htmlFor, id: `${id}-label` },
|
|
1343
1381
|
label,
|
|
1344
|
-
required ? React.createElement(Required,
|
|
1382
|
+
required ? React.createElement(Required, { id: `${id}-required` }, "*") : null,
|
|
1345
1383
|
tooltip ? React.createElement(Tooltip, Object.assign({}, tooltip)) : null),
|
|
1346
|
-
action ? (React.createElement(Action, { id: action.id
|
|
1347
|
-
description ? React.createElement(Description,
|
|
1348
|
-
children,
|
|
1349
|
-
validationText ? React.createElement(Validation,
|
|
1350
|
-
};
|
|
1351
|
-
|
|
1384
|
+
action ? (React.createElement(Action, { id: action.id || `${id}-action`, onClick: action.onClick }, action.label)) : null),
|
|
1385
|
+
description ? React.createElement(Description, { id: `${id}-description` }, description) : null,
|
|
1386
|
+
React.createElement("div", { id: `${id}-children` }, children),
|
|
1387
|
+
validationText ? React.createElement(Validation, { id: `${id}-validation` }, validationText) : null));
|
|
1388
|
+
};
|
|
1389
|
+
|
|
1352
1390
|
const Wrapper$8 = styled.fieldset `
|
|
1353
1391
|
margin-inline-start: 0px;
|
|
1354
1392
|
margin-inline-end: 0px;
|
|
@@ -1379,11 +1417,12 @@ const Content$1 = styled.div `
|
|
|
1379
1417
|
background: #fcfcfc;
|
|
1380
1418
|
`;
|
|
1381
1419
|
const FieldGroup = ({ children, label }) => {
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
React.createElement(
|
|
1385
|
-
};
|
|
1386
|
-
|
|
1420
|
+
const id = generateUniqueId('field-group');
|
|
1421
|
+
return (React.createElement(Wrapper$8, { id: `${id}-wrapper` },
|
|
1422
|
+
React.createElement(Label$1, { id: `${id}-label` }, label),
|
|
1423
|
+
React.createElement(Content$1, { id: `${id}-content` }, children)));
|
|
1424
|
+
};
|
|
1425
|
+
|
|
1387
1426
|
const Dropzone = styled.div `
|
|
1388
1427
|
border-radius: 8px;
|
|
1389
1428
|
border-width: 1px;
|
|
@@ -1554,25 +1593,27 @@ const FileUpload = ({ accept, onChange, onError, maxFiles = 10, maxSize = 2, val
|
|
|
1554
1593
|
setAllowMoreFiles(false);
|
|
1555
1594
|
}
|
|
1556
1595
|
}, [files]);
|
|
1596
|
+
const id = generateUniqueId('file-upload');
|
|
1557
1597
|
return (React.createElement(React.Fragment, null,
|
|
1558
|
-
React.createElement("input", { accept: accept, multiple: true, onChange: allowMoreFiles ? handleChange : undefined, ref: inputRef, style: { display: 'none' }, type: 'file' }),
|
|
1559
|
-
React.createElement(Dropzone, { "$dragging": dragging, onDragEnter: allowMoreFiles ? handleDrag : undefined, onDragLeave: allowMoreFiles ? handleDrag : undefined, onDragOver: allowMoreFiles ? handleDrag : undefined, onDrop: allowMoreFiles ? handleDrop : undefined, value: files ? files : [] },
|
|
1560
|
-
files.length ? (React.createElement(Files,
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
React.createElement(
|
|
1598
|
+
React.createElement("input", { accept: accept, id: `${id}-input`, multiple: true, onChange: allowMoreFiles ? handleChange : undefined, ref: inputRef, style: { display: 'none' }, type: 'file' }),
|
|
1599
|
+
React.createElement(Dropzone, { "$dragging": dragging, id: `${id}-dropzone`, onDragEnter: allowMoreFiles ? handleDrag : undefined, onDragLeave: allowMoreFiles ? handleDrag : undefined, onDragOver: allowMoreFiles ? handleDrag : undefined, onDrop: allowMoreFiles ? handleDrop : undefined, value: files ? files : [] },
|
|
1600
|
+
files.length ? (React.createElement(Files, { id: `${id}-files` }, files.map(file => {
|
|
1601
|
+
const fileId = generateUniqueId('file');
|
|
1602
|
+
return (React.createElement(File, { id: `${fileId}-file`, key: file.name },
|
|
1603
|
+
React.createElement(Copy, { id: `${fileId}-file-name`, type: 'bold' }, file.name),
|
|
1604
|
+
React.createElement(Remove, { id: `${fileId}-remove`, onClick: handleRemove.bind(null, file), path: js.mdiMinusCircle })));
|
|
1564
1605
|
}))) : null,
|
|
1565
|
-
allowMoreFiles ? (React.createElement(ClickZone, { onClick: triggerFileExplorer },
|
|
1566
|
-
files.length ? null : (React.createElement(IconWrapper$1, { "$dragging": dragging },
|
|
1567
|
-
React.createElement(StyledIcon$3, { path: js.mdiFolderPlusOutline }))),
|
|
1568
|
-
React.createElement(Content,
|
|
1569
|
-
React.createElement(Copy, { align: 'center', type: 'bold' }, "Drag & drop files here or click to select files"),
|
|
1570
|
-
message ? (React.createElement(MessageDiv,
|
|
1571
|
-
React.createElement(Copy, { align: 'center', color: 'GRAY' }, message),
|
|
1572
|
-
tooltipInfo && (React.createElement("span",
|
|
1606
|
+
allowMoreFiles ? (React.createElement(ClickZone, { id: `${id}-click-zone`, onClick: triggerFileExplorer },
|
|
1607
|
+
files.length ? null : (React.createElement(IconWrapper$1, { "$dragging": dragging, id: `${id}-icon-wrapper` },
|
|
1608
|
+
React.createElement(StyledIcon$3, { id: `${id}-icon`, path: js.mdiFolderPlusOutline }))),
|
|
1609
|
+
React.createElement(Content, { id: `${id}-content` },
|
|
1610
|
+
React.createElement(Copy, { align: 'center', id: `${id}-copy`, type: 'bold' }, "Drag & drop files here or click to select files"),
|
|
1611
|
+
message ? (React.createElement(MessageDiv, { id: `${id}-message-div` },
|
|
1612
|
+
React.createElement(Copy, { align: 'center', color: 'GRAY', id: `${id}-message` }, message),
|
|
1613
|
+
tooltipInfo && (React.createElement("span", { id: `${id}-tooltip` },
|
|
1573
1614
|
React.createElement(Tooltip, { children: tooltipInfo, position: 'left-center' }))))) : null))) : null)));
|
|
1574
|
-
};
|
|
1575
|
-
|
|
1615
|
+
};
|
|
1616
|
+
|
|
1576
1617
|
const getAgesFromDob = (dob) => {
|
|
1577
1618
|
let calculated_current_age = null;
|
|
1578
1619
|
let calculated_nearest_age = null;
|
|
@@ -1645,8 +1686,8 @@ const formatAsSsn = (number) => {
|
|
|
1645
1686
|
formatted_value = `${formatted_value.substring(0, 3)}-${formatted_value.substring(3, 5)}-${formatted_value.substring(5, 9)}`;
|
|
1646
1687
|
}
|
|
1647
1688
|
return formatted_value;
|
|
1648
|
-
};
|
|
1649
|
-
|
|
1689
|
+
};
|
|
1690
|
+
|
|
1650
1691
|
const StyledInput = styled.input `
|
|
1651
1692
|
border: none !important;
|
|
1652
1693
|
background: none !important;
|
|
@@ -1858,7 +1899,8 @@ const Input$1 = (_a) => {
|
|
|
1858
1899
|
if (format === 'ssn' && type !== 'password') {
|
|
1859
1900
|
formatted_value = formatAsSsn(internalValue);
|
|
1860
1901
|
}
|
|
1861
|
-
|
|
1902
|
+
const id = generateUniqueId('input');
|
|
1903
|
+
return type === 'textarea' ? (React.createElement(StyledWrapper, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, "$suggestions": show_options && !!internalSuggestedValues.length, id: `${id}-wrapper` },
|
|
1862
1904
|
React.createElement(StyledTextArea, Object.assign({ "$height": height, "$invalid": invalid, "$readOnly": readOnly, "$showErrorTextColor": showErrorTextColor, maxLength: maxLength, onBlur: readOnly
|
|
1863
1905
|
? e => e.preventDefault()
|
|
1864
1906
|
: e => {
|
|
@@ -1873,12 +1915,12 @@ const Input$1 = (_a) => {
|
|
|
1873
1915
|
setShowOptions(true);
|
|
1874
1916
|
if (onFocus)
|
|
1875
1917
|
onFocus(e);
|
|
1876
|
-
}, onKeyDown: readOnly ? e => e.preventDefault() : onKeyDown, placeholder: placeholder, readOnly: readOnly, ref: innerRef, tabIndex: readOnly ? -1 : tabIndex, value: formatted_value }, accessibleProps)),
|
|
1877
|
-
loading ? (React.createElement(Loader$1,
|
|
1918
|
+
}, onKeyDown: readOnly ? e => e.preventDefault() : onKeyDown, placeholder: placeholder, readOnly: readOnly, ref: innerRef, tabIndex: readOnly ? -1 : tabIndex, value: formatted_value }, accessibleProps, { id: `${id}-textarea` })),
|
|
1919
|
+
loading ? (React.createElement(Loader$1, { id: `${id}-loader` },
|
|
1878
1920
|
React.createElement(Icon, { color: Colors.MEDIUM_GRAY.Hex, path: js.mdiLoading, size: '20px', spin: true }))) : null,
|
|
1879
|
-
showCharCount ? (React.createElement(CharacterCount,
|
|
1921
|
+
showCharCount ? (React.createElement(CharacterCount, { id: `${id}-char-count` },
|
|
1880
1922
|
internalValue.length,
|
|
1881
|
-
maxLength ? ` / ${maxLength}` : null)) : null)) : (React.createElement(StyledWrapper, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, "$suggestions": show_options && !!internalSuggestedValues.length },
|
|
1923
|
+
maxLength ? ` / ${maxLength}` : null)) : null)) : (React.createElement(StyledWrapper, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, "$suggestions": show_options && !!internalSuggestedValues.length, id: `${id}-wrapper` },
|
|
1882
1924
|
React.createElement(StyledInput, Object.assign({ "$height": height, "$invalid": invalid, "$readOnly": readOnly, "$showErrorTextColor": showErrorTextColor, max: max, maxLength: maxLength, min: min, onBlur: readOnly
|
|
1883
1925
|
? e => e.preventDefault()
|
|
1884
1926
|
: e => {
|
|
@@ -1893,26 +1935,26 @@ const Input$1 = (_a) => {
|
|
|
1893
1935
|
setShowOptions(true);
|
|
1894
1936
|
if (onFocus)
|
|
1895
1937
|
onFocus(e);
|
|
1896
|
-
}, 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)),
|
|
1897
|
-
loading ? (React.createElement(Loader$1,
|
|
1938
|
+
}, 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: `${id}-input` })),
|
|
1939
|
+
loading ? (React.createElement(Loader$1, { id: `${id}-loader` },
|
|
1898
1940
|
React.createElement(Icon, { color: Colors.MEDIUM_GRAY.Hex, path: js.mdiLoading, size: '20px', spin: true }))) : null,
|
|
1899
|
-
showCharCount ? (React.createElement(CharacterCount,
|
|
1941
|
+
showCharCount ? (React.createElement(CharacterCount, { id: `${id}-char-count` },
|
|
1900
1942
|
internalValue.length,
|
|
1901
1943
|
maxLength ? ` / ${maxLength}` : null)) : null,
|
|
1902
|
-
suffix && React.createElement(StyledSuffix,
|
|
1903
|
-
show_options && internalSuggestedValues.length ? (React.createElement(SuggestedValues,
|
|
1904
|
-
React.createElement(SuggestedSummary,
|
|
1944
|
+
suffix && React.createElement(StyledSuffix, { id: `${id}-suffix` }, suffix),
|
|
1945
|
+
show_options && internalSuggestedValues.length ? (React.createElement(SuggestedValues, { id: `${id}-suggested-values` },
|
|
1946
|
+
React.createElement(SuggestedSummary, { id: `${id}-suggested-summary` },
|
|
1905
1947
|
internalSuggestedValues.length,
|
|
1906
1948
|
" Results Match \"",
|
|
1907
1949
|
internalValue,
|
|
1908
1950
|
"\""),
|
|
1909
|
-
internalSuggestedValues.map((suggestedValue, index) => (React.createElement(SuggestedValue, { key: index, onClick: () => {
|
|
1951
|
+
internalSuggestedValues.map((suggestedValue, index) => (React.createElement(SuggestedValue, { id: `${id}-suggested-value-${index}`, key: index, onClick: () => {
|
|
1910
1952
|
handleInputChange({ target: { value: suggestedValue } });
|
|
1911
1953
|
onSuggestedSelect();
|
|
1912
1954
|
setShowOptions(false);
|
|
1913
1955
|
} }, suggestedValue))))) : null));
|
|
1914
|
-
};
|
|
1915
|
-
|
|
1956
|
+
};
|
|
1957
|
+
|
|
1916
1958
|
const Wrapper$7 = styled.a `
|
|
1917
1959
|
color: ${props => props.theme.PRIMARY_COLOR.Hex};
|
|
1918
1960
|
font-size: ${props => (props.$small ? FontSizes.SMALL : FontSizes.DEFAULT)};
|
|
@@ -1930,9 +1972,10 @@ const Wrapper$7 = styled.a `
|
|
|
1930
1972
|
Wrapper$7.defaultProps = { theme: EditableTheme };
|
|
1931
1973
|
const Link = (_a) => {
|
|
1932
1974
|
var { children, onClick, small } = _a, accessibleProps = __rest(_a, ["children", "onClick", "small"]);
|
|
1933
|
-
|
|
1934
|
-
};
|
|
1935
|
-
|
|
1975
|
+
const id = generateUniqueId('link');
|
|
1976
|
+
return (React.createElement(Wrapper$7, Object.assign({ "$small": small, onClick: onClick }, accessibleProps, { id: `${id}-wrapper` }), children));
|
|
1977
|
+
};
|
|
1978
|
+
|
|
1936
1979
|
const dash = styled.keyframes `
|
|
1937
1980
|
0% {
|
|
1938
1981
|
stroke-dasharray: 1, 160;
|
|
@@ -1964,10 +2007,11 @@ const Path = styled.path `
|
|
|
1964
2007
|
animation: ${dash} 1.1s ease-in-out infinite;
|
|
1965
2008
|
`;
|
|
1966
2009
|
const Loader = () => {
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
};
|
|
1970
|
-
|
|
2010
|
+
const id = generateUniqueId('loader');
|
|
2011
|
+
return (React.createElement(Spinner, { id: `${id}-spinner`, viewBox: '0 0 16 18' },
|
|
2012
|
+
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: `${id}-path`, strokeWidth: '2' })));
|
|
2013
|
+
};
|
|
2014
|
+
|
|
1971
2015
|
const Steps = styled.div `
|
|
1972
2016
|
padding: 20px;
|
|
1973
2017
|
border-bottom: 1px solid #e7e6e6;
|
|
@@ -2017,15 +2061,17 @@ const StepLine = styled.div `
|
|
|
2017
2061
|
transition: background-color 0.5s ease-in-out;
|
|
2018
2062
|
`;
|
|
2019
2063
|
const ProgressBar = ({ steps, showStepLine = false }) => {
|
|
2020
|
-
|
|
2064
|
+
const id = generateUniqueId('progress-bar');
|
|
2065
|
+
return (React.createElement(Steps, { id: `${id}-steps` }, steps.map((step, i) => {
|
|
2066
|
+
const stepId = generateUniqueId(`step-${i}`);
|
|
2021
2067
|
return (React.createElement(React.Fragment, { key: i },
|
|
2022
|
-
i !== 0 && showStepLine && React.createElement(StepLine, { "$active": step.active }),
|
|
2023
|
-
React.createElement(Step,
|
|
2024
|
-
step.complete ? (React.createElement(StyledIcon$2, { path: js.mdiCheckboxMarkedCircleOutline, size: '32px' })) : (React.createElement(StepIndicator, { "$active": step.active }, i + 1)),
|
|
2025
|
-
React.createElement(StepLabel,
|
|
2068
|
+
i !== 0 && showStepLine && React.createElement(StepLine, { "$active": step.active, id: `${stepId}-line` }),
|
|
2069
|
+
React.createElement(Step, { id: `${stepId}-step` },
|
|
2070
|
+
step.complete ? (React.createElement(StyledIcon$2, { id: `${stepId}-icon`, path: js.mdiCheckboxMarkedCircleOutline, size: '32px' })) : (React.createElement(StepIndicator, { "$active": step.active, id: `${stepId}-indicator` }, i + 1)),
|
|
2071
|
+
React.createElement(StepLabel, { id: `${stepId}-label` }, step.label))));
|
|
2026
2072
|
})));
|
|
2027
|
-
};
|
|
2028
|
-
|
|
2073
|
+
};
|
|
2074
|
+
|
|
2029
2075
|
const Wrapper$6 = styled.div `
|
|
2030
2076
|
position: fixed;
|
|
2031
2077
|
top: 0;
|
|
@@ -2109,36 +2155,37 @@ const Modal = (_a) => {
|
|
|
2109
2155
|
document.onkeydown = null;
|
|
2110
2156
|
};
|
|
2111
2157
|
}, []);
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
React.createElement(
|
|
2117
|
-
|
|
2118
|
-
React.createElement(
|
|
2158
|
+
const id = generateUniqueId('modal');
|
|
2159
|
+
return (React.createElement(Wrapper$6, { id: `${id}-wrapper` },
|
|
2160
|
+
React.createElement(Container$1, Object.assign({ "$fullscreen": fullscreen, "$maxWidth": maxWidth, open: true }, accessibleProps, { id: `${id}-container` }),
|
|
2161
|
+
React.createElement(Header$1, { id: `${id}-header` },
|
|
2162
|
+
title ? (React.createElement(Heading, { id: `${id}-title`, type: 'secondary' }, title)) : null,
|
|
2163
|
+
React.createElement(Close, { id: `${id}-close`, onClick: onClose },
|
|
2164
|
+
React.createElement(CloseMsg, { id: `${id}-close-msg` }, "(Esc)"),
|
|
2165
|
+
React.createElement(Icon, { color: Colors.BLACK.Hex, id: `${id}-close-icon`, path: js.mdiClose, size: '24px' }))),
|
|
2119
2166
|
steps ? React.createElement(ProgressBar, { steps: steps }) : null,
|
|
2120
|
-
React.createElement(ContentWrapper,
|
|
2121
|
-
primaryButton || secondaryButton || tertiaryButton || quarternaryButton ? (React.createElement(ButtonBar,
|
|
2122
|
-
tertiaryButton || quarternaryButton ? (React.createElement("div", { style: {
|
|
2167
|
+
React.createElement(ContentWrapper, { id: `${id}-content-wrapper` }, children),
|
|
2168
|
+
primaryButton || secondaryButton || tertiaryButton || quarternaryButton ? (React.createElement(ButtonBar, { id: `${id}-button-bar` },
|
|
2169
|
+
tertiaryButton || quarternaryButton ? (React.createElement("div", { id: `${id}-left-buttons`, style: {
|
|
2123
2170
|
marginRight: 'auto',
|
|
2124
2171
|
paddingRight: 40,
|
|
2125
2172
|
display: 'flex',
|
|
2126
2173
|
alignItems: 'center',
|
|
2127
2174
|
} },
|
|
2128
|
-
tertiaryButton ? (React.createElement(Button, Object.assign({}, tertiaryButton, { format: tertiaryButton.format || 'secondary' }))) : null,
|
|
2129
|
-
quarternaryButton ? (React.createElement(ButtonContainer,
|
|
2130
|
-
React.createElement(Button, Object.assign({}, quarternaryButton, { format: quarternaryButton.format || 'secondary' })))) : null)) : null,
|
|
2131
|
-
primaryButton || secondaryButton ? (React.createElement("div", { style: {
|
|
2175
|
+
tertiaryButton ? (React.createElement(Button, Object.assign({}, tertiaryButton, { format: tertiaryButton.format || 'secondary', id: `${id}-tertiary-button` }))) : null,
|
|
2176
|
+
quarternaryButton ? (React.createElement(ButtonContainer, { id: `${id}-quarternary-button-container` },
|
|
2177
|
+
React.createElement(Button, Object.assign({}, quarternaryButton, { format: quarternaryButton.format || 'secondary', id: `${id}-quarternary-button` })))) : null)) : null,
|
|
2178
|
+
primaryButton || secondaryButton ? (React.createElement("div", { id: `${id}-right-buttons`, style: {
|
|
2132
2179
|
marginLeft: 'auto',
|
|
2133
2180
|
paddingLeft: 40,
|
|
2134
2181
|
display: 'flex',
|
|
2135
2182
|
alignItems: 'center',
|
|
2136
2183
|
} },
|
|
2137
|
-
secondaryButton ? (React.createElement(ButtonContainer,
|
|
2138
|
-
React.createElement(Button, Object.assign({}, secondaryButton, { format: secondaryButton.format || 'secondary' })))) : null,
|
|
2139
|
-
primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { format: primaryButton.format || 'primary' }))) : null)) : null)) : null)));
|
|
2140
|
-
};
|
|
2141
|
-
|
|
2184
|
+
secondaryButton ? (React.createElement(ButtonContainer, { id: `${id}-secondary-button-container` },
|
|
2185
|
+
React.createElement(Button, Object.assign({}, secondaryButton, { format: secondaryButton.format || 'secondary', id: `${id}-secondary-button` })))) : null,
|
|
2186
|
+
primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { format: primaryButton.format || 'primary', id: `${id}-primary-button` }))) : null)) : null)) : null)));
|
|
2187
|
+
};
|
|
2188
|
+
|
|
2142
2189
|
const Wrapper$5 = styled.div `
|
|
2143
2190
|
position: relative;
|
|
2144
2191
|
width: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.width) || 'auto'};
|
|
@@ -2192,7 +2239,7 @@ const Options = styled.div `
|
|
|
2192
2239
|
border-top: none;
|
|
2193
2240
|
border-width: 1px;
|
|
2194
2241
|
left: 0;
|
|
2195
|
-
position:
|
|
2242
|
+
position: absolute;
|
|
2196
2243
|
right: 0;
|
|
2197
2244
|
z-index: 10;
|
|
2198
2245
|
max-height: 220px;
|
|
@@ -2229,20 +2276,21 @@ const MultiSelect = (_a) => {
|
|
|
2229
2276
|
const [showOptions, setShowOptions] = React.useState(false);
|
|
2230
2277
|
const selected_options = options.filter(o => selected.includes(o.value));
|
|
2231
2278
|
const [filter, setFilter] = React.useState('');
|
|
2279
|
+
const id = generateUniqueId('multiselect');
|
|
2232
2280
|
// Filter the options based on the filter state
|
|
2233
2281
|
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)); });
|
|
2234
|
-
return (React.createElement(Wrapper$5, { "$style": style },
|
|
2235
|
-
searchable && (React.createElement(SearchInput, { onChange: e => setFilter(e.target.value), onClick: () => setShowOptions(!showOptions), placeholder: `${showSelectAll ? options.length : selected_options.length} Selected`, type: 'text', value: filter })),
|
|
2236
|
-
React.createElement(Trigger, Object.assign({ "$invalid": invalid, "$readOnly": readOnly, "$showOptions": showOptions, onClick: readOnly ? undefined : setShowOptions.bind(null, !showOptions) }, accessibleProps),
|
|
2237
|
-
React.createElement(Value,
|
|
2282
|
+
return (React.createElement(Wrapper$5, { "$style": style, id: `${id}-wrapper` },
|
|
2283
|
+
searchable && (React.createElement(SearchInput, { id: `${id}-search-input`, onChange: e => setFilter(e.target.value), onClick: () => setShowOptions(!showOptions), placeholder: `${showSelectAll ? options.length : selected_options.length} Selected`, type: 'text', value: filter })),
|
|
2284
|
+
React.createElement(Trigger, Object.assign({ "$invalid": invalid, "$readOnly": readOnly, "$showOptions": showOptions, id: `${id}-trigger`, onClick: readOnly ? undefined : setShowOptions.bind(null, !showOptions) }, accessibleProps),
|
|
2285
|
+
React.createElement(Value, { id: `${id}-value` }, selected.length > 0 && selected.length <= displayCount
|
|
2238
2286
|
? selected_options.map(o => o.label || o.value).join(', ')
|
|
2239
2287
|
: `${selected_options.length} Selected`),
|
|
2240
|
-
React.createElement(Icon, { color: Colors.BLACK.Hex, path: showOptions ? js.mdiChevronUp : js.mdiChevronDown, size: '22px' })),
|
|
2241
|
-
showOptions ? (React.createElement(Options,
|
|
2242
|
-
React.createElement(Checklist, { onChange: onChange, options: filteredOptions, selected: selected, showSelectAll: showSelectAll }))) : null,
|
|
2243
|
-
showOptions ? React.createElement(Scrim, { onClick: setShowOptions.bind(null, !showOptions) }) : null));
|
|
2244
|
-
};
|
|
2245
|
-
|
|
2288
|
+
React.createElement(Icon, { color: Colors.BLACK.Hex, id: `${id}-icon`, path: showOptions ? js.mdiChevronUp : js.mdiChevronDown, size: '22px' })),
|
|
2289
|
+
showOptions ? (React.createElement(Options, { id: `${id}-options` },
|
|
2290
|
+
React.createElement(Checklist, { id: `${id}-checklist`, onChange: onChange, options: filteredOptions, selected: selected, showSelectAll: showSelectAll }))) : null,
|
|
2291
|
+
showOptions ? (React.createElement(Scrim, { id: `${id}-scrim`, onClick: setShowOptions.bind(null, !showOptions) })) : null));
|
|
2292
|
+
};
|
|
2293
|
+
|
|
2246
2294
|
const Wrapper$4 = styled.div `
|
|
2247
2295
|
display: flex;
|
|
2248
2296
|
padding: 16px 30px;
|
|
@@ -2275,24 +2323,27 @@ const Actions = styled.div `
|
|
|
2275
2323
|
`;
|
|
2276
2324
|
const PageHeader = ({ title = '', breadcrumbs, actions, buttonMenu, tag }) => {
|
|
2277
2325
|
const { format = 'primary', menuItems = [], label = '', enableHover = true, enableClick = false, show = false, } = buttonMenu || {};
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2326
|
+
const id = generateUniqueId('page-header');
|
|
2327
|
+
return (React.createElement(Wrapper$4, { id: `${id}-wrapper` },
|
|
2328
|
+
React.createElement(Info, { id: `${id}-info` },
|
|
2329
|
+
React.createElement(Title, { id: `${id}-title` },
|
|
2330
|
+
React.createElement(Heading, { id: `${id}-heading`, type: 'secondary' }, title),
|
|
2331
|
+
tag ? React.createElement(Tag, Object.assign({}, tag, { id: `${id}-tag` })) : null),
|
|
2332
|
+
breadcrumbs ? (React.createElement(Breadcrumbs, { id: `${id}-breadcrumbs` }, breadcrumbs.map((crumb, i) => {
|
|
2333
|
+
const crumbId = generateUniqueId(`breadcrumb-${i}`);
|
|
2284
2334
|
return (React.createElement(React.Fragment, { key: i },
|
|
2285
|
-
crumb.onClick ? (React.createElement(Link, { onClick: crumb.onClick, small: true }, crumb.label)) : (React.createElement(Copy, { type: 'small' }, crumb.label)),
|
|
2286
|
-
i + 1 < breadcrumbs.length ? React.createElement(Icon.Icon, { path: js.mdiChevronRight, size: '14px' }) : null));
|
|
2335
|
+
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)),
|
|
2336
|
+
i + 1 < breadcrumbs.length ? (React.createElement(Icon.Icon, { id: `${crumbId}-icon`, path: js.mdiChevronRight, size: '14px' })) : null));
|
|
2287
2337
|
}))) : null),
|
|
2288
|
-
actions ? (React.createElement(Actions,
|
|
2338
|
+
actions ? (React.createElement(Actions, { id: `${id}-actions` },
|
|
2289
2339
|
actions.map((action, i) => {
|
|
2290
2340
|
const { label } = action, buttonProps = __rest(action, ["label"]);
|
|
2291
|
-
|
|
2341
|
+
const actionId = generateUniqueId(`action-${i}`);
|
|
2342
|
+
return (React.createElement(Button, Object.assign({}, buttonProps, { id: `${actionId}-button`, key: i, small: true }), label));
|
|
2292
2343
|
}),
|
|
2293
2344
|
menuItems.length ? (React.createElement(ButtonMenu, { enableClick: enableClick, enableHover: enableHover, format: format, label: label, menuItems: menuItems, show: show, small: true })) : null)) : null));
|
|
2294
|
-
};
|
|
2295
|
-
|
|
2345
|
+
};
|
|
2346
|
+
|
|
2296
2347
|
const Wrapper$3 = styled.nav `
|
|
2297
2348
|
box-sizing: border-box;
|
|
2298
2349
|
display: flex;
|
|
@@ -2319,15 +2370,16 @@ const Pagination = (_a) => {
|
|
|
2319
2370
|
onClick(new_page);
|
|
2320
2371
|
}
|
|
2321
2372
|
};
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
React.createElement(
|
|
2373
|
+
const id = generateUniqueId('pagination');
|
|
2374
|
+
return (React.createElement(Wrapper$3, Object.assign({}, accessibleProps, { id: `${id}-wrapper` }),
|
|
2375
|
+
React.createElement(Button, { disabled: is_first_page, icon: js.mdiChevronLeft, id: `${id}-prev-button`, onClick: handlePrevClick, small: true }),
|
|
2376
|
+
React.createElement(Select, { id: `${id}-select`, onChange: handlePageChange, options: Array.from(Array(pageCount).keys(), p => p + 1).map(p => ({
|
|
2325
2377
|
label: `Page ${p}`,
|
|
2326
2378
|
value: `${p}`,
|
|
2327
2379
|
})), value: `${currentPage}` }),
|
|
2328
|
-
React.createElement(Button, { disabled: is_last_page, icon: js.mdiChevronRight, onClick: handleNextClick, small: true })));
|
|
2329
|
-
};
|
|
2330
|
-
|
|
2380
|
+
React.createElement(Button, { disabled: is_last_page, icon: js.mdiChevronRight, id: `${id}-next-button`, onClick: handleNextClick, small: true })));
|
|
2381
|
+
};
|
|
2382
|
+
|
|
2331
2383
|
const Wrapper$2 = styled.label `
|
|
2332
2384
|
border-radius: 4px;
|
|
2333
2385
|
padding: 4px 0px 4px 6px;
|
|
@@ -2405,22 +2457,23 @@ const Label = styled.span `
|
|
|
2405
2457
|
`;
|
|
2406
2458
|
const Radio = (_a) => {
|
|
2407
2459
|
var { children, disabled, checked, onChange, value, invalid, tooltip, tabIndex } = _a, accessibleProps = __rest(_a, ["children", "disabled", "checked", "onChange", "value", "invalid", "tooltip", "tabIndex"]);
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
React.createElement(
|
|
2411
|
-
React.createElement(
|
|
2460
|
+
const id = generateUniqueId('radio');
|
|
2461
|
+
return (React.createElement(Wrapper$2, Object.assign({}, accessibleProps, { id: `${id}-wrapper` }),
|
|
2462
|
+
React.createElement(Input, { checked: checked, disabled: disabled, id: `${id}-input`, name: accessibleProps.name, onChange: disabled ? undefined : onChange, tabIndex: disabled ? -1 : tabIndex, type: 'radio', value: value }),
|
|
2463
|
+
React.createElement(Check, { "$invalid": invalid, id: `${id}-check` }),
|
|
2464
|
+
React.createElement(Label, { id: `${id}-label` },
|
|
2412
2465
|
children,
|
|
2413
2466
|
tooltip ? React.createElement(Tooltip, Object.assign({}, tooltip)) : null)));
|
|
2414
|
-
};
|
|
2415
|
-
|
|
2467
|
+
};
|
|
2468
|
+
|
|
2416
2469
|
const RadioList = (_a) => {
|
|
2417
2470
|
var { disabled, onChange, options, value } = _a, accessibleProps = __rest(_a, ["disabled", "onChange", "options", "value"]);
|
|
2418
2471
|
return (React.createElement(React.Fragment, null, options.map((option) => {
|
|
2419
2472
|
const label = option.label || option.value;
|
|
2420
2473
|
return (React.createElement(Radio, Object.assign({ checked: value === option.value, disabled: disabled, onChange: onChange, value: option.value }, accessibleProps), label));
|
|
2421
2474
|
})));
|
|
2422
|
-
};
|
|
2423
|
-
|
|
2475
|
+
};
|
|
2476
|
+
|
|
2424
2477
|
const StyledTable = styled.table `
|
|
2425
2478
|
width: 100%;
|
|
2426
2479
|
margin-top: 1px;
|
|
@@ -2486,21 +2539,25 @@ const StyledIcon$1 = styled(Icon) `
|
|
|
2486
2539
|
StyledIcon$1.defaultProps = { theme: EditableTheme };
|
|
2487
2540
|
const Table = (_a) => {
|
|
2488
2541
|
var { columns = [], data = [], sortBy, sortDirection, hideHeaders, onRowClick, onSortChange, tableLayout } = _a, accessibleProps = __rest(_a, ["columns", "data", "sortBy", "sortDirection", "hideHeaders", "onRowClick", "onSortChange", "tableLayout"]);
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2542
|
+
const id = generateUniqueId('table');
|
|
2543
|
+
return (React.createElement(StyledTable, Object.assign({ "$tableLayout": tableLayout }, accessibleProps, { id: `${id}-styled-table` }),
|
|
2544
|
+
hideHeaders ? null : (React.createElement("thead", { id: `${id}-thead` },
|
|
2545
|
+
React.createElement("tr", { id: `${id}-header-row` }, columns.map((column, i) => {
|
|
2546
|
+
const columnId = generateUniqueId(`column-${i}`);
|
|
2547
|
+
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) },
|
|
2493
2548
|
column.label,
|
|
2494
|
-
column.isSortable && sortBy === column.id ? (React.createElement(IconWrapper,
|
|
2495
|
-
React.createElement(StyledIcon$1, { path: sortDirection === 'asc' ? js.mdiChevronUp : js.mdiChevronDown, size: '20px' }))) : null));
|
|
2549
|
+
column.isSortable && sortBy === column.id ? (React.createElement(IconWrapper, { id: `${columnId}-icon-wrapper` },
|
|
2550
|
+
React.createElement(StyledIcon$1, { id: `${columnId}-icon`, path: sortDirection === 'asc' ? js.mdiChevronUp : js.mdiChevronDown, size: '20px' }))) : null));
|
|
2496
2551
|
})))),
|
|
2497
|
-
data.length ? (React.createElement("tbody",
|
|
2498
|
-
|
|
2499
|
-
|
|
2552
|
+
data.length ? (React.createElement("tbody", { id: `${id}-tbody` }, data.map((row, i) => {
|
|
2553
|
+
const rowId = generateUniqueId(`row-${i}`);
|
|
2554
|
+
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) => {
|
|
2555
|
+
const columnId = generateUniqueId(`column-${j}`);
|
|
2556
|
+
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'));
|
|
2500
2557
|
})));
|
|
2501
2558
|
}))) : null));
|
|
2502
|
-
};
|
|
2503
|
-
|
|
2559
|
+
};
|
|
2560
|
+
|
|
2504
2561
|
const Wrapper$1 = styled.div `
|
|
2505
2562
|
display: flex;
|
|
2506
2563
|
box-sizing: border-box;
|
|
@@ -2552,15 +2609,17 @@ const Badge = styled.div `
|
|
|
2552
2609
|
Badge.defaultProps = { theme: EditableTheme };
|
|
2553
2610
|
const Tabs = (_a) => {
|
|
2554
2611
|
var { tabs } = _a, accessibleProps = __rest(_a, ["tabs"]);
|
|
2555
|
-
|
|
2612
|
+
const id = generateUniqueId('tabs');
|
|
2613
|
+
return (React.createElement(Wrapper$1, Object.assign({}, accessibleProps, { id: `${id}-wrapper` }), tabs.map((_a, i) => {
|
|
2556
2614
|
var { isActive, label, badgeCount, errorBadge, onClick } = _a, accessibleProps = __rest(_a, ["isActive", "label", "badgeCount", "errorBadge", "onClick"]);
|
|
2557
|
-
|
|
2558
|
-
|
|
2615
|
+
const tabId = generateUniqueId(`tab-${i}`);
|
|
2616
|
+
return (React.createElement(Tab, Object.assign({ "$isActive": isActive || false, key: i, onClick: isActive ? undefined : onClick }, accessibleProps, { id: `${tabId}-tab` }),
|
|
2617
|
+
badgeCount ? (React.createElement(Badge, { "$isError": errorBadge || false, id: `${tabId}-badge` }, badgeCount)) : null,
|
|
2559
2618
|
label));
|
|
2560
2619
|
})));
|
|
2561
2620
|
};
|
|
2562
|
-
Tabs.defaultProps = {};
|
|
2563
|
-
|
|
2621
|
+
Tabs.defaultProps = {};
|
|
2622
|
+
|
|
2564
2623
|
const Track = styled.div `
|
|
2565
2624
|
height: 24px;
|
|
2566
2625
|
border-radius: 12px;
|
|
@@ -2585,13 +2644,14 @@ const Handle = styled.div `
|
|
|
2585
2644
|
`;
|
|
2586
2645
|
const Toggle = (_a) => {
|
|
2587
2646
|
var { onClick, on } = _a, accessibleProps = __rest(_a, ["onClick", "on"]);
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
React.createElement(
|
|
2591
|
-
|
|
2647
|
+
const id = generateUniqueId('toggle');
|
|
2648
|
+
return (React.createElement(Track, Object.assign({ "$on": on, onClick: onClick }, accessibleProps, { id: `${id}-track` }),
|
|
2649
|
+
React.createElement("input", { checked: on, id: `${id}-input`, name: accessibleProps.name, type: 'hidden' }),
|
|
2650
|
+
React.createElement(Handle, { "$on": on, id: `${id}-handle` },
|
|
2651
|
+
React.createElement(Icon, { color: on ? Colors.GREEN.Hex : Colors.BLACK.Hex, id: `${id}-icon`, path: on ? js.mdiCheck : js.mdiClose, size: '16px' }))));
|
|
2592
2652
|
};
|
|
2593
|
-
Toggle.defaultProps = {};
|
|
2594
|
-
|
|
2653
|
+
Toggle.defaultProps = {};
|
|
2654
|
+
|
|
2595
2655
|
const Container = styled.div `
|
|
2596
2656
|
width: 100%;
|
|
2597
2657
|
padding: 40px auto;
|
|
@@ -2619,60 +2679,61 @@ const StyledIcon = styled.div `
|
|
|
2619
2679
|
`;
|
|
2620
2680
|
const ZeroState = (_a) => {
|
|
2621
2681
|
var { icon, title, description, action } = _a, accessibleProps = __rest(_a, ["icon", "title", "description", "action"]);
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
};
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
exports.
|
|
2633
|
-
exports.
|
|
2634
|
-
exports.
|
|
2635
|
-
exports.
|
|
2636
|
-
exports.
|
|
2637
|
-
exports.
|
|
2638
|
-
exports.
|
|
2639
|
-
exports.
|
|
2640
|
-
exports.
|
|
2641
|
-
exports.
|
|
2642
|
-
exports.
|
|
2643
|
-
exports.
|
|
2644
|
-
exports.
|
|
2645
|
-
exports.
|
|
2646
|
-
exports.
|
|
2647
|
-
exports.
|
|
2648
|
-
exports.
|
|
2649
|
-
exports.
|
|
2650
|
-
exports.
|
|
2651
|
-
exports.
|
|
2652
|
-
exports.
|
|
2653
|
-
exports.
|
|
2654
|
-
exports.
|
|
2655
|
-
exports.
|
|
2656
|
-
exports.
|
|
2657
|
-
exports.
|
|
2658
|
-
exports.
|
|
2659
|
-
exports.
|
|
2660
|
-
exports.
|
|
2661
|
-
exports.
|
|
2662
|
-
exports.
|
|
2663
|
-
exports.
|
|
2664
|
-
exports.
|
|
2665
|
-
exports.
|
|
2666
|
-
exports.
|
|
2667
|
-
exports.
|
|
2668
|
-
exports.
|
|
2669
|
-
exports.
|
|
2670
|
-
exports.
|
|
2671
|
-
exports.
|
|
2672
|
-
exports.
|
|
2673
|
-
exports.
|
|
2674
|
-
exports.
|
|
2675
|
-
exports.
|
|
2676
|
-
exports.
|
|
2677
|
-
exports.
|
|
2678
|
-
|
|
2682
|
+
const id = generateUniqueId('zero-state');
|
|
2683
|
+
return (React.createElement(Container, Object.assign({}, accessibleProps, { id: `${id}-container` }),
|
|
2684
|
+
React.createElement(StyledIcon, { id: `${id}-icon-wrapper` },
|
|
2685
|
+
React.createElement(Icon, { color: Colors.MEDIUM_GRAY.Hex, id: `${id}-icon`, path: icon, size: '40px' })),
|
|
2686
|
+
React.createElement(Wrapper, { id: `${id}-wrapper` },
|
|
2687
|
+
React.createElement(Heading, { children: title, id: `${id}-heading`, type: 'tertiary' }),
|
|
2688
|
+
description && (React.createElement(Copy, { align: 'center', children: description, color: 'GRAY', id: `${id}-description`, type: 'default' }))),
|
|
2689
|
+
action && (React.createElement(Button, { children: action.children, disabled: action.disabled, format: action.format, icon: action.icon, id: `${id}-button`, onClick: action.onClick }))));
|
|
2690
|
+
};
|
|
2691
|
+
|
|
2692
|
+
exports.Accordion = Accordion;
|
|
2693
|
+
exports.ActionDialog = ActionDialog;
|
|
2694
|
+
exports.Alert = Alert;
|
|
2695
|
+
exports.AppHeader = AppHeader;
|
|
2696
|
+
exports.AppMenu = AppMenu;
|
|
2697
|
+
exports.BulkActionBar = BulkActionBar;
|
|
2698
|
+
exports.Button = Button;
|
|
2699
|
+
exports.ButtonMenu = ButtonMenu;
|
|
2700
|
+
exports.Checkbox = Checkbox;
|
|
2701
|
+
exports.Checklist = Checklist;
|
|
2702
|
+
exports.Colors = Colors;
|
|
2703
|
+
exports.Copy = Copy;
|
|
2704
|
+
exports.DatePicker = DatePicker;
|
|
2705
|
+
exports.Drawer = Drawer;
|
|
2706
|
+
exports.EditableTheme = EditableTheme;
|
|
2707
|
+
exports.Field = Field;
|
|
2708
|
+
exports.FieldGroup = FieldGroup;
|
|
2709
|
+
exports.FileUpload = FileUpload;
|
|
2710
|
+
exports.FontSizes = FontSizes;
|
|
2711
|
+
exports.FontStyles = FontStyles;
|
|
2712
|
+
exports.Heading = Heading;
|
|
2713
|
+
exports.Input = Input$1;
|
|
2714
|
+
exports.Link = Link;
|
|
2715
|
+
exports.Loader = Loader;
|
|
2716
|
+
exports.Logo = Logo;
|
|
2717
|
+
exports.Modal = Modal;
|
|
2718
|
+
exports.MoreMenu = MoreMenu;
|
|
2719
|
+
exports.MultiSelect = MultiSelect;
|
|
2720
|
+
exports.PageHeader = PageHeader;
|
|
2721
|
+
exports.Pagination = Pagination;
|
|
2722
|
+
exports.ProgressBar = ProgressBar;
|
|
2723
|
+
exports.Radio = Radio;
|
|
2724
|
+
exports.RadioList = RadioList;
|
|
2725
|
+
exports.Select = Select;
|
|
2726
|
+
exports.Table = Table;
|
|
2727
|
+
exports.Tabs = Tabs;
|
|
2728
|
+
exports.Tag = Tag;
|
|
2729
|
+
exports.Toggle = Toggle;
|
|
2730
|
+
exports.Tooltip = Tooltip;
|
|
2731
|
+
exports.ZeroState = ZeroState;
|
|
2732
|
+
exports.formatAsPhone = formatAsPhone;
|
|
2733
|
+
exports.formatAsSsn = formatAsSsn;
|
|
2734
|
+
exports.getAgesFromDob = getAgesFromDob;
|
|
2735
|
+
exports.getDaysForMonth = getDaysForMonth;
|
|
2736
|
+
exports.getYears = getYears;
|
|
2737
|
+
exports.validateEmail = validateEmail;
|
|
2738
|
+
exports.validatePhone = validatePhone;
|
|
2739
|
+
//# sourceMappingURL=index.js.map
|