@hexure/ui 1.13.39 → 1.13.41
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 +1809 -1825
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/Accordion/Accordion.d.ts +1 -0
- package/dist/cjs/types/components/ActionDialog/ActionDialog.d.ts +2 -0
- package/dist/cjs/types/components/Alert/Alert.d.ts +2 -0
- package/dist/cjs/types/components/AppHeader/AppHeader.d.ts +2 -0
- package/dist/cjs/types/components/AppMenu/AppMenu.d.ts +2 -0
- package/dist/cjs/types/components/BulkActionBar/BulkActionBar.d.ts +2 -0
- package/dist/cjs/types/components/Button/Button.d.ts +2 -0
- package/dist/cjs/types/components/ButtonMenu/ButtonMenu.d.ts +2 -0
- package/dist/cjs/types/components/Checkbox/Checkbox.d.ts +2 -0
- package/dist/cjs/types/components/Checklist/Checklist.d.ts +2 -0
- package/dist/cjs/types/components/Copy/Copy.d.ts +3 -1
- package/dist/cjs/types/components/DatePicker/DatePicker.d.ts +2 -0
- package/dist/cjs/types/components/Drawer/Drawer.d.ts +2 -0
- package/dist/cjs/types/components/Field/Field.d.ts +2 -0
- package/dist/cjs/types/components/FieldGroup/FieldGroup.d.ts +2 -0
- package/dist/cjs/types/components/FileUpload/FileUpload.d.ts +2 -0
- package/dist/cjs/types/components/Heading/Heading.d.ts +2 -0
- package/dist/cjs/types/components/Input/Input.d.ts +2 -0
- package/dist/cjs/types/components/Link/Link.d.ts +2 -0
- package/dist/cjs/types/components/Loader/Loader.d.ts +5 -1
- package/dist/cjs/types/components/Logo/Logo.d.ts +2 -0
- package/dist/cjs/types/components/Modal/Modal.d.ts +2 -0
- package/dist/cjs/types/components/MoreMenu/MoreMenu.d.ts +2 -0
- package/dist/cjs/types/components/MultiSelect/MultiSelect.d.ts +2 -0
- package/dist/cjs/types/components/PageHeader/PageHeader.d.ts +2 -0
- package/dist/cjs/types/components/Pagination/Pagination.d.ts +2 -0
- package/dist/cjs/types/components/ProgressBar/ProgressBar.d.ts +2 -0
- package/dist/cjs/types/components/Radio/Radio.d.ts +2 -0
- package/dist/cjs/types/components/RadioList/RadioList.d.ts +2 -0
- package/dist/cjs/types/components/Select/Select.d.ts +2 -0
- package/dist/cjs/types/components/Table/Table.d.ts +2 -0
- package/dist/cjs/types/components/Tabs/Tabs.d.ts +2 -0
- package/dist/cjs/types/components/Tag/Tag.d.ts +2 -0
- package/dist/cjs/types/components/Toast/Toast.d.ts +2 -0
- package/dist/cjs/types/components/Toggle/Toggle.d.ts +2 -0
- package/dist/cjs/types/components/Tooltip/Tooltip.d.ts +2 -0
- package/dist/cjs/types/components/ZeroState/ZeroState.d.ts +2 -0
- package/dist/esm/index.js +1761 -1777
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Accordion/Accordion.d.ts +1 -0
- package/dist/esm/types/components/ActionDialog/ActionDialog.d.ts +2 -0
- package/dist/esm/types/components/Alert/Alert.d.ts +2 -0
- package/dist/esm/types/components/AppHeader/AppHeader.d.ts +2 -0
- package/dist/esm/types/components/AppMenu/AppMenu.d.ts +2 -0
- package/dist/esm/types/components/BulkActionBar/BulkActionBar.d.ts +2 -0
- package/dist/esm/types/components/Button/Button.d.ts +2 -0
- package/dist/esm/types/components/ButtonMenu/ButtonMenu.d.ts +2 -0
- package/dist/esm/types/components/Checkbox/Checkbox.d.ts +2 -0
- package/dist/esm/types/components/Checklist/Checklist.d.ts +2 -0
- package/dist/esm/types/components/Copy/Copy.d.ts +3 -1
- package/dist/esm/types/components/DatePicker/DatePicker.d.ts +2 -0
- package/dist/esm/types/components/Drawer/Drawer.d.ts +2 -0
- package/dist/esm/types/components/Field/Field.d.ts +2 -0
- package/dist/esm/types/components/FieldGroup/FieldGroup.d.ts +2 -0
- package/dist/esm/types/components/FileUpload/FileUpload.d.ts +2 -0
- package/dist/esm/types/components/Heading/Heading.d.ts +2 -0
- package/dist/esm/types/components/Input/Input.d.ts +2 -0
- package/dist/esm/types/components/Link/Link.d.ts +2 -0
- package/dist/esm/types/components/Loader/Loader.d.ts +5 -1
- package/dist/esm/types/components/Logo/Logo.d.ts +2 -0
- package/dist/esm/types/components/Modal/Modal.d.ts +2 -0
- package/dist/esm/types/components/MoreMenu/MoreMenu.d.ts +2 -0
- package/dist/esm/types/components/MultiSelect/MultiSelect.d.ts +2 -0
- package/dist/esm/types/components/PageHeader/PageHeader.d.ts +2 -0
- package/dist/esm/types/components/Pagination/Pagination.d.ts +2 -0
- package/dist/esm/types/components/ProgressBar/ProgressBar.d.ts +2 -0
- package/dist/esm/types/components/Radio/Radio.d.ts +2 -0
- package/dist/esm/types/components/RadioList/RadioList.d.ts +2 -0
- package/dist/esm/types/components/Select/Select.d.ts +2 -0
- package/dist/esm/types/components/Table/Table.d.ts +2 -0
- package/dist/esm/types/components/Tabs/Tabs.d.ts +2 -0
- package/dist/esm/types/components/Tag/Tag.d.ts +2 -0
- package/dist/esm/types/components/Toast/Toast.d.ts +2 -0
- package/dist/esm/types/components/Toggle/Toggle.d.ts +2 -0
- package/dist/esm/types/components/Tooltip/Tooltip.d.ts +2 -0
- package/dist/esm/types/components/ZeroState/ZeroState.d.ts +2 -0
- package/dist/index.d.ts +155 -82
- package/package.json +1 -1
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,89 +85,71 @@ const FontSizes = {
|
|
|
85
85
|
};
|
|
86
86
|
const EditableTheme = {
|
|
87
87
|
PRIMARY_COLOR: Colors.PRIMARY,
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
const Header$3 = styled.div `
|
|
109
|
-
display: flex;
|
|
110
|
-
align-items: center;
|
|
111
|
-
justify-content: space-between;
|
|
112
|
-
box-sizing: border-box;
|
|
113
|
-
background: #f5f5f5;
|
|
114
|
-
border: 1px solid #e5e5e5;
|
|
115
|
-
padding: 14px 20px;
|
|
116
|
-
height: 50px;
|
|
117
|
-
cursor: pointer;
|
|
118
|
-
`;
|
|
119
|
-
const Title$2 = styled.div `
|
|
120
|
-
font-size: ${FontSizes.DEFAULT};
|
|
121
|
-
font-weight: 400;
|
|
122
|
-
color: ${Colors.BLACK.Hex};
|
|
123
|
-
line-height: 1.6em;
|
|
124
|
-
font-family: ${FontStyles.DEFAULT};
|
|
125
|
-
box-sizing: border-box;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const Header$3 = styled.div `
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
justify-content: space-between;
|
|
94
|
+
box-sizing: border-box;
|
|
95
|
+
background: #f5f5f5;
|
|
96
|
+
border: 1px solid #e5e5e5;
|
|
97
|
+
padding: 14px 20px;
|
|
98
|
+
height: 50px;
|
|
99
|
+
cursor: pointer;
|
|
100
|
+
`;
|
|
101
|
+
const Title$2 = styled.div `
|
|
102
|
+
font-size: ${FontSizes.DEFAULT};
|
|
103
|
+
font-weight: 400;
|
|
104
|
+
color: ${Colors.BLACK.Hex};
|
|
105
|
+
line-height: 1.6em;
|
|
106
|
+
font-family: ${FontStyles.DEFAULT};
|
|
107
|
+
box-sizing: border-box;
|
|
126
108
|
`;
|
|
127
109
|
const Accordion = (_a) => {
|
|
128
|
-
var { title, children, open, onClick } = _a, accessibleProps = __rest(_a, ["title", "children", "open", "onClick"]);
|
|
129
|
-
const
|
|
110
|
+
var { id, title, children, open, onClick } = _a, accessibleProps = __rest(_a, ["id", "title", "children", "open", "onClick"]);
|
|
111
|
+
const baseId = id || 'accordion';
|
|
130
112
|
return (React.createElement(React.Fragment, null,
|
|
131
|
-
React.createElement(Header$3, Object.assign({ id: `${
|
|
132
|
-
React.createElement(Title$2, { id: `${
|
|
133
|
-
React.createElement(Icon, { color: Colors.BLACK.Hex, id: `${
|
|
134
|
-
open ? React.createElement("div", { id: `${
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
const StyledComponent = styled.p `
|
|
138
|
-
color: ${props => Colors[props.$color || 'BLACK'].Hex};
|
|
139
|
-
font-size: ${props => (props.$type === 'small' ? FontSizes.SMALL : FontSizes.DEFAULT)};
|
|
140
|
-
line-height: ${props => (props.$type === 'small' ? '1.5em' : '1.6em')};
|
|
141
|
-
letter-spacing: ${props => (props.$type === 'small' ? '1px' : '0px')};
|
|
142
|
-
font-weight: ${props => (props.$type === 'bold' ? '500' : '400')};
|
|
143
|
-
font-style: ${props => (props.$type === 'italic' ? 'italic' : 'normal')};
|
|
144
|
-
text-decoration: ${props => ['underline', 'line-through'].includes(props.$type) ? props.$type : 'none'};
|
|
145
|
-
font-family: 'Roboto', Helvetica, Arial, sans-serif;
|
|
146
|
-
margin: ${props => props.$margin || '0px'};
|
|
147
|
-
padding: ${props => props.$padding || '0px'};
|
|
148
|
-
text-align: ${props => props.$align || 'left'};
|
|
149
|
-
box-sizing: border-box;
|
|
113
|
+
React.createElement(Header$3, Object.assign({ id: `${baseId}-header`, onClick: onClick }, accessibleProps),
|
|
114
|
+
React.createElement(Title$2, { id: `${baseId}-title` }, title),
|
|
115
|
+
React.createElement(Icon, { color: Colors.BLACK.Hex, id: `${baseId}-icon`, path: open ? js.mdiChevronUp : js.mdiChevronDown, size: '24px' })),
|
|
116
|
+
open ? React.createElement("div", { id: `${baseId}-content` }, children) : null));
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const StyledComponent = styled.p `
|
|
120
|
+
color: ${props => Colors[props.$color || 'BLACK'].Hex};
|
|
121
|
+
font-size: ${props => (props.$type === 'small' ? FontSizes.SMALL : FontSizes.DEFAULT)};
|
|
122
|
+
line-height: ${props => (props.$type === 'small' ? '1.5em' : '1.6em')};
|
|
123
|
+
letter-spacing: ${props => (props.$type === 'small' ? '1px' : '0px')};
|
|
124
|
+
font-weight: ${props => (props.$type === 'bold' ? '500' : '400')};
|
|
125
|
+
font-style: ${props => (props.$type === 'italic' ? 'italic' : 'normal')};
|
|
126
|
+
text-decoration: ${props => ['underline', 'line-through'].includes(props.$type) ? props.$type : 'none'};
|
|
127
|
+
font-family: 'Roboto', Helvetica, Arial, sans-serif;
|
|
128
|
+
margin: ${props => props.$margin || '0px'};
|
|
129
|
+
padding: ${props => props.$padding || '0px'};
|
|
130
|
+
text-align: ${props => props.$align || 'left'};
|
|
131
|
+
box-sizing: border-box;
|
|
150
132
|
`;
|
|
151
133
|
const Copy = (_a) => {
|
|
152
|
-
var { children, align = '', margin = '', padding = '', type = 'default', color = 'BLACK' } = _a, accessibleProps = __rest(_a, ["children", "align", "margin", "padding", "type", "color"]);
|
|
153
|
-
const
|
|
154
|
-
return (React.createElement(StyledComponent, Object.assign({ "$align": align, "$color": color, "$margin": margin, "$padding": padding, "$type": type, id: `${
|
|
134
|
+
var { children, align = '', margin = '', padding = '', type = 'default', color = 'BLACK', id } = _a, accessibleProps = __rest(_a, ["children", "align", "margin", "padding", "type", "color", "id"]);
|
|
135
|
+
const baseId = id || 'copy';
|
|
136
|
+
return (React.createElement(StyledComponent, Object.assign({ "$align": align, "$color": color, "$margin": margin, "$padding": padding, "$type": type, id: `${baseId}-styled-component` }, accessibleProps), children));
|
|
155
137
|
};
|
|
156
138
|
Copy.defaultProps = {
|
|
157
139
|
type: 'default',
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
const Wrapper$h = styled.div `
|
|
161
|
-
display: inline-block;
|
|
162
|
-
position: relative;
|
|
163
|
-
height: 16px;
|
|
164
|
-
`;
|
|
165
|
-
const StyledIcon$6 = styled(Icon) `
|
|
166
|
-
width: 16px;
|
|
167
|
-
height: 16px;
|
|
168
|
-
margin: 0px 6px;
|
|
169
|
-
color: ${props => props.theme.PRIMARY_COLOR.Hex};
|
|
170
|
-
cursor: pointer;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
const Wrapper$h = styled.div `
|
|
143
|
+
display: inline-block;
|
|
144
|
+
position: relative;
|
|
145
|
+
height: 16px;
|
|
146
|
+
`;
|
|
147
|
+
const StyledIcon$6 = styled(Icon) `
|
|
148
|
+
width: 16px;
|
|
149
|
+
height: 16px;
|
|
150
|
+
margin: 0px 6px;
|
|
151
|
+
color: ${props => props.theme.PRIMARY_COLOR.Hex};
|
|
152
|
+
cursor: pointer;
|
|
171
153
|
`;
|
|
172
154
|
StyledIcon$6.defaultProps = { theme: EditableTheme };
|
|
173
155
|
const positions = {
|
|
@@ -200,19 +182,19 @@ const positions = {
|
|
|
200
182
|
};
|
|
201
183
|
const Content$3 = styled.div(props => (Object.assign({ position: 'absolute', borderRadius: '4px', borderWidth: '1px', borderStyle: 'solid', borderColor: props.theme.PRIMARY_COLOR.Hex, background: '#ffffff', boxShadow: '0px 5px 30px -10px rgba(0, 0, 0, 0.5)', width: props.$width || '240px', padding: '10px 12px', zIndex: 9999 }, positions[props.$position])));
|
|
202
184
|
Content$3.defaultProps = { theme: EditableTheme };
|
|
203
|
-
const Tooltip = ({ children, position = 'right-top', width = '240px', trigger, }) => {
|
|
185
|
+
const Tooltip = ({ children, position = 'right-top', width = '240px', trigger, id, }) => {
|
|
204
186
|
const [show_content, toggleContent] = React.useState(false);
|
|
205
|
-
const
|
|
206
|
-
return (React.createElement(Wrapper$h, { id: `${
|
|
207
|
-
trigger || React.createElement(StyledIcon$6, { id: `${
|
|
208
|
-
show_content ? (React.createElement(Content$3, { "$position": position, "$width": width, id: `${
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
const StyledButton = styled.button `
|
|
212
|
-
height: ${props => (props.$small ? '30px' : '40px')};
|
|
213
|
-
line-height: 1em;
|
|
214
|
-
border-radius: ${props => (props.$small ? '15px' : '20px')};
|
|
215
|
-
margin: ${props => props.$margin || '0px'};
|
|
187
|
+
const baseId = id || 'tooltip';
|
|
188
|
+
return (React.createElement(Wrapper$h, { id: `${baseId}-wrapper`, onMouseEnter: toggleContent.bind(null, true), onMouseLeave: toggleContent.bind(null, false) },
|
|
189
|
+
trigger || React.createElement(StyledIcon$6, { id: `${baseId}-icon`, path: js.mdiInformationOutline }),
|
|
190
|
+
show_content ? (React.createElement(Content$3, { "$position": position, "$width": width, id: `${baseId}-content` }, children && (React.createElement(Copy, { id: `${baseId}-copy`, type: 'small' }, children)))) : null));
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
const StyledButton = styled.button `
|
|
194
|
+
height: ${props => (props.$small ? '30px' : '40px')};
|
|
195
|
+
line-height: 1em;
|
|
196
|
+
border-radius: ${props => (props.$small ? '15px' : '20px')};
|
|
197
|
+
margin: ${props => props.$margin || '0px'};
|
|
216
198
|
padding: ${props => {
|
|
217
199
|
if (props.$hasChildren) {
|
|
218
200
|
if (props.$small) {
|
|
@@ -223,9 +205,9 @@ const StyledButton = styled.button `
|
|
|
223
205
|
}
|
|
224
206
|
}
|
|
225
207
|
return '0px';
|
|
226
|
-
}};
|
|
227
|
-
outline: none;
|
|
228
|
-
background: ${props => props.$bg_color || props.theme.PRIMARY_COLOR.Hex};
|
|
208
|
+
}};
|
|
209
|
+
outline: none;
|
|
210
|
+
background: ${props => props.$bg_color || props.theme.PRIMARY_COLOR.Hex};
|
|
229
211
|
width: ${props => {
|
|
230
212
|
if (props.$hasChildren) {
|
|
231
213
|
return 'auto';
|
|
@@ -234,58 +216,58 @@ const StyledButton = styled.button `
|
|
|
234
216
|
return '30px';
|
|
235
217
|
}
|
|
236
218
|
return '40px';
|
|
237
|
-
}};
|
|
238
|
-
cursor: ${props => (props.$disabled ? 'default' : 'pointer')};
|
|
239
|
-
display: flex;
|
|
240
|
-
align-items: center;
|
|
241
|
-
justify-content: center;
|
|
242
|
-
gap: ${props => (props.$iconPosition === 'before' ? '8px' : '0px')};
|
|
243
|
-
flex-direction: ${props => (props.$iconPosition === 'before' ? 'row-reverse' : 'row')};
|
|
244
|
-
opacity: ${props => (props.$disabled ? 0.6 : 0.9)};
|
|
245
|
-
border-width: 1px;
|
|
246
|
-
border-style: solid;
|
|
247
|
-
border-color: ${props => props.$border_color || props.theme.PRIMARY_COLOR.Hex};
|
|
248
|
-
box-sizing: border-box;
|
|
249
|
-
|
|
250
|
-
&:active,
|
|
251
|
-
&:focus,
|
|
252
|
-
&:hover {
|
|
253
|
-
opacity: ${props => (props.$disabled ? 0.6 : 1)};
|
|
254
|
-
}
|
|
255
|
-
`;
|
|
256
|
-
const Label$5 = styled.span `
|
|
257
|
-
color: ${props => props.$content_color || '#fff'};
|
|
258
|
-
font-size: ${props => (props.$small ? FontSizes.SMALL : FontSizes.DEFAULT)};
|
|
259
|
-
font-family: ${FontStyles.DEFAULT};
|
|
260
|
-
font-weight: 500;
|
|
261
|
-
line-height: 1;
|
|
262
|
-
`;
|
|
263
|
-
const StyledIcon$5 = styled.span `
|
|
264
|
-
margin-left: ${props => (props.$hasChildren ? '6px' : '0px')};
|
|
265
|
-
margin-right: ${props => (props.$hasChildren ? '-4px' : '0px')};
|
|
266
|
-
display: flex;
|
|
267
|
-
align-items: center;
|
|
268
|
-
box-sizing: border-box;
|
|
269
|
-
`;
|
|
270
|
-
const Badge$1 = styled.span `
|
|
271
|
-
width: ${props => (props.$small ? '20px' : '24px')};
|
|
272
|
-
height: ${props => (props.$small ? '20px' : '24px')};
|
|
273
|
-
line-height: 1;
|
|
274
|
-
display: flex;
|
|
275
|
-
align-items: center;
|
|
276
|
-
justify-content: center;
|
|
277
|
-
border-radius: 100%;
|
|
278
|
-
background-color: ${props => props.$bg_color || '#fff'};
|
|
279
|
-
color: ${props => props.$content_color || props.theme.PRIMARY_COLOR.Hex};
|
|
280
|
-
font-size: ${props => (props.$small ? '10px' : '12px')};
|
|
281
|
-
font-weight: 600;
|
|
282
|
-
font-family: ${FontStyles.DEFAULT};
|
|
283
|
-
letter-spacing: -1px;
|
|
284
|
-
margin-left: ${props => (props.$small ? '5px' : '10px')};
|
|
285
|
-
margin-right: ${props => (props.$small ? '-5px' : '-10px')};
|
|
219
|
+
}};
|
|
220
|
+
cursor: ${props => (props.$disabled ? 'default' : 'pointer')};
|
|
221
|
+
display: flex;
|
|
222
|
+
align-items: center;
|
|
223
|
+
justify-content: center;
|
|
224
|
+
gap: ${props => (props.$iconPosition === 'before' ? '8px' : '0px')};
|
|
225
|
+
flex-direction: ${props => (props.$iconPosition === 'before' ? 'row-reverse' : 'row')};
|
|
226
|
+
opacity: ${props => (props.$disabled ? 0.6 : 0.9)};
|
|
227
|
+
border-width: 1px;
|
|
228
|
+
border-style: solid;
|
|
229
|
+
border-color: ${props => props.$border_color || props.theme.PRIMARY_COLOR.Hex};
|
|
230
|
+
box-sizing: border-box;
|
|
231
|
+
|
|
232
|
+
&:active,
|
|
233
|
+
&:focus,
|
|
234
|
+
&:hover {
|
|
235
|
+
opacity: ${props => (props.$disabled ? 0.6 : 1)};
|
|
236
|
+
}
|
|
237
|
+
`;
|
|
238
|
+
const Label$5 = styled.span `
|
|
239
|
+
color: ${props => props.$content_color || '#fff'};
|
|
240
|
+
font-size: ${props => (props.$small ? FontSizes.SMALL : FontSizes.DEFAULT)};
|
|
241
|
+
font-family: ${FontStyles.DEFAULT};
|
|
242
|
+
font-weight: 500;
|
|
243
|
+
line-height: 1;
|
|
244
|
+
`;
|
|
245
|
+
const StyledIcon$5 = styled.span `
|
|
246
|
+
margin-left: ${props => (props.$hasChildren ? '6px' : '0px')};
|
|
247
|
+
margin-right: ${props => (props.$hasChildren ? '-4px' : '0px')};
|
|
248
|
+
display: flex;
|
|
249
|
+
align-items: center;
|
|
250
|
+
box-sizing: border-box;
|
|
251
|
+
`;
|
|
252
|
+
const Badge$1 = styled.span `
|
|
253
|
+
width: ${props => (props.$small ? '20px' : '24px')};
|
|
254
|
+
height: ${props => (props.$small ? '20px' : '24px')};
|
|
255
|
+
line-height: 1;
|
|
256
|
+
display: flex;
|
|
257
|
+
align-items: center;
|
|
258
|
+
justify-content: center;
|
|
259
|
+
border-radius: 100%;
|
|
260
|
+
background-color: ${props => props.$bg_color || '#fff'};
|
|
261
|
+
color: ${props => props.$content_color || props.theme.PRIMARY_COLOR.Hex};
|
|
262
|
+
font-size: ${props => (props.$small ? '10px' : '12px')};
|
|
263
|
+
font-weight: 600;
|
|
264
|
+
font-family: ${FontStyles.DEFAULT};
|
|
265
|
+
letter-spacing: -1px;
|
|
266
|
+
margin-left: ${props => (props.$small ? '5px' : '10px')};
|
|
267
|
+
margin-right: ${props => (props.$small ? '-5px' : '-10px')};
|
|
286
268
|
`;
|
|
287
269
|
const Button = (_a) => {
|
|
288
|
-
var { badge, children, disabled = false, icon, isForm = false, loading = false, margin = '', onClick, small = false, format = 'primary', iconPosition = 'after', toolTip, title = '' } = _a, accessibleProps = __rest(_a, ["badge", "children", "disabled", "icon", "isForm", "loading", "margin", "onClick", "small", "format", "iconPosition", "toolTip", "title"]);
|
|
270
|
+
var { badge, children, disabled = false, icon, isForm = false, loading = false, margin = '', onClick, small = false, format = 'primary', iconPosition = 'after', toolTip, title = '', id } = _a, accessibleProps = __rest(_a, ["badge", "children", "disabled", "icon", "isForm", "loading", "margin", "onClick", "small", "format", "iconPosition", "toolTip", "title", "id"]);
|
|
289
271
|
const theme = React.useContext(styled.ThemeContext) || EditableTheme;
|
|
290
272
|
const has_children = children && children.length > 0;
|
|
291
273
|
const button_type_mapping = {
|
|
@@ -319,130 +301,130 @@ const Button = (_a) => {
|
|
|
319
301
|
},
|
|
320
302
|
};
|
|
321
303
|
const format_styles = button_type_mapping[format];
|
|
322
|
-
const
|
|
323
|
-
const button_view = (React.createElement(StyledButton, Object.assign({ "$bg_color": format_styles.background_color, "$border_color": format_styles.border_color, "$disabled": disabled || loading, "$hasChildren": !!has_children, "$iconPosition": iconPosition, "$margin": margin, "$small": small, disabled: disabled || loading, onClick: disabled || loading ? undefined : onClick, title: title, type: isForm ? 'submit' : undefined }, accessibleProps, { id: `${
|
|
324
|
-
children ? (React.createElement(Label$5, { "$content_color": format_styles.content_color, "$small": small, id: `${
|
|
325
|
-
icon && !badge ? (React.createElement(StyledIcon$5, { "$hasChildren": !!has_children, id: `${
|
|
326
|
-
React.createElement(Icon, { color: format ? format_styles === null || format_styles === void 0 ? void 0 : format_styles.content_color : '#fff', id: `${
|
|
327
|
-
badge && !icon ? (React.createElement(Badge$1, { "$bg_color": format_styles.badge_bg_color, "$content_color": format_styles.badge_content_color, "$small": small, id: `${
|
|
304
|
+
const baseId = id || 'button';
|
|
305
|
+
const button_view = (React.createElement(StyledButton, Object.assign({ "$bg_color": format_styles.background_color, "$border_color": format_styles.border_color, "$disabled": disabled || loading, "$hasChildren": !!has_children, "$iconPosition": iconPosition, "$margin": margin, "$small": small, disabled: disabled || loading, onClick: disabled || loading ? undefined : onClick, title: title, type: isForm ? 'submit' : undefined }, accessibleProps, { id: `${baseId}-styled-button` }),
|
|
306
|
+
children ? (React.createElement(Label$5, { "$content_color": format_styles.content_color, "$small": small, id: `${baseId}-label` }, children)) : null,
|
|
307
|
+
icon && !badge ? (React.createElement(StyledIcon$5, { "$hasChildren": !!has_children, id: `${baseId}-icon` },
|
|
308
|
+
React.createElement(Icon, { color: format ? format_styles === null || format_styles === void 0 ? void 0 : format_styles.content_color : '#fff', id: `${baseId}-icon-svg`, path: loading ? js.mdiLoading : icon, size: small ? '20px' : '24px', spin: loading }))) : null,
|
|
309
|
+
badge && !icon ? (React.createElement(Badge$1, { "$bg_color": format_styles.badge_bg_color, "$content_color": format_styles.badge_content_color, "$small": small, id: `${baseId}-badge` }, badge)) : null));
|
|
328
310
|
if (toolTip && Object.keys(toolTip).length) {
|
|
329
311
|
return (React.createElement(Tooltip, Object.assign({}, toolTip, { trigger: (toolTip === null || toolTip === void 0 ? void 0 : toolTip.trigger) || button_view }), toolTip === null || toolTip === void 0 ? void 0 : toolTip.children));
|
|
330
312
|
}
|
|
331
313
|
return button_view;
|
|
332
|
-
};
|
|
333
|
-
|
|
334
|
-
const H1 = styled.h1 `
|
|
335
|
-
color: ${Colors.BLACK.Hex};
|
|
336
|
-
font-size: 30px;
|
|
337
|
-
font-weight: ${props => (props.$bold ? '500' : '400')};
|
|
338
|
-
line-height: 1.4em;
|
|
339
|
-
font-family: 'Roboto Slab', Roboto, Helvetica, Arial, sans-serif;
|
|
340
|
-
margin: ${props => props.$margin || '0px'};
|
|
341
|
-
padding: ${props => props.$padding || '0px'};
|
|
342
|
-
box-sizing: border-box;
|
|
343
|
-
`;
|
|
344
|
-
const H2 = styled.h2 `
|
|
345
|
-
color: ${Colors.BLACK.Hex};
|
|
346
|
-
font-size: 24px;
|
|
347
|
-
font-weight: ${props => (props.$bold ? '500' : '400')};
|
|
348
|
-
line-height: 1.33em;
|
|
349
|
-
font-family: 'Roboto Slab', Roboto, Helvetica, Arial, sans-serif;
|
|
350
|
-
margin: ${props => props.$margin || '0px'};
|
|
351
|
-
padding: ${props => props.$padding || '0px'};
|
|
352
|
-
box-sizing: border-box;
|
|
353
|
-
`;
|
|
354
|
-
const H3 = styled.h3 `
|
|
355
|
-
color: ${Colors.BLACK.Hex};
|
|
356
|
-
font-size: 18px;
|
|
357
|
-
font-weight: ${props => (props.$bold ? '500' : '400')};
|
|
358
|
-
line-height: 1.33em;
|
|
359
|
-
font-family: 'Roboto Slab', Roboto, Helvetica, Arial, sans-serif;
|
|
360
|
-
margin: ${props => props.$margin || '0px'};
|
|
361
|
-
padding: ${props => props.$padding || '0px'};
|
|
362
|
-
box-sizing: border-box;
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
const H1 = styled.h1 `
|
|
317
|
+
color: ${Colors.BLACK.Hex};
|
|
318
|
+
font-size: 30px;
|
|
319
|
+
font-weight: ${props => (props.$bold ? '500' : '400')};
|
|
320
|
+
line-height: 1.4em;
|
|
321
|
+
font-family: 'Roboto Slab', Roboto, Helvetica, Arial, sans-serif;
|
|
322
|
+
margin: ${props => props.$margin || '0px'};
|
|
323
|
+
padding: ${props => props.$padding || '0px'};
|
|
324
|
+
box-sizing: border-box;
|
|
325
|
+
`;
|
|
326
|
+
const H2 = styled.h2 `
|
|
327
|
+
color: ${Colors.BLACK.Hex};
|
|
328
|
+
font-size: 24px;
|
|
329
|
+
font-weight: ${props => (props.$bold ? '500' : '400')};
|
|
330
|
+
line-height: 1.33em;
|
|
331
|
+
font-family: 'Roboto Slab', Roboto, Helvetica, Arial, sans-serif;
|
|
332
|
+
margin: ${props => props.$margin || '0px'};
|
|
333
|
+
padding: ${props => props.$padding || '0px'};
|
|
334
|
+
box-sizing: border-box;
|
|
335
|
+
`;
|
|
336
|
+
const H3 = styled.h3 `
|
|
337
|
+
color: ${Colors.BLACK.Hex};
|
|
338
|
+
font-size: 18px;
|
|
339
|
+
font-weight: ${props => (props.$bold ? '500' : '400')};
|
|
340
|
+
line-height: 1.33em;
|
|
341
|
+
font-family: 'Roboto Slab', Roboto, Helvetica, Arial, sans-serif;
|
|
342
|
+
margin: ${props => props.$margin || '0px'};
|
|
343
|
+
padding: ${props => props.$padding || '0px'};
|
|
344
|
+
box-sizing: border-box;
|
|
363
345
|
`;
|
|
364
346
|
const Heading = (_a) => {
|
|
365
|
-
var { bold, children, margin, padding, type } = _a, accessibleProps = __rest(_a, ["bold", "children", "margin", "padding", "type"]);
|
|
366
|
-
const
|
|
347
|
+
var { bold, children, margin, padding, type, id } = _a, accessibleProps = __rest(_a, ["bold", "children", "margin", "padding", "type", "id"]);
|
|
348
|
+
const baseId = id || 'heading';
|
|
367
349
|
switch (type) {
|
|
368
350
|
case 'secondary': {
|
|
369
|
-
return (React.createElement(H2, Object.assign({ "$bold": bold, "$margin": margin, "$padding": padding }, accessibleProps, { id: `${
|
|
351
|
+
return (React.createElement(H2, Object.assign({ "$bold": bold, "$margin": margin, "$padding": padding }, accessibleProps, { id: `${baseId}-h2` }), children));
|
|
370
352
|
}
|
|
371
353
|
case 'tertiary': {
|
|
372
|
-
return (React.createElement(H3, Object.assign({ "$bold": bold, "$margin": margin, "$padding": padding }, accessibleProps, { id: `${
|
|
354
|
+
return (React.createElement(H3, Object.assign({ "$bold": bold, "$margin": margin, "$padding": padding }, accessibleProps, { id: `${baseId}-h3` }), children));
|
|
373
355
|
}
|
|
374
356
|
default: {
|
|
375
|
-
return (React.createElement(H1, Object.assign({ "$bold": bold, "$margin": margin, "$padding": padding }, accessibleProps, { id: `${
|
|
357
|
+
return (React.createElement(H1, Object.assign({ "$bold": bold, "$margin": margin, "$padding": padding }, accessibleProps, { id: `${baseId}-h1` }), children));
|
|
376
358
|
}
|
|
377
359
|
}
|
|
378
360
|
};
|
|
379
361
|
Heading.defaultProps = {
|
|
380
362
|
bold: false,
|
|
381
363
|
type: 'primary',
|
|
382
|
-
};
|
|
383
|
-
|
|
384
|
-
const Wrapper$g = styled.div `
|
|
385
|
-
position: fixed;
|
|
386
|
-
top: 0;
|
|
387
|
-
right: 0;
|
|
388
|
-
bottom: 0;
|
|
389
|
-
left: 0;
|
|
390
|
-
z-index: 9999;
|
|
391
|
-
background: rgba(0, 0, 0, 0.8);
|
|
392
|
-
display: flex;
|
|
393
|
-
align-items: center;
|
|
394
|
-
justify-content: center;
|
|
395
|
-
box-sizing: border-box;
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
const Wrapper$g = styled.div `
|
|
367
|
+
position: fixed;
|
|
368
|
+
top: 0;
|
|
369
|
+
right: 0;
|
|
370
|
+
bottom: 0;
|
|
371
|
+
left: 0;
|
|
372
|
+
z-index: 9999;
|
|
373
|
+
background: rgba(0, 0, 0, 0.8);
|
|
374
|
+
display: flex;
|
|
375
|
+
align-items: center;
|
|
376
|
+
justify-content: center;
|
|
377
|
+
box-sizing: border-box;
|
|
396
378
|
`;
|
|
397
379
|
const Container$4 = styled.dialog(props => (Object.assign({ maxWidth: '600px', width: 'auto', borderRadius: '8px', overflow: 'hidden', boxShadow: '0px 10px 30px -15px rgba(0, 0, 0, 0.2)', outline: 'none', border: 'none', position: 'relative', padding: '40px', textAlign: 'center', boxSizing: 'border-box', wordWrap: 'break-word' }, props.$customStyle)));
|
|
398
|
-
const Buttons$1 = styled.div `
|
|
399
|
-
display: flex;
|
|
400
|
-
gap: 10px;
|
|
401
|
-
align-items: center;
|
|
402
|
-
justify-content: center;
|
|
403
|
-
margin-top: 30px;
|
|
404
|
-
box-sizing: border-box;
|
|
380
|
+
const Buttons$1 = styled.div `
|
|
381
|
+
display: flex;
|
|
382
|
+
gap: 10px;
|
|
383
|
+
align-items: center;
|
|
384
|
+
justify-content: center;
|
|
385
|
+
margin-top: 30px;
|
|
386
|
+
box-sizing: border-box;
|
|
405
387
|
`;
|
|
406
388
|
const ActionDialog = (_a) => {
|
|
407
|
-
var { description, title, primaryButton, secondaryButton, tertiaryButton, style = {} } = _a, accessibleProps = __rest(_a, ["description", "title", "primaryButton", "secondaryButton", "tertiaryButton", "style"]);
|
|
408
|
-
const
|
|
409
|
-
return (React.createElement(Wrapper$g, Object.assign({}, accessibleProps, { id: `${
|
|
410
|
-
React.createElement(Container$4, { "$customStyle": style, id: `${
|
|
411
|
-
title ? (React.createElement(Heading, { id: `${
|
|
412
|
-
description ? (React.createElement(Copy, { align: 'center', id: `${
|
|
413
|
-
primaryButton || secondaryButton || tertiaryButton ? (React.createElement(Buttons$1, { id: `${
|
|
414
|
-
tertiaryButton ? (React.createElement(Button, Object.assign({}, tertiaryButton, { format: tertiaryButton.format || 'secondary', id: `${
|
|
415
|
-
secondaryButton ? (React.createElement(Button, Object.assign({}, secondaryButton, { format: secondaryButton.format || 'secondary', id: `${
|
|
416
|
-
primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { format: primaryButton.format || 'primary', id: `${
|
|
417
|
-
};
|
|
418
|
-
|
|
419
|
-
const Wrapper$f = styled.div `
|
|
420
|
-
border: 1px solid #f1f1f1;
|
|
421
|
-
border-radius: 4px;
|
|
422
|
-
border-left-width: 4px;
|
|
423
|
-
box-shadow: 0px 4px 12px -6px rgba(0, 0, 0, 0.2);
|
|
424
|
-
display: flex;
|
|
425
|
-
align-items: flex-start;
|
|
426
|
-
gap: ${({ $small }) => ($small ? '8px' : '20px')};
|
|
427
|
-
padding: ${({ $small }) => ($small ? '11px' : '20px')};
|
|
428
|
-
box-sizing: border-box;
|
|
429
|
-
`;
|
|
430
|
-
const StyledIcon$4 = styled(Icon) `
|
|
431
|
-
flex-shrink: 0;
|
|
432
|
-
`;
|
|
433
|
-
const Action$1 = styled.div `
|
|
434
|
-
color: ${props => props.theme.PRIMARY_COLOR.Hex};
|
|
435
|
-
font-size: ${FontSizes.DEFAULT};
|
|
436
|
-
font-family: ${FontStyles.DEFAULT};
|
|
437
|
-
font-weight: 500;
|
|
438
|
-
cursor: pointer;
|
|
439
|
-
margin-top: 6px;
|
|
389
|
+
var { description, title, primaryButton, secondaryButton, tertiaryButton, style = {}, id } = _a, accessibleProps = __rest(_a, ["description", "title", "primaryButton", "secondaryButton", "tertiaryButton", "style", "id"]);
|
|
390
|
+
const baseId = id || 'action-dialog';
|
|
391
|
+
return (React.createElement(Wrapper$g, Object.assign({}, accessibleProps, { id: `${baseId}-wrapper` }),
|
|
392
|
+
React.createElement(Container$4, { "$customStyle": style, id: `${baseId}-container`, open: true },
|
|
393
|
+
title ? (React.createElement(Heading, { id: `${baseId}-title`, margin: '0px 0px 20px 0px', type: 'secondary' }, title)) : null,
|
|
394
|
+
description ? (React.createElement(Copy, { align: 'center', id: `${baseId}-description` }, description)) : null,
|
|
395
|
+
primaryButton || secondaryButton || tertiaryButton ? (React.createElement(Buttons$1, { id: `${baseId}-buttons` },
|
|
396
|
+
tertiaryButton ? (React.createElement(Button, Object.assign({}, tertiaryButton, { format: tertiaryButton.format || 'secondary', id: `${baseId}-tertiary-button` }))) : null,
|
|
397
|
+
secondaryButton ? (React.createElement(Button, Object.assign({}, secondaryButton, { format: secondaryButton.format || 'secondary', id: `${baseId}-secondary-button` }))) : null,
|
|
398
|
+
primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { format: primaryButton.format || 'primary', id: `${baseId}-primary-button` }))) : null)) : null)));
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
const Wrapper$f = styled.div `
|
|
402
|
+
border: 1px solid #f1f1f1;
|
|
403
|
+
border-radius: 4px;
|
|
404
|
+
border-left-width: 4px;
|
|
405
|
+
box-shadow: 0px 4px 12px -6px rgba(0, 0, 0, 0.2);
|
|
406
|
+
display: flex;
|
|
407
|
+
align-items: flex-start;
|
|
408
|
+
gap: ${({ $small }) => ($small ? '8px' : '20px')};
|
|
409
|
+
padding: ${({ $small }) => ($small ? '11px' : '20px')};
|
|
410
|
+
box-sizing: border-box;
|
|
411
|
+
`;
|
|
412
|
+
const StyledIcon$4 = styled(Icon) `
|
|
413
|
+
flex-shrink: 0;
|
|
414
|
+
`;
|
|
415
|
+
const Action$1 = styled.div `
|
|
416
|
+
color: ${props => props.theme.PRIMARY_COLOR.Hex};
|
|
417
|
+
font-size: ${FontSizes.DEFAULT};
|
|
418
|
+
font-family: ${FontStyles.DEFAULT};
|
|
419
|
+
font-weight: 500;
|
|
420
|
+
cursor: pointer;
|
|
421
|
+
margin-top: 6px;
|
|
440
422
|
`;
|
|
441
423
|
Action$1.defaultProps = { theme: EditableTheme };
|
|
442
424
|
const Alert = (_a) => {
|
|
443
|
-
var { action, type = 'info', title, description, small = false } = _a, accessibleProps = __rest(_a, ["action", "type", "title", "description", "small"]);
|
|
425
|
+
var { action, type = 'info', title, description, small = false, id } = _a, accessibleProps = __rest(_a, ["action", "type", "title", "description", "small", "id"]);
|
|
444
426
|
const theme = React.useContext(styled.ThemeContext) || EditableTheme;
|
|
445
|
-
const
|
|
427
|
+
const baseId = id || 'alert';
|
|
446
428
|
const type_mapping = {
|
|
447
429
|
info: {
|
|
448
430
|
color: theme.PRIMARY_COLOR.Hex,
|
|
@@ -461,14 +443,14 @@ const Alert = (_a) => {
|
|
|
461
443
|
icon: js.mdiCheckboxMarkedCircleOutline,
|
|
462
444
|
},
|
|
463
445
|
};
|
|
464
|
-
return (React.createElement(Wrapper$f, Object.assign({}, accessibleProps, { "$small": small, id: `${
|
|
465
|
-
React.createElement(StyledIcon$4, { color: type_mapping[type].color, id: `${
|
|
466
|
-
React.createElement("div", { id: `${
|
|
467
|
-
title && !small ? (React.createElement(Heading, { bold: true, id: `${
|
|
468
|
-
description ? (React.createElement(Copy, { id: `${
|
|
469
|
-
action && !small ? (React.createElement(Action$1, { id: `${
|
|
470
|
-
};
|
|
471
|
-
|
|
446
|
+
return (React.createElement(Wrapper$f, Object.assign({}, accessibleProps, { "$small": small, id: `${baseId}-wrapper`, style: { borderLeftColor: type_mapping[type].color } }),
|
|
447
|
+
React.createElement(StyledIcon$4, { color: type_mapping[type].color, id: `${baseId}-icon`, path: type_mapping[type].icon, size: small ? '20px' : '30px' }),
|
|
448
|
+
React.createElement("div", { id: `${baseId}-content` },
|
|
449
|
+
title && !small ? (React.createElement(Heading, { bold: true, id: `${baseId}-title`, margin: '2px 0 0 0', type: 'tertiary' }, title)) : null,
|
|
450
|
+
description ? (React.createElement(Copy, { id: `${baseId}-description`, margin: small ? '' : '6px 0 0 0 !important' }, description)) : null,
|
|
451
|
+
action && !small ? (React.createElement(Action$1, { id: `${baseId}-action`, onClick: action.onClick }, action.label)) : null)));
|
|
452
|
+
};
|
|
453
|
+
|
|
472
454
|
const colorMapping = {
|
|
473
455
|
black: {
|
|
474
456
|
fill_1: '#000000',
|
|
@@ -492,364 +474,364 @@ const colorMapping = {
|
|
|
492
474
|
},
|
|
493
475
|
};
|
|
494
476
|
const Logo = (_a) => {
|
|
495
|
-
var { type = 'standard_full', height = '50px' } = _a, accessibleProps = __rest(_a, ["type", "height"]);
|
|
477
|
+
var { type = 'standard_full', height = '50px', id } = _a, accessibleProps = __rest(_a, ["type", "height", "id"]);
|
|
496
478
|
const type_parts = type.split('_');
|
|
497
|
-
const
|
|
479
|
+
const baseId = id || 'logo';
|
|
498
480
|
switch (type_parts[0]) {
|
|
499
481
|
case 'mark':
|
|
500
|
-
return (React.createElement("svg", Object.assign({ fill: 'none', height: height, viewBox: '0 0 58 51', width: '100%', xmlns: 'http://www.w3.org/2000/svg' }, accessibleProps, { id: `${
|
|
501
|
-
React.createElement("path", { d: 'M43.9348 -1.14441e-05H13.3724L0 25.2376L7.27148 38.0136L14.1215 50.0487H43.1856L57.3077 25.2376L43.9348 -1.14441e-05ZM38.206 9.49903L46.459 25.0743L37.6507 40.5497H19.6567L15.5417 33.3199L10.8487 25.0743L19.1013 9.49903H38.206Z', fill: type_parts[1], id: `${
|
|
482
|
+
return (React.createElement("svg", Object.assign({ fill: 'none', height: height, viewBox: '0 0 58 51', width: '100%', xmlns: 'http://www.w3.org/2000/svg' }, accessibleProps, { id: `${baseId}-svg` }),
|
|
483
|
+
React.createElement("path", { d: 'M43.9348 -1.14441e-05H13.3724L0 25.2376L7.27148 38.0136L14.1215 50.0487H43.1856L57.3077 25.2376L43.9348 -1.14441e-05ZM38.206 9.49903L46.459 25.0743L37.6507 40.5497H19.6567L15.5417 33.3199L10.8487 25.0743L19.1013 9.49903H38.206Z', fill: type_parts[1], id: `${baseId}-path` })));
|
|
502
484
|
default:
|
|
503
|
-
return (React.createElement("svg", Object.assign({ fill: 'none', height: height, preserveAspectRatio: 'xMidYMid meet', viewBox: '0 0 236 50', width: '100%', xmlns: 'http://www.w3.org/2000/svg' }, accessibleProps, { id: `${
|
|
504
|
-
React.createElement("path", { d: 'M230.794 29.59H219.306L214.279 39.0907L217.012 43.9001L219.587 48.4308H230.512L235.821 39.0907L230.794 29.59V29.59ZM228.641 33.1659L231.743 39.0292L228.432 44.8549H221.668L220.121 42.1332L218.356 39.0292L221.459 33.1659H228.641Z', fill: colorMapping[type_parts[1]].fill_3, id: `${
|
|
505
|
-
React.createElement("path", { d: 'M211.662 42.6033L199.206 42.6319C196.339 42.6319 193.862 41.6095 191.846 39.5923C189.828 37.5755 188.805 35.0985 188.805 32.2321C188.805 29.3656 189.828 26.8886 191.846 24.8718C193.848 22.8332 196.325 21.7975 199.206 21.7975C202.072 21.7975 204.549 22.8199 206.566 24.8374C207.613 25.8847 208.391 27.093 208.944 28.5312L209.253 29.3327H197.87L196.325 32.2579L197.921 35.0969H211.458L215.015 28.6192C214.296 25.5702 212.835 22.9293 210.672 20.7657C207.531 17.6257 203.674 16.0333 199.206 16.0333C194.737 16.0333 190.88 17.6257 187.739 20.7657C184.555 23.9501 183.007 27.7011 183.007 32.2321C183.007 36.7001 184.599 40.5577 187.739 43.6981C190.88 46.8384 194.737 48.4308 199.206 48.4308H210.095L214.745 48.3297L211.662 42.6033', fill: colorMapping[type_parts[1]].fill_1, id: `${
|
|
506
|
-
React.createElement("path", { d: 'M160.945 19.133L158.826 20.8384C155.734 23.9359 154.141 27.8058 154.141 32.2967L154.141 47.7903L156.985 49.407L159.939 47.8778L159.94 32.2967C159.94 29.6632 160.778 27.3706 162.432 25.4846C162.615 25.2739 162.811 25.0666 163.018 24.8639C163.074 24.8155 164.138 24.0061 164.811 23.5592C166.321 22.5576 168.076 21.9876 170.024 21.8632L170.166 21.8621C172.923 21.8621 175.32 22.7325 177.301 24.4494L180.146 23.0088L180.246 19.3426C177.44 17.1664 174.132 16.0633 170.408 16.0633C166.909 16.0633 163.725 17.0962 160.945 19.133', fill: colorMapping[type_parts[1]].fill_1, id: `${
|
|
507
|
-
React.createElement("path", { d: 'M131.392 50C135.884 50 139.753 48.4076 142.893 45.2676C146.033 42.1269 147.626 38.2581 147.626 33.7668V18.1124L144.782 16.4964L141.827 18.0251V33.7668C141.827 36.6932 140.792 39.1936 138.745 41.2034C136.684 43.1927 134.128 44.2013 131.151 44.2013L131.01 44.2002H131.81L131.669 44.2013C128.692 44.2013 126.136 43.1927 124.074 41.2034C122.028 39.1936 120.993 36.6932 120.993 33.7668V18.0251L118.038 16.4964L115.194 18.1124V33.7668C115.194 38.2581 116.786 42.1269 119.926 45.2676C123.067 48.4076 126.936 50 131.427 50H131.392Z', fill: colorMapping[type_parts[1]].fill_1, id: `${
|
|
508
|
-
React.createElement("path", { d: 'M93.8353 26.9933L97.8468 31.2421L100.788 28.1521L107.791 20.4534L106.753 17.3567L103.584 16.5678', fill: colorMapping[type_parts[1]].fill_2, id: `${
|
|
509
|
-
React.createElement("path", { d: 'M80.7509 16.5677L77.5821 17.3564L76.5441 20.4534L83.5514 28.1568L88.1484 32.9862L76.5412 45.2133L77.5187 48.3175C79.525 48.9571 80.359 49.1805 80.6985 49.2584L92.195 37.238L103.636 49.2584C103.976 49.1805 104.81 48.9571 106.817 48.3175L107.794 45.2133L80.7509 16.5677', fill: colorMapping[type_parts[1]].fill_1, id: `${
|
|
510
|
-
React.createElement("path", { d: 'M67.8498 45.479C67.5109 44.893 66.7322 43.5486 66.2043 42.6319H55.1965C52.3299 42.6319 49.8532 41.6095 47.8364 39.5923C45.819 37.5755 44.7966 35.0985 44.7966 32.2321C44.7966 29.3656 45.819 26.8886 47.8364 24.8718C49.8388 22.8332 52.316 21.7975 55.1965 21.7975C58.0632 21.7975 60.5398 22.8199 62.5565 24.8374C63.6038 25.8847 64.3824 27.093 64.9357 28.5312L65.2435 29.3327H53.8141C53.231 30.2171 52.5673 31.6476 52.303 32.2354L53.912 35.0969H67.474L71.0059 28.6192C70.2872 25.5702 68.8261 22.9293 66.6625 20.7657C63.5219 17.6257 59.6649 16.0333 55.1965 16.0333C50.7283 16.0333 46.8708 17.6257 43.7303 20.7657C40.546 23.9501 38.9979 27.7011 38.9979 32.2321C38.9979 36.7001 40.5903 40.5577 43.7303 43.6981C46.8708 46.8384 50.7283 48.4308 55.1965 48.4308H66.0873C66.9322 47.0737 67.5668 45.977 67.8498 45.479', fill: colorMapping[type_parts[1]].fill_1, id: `${
|
|
511
|
-
React.createElement("path", { d: 'M27.6655 20.7443C26.9235 20.002 26.2307 19.4097 25.608 18.9831C22.7338 17.0113 19.5684 16.0117 16.1992 16.0117C13.6229 16.0117 11.1676 16.5943 8.9002 17.7442C8.1016 18.1264 7.38657 18.6118 6.73074 19.0799L5.88805 19.6819C5.85364 19.711 5.81716 19.7449 5.78223 19.7749L5.77618 17.9067C5.78246 17.9022 5.7892 17.8965 5.79554 17.8921L5.72168 1.52402L2.84058 1.54784e-05L0 1.6145V24.9966V30.8918C0.0184614 30.8508 0.0393993 30.8108 0.0580857 30.7698C0.0216133 31.2417 0 31.7206 0 32.2105V47.6757L2.84688 49.2499C4.7412 48.3293 5.4988 47.9164 5.79866 47.7385V32.2105C5.79866 29.3439 6.82128 26.8672 8.83853 24.8504C10.8415 22.8118 13.319 21.7759 16.1992 21.7759C19.0796 21.7759 21.557 22.8118 23.5635 24.8538C25.3441 26.6351 26.3374 28.7976 26.5963 31.4625C26.6263 31.6669 26.6339 40.3058 26.6339 47.6694C27.2825 48.0147 28.6127 48.8167 29.5141 49.3059C29.9448 49.0814 32.0589 47.8425 32.3979 47.6669V32.2105C32.3979 27.6795 30.8499 23.9285 27.6655 20.7443Z', fill: colorMapping[type_parts[1]].fill_1, id: `${
|
|
485
|
+
return (React.createElement("svg", Object.assign({ fill: 'none', height: height, preserveAspectRatio: 'xMidYMid meet', viewBox: '0 0 236 50', width: '100%', xmlns: 'http://www.w3.org/2000/svg' }, accessibleProps, { id: `${baseId}-svg` }),
|
|
486
|
+
React.createElement("path", { d: 'M230.794 29.59H219.306L214.279 39.0907L217.012 43.9001L219.587 48.4308H230.512L235.821 39.0907L230.794 29.59V29.59ZM228.641 33.1659L231.743 39.0292L228.432 44.8549H221.668L220.121 42.1332L218.356 39.0292L221.459 33.1659H228.641Z', fill: colorMapping[type_parts[1]].fill_3, id: `${baseId}-path-1` }),
|
|
487
|
+
React.createElement("path", { d: 'M211.662 42.6033L199.206 42.6319C196.339 42.6319 193.862 41.6095 191.846 39.5923C189.828 37.5755 188.805 35.0985 188.805 32.2321C188.805 29.3656 189.828 26.8886 191.846 24.8718C193.848 22.8332 196.325 21.7975 199.206 21.7975C202.072 21.7975 204.549 22.8199 206.566 24.8374C207.613 25.8847 208.391 27.093 208.944 28.5312L209.253 29.3327H197.87L196.325 32.2579L197.921 35.0969H211.458L215.015 28.6192C214.296 25.5702 212.835 22.9293 210.672 20.7657C207.531 17.6257 203.674 16.0333 199.206 16.0333C194.737 16.0333 190.88 17.6257 187.739 20.7657C184.555 23.9501 183.007 27.7011 183.007 32.2321C183.007 36.7001 184.599 40.5577 187.739 43.6981C190.88 46.8384 194.737 48.4308 199.206 48.4308H210.095L214.745 48.3297L211.662 42.6033', fill: colorMapping[type_parts[1]].fill_1, id: `${baseId}-path-2` }),
|
|
488
|
+
React.createElement("path", { d: 'M160.945 19.133L158.826 20.8384C155.734 23.9359 154.141 27.8058 154.141 32.2967L154.141 47.7903L156.985 49.407L159.939 47.8778L159.94 32.2967C159.94 29.6632 160.778 27.3706 162.432 25.4846C162.615 25.2739 162.811 25.0666 163.018 24.8639C163.074 24.8155 164.138 24.0061 164.811 23.5592C166.321 22.5576 168.076 21.9876 170.024 21.8632L170.166 21.8621C172.923 21.8621 175.32 22.7325 177.301 24.4494L180.146 23.0088L180.246 19.3426C177.44 17.1664 174.132 16.0633 170.408 16.0633C166.909 16.0633 163.725 17.0962 160.945 19.133', fill: colorMapping[type_parts[1]].fill_1, id: `${baseId}-path-3` }),
|
|
489
|
+
React.createElement("path", { d: 'M131.392 50C135.884 50 139.753 48.4076 142.893 45.2676C146.033 42.1269 147.626 38.2581 147.626 33.7668V18.1124L144.782 16.4964L141.827 18.0251V33.7668C141.827 36.6932 140.792 39.1936 138.745 41.2034C136.684 43.1927 134.128 44.2013 131.151 44.2013L131.01 44.2002H131.81L131.669 44.2013C128.692 44.2013 126.136 43.1927 124.074 41.2034C122.028 39.1936 120.993 36.6932 120.993 33.7668V18.0251L118.038 16.4964L115.194 18.1124V33.7668C115.194 38.2581 116.786 42.1269 119.926 45.2676C123.067 48.4076 126.936 50 131.427 50H131.392Z', fill: colorMapping[type_parts[1]].fill_1, id: `${baseId}-path-4` }),
|
|
490
|
+
React.createElement("path", { d: 'M93.8353 26.9933L97.8468 31.2421L100.788 28.1521L107.791 20.4534L106.753 17.3567L103.584 16.5678', fill: colorMapping[type_parts[1]].fill_2, id: `${baseId}-path-5` }),
|
|
491
|
+
React.createElement("path", { d: 'M80.7509 16.5677L77.5821 17.3564L76.5441 20.4534L83.5514 28.1568L88.1484 32.9862L76.5412 45.2133L77.5187 48.3175C79.525 48.9571 80.359 49.1805 80.6985 49.2584L92.195 37.238L103.636 49.2584C103.976 49.1805 104.81 48.9571 106.817 48.3175L107.794 45.2133L80.7509 16.5677', fill: colorMapping[type_parts[1]].fill_1, id: `${baseId}-path-6` }),
|
|
492
|
+
React.createElement("path", { d: 'M67.8498 45.479C67.5109 44.893 66.7322 43.5486 66.2043 42.6319H55.1965C52.3299 42.6319 49.8532 41.6095 47.8364 39.5923C45.819 37.5755 44.7966 35.0985 44.7966 32.2321C44.7966 29.3656 45.819 26.8886 47.8364 24.8718C49.8388 22.8332 52.316 21.7975 55.1965 21.7975C58.0632 21.7975 60.5398 22.8199 62.5565 24.8374C63.6038 25.8847 64.3824 27.093 64.9357 28.5312L65.2435 29.3327H53.8141C53.231 30.2171 52.5673 31.6476 52.303 32.2354L53.912 35.0969H67.474L71.0059 28.6192C70.2872 25.5702 68.8261 22.9293 66.6625 20.7657C63.5219 17.6257 59.6649 16.0333 55.1965 16.0333C50.7283 16.0333 46.8708 17.6257 43.7303 20.7657C40.546 23.9501 38.9979 27.7011 38.9979 32.2321C38.9979 36.7001 40.5903 40.5577 43.7303 43.6981C46.8708 46.8384 50.7283 48.4308 55.1965 48.4308H66.0873C66.9322 47.0737 67.5668 45.977 67.8498 45.479', fill: colorMapping[type_parts[1]].fill_1, id: `${baseId}-path-7` }),
|
|
493
|
+
React.createElement("path", { d: 'M27.6655 20.7443C26.9235 20.002 26.2307 19.4097 25.608 18.9831C22.7338 17.0113 19.5684 16.0117 16.1992 16.0117C13.6229 16.0117 11.1676 16.5943 8.9002 17.7442C8.1016 18.1264 7.38657 18.6118 6.73074 19.0799L5.88805 19.6819C5.85364 19.711 5.81716 19.7449 5.78223 19.7749L5.77618 17.9067C5.78246 17.9022 5.7892 17.8965 5.79554 17.8921L5.72168 1.52402L2.84058 1.54784e-05L0 1.6145V24.9966V30.8918C0.0184614 30.8508 0.0393993 30.8108 0.0580857 30.7698C0.0216133 31.2417 0 31.7206 0 32.2105V47.6757L2.84688 49.2499C4.7412 48.3293 5.4988 47.9164 5.79866 47.7385V32.2105C5.79866 29.3439 6.82128 26.8672 8.83853 24.8504C10.8415 22.8118 13.319 21.7759 16.1992 21.7759C19.0796 21.7759 21.557 22.8118 23.5635 24.8538C25.3441 26.6351 26.3374 28.7976 26.5963 31.4625C26.6263 31.6669 26.6339 40.3058 26.6339 47.6694C27.2825 48.0147 28.6127 48.8167 29.5141 49.3059C29.9448 49.0814 32.0589 47.8425 32.3979 47.6669V32.2105C32.3979 27.6795 30.8499 23.9285 27.6655 20.7443Z', fill: colorMapping[type_parts[1]].fill_1, id: `${baseId}-path-8` })));
|
|
512
494
|
}
|
|
513
|
-
};
|
|
514
|
-
|
|
515
|
-
const Container$3 = styled.header `
|
|
516
|
-
width: 100%;
|
|
517
|
-
display: flex;
|
|
518
|
-
padding: 20px;
|
|
519
|
-
box-sizing: border-box;
|
|
520
|
-
border-bottom: 1px solid ${Colors.LIGHT_GRAY.Hex};
|
|
521
|
-
background: '#fff';
|
|
522
|
-
justify-content: space-between;
|
|
523
|
-
`;
|
|
524
|
-
const LogoWrapper = styled.div `
|
|
525
|
-
display: flex;
|
|
526
|
-
align-items: center;
|
|
527
|
-
`;
|
|
528
|
-
const Image = styled.img `
|
|
529
|
-
height: 30px !important;
|
|
530
|
-
width: auto !important;
|
|
531
|
-
`;
|
|
532
|
-
const Buttons = styled.div `
|
|
533
|
-
display: flex;
|
|
534
|
-
flex-direction: row;
|
|
535
|
-
column-gap: 10px;
|
|
536
|
-
flex-direction: reverse;
|
|
537
|
-
`;
|
|
538
|
-
const AppHeader = ({ logoUrl, buttons = [] }) => {
|
|
539
|
-
const
|
|
540
|
-
return (React.createElement(Container$3, { id: `${
|
|
541
|
-
React.createElement(LogoWrapper, { id: `${
|
|
542
|
-
React.createElement(Buttons, { id: `${
|
|
543
|
-
};
|
|
544
|
-
|
|
545
|
-
const Wrapper$e = styled.div `
|
|
546
|
-
display: inline-block;
|
|
547
|
-
border-radius: 4px;
|
|
548
|
-
padding: 4px 6px;
|
|
549
|
-
background: ${props => Colors[props.$color].Hex};
|
|
550
|
-
color: #ffffff;
|
|
551
|
-
box-sizing: border-box;
|
|
552
|
-
cursor: ${props => (props.$removable ? 'pointer' : 'default')};
|
|
553
|
-
`;
|
|
554
|
-
const Content$2 = styled.div `
|
|
555
|
-
display: flex;
|
|
556
|
-
align-items: center;
|
|
557
|
-
`;
|
|
558
|
-
const Label$4 = styled.div `
|
|
559
|
-
color: ${props => (props.$color === 'SUBTLE_GRAY' ? '#000000' : '#ffffff')};
|
|
560
|
-
font-size: ${FontSizes.SMALL};
|
|
561
|
-
font-weight: 500;
|
|
562
|
-
font-family: ${FontStyles.DEFAULT};
|
|
563
|
-
line-height: 1.2em;
|
|
564
|
-
`;
|
|
565
|
-
const Remove$1 = styled.div `
|
|
566
|
-
margin-left: 10px;
|
|
567
|
-
display: flex;
|
|
568
|
-
align-items: center;
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
const Container$3 = styled.header `
|
|
498
|
+
width: 100%;
|
|
499
|
+
display: flex;
|
|
500
|
+
padding: 20px;
|
|
501
|
+
box-sizing: border-box;
|
|
502
|
+
border-bottom: 1px solid ${Colors.LIGHT_GRAY.Hex};
|
|
503
|
+
background: '#fff';
|
|
504
|
+
justify-content: space-between;
|
|
505
|
+
`;
|
|
506
|
+
const LogoWrapper = styled.div `
|
|
507
|
+
display: flex;
|
|
508
|
+
align-items: center;
|
|
509
|
+
`;
|
|
510
|
+
const Image = styled.img `
|
|
511
|
+
height: 30px !important;
|
|
512
|
+
width: auto !important;
|
|
513
|
+
`;
|
|
514
|
+
const Buttons = styled.div `
|
|
515
|
+
display: flex;
|
|
516
|
+
flex-direction: row;
|
|
517
|
+
column-gap: 10px;
|
|
518
|
+
flex-direction: reverse;
|
|
519
|
+
`;
|
|
520
|
+
const AppHeader = ({ logoUrl, buttons = [], id }) => {
|
|
521
|
+
const baseId = id || 'app-header';
|
|
522
|
+
return (React.createElement(Container$3, { id: `${baseId}-container` },
|
|
523
|
+
React.createElement(LogoWrapper, { id: `${baseId}-logo-wrapper` }, logoUrl ? (React.createElement(Image, { id: `${baseId}-logo`, src: logoUrl })) : (React.createElement(Logo, { height: '30px', id: `${baseId}-default-logo` }))),
|
|
524
|
+
React.createElement(Buttons, { id: `${baseId}-buttons` }, buttons.map((b, i) => (React.createElement(Button, Object.assign({ key: i }, b, { id: `${baseId}-button-${i}` })))))));
|
|
525
|
+
};
|
|
526
|
+
|
|
527
|
+
const Wrapper$e = styled.div `
|
|
528
|
+
display: inline-block;
|
|
529
|
+
border-radius: 4px;
|
|
530
|
+
padding: 4px 6px;
|
|
531
|
+
background: ${props => Colors[props.$color].Hex};
|
|
532
|
+
color: #ffffff;
|
|
533
|
+
box-sizing: border-box;
|
|
534
|
+
cursor: ${props => (props.$removable ? 'pointer' : 'default')};
|
|
535
|
+
`;
|
|
536
|
+
const Content$2 = styled.div `
|
|
537
|
+
display: flex;
|
|
538
|
+
align-items: center;
|
|
539
|
+
`;
|
|
540
|
+
const Label$4 = styled.div `
|
|
541
|
+
color: ${props => (props.$color === 'SUBTLE_GRAY' ? '#000000' : '#ffffff')};
|
|
542
|
+
font-size: ${FontSizes.SMALL};
|
|
543
|
+
font-weight: 500;
|
|
544
|
+
font-family: ${FontStyles.DEFAULT};
|
|
545
|
+
line-height: 1.2em;
|
|
546
|
+
`;
|
|
547
|
+
const Remove$1 = styled.div `
|
|
548
|
+
margin-left: 10px;
|
|
549
|
+
display: flex;
|
|
550
|
+
align-items: center;
|
|
569
551
|
`;
|
|
570
552
|
const Tag = (_a) => {
|
|
571
|
-
var { children, color = 'PRIMARY', removable, onClick } = _a, accessibleProps = __rest(_a, ["children", "color", "removable", "onClick"]);
|
|
572
|
-
const
|
|
573
|
-
return (React.createElement(Wrapper$e, Object.assign({ "$color": color, "$removable": removable, onClick: onClick }, accessibleProps, { id: `${
|
|
574
|
-
React.createElement(Content$2, { id: `${
|
|
575
|
-
React.createElement(Label$4, { "$color": color, id: `${
|
|
576
|
-
removable ? (React.createElement(Remove$1, { id: `${
|
|
577
|
-
React.createElement(Icon, { color: color === 'SUBTLE_GRAY' ? '#000000' : '#ffffff', id: `${
|
|
578
|
-
};
|
|
579
|
-
|
|
580
|
-
const SidebarContainer = styled.div `
|
|
581
|
-
border-right: 1px solid ${Colors.LIGHT_GRAY.Hex};
|
|
582
|
-
display: flex;
|
|
583
|
-
flex-direction: column;
|
|
584
|
-
height: 100%;
|
|
585
|
-
padding: 12px 0px;
|
|
586
|
-
width: ${props => (props.$isOpen ? props.$width : '60px')};
|
|
587
|
-
`;
|
|
588
|
-
const MenuWrapper$1 = styled.button `
|
|
589
|
-
display: flex;
|
|
590
|
-
align-items: center;
|
|
591
|
-
border: 0px;
|
|
592
|
-
background-color: transparent;
|
|
593
|
-
padding-left: 0px;
|
|
594
|
-
border-left-width: 4px;
|
|
595
|
-
border-left-style: solid;
|
|
596
|
-
border-left-color: ${props => (props.$active ? props.$color.Hex : 'transparent')};
|
|
597
|
-
cursor: pointer;
|
|
598
|
-
height: 40px;
|
|
599
|
-
|
|
600
|
-
&:hover > div {
|
|
601
|
-
color: ${props => props.$color.Hex};
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
&:hover > svg > path {
|
|
605
|
-
fill: ${Colors.BLACK.Hex} !important;
|
|
606
|
-
}
|
|
607
|
-
`;
|
|
608
|
-
const MenuIcon = styled(Icon) `
|
|
609
|
-
width: 20px;
|
|
610
|
-
height: 20px;
|
|
611
|
-
margin: 0px 16px;
|
|
612
|
-
flex-shrink: 0;
|
|
613
|
-
|
|
614
|
-
> path {
|
|
615
|
-
fill: ${({ $active }) => ($active ? Colors.BLACK.Hex : Colors.MEDIUM_GRAY.Hex)} !important;
|
|
616
|
-
}
|
|
617
|
-
`;
|
|
618
|
-
const MenuLabel = styled.div `
|
|
619
|
-
color: ${props => (props.$active ? props.$color.Hex : Colors.BLACK.Hex)};
|
|
620
|
-
flex: 1;
|
|
621
|
-
font-size: 12px;
|
|
622
|
-
font-style: normal;
|
|
623
|
-
font-weight: 600;
|
|
624
|
-
font-family: 'Roboto', Helvetica, Arial, sans-serif;
|
|
625
|
-
line-height: 16px;
|
|
626
|
-
padding: 12px 0px;
|
|
627
|
-
letter-spacing: 1px;
|
|
628
|
-
`;
|
|
629
|
-
const SubMenu = styled.div `
|
|
630
|
-
overflow-y: auto;
|
|
631
|
-
padding-left: 44px;
|
|
632
|
-
padding-right: 20px;
|
|
633
|
-
padding-bottom: 10px;
|
|
634
|
-
`;
|
|
635
|
-
const SubMenuItem = styled.a `
|
|
636
|
-
display: block;
|
|
637
|
-
padding: 8px 12px;
|
|
638
|
-
border-radius: 8px;
|
|
639
|
-
font-size: 13px;
|
|
640
|
-
font-family: 'Roboto', Helvetica, Arial, sans-serif;
|
|
641
|
-
line-height: 20px;
|
|
642
|
-
text-decoration: none;
|
|
643
|
-
font-weight: ${({ $active }) => ($active ? '500' : '400')};
|
|
644
|
-
color: ${({ $active }) => ($active ? Colors.BLACK.Hex : Colors.GRAY.Hex)};
|
|
645
|
-
background: ${props => (props.$active ? `rgba(${props.$color.Rgb}, 0.1)` : '#fff')};
|
|
646
|
-
cursor: pointer;
|
|
647
|
-
|
|
648
|
-
&:hover {
|
|
649
|
-
color: ${props => props.$color.Hex};
|
|
650
|
-
font-weight: 500;
|
|
651
|
-
}
|
|
652
|
-
`;
|
|
653
|
-
const Footer = styled.div `
|
|
654
|
-
padding: 20px 14px 0px;
|
|
655
|
-
display: flex;
|
|
656
|
-
align-items: center;
|
|
657
|
-
`;
|
|
658
|
-
const FooterInfo = styled.div `
|
|
659
|
-
display: flex;
|
|
660
|
-
flex-direction: column;
|
|
661
|
-
flex: 1;
|
|
662
|
-
align-items: flex-start;
|
|
663
|
-
`;
|
|
664
|
-
const SidebarMenuContainer = styled.div `
|
|
665
|
-
flex-grow: 1;
|
|
666
|
-
`;
|
|
667
|
-
const AppMenu = ({ menu, isCollapsed, footerTag, defaultWidth = '280px' }) => {
|
|
553
|
+
var { children, color = 'PRIMARY', removable, onClick, id } = _a, accessibleProps = __rest(_a, ["children", "color", "removable", "onClick", "id"]);
|
|
554
|
+
const baseId = id || 'tag';
|
|
555
|
+
return (React.createElement(Wrapper$e, Object.assign({ "$color": color, "$removable": removable, onClick: onClick }, accessibleProps, { id: `${baseId}-wrapper` }),
|
|
556
|
+
React.createElement(Content$2, { id: `${baseId}-content` },
|
|
557
|
+
React.createElement(Label$4, { "$color": color, id: `${baseId}-label` }, children),
|
|
558
|
+
removable ? (React.createElement(Remove$1, { id: `${baseId}-remove` },
|
|
559
|
+
React.createElement(Icon, { color: color === 'SUBTLE_GRAY' ? '#000000' : '#ffffff', id: `${baseId}-icon`, path: js.mdiClose, size: '15px' }))) : null)));
|
|
560
|
+
};
|
|
561
|
+
|
|
562
|
+
const SidebarContainer = styled.div `
|
|
563
|
+
border-right: 1px solid ${Colors.LIGHT_GRAY.Hex};
|
|
564
|
+
display: flex;
|
|
565
|
+
flex-direction: column;
|
|
566
|
+
height: 100%;
|
|
567
|
+
padding: 12px 0px;
|
|
568
|
+
width: ${props => (props.$isOpen ? props.$width : '60px')};
|
|
569
|
+
`;
|
|
570
|
+
const MenuWrapper$1 = styled.button `
|
|
571
|
+
display: flex;
|
|
572
|
+
align-items: center;
|
|
573
|
+
border: 0px;
|
|
574
|
+
background-color: transparent;
|
|
575
|
+
padding-left: 0px;
|
|
576
|
+
border-left-width: 4px;
|
|
577
|
+
border-left-style: solid;
|
|
578
|
+
border-left-color: ${props => (props.$active ? props.$color.Hex : 'transparent')};
|
|
579
|
+
cursor: pointer;
|
|
580
|
+
height: 40px;
|
|
581
|
+
|
|
582
|
+
&:hover > div {
|
|
583
|
+
color: ${props => props.$color.Hex};
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
&:hover > svg > path {
|
|
587
|
+
fill: ${Colors.BLACK.Hex} !important;
|
|
588
|
+
}
|
|
589
|
+
`;
|
|
590
|
+
const MenuIcon = styled(Icon) `
|
|
591
|
+
width: 20px;
|
|
592
|
+
height: 20px;
|
|
593
|
+
margin: 0px 16px;
|
|
594
|
+
flex-shrink: 0;
|
|
595
|
+
|
|
596
|
+
> path {
|
|
597
|
+
fill: ${({ $active }) => ($active ? Colors.BLACK.Hex : Colors.MEDIUM_GRAY.Hex)} !important;
|
|
598
|
+
}
|
|
599
|
+
`;
|
|
600
|
+
const MenuLabel = styled.div `
|
|
601
|
+
color: ${props => (props.$active ? props.$color.Hex : Colors.BLACK.Hex)};
|
|
602
|
+
flex: 1;
|
|
603
|
+
font-size: 12px;
|
|
604
|
+
font-style: normal;
|
|
605
|
+
font-weight: 600;
|
|
606
|
+
font-family: 'Roboto', Helvetica, Arial, sans-serif;
|
|
607
|
+
line-height: 16px;
|
|
608
|
+
padding: 12px 0px;
|
|
609
|
+
letter-spacing: 1px;
|
|
610
|
+
`;
|
|
611
|
+
const SubMenu = styled.div `
|
|
612
|
+
overflow-y: auto;
|
|
613
|
+
padding-left: 44px;
|
|
614
|
+
padding-right: 20px;
|
|
615
|
+
padding-bottom: 10px;
|
|
616
|
+
`;
|
|
617
|
+
const SubMenuItem = styled.a `
|
|
618
|
+
display: block;
|
|
619
|
+
padding: 8px 12px;
|
|
620
|
+
border-radius: 8px;
|
|
621
|
+
font-size: 13px;
|
|
622
|
+
font-family: 'Roboto', Helvetica, Arial, sans-serif;
|
|
623
|
+
line-height: 20px;
|
|
624
|
+
text-decoration: none;
|
|
625
|
+
font-weight: ${({ $active }) => ($active ? '500' : '400')};
|
|
626
|
+
color: ${({ $active }) => ($active ? Colors.BLACK.Hex : Colors.GRAY.Hex)};
|
|
627
|
+
background: ${props => (props.$active ? `rgba(${props.$color.Rgb}, 0.1)` : '#fff')};
|
|
628
|
+
cursor: pointer;
|
|
629
|
+
|
|
630
|
+
&:hover {
|
|
631
|
+
color: ${props => props.$color.Hex};
|
|
632
|
+
font-weight: 500;
|
|
633
|
+
}
|
|
634
|
+
`;
|
|
635
|
+
const Footer = styled.div `
|
|
636
|
+
padding: 20px 14px 0px;
|
|
637
|
+
display: flex;
|
|
638
|
+
align-items: center;
|
|
639
|
+
`;
|
|
640
|
+
const FooterInfo = styled.div `
|
|
641
|
+
display: flex;
|
|
642
|
+
flex-direction: column;
|
|
643
|
+
flex: 1;
|
|
644
|
+
align-items: flex-start;
|
|
645
|
+
`;
|
|
646
|
+
const SidebarMenuContainer = styled.div `
|
|
647
|
+
flex-grow: 1;
|
|
648
|
+
`;
|
|
649
|
+
const AppMenu = ({ menu, isCollapsed, footerTag, defaultWidth = '280px', id, }) => {
|
|
668
650
|
const theme = React.useContext(styled.ThemeContext) || EditableTheme;
|
|
669
651
|
const [collapsed, toggleCollapse] = React.useState(isCollapsed);
|
|
670
|
-
const
|
|
671
|
-
return (React.createElement(SidebarContainer, { "$isOpen": !collapsed, "$width": defaultWidth, id: `${
|
|
672
|
-
React.createElement(SidebarMenuContainer, { id: `${
|
|
673
|
-
const navItemId =
|
|
652
|
+
const baseId = id || 'app-menu';
|
|
653
|
+
return (React.createElement(SidebarContainer, { "$isOpen": !collapsed, "$width": defaultWidth, id: `${baseId}-sidebar-container` },
|
|
654
|
+
React.createElement(SidebarMenuContainer, { id: `${baseId}-sidebar-menu-container` }, menu.map((nav_item, navIndex) => {
|
|
655
|
+
const navItemId = `${baseId}-nav-item-${navIndex}`;
|
|
674
656
|
return (React.createElement(React.Fragment, { key: navItemId },
|
|
675
657
|
React.createElement(MenuWrapper$1, { "$active": !!nav_item.is_active, "$color": theme.PRIMARY_COLOR, id: `${navItemId}-menu-wrapper`, onClick: nav_item.onClick, title: collapsed ? (nav_item === null || nav_item === void 0 ? void 0 : nav_item.title) || nav_item.label : '' },
|
|
676
658
|
React.createElement(MenuIcon, { "$active": !!nav_item.is_active, id: `${navItemId}-menu-icon`, path: nav_item.icon }),
|
|
677
659
|
collapsed ? null : (React.createElement(MenuLabel, { "$active": nav_item.is_active, "$color": theme.PRIMARY_COLOR, id: `${navItemId}-menu-label` }, nav_item.label))),
|
|
678
660
|
nav_item.is_active && nav_item.menu && !collapsed ? (React.createElement(SubMenu, { id: `${navItemId}-sub-menu` }, nav_item.menu.map((menu_item, menuIndex) => {
|
|
679
|
-
const menuItemId =
|
|
661
|
+
const menuItemId = `${navItemId}-menu-item-${menuIndex}`;
|
|
680
662
|
return (React.createElement(SubMenuItem, { "$active": menu_item.is_active, "$color": theme.PRIMARY_COLOR, id: `${menuItemId}-sub-menu-item`, key: menuItemId, onClick: menu_item.onClick }, menu_item.label));
|
|
681
663
|
}))) : null));
|
|
682
664
|
})),
|
|
683
|
-
React.createElement(Footer, { id: `${
|
|
684
|
-
collapsed ? null : (React.createElement(FooterInfo, { id: `${
|
|
685
|
-
footerTag ? React.createElement(Tag, { id: `${
|
|
686
|
-
React.createElement(Copy, { id: `${
|
|
665
|
+
React.createElement(Footer, { id: `${baseId}-footer` },
|
|
666
|
+
collapsed ? null : (React.createElement(FooterInfo, { id: `${baseId}-footer-info` },
|
|
667
|
+
footerTag ? React.createElement(Tag, { id: `${baseId}-footer-tag` }, footerTag) : null,
|
|
668
|
+
React.createElement(Copy, { id: `${baseId}-footer-copy`, margin: '8px 0 0 0', type: 'small' },
|
|
687
669
|
"\u00A9 ",
|
|
688
670
|
new Date().getFullYear(),
|
|
689
671
|
" Hexure"))),
|
|
690
|
-
React.createElement(Button, { icon: collapsed ? js.mdiChevronRight : js.mdiChevronLeft, id: `${
|
|
672
|
+
React.createElement(Button, { icon: collapsed ? js.mdiChevronRight : js.mdiChevronLeft, id: `${baseId}-collapse-button`, onClick: (e) => {
|
|
691
673
|
e.preventDefault();
|
|
692
674
|
toggleCollapse(!collapsed);
|
|
693
675
|
}, small: true }))));
|
|
694
|
-
};
|
|
695
|
-
|
|
696
|
-
const Wrapper$d = styled.div `
|
|
697
|
-
border: 1px solid ${props => props.theme.PRIMARY_COLOR.Hex};
|
|
698
|
-
border-radius: 8px;
|
|
699
|
-
box-sizing: border-box;
|
|
700
|
-
display: flex;
|
|
701
|
-
align-items: center;
|
|
702
|
-
justify-content: space-between;
|
|
703
|
-
padding: 16px 20px;
|
|
676
|
+
};
|
|
677
|
+
|
|
678
|
+
const Wrapper$d = styled.div `
|
|
679
|
+
border: 1px solid ${props => props.theme.PRIMARY_COLOR.Hex};
|
|
680
|
+
border-radius: 8px;
|
|
681
|
+
box-sizing: border-box;
|
|
682
|
+
display: flex;
|
|
683
|
+
align-items: center;
|
|
684
|
+
justify-content: space-between;
|
|
685
|
+
padding: 16px 20px;
|
|
704
686
|
`;
|
|
705
687
|
Wrapper$d.defaultProps = { theme: EditableTheme };
|
|
706
|
-
const Left = styled.div `
|
|
707
|
-
box-sizing: border-box;
|
|
708
|
-
display: flex;
|
|
709
|
-
align-items: center;
|
|
710
|
-
justify-content: space-between;
|
|
711
|
-
flex-shrink: 0;
|
|
712
|
-
`;
|
|
713
|
-
const Info$1 = styled.div `
|
|
714
|
-
box-sizing: border-box;
|
|
715
|
-
display: flex;
|
|
716
|
-
align-items: center;
|
|
717
|
-
margin-right: 30px;
|
|
718
|
-
`;
|
|
719
|
-
const Selected = styled.span `
|
|
720
|
-
font-size: 14px;
|
|
721
|
-
font-weight: 400;
|
|
722
|
-
font-family: ${FontStyles.DEFAULT};
|
|
723
|
-
color: ${Colors.BLACK.Hex};
|
|
724
|
-
line-height: 1;
|
|
725
|
-
`;
|
|
726
|
-
const Clear = styled.span `
|
|
727
|
-
font-size: 14px;
|
|
728
|
-
font-weight: 400;
|
|
729
|
-
font-family: ${FontStyles.DEFAULT};
|
|
730
|
-
color: ${props => props.theme.PRIMARY_COLOR.Hex};
|
|
731
|
-
line-height: 1;
|
|
732
|
-
cursor: pointer;
|
|
733
|
-
padding-left: 10px;
|
|
734
|
-
margin-left: 10px;
|
|
735
|
-
border-left: 1px solid #ccc;
|
|
688
|
+
const Left = styled.div `
|
|
689
|
+
box-sizing: border-box;
|
|
690
|
+
display: flex;
|
|
691
|
+
align-items: center;
|
|
692
|
+
justify-content: space-between;
|
|
693
|
+
flex-shrink: 0;
|
|
694
|
+
`;
|
|
695
|
+
const Info$1 = styled.div `
|
|
696
|
+
box-sizing: border-box;
|
|
697
|
+
display: flex;
|
|
698
|
+
align-items: center;
|
|
699
|
+
margin-right: 30px;
|
|
700
|
+
`;
|
|
701
|
+
const Selected = styled.span `
|
|
702
|
+
font-size: 14px;
|
|
703
|
+
font-weight: 400;
|
|
704
|
+
font-family: ${FontStyles.DEFAULT};
|
|
705
|
+
color: ${Colors.BLACK.Hex};
|
|
706
|
+
line-height: 1;
|
|
707
|
+
`;
|
|
708
|
+
const Clear = styled.span `
|
|
709
|
+
font-size: 14px;
|
|
710
|
+
font-weight: 400;
|
|
711
|
+
font-family: ${FontStyles.DEFAULT};
|
|
712
|
+
color: ${props => props.theme.PRIMARY_COLOR.Hex};
|
|
713
|
+
line-height: 1;
|
|
714
|
+
cursor: pointer;
|
|
715
|
+
padding-left: 10px;
|
|
716
|
+
margin-left: 10px;
|
|
717
|
+
border-left: 1px solid #ccc;
|
|
736
718
|
`;
|
|
737
719
|
Clear.defaultProps = { theme: EditableTheme };
|
|
738
|
-
const Actions$1 = styled.div `
|
|
739
|
-
box-sizing: border-box;
|
|
740
|
-
display: flex;
|
|
741
|
-
align-items: center;
|
|
742
|
-
column-gap: 10px;
|
|
743
|
-
`;
|
|
744
|
-
const Error$1 = styled.div `
|
|
745
|
-
box-sizing: border-box;
|
|
746
|
-
display: flex;
|
|
747
|
-
align-items: center;
|
|
748
|
-
background: rgba(${Colors.RED.Rgb}, 0.1);
|
|
749
|
-
border-radius: 4px;
|
|
750
|
-
padding: 6px 8px;
|
|
751
|
-
text-overflow: ellipsis;
|
|
752
|
-
white-space: nowrap;
|
|
753
|
-
overflow: hidden;
|
|
754
|
-
margin-left: 30px;
|
|
755
|
-
`;
|
|
756
|
-
const ErrorMsg = styled.span `
|
|
757
|
-
font-size: 14px;
|
|
758
|
-
font-weight: 500;
|
|
759
|
-
font-family: ${FontStyles.DEFAULT};
|
|
760
|
-
line-height: 1em;
|
|
761
|
-
color: ${Colors.RED.Hex};
|
|
762
|
-
margin-left: 8px;
|
|
720
|
+
const Actions$1 = styled.div `
|
|
721
|
+
box-sizing: border-box;
|
|
722
|
+
display: flex;
|
|
723
|
+
align-items: center;
|
|
724
|
+
column-gap: 10px;
|
|
725
|
+
`;
|
|
726
|
+
const Error$1 = styled.div `
|
|
727
|
+
box-sizing: border-box;
|
|
728
|
+
display: flex;
|
|
729
|
+
align-items: center;
|
|
730
|
+
background: rgba(${Colors.RED.Rgb}, 0.1);
|
|
731
|
+
border-radius: 4px;
|
|
732
|
+
padding: 6px 8px;
|
|
733
|
+
text-overflow: ellipsis;
|
|
734
|
+
white-space: nowrap;
|
|
735
|
+
overflow: hidden;
|
|
736
|
+
margin-left: 30px;
|
|
737
|
+
`;
|
|
738
|
+
const ErrorMsg = styled.span `
|
|
739
|
+
font-size: 14px;
|
|
740
|
+
font-weight: 500;
|
|
741
|
+
font-family: ${FontStyles.DEFAULT};
|
|
742
|
+
line-height: 1em;
|
|
743
|
+
color: ${Colors.RED.Hex};
|
|
744
|
+
margin-left: 8px;
|
|
763
745
|
`;
|
|
764
746
|
const BulkActionBar = (_a) => {
|
|
765
|
-
var { actions = [], errorMsg, onClear, selectedCount = 0 } = _a, accessibleProps = __rest(_a, ["actions", "errorMsg", "onClear", "selectedCount"]);
|
|
766
|
-
const
|
|
767
|
-
return (React.createElement(Wrapper$d, Object.assign({}, accessibleProps, { id: `${
|
|
768
|
-
React.createElement(Left, { id: `${
|
|
769
|
-
React.createElement(Info$1, { id: `${
|
|
770
|
-
React.createElement(Selected, { id: `${
|
|
747
|
+
var { actions = [], errorMsg, onClear, selectedCount = 0, id } = _a, accessibleProps = __rest(_a, ["actions", "errorMsg", "onClear", "selectedCount", "id"]);
|
|
748
|
+
const baseId = id || 'bulk-action-bar';
|
|
749
|
+
return (React.createElement(Wrapper$d, Object.assign({}, accessibleProps, { id: `${baseId}-wrapper` }),
|
|
750
|
+
React.createElement(Left, { id: `${baseId}-left` },
|
|
751
|
+
React.createElement(Info$1, { id: `${baseId}-info` },
|
|
752
|
+
React.createElement(Selected, { id: `${baseId}-selected` },
|
|
771
753
|
selectedCount,
|
|
772
754
|
" Selected"),
|
|
773
|
-
onClear ? (React.createElement(Clear, { id: `${
|
|
774
|
-
React.createElement(Actions$1, { id: `${
|
|
775
|
-
errorMsg ? (React.createElement(Error$1, { id: `${
|
|
776
|
-
React.createElement(Icon, { color: Colors.RED.Hex, id: `${
|
|
777
|
-
React.createElement(ErrorMsg, { id: `${
|
|
778
|
-
};
|
|
779
|
-
|
|
780
|
-
const Wrapper$c = styled.div `
|
|
781
|
-
background: #fff;
|
|
782
|
-
border-radius: 8px;
|
|
783
|
-
box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.2);
|
|
784
|
-
display: flex;
|
|
785
|
-
flex-direction: column;
|
|
786
|
-
gap: 4px;
|
|
787
|
-
max-height: ${props => props.$maxHeight || '312px'};
|
|
788
|
-
padding: 10px;
|
|
789
|
-
width: 200px;
|
|
790
|
-
`;
|
|
791
|
-
const MenuItem = styled.div `
|
|
792
|
-
align-items: center;
|
|
793
|
-
border-radius: 8px;
|
|
794
|
-
border: 1px solid transparent;
|
|
795
|
-
display: flex;
|
|
796
|
-
gap: 8px;
|
|
797
|
-
height: 38px;
|
|
798
|
-
padding: 8px;
|
|
799
|
-
&:hover {
|
|
800
|
-
background: rgba(1, 147, 215, 0.1);
|
|
801
|
-
cursor: pointer;
|
|
802
|
-
|
|
803
|
-
svg,
|
|
804
|
-
path {
|
|
805
|
-
fill: ${props => props.theme.PRIMARY_COLOR.Hex} !important;
|
|
806
|
-
}
|
|
807
|
-
}
|
|
755
|
+
onClear ? (React.createElement(Clear, { id: `${baseId}-clear`, onClick: onClear }, "Clear")) : null),
|
|
756
|
+
React.createElement(Actions$1, { id: `${baseId}-actions` }, actions.map((action, i) => (React.createElement(Button, Object.assign({}, action, { id: `${baseId}-action-${i}`, key: i, small: true })))))),
|
|
757
|
+
errorMsg ? (React.createElement(Error$1, { id: `${baseId}-error` },
|
|
758
|
+
React.createElement(Icon, { color: Colors.RED.Hex, id: `${baseId}-error-icon`, path: js.mdiInformationOutline, size: '20px' }),
|
|
759
|
+
React.createElement(ErrorMsg, { id: `${baseId}-error-msg` }, errorMsg))) : null));
|
|
760
|
+
};
|
|
761
|
+
|
|
762
|
+
const Wrapper$c = styled.div `
|
|
763
|
+
background: #fff;
|
|
764
|
+
border-radius: 8px;
|
|
765
|
+
box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.2);
|
|
766
|
+
display: flex;
|
|
767
|
+
flex-direction: column;
|
|
768
|
+
gap: 4px;
|
|
769
|
+
max-height: ${props => props.$maxHeight || '312px'};
|
|
770
|
+
padding: 10px;
|
|
771
|
+
width: 200px;
|
|
772
|
+
`;
|
|
773
|
+
const MenuItem = styled.div `
|
|
774
|
+
align-items: center;
|
|
775
|
+
border-radius: 8px;
|
|
776
|
+
border: 1px solid transparent;
|
|
777
|
+
display: flex;
|
|
778
|
+
gap: 8px;
|
|
779
|
+
height: 38px;
|
|
780
|
+
padding: 8px;
|
|
781
|
+
&:hover {
|
|
782
|
+
background: rgba(1, 147, 215, 0.1);
|
|
783
|
+
cursor: pointer;
|
|
784
|
+
|
|
785
|
+
svg,
|
|
786
|
+
path {
|
|
787
|
+
fill: ${props => props.theme.PRIMARY_COLOR.Hex} !important;
|
|
788
|
+
}
|
|
789
|
+
}
|
|
808
790
|
`;
|
|
809
791
|
MenuItem.defaultProps = { theme: EditableTheme };
|
|
810
|
-
const Title$1 = styled.span `
|
|
811
|
-
font-family: Roboto;
|
|
812
|
-
font-size: 14px;
|
|
813
|
-
font-weight: 400;
|
|
814
|
-
height: auto;
|
|
815
|
-
letter-spacing: 0px;
|
|
816
|
-
line-height: 22px;
|
|
817
|
-
text-align: left;
|
|
818
|
-
color: ${({ disabled }) => (disabled ? Colors.LIGHT_GRAY.Hex : 'inherit')};
|
|
819
|
-
pointer-events: ${({ disabled }) => (disabled ? 'none' : 'auto')};
|
|
792
|
+
const Title$1 = styled.span `
|
|
793
|
+
font-family: Roboto;
|
|
794
|
+
font-size: 14px;
|
|
795
|
+
font-weight: 400;
|
|
796
|
+
height: auto;
|
|
797
|
+
letter-spacing: 0px;
|
|
798
|
+
line-height: 22px;
|
|
799
|
+
text-align: left;
|
|
800
|
+
color: ${({ disabled }) => (disabled ? Colors.LIGHT_GRAY.Hex : 'inherit')};
|
|
801
|
+
pointer-events: ${({ disabled }) => (disabled ? 'none' : 'auto')};
|
|
820
802
|
`;
|
|
821
803
|
Title$1.defaultProps = {
|
|
822
804
|
disabled: false,
|
|
823
805
|
};
|
|
824
806
|
const MoreMenu = (_a) => {
|
|
825
|
-
var { maxHeight, menuItems = [] } = _a, accessibleProps = __rest(_a, ["maxHeight", "menuItems"]);
|
|
826
|
-
const
|
|
827
|
-
return (React.createElement(Wrapper$c, Object.assign({ "$maxHeight": maxHeight }, accessibleProps, { id: `${
|
|
807
|
+
var { maxHeight, menuItems = [], id } = _a, accessibleProps = __rest(_a, ["maxHeight", "menuItems", "id"]);
|
|
808
|
+
const baseId = id || 'more-menu';
|
|
809
|
+
return (React.createElement(Wrapper$c, Object.assign({ "$maxHeight": maxHeight }, accessibleProps, { id: `${baseId}-wrapper` }), menuItems.map((item, i) => {
|
|
828
810
|
var _a;
|
|
829
|
-
const itemId =
|
|
811
|
+
const itemId = `${baseId}-menu-item-${i}`;
|
|
830
812
|
return (React.createElement(MenuItem, { id: `${itemId}-menu-item`, key: i, onClick: item.onClick },
|
|
831
813
|
item.icon ? (React.createElement(Icon, { color: item.disabled ? Colors.LIGHT_GRAY.Hex : Colors.MEDIUM_GRAY.Hex, id: `${itemId}-icon`, path: item.icon, size: '20px' })) : null,
|
|
832
814
|
React.createElement(Title$1, { disabled: (_a = item.disabled) !== null && _a !== void 0 ? _a : false, id: `${itemId}-title` }, item.label)));
|
|
833
815
|
})));
|
|
834
|
-
};
|
|
835
|
-
|
|
836
|
-
const MenuWrapper = styled.div `
|
|
837
|
-
position: relative;
|
|
838
|
-
display: inline-block;
|
|
839
|
-
`;
|
|
840
|
-
const StyledMoreMenu = styled(MoreMenu) `
|
|
841
|
-
position: absolute;
|
|
842
|
-
top: ${props => props.$top};
|
|
843
|
-
left: ${props => props.$left};
|
|
844
|
-
width: ${props => props.$menuWidth};
|
|
845
|
-
max-height: ${props => props.maxHeight};
|
|
846
|
-
z-index: 10;
|
|
847
|
-
`;
|
|
848
|
-
const ButtonMenu = ({ disabled, label, maxHeight, menuItems, small, position = 'bottomLeft', format = 'primary', menuWidth = '200px', enableHover = true, enableClick = false, show = false, }) => {
|
|
816
|
+
};
|
|
817
|
+
|
|
818
|
+
const MenuWrapper = styled.div `
|
|
819
|
+
position: relative;
|
|
820
|
+
display: inline-block;
|
|
821
|
+
`;
|
|
822
|
+
const StyledMoreMenu = styled(MoreMenu) `
|
|
823
|
+
position: absolute;
|
|
824
|
+
top: ${props => props.$top};
|
|
825
|
+
left: ${props => props.$left};
|
|
826
|
+
width: ${props => props.$menuWidth};
|
|
827
|
+
max-height: ${props => props.maxHeight};
|
|
828
|
+
z-index: 10;
|
|
829
|
+
`;
|
|
830
|
+
const ButtonMenu = ({ disabled, label, maxHeight, menuItems, small, position = 'bottomLeft', format = 'primary', menuWidth = '200px', enableHover = true, enableClick = false, show = false, id, }) => {
|
|
849
831
|
const [showMenu, toggleMenu] = React.useState(false);
|
|
850
832
|
const [menuPosition, setMenuPosition] = React.useState({ top: '0px', left: '0px' });
|
|
851
833
|
const menuWrapperRef = React.useRef(null);
|
|
852
|
-
const
|
|
834
|
+
const baseId = id || 'button-menu';
|
|
853
835
|
React.useEffect(() => {
|
|
854
836
|
toggleMenu(show);
|
|
855
837
|
}, [show]);
|
|
@@ -915,113 +897,114 @@ const ButtonMenu = ({ disabled, label, maxHeight, menuItems, small, position = '
|
|
|
915
897
|
setMenuPosition({ top: `${top}px`, left: `${left}px` });
|
|
916
898
|
}
|
|
917
899
|
}, [showMenu, position, menuWidth]);
|
|
918
|
-
return (React.createElement(MenuWrapper, { id: `${
|
|
919
|
-
React.createElement(Button, { disabled: disabled, format: format, icon: js.mdiDotsHorizontal, id: `${
|
|
920
|
-
showMenu && (React.createElement(StyledMoreMenu, { "$left": menuPosition.left, "$menuWidth": menuWidth, "$top": menuPosition.top, id: `${
|
|
921
|
-
};
|
|
922
|
-
|
|
923
|
-
const Wrapper$b = styled.label `
|
|
924
|
-
border-radius: 4px;
|
|
925
|
-
padding: 4px 0px 4px 6px;
|
|
926
|
-
margin-left: -6px;
|
|
927
|
-
cursor: ${props => (props.$disabled ? 'default' : 'pointer')};
|
|
928
|
-
display: flex;
|
|
929
|
-
align-items: center;
|
|
930
|
-
font-size: ${FontSizes.DEFAULT};
|
|
931
|
-
line-height: 1.6em;
|
|
932
|
-
box-sizing: border-box;
|
|
933
|
-
position: relative;
|
|
934
|
-
|
|
935
|
-
&:focus-within {
|
|
936
|
-
background: ${props => `rgba(${props.theme.PRIMARY_COLOR.Rgb}, 0.05)`};
|
|
937
|
-
}
|
|
900
|
+
return (React.createElement(MenuWrapper, { id: `${baseId}-menu-wrapper`, onClick: handleClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ref: menuWrapperRef },
|
|
901
|
+
React.createElement(Button, { disabled: disabled, format: format, icon: js.mdiDotsHorizontal, id: `${baseId}-button`, small: small }, label),
|
|
902
|
+
showMenu && (React.createElement(StyledMoreMenu, { "$left": menuPosition.left, "$menuWidth": menuWidth, "$top": menuPosition.top, id: `${baseId}-more-menu`, maxHeight: maxHeight, menuItems: menuItems }))));
|
|
903
|
+
};
|
|
904
|
+
|
|
905
|
+
const Wrapper$b = styled.label `
|
|
906
|
+
border-radius: 4px;
|
|
907
|
+
padding: 4px 0px 4px 6px;
|
|
908
|
+
margin-left: -6px;
|
|
909
|
+
cursor: ${props => (props.$disabled ? 'default' : 'pointer')};
|
|
910
|
+
display: flex;
|
|
911
|
+
align-items: center;
|
|
912
|
+
font-size: ${FontSizes.DEFAULT};
|
|
913
|
+
line-height: 1.6em;
|
|
914
|
+
box-sizing: border-box;
|
|
915
|
+
position: relative;
|
|
916
|
+
|
|
917
|
+
&:focus-within {
|
|
918
|
+
background: ${props => `rgba(${props.theme.PRIMARY_COLOR.Rgb}, 0.05)`};
|
|
919
|
+
}
|
|
938
920
|
`;
|
|
939
921
|
Wrapper$b.defaultProps = { theme: EditableTheme };
|
|
940
|
-
const Input$2 = styled.input `
|
|
941
|
-
font-size: 20px;
|
|
942
|
-
margin: 0px;
|
|
943
|
-
line-height: 1.1em;
|
|
944
|
-
box-sizing: border-box;
|
|
945
|
-
position: absolute;
|
|
946
|
-
opacity: 0;
|
|
947
|
-
cursor: pointer;
|
|
948
|
-
height: 0;
|
|
949
|
-
width: 0;
|
|
950
|
-
&:checked + span {
|
|
951
|
-
background-color: ${Colors.PRIMARY.Hex};
|
|
952
|
-
border-color: ${Colors.PRIMARY.Hex};
|
|
953
|
-
}
|
|
954
|
-
&:checked:disabled + span {
|
|
955
|
-
background-color: ${Colors.MEDIUM_GRAY.Hex};
|
|
956
|
-
border-color: ${Colors.MEDIUM_GRAY.Hex};
|
|
957
|
-
}
|
|
958
|
-
&:disabled + span {
|
|
959
|
-
background-color: #d3d3d3;
|
|
960
|
-
border-color: #d3d3d3;
|
|
961
|
-
}
|
|
962
|
-
&:checked + span:after {
|
|
963
|
-
display: block;
|
|
964
|
-
}
|
|
965
|
-
`;
|
|
966
|
-
const Check$1 = styled.span `
|
|
967
|
-
height: 17px;
|
|
968
|
-
width: 17px;
|
|
969
|
-
min-width: 17px;
|
|
970
|
-
background-color: #fff;
|
|
971
|
-
border-width: 2px;
|
|
972
|
-
border-style: solid;
|
|
973
|
-
border-color: ${props => (props.$invalid ? `${Colors.RED.Hex}` : `${Colors.GRAY.Hex}`)};
|
|
974
|
-
box-sizing: border-box;
|
|
975
|
-
position: relative;
|
|
976
|
-
&:after {
|
|
977
|
-
content: '';
|
|
978
|
-
position: absolute;
|
|
979
|
-
left: 3px;
|
|
980
|
-
top: 0px;
|
|
981
|
-
width: 7px;
|
|
982
|
-
height: 12px;
|
|
983
|
-
border: solid white;
|
|
984
|
-
border-width: 0 3px 3px 0;
|
|
985
|
-
-webkit-transform: rotate(45deg);
|
|
986
|
-
-ms-transform: rotate(45deg);
|
|
987
|
-
transform: rotate(45deg);
|
|
988
|
-
box-sizing: border-box;
|
|
989
|
-
display: none;
|
|
990
|
-
}
|
|
991
|
-
`;
|
|
992
|
-
const Label$3 = styled.span `
|
|
993
|
-
font-family: ${FontStyles.DEFAULT};
|
|
994
|
-
font-size: ${FontSizes.DEFAULT};
|
|
995
|
-
font-weight: 400;
|
|
996
|
-
line-height: 1.6em;
|
|
997
|
-
color: ${props => props.color || Colors.BLACK.Hex};
|
|
998
|
-
margin-left: 6px;
|
|
999
|
-
box-sizing: border-box;
|
|
922
|
+
const Input$2 = styled.input `
|
|
923
|
+
font-size: 20px;
|
|
924
|
+
margin: 0px;
|
|
925
|
+
line-height: 1.1em;
|
|
926
|
+
box-sizing: border-box;
|
|
927
|
+
position: absolute;
|
|
928
|
+
opacity: 0;
|
|
929
|
+
cursor: pointer;
|
|
930
|
+
height: 0;
|
|
931
|
+
width: 0;
|
|
932
|
+
&:checked + span {
|
|
933
|
+
background-color: ${Colors.PRIMARY.Hex};
|
|
934
|
+
border-color: ${Colors.PRIMARY.Hex};
|
|
935
|
+
}
|
|
936
|
+
&:checked:disabled + span {
|
|
937
|
+
background-color: ${Colors.MEDIUM_GRAY.Hex};
|
|
938
|
+
border-color: ${Colors.MEDIUM_GRAY.Hex};
|
|
939
|
+
}
|
|
940
|
+
&:disabled + span {
|
|
941
|
+
background-color: #d3d3d3;
|
|
942
|
+
border-color: #d3d3d3;
|
|
943
|
+
}
|
|
944
|
+
&:checked + span:after {
|
|
945
|
+
display: block;
|
|
946
|
+
}
|
|
947
|
+
`;
|
|
948
|
+
const Check$1 = styled.span `
|
|
949
|
+
height: 17px;
|
|
950
|
+
width: 17px;
|
|
951
|
+
min-width: 17px;
|
|
952
|
+
background-color: #fff;
|
|
953
|
+
border-width: 2px;
|
|
954
|
+
border-style: solid;
|
|
955
|
+
border-color: ${props => (props.$invalid ? `${Colors.RED.Hex}` : `${Colors.GRAY.Hex}`)};
|
|
956
|
+
box-sizing: border-box;
|
|
957
|
+
position: relative;
|
|
958
|
+
&:after {
|
|
959
|
+
content: '';
|
|
960
|
+
position: absolute;
|
|
961
|
+
left: 3px;
|
|
962
|
+
top: 0px;
|
|
963
|
+
width: 7px;
|
|
964
|
+
height: 12px;
|
|
965
|
+
border: solid white;
|
|
966
|
+
border-width: 0 3px 3px 0;
|
|
967
|
+
-webkit-transform: rotate(45deg);
|
|
968
|
+
-ms-transform: rotate(45deg);
|
|
969
|
+
transform: rotate(45deg);
|
|
970
|
+
box-sizing: border-box;
|
|
971
|
+
display: none;
|
|
972
|
+
}
|
|
973
|
+
`;
|
|
974
|
+
const Label$3 = styled.span `
|
|
975
|
+
font-family: ${FontStyles.DEFAULT};
|
|
976
|
+
font-size: ${FontSizes.DEFAULT};
|
|
977
|
+
font-weight: 400;
|
|
978
|
+
line-height: 1.6em;
|
|
979
|
+
color: ${props => props.color || Colors.BLACK.Hex};
|
|
980
|
+
margin-left: 6px;
|
|
981
|
+
box-sizing: border-box;
|
|
1000
982
|
`;
|
|
1001
983
|
const Checkbox = (_a) => {
|
|
1002
|
-
var { children, color, disabled, checked, onChange, invalid, tooltip, tabIndex } = _a, accessibleProps = __rest(_a, ["children", "color", "disabled", "checked", "onChange", "invalid", "tooltip", "tabIndex"]);
|
|
1003
|
-
const
|
|
1004
|
-
return (React.createElement(Wrapper$b, Object.assign({ "$disabled": disabled }, accessibleProps, { id: `${
|
|
1005
|
-
React.createElement(Input$2, { checked: checked, disabled: disabled, id: `${
|
|
1006
|
-
React.createElement(Check$1, { "$invalid": invalid, id: `${
|
|
1007
|
-
children ? (React.createElement(Label$3, { color: color, id: `${
|
|
984
|
+
var { children, color, disabled, checked, onChange, invalid, tooltip, tabIndex, id } = _a, accessibleProps = __rest(_a, ["children", "color", "disabled", "checked", "onChange", "invalid", "tooltip", "tabIndex", "id"]);
|
|
985
|
+
const baseId = id || 'checkbox';
|
|
986
|
+
return (React.createElement(Wrapper$b, Object.assign({ "$disabled": disabled }, accessibleProps, { id: `${baseId}-wrapper` }),
|
|
987
|
+
React.createElement(Input$2, { checked: checked, disabled: disabled, id: `${baseId}-input`, name: accessibleProps.name, onChange: disabled ? undefined : onChange, tabIndex: disabled ? -1 : tabIndex, type: 'checkbox' }),
|
|
988
|
+
React.createElement(Check$1, { "$invalid": invalid, id: `${baseId}-check` }),
|
|
989
|
+
children ? (React.createElement(Label$3, { color: color, id: `${baseId}-label` },
|
|
1008
990
|
children,
|
|
1009
991
|
tooltip ? React.createElement(Tooltip, Object.assign({}, tooltip)) : null)) : null));
|
|
1010
|
-
};
|
|
1011
|
-
|
|
1012
|
-
const SelectAll = styled.div `
|
|
1013
|
-
padding: 8px 12px;
|
|
1014
|
-
border-bottom: 1px solid ${Colors.LIGHT_GRAY.Hex};
|
|
1015
|
-
box-sizing: border-box;
|
|
992
|
+
};
|
|
993
|
+
|
|
994
|
+
const SelectAll = styled.div `
|
|
995
|
+
padding: 8px 12px;
|
|
996
|
+
border-bottom: 1px solid ${Colors.LIGHT_GRAY.Hex};
|
|
997
|
+
box-sizing: border-box;
|
|
1016
998
|
`;
|
|
1017
|
-
const Options$1 = styled.div `
|
|
1018
|
-
padding: 12px;
|
|
1019
|
-
box-sizing: border-box;
|
|
999
|
+
const Options$1 = styled.div `
|
|
1000
|
+
padding: 12px;
|
|
1001
|
+
box-sizing: border-box;
|
|
1020
1002
|
`;
|
|
1021
1003
|
const Checklist = (_a) => {
|
|
1022
|
-
var { disabled, onChange, options, selected = [], showSelectAll } = _a, accessibleProps = __rest(_a, ["disabled", "onChange", "options", "selected", "showSelectAll"]);
|
|
1004
|
+
var { disabled, onChange, options, selected = [], showSelectAll, id } = _a, accessibleProps = __rest(_a, ["disabled", "onChange", "options", "selected", "showSelectAll", "id"]);
|
|
1023
1005
|
const values = options.map((option) => option.value);
|
|
1024
1006
|
const selected_options = options.filter(o => selected.includes(o.value));
|
|
1007
|
+
const baseId = id || 'checklist';
|
|
1025
1008
|
const handleToggleAll = () => {
|
|
1026
1009
|
if (selected_options.length === options.length) {
|
|
1027
1010
|
triggerChange([]);
|
|
@@ -1045,86 +1028,85 @@ const Checklist = (_a) => {
|
|
|
1045
1028
|
},
|
|
1046
1029
|
});
|
|
1047
1030
|
};
|
|
1048
|
-
const id = generateUniqueId('checklist');
|
|
1049
1031
|
return (React.createElement(React.Fragment, null,
|
|
1050
|
-
showSelectAll && values.length ? (React.createElement(SelectAll, { id: `${
|
|
1051
|
-
React.createElement(Checkbox, { checked: selected.length === values.length, disabled: disabled, id: `${
|
|
1052
|
-
React.createElement(Options$1, { id: `${
|
|
1032
|
+
showSelectAll && values.length ? (React.createElement(SelectAll, { id: `${baseId}-select-all` },
|
|
1033
|
+
React.createElement(Checkbox, { checked: selected.length === values.length, disabled: disabled, id: `${baseId}-checkbox-select-all`, onChange: handleToggleAll }, "Select All"))) : null,
|
|
1034
|
+
React.createElement(Options$1, { id: `${baseId}-options` }, options.map((option, i) => {
|
|
1053
1035
|
const label = `${option.label || option.value}`;
|
|
1054
1036
|
const checked = selected.includes(option.value);
|
|
1055
|
-
const optionId =
|
|
1037
|
+
const optionId = `${baseId}-option-${i}`;
|
|
1056
1038
|
return (React.createElement(Checkbox, Object.assign({ id: `${optionId}-checkbox`, key: i }, accessibleProps, { checked: checked, color: option.color, disabled: disabled, onChange: handleChange.bind(null, option) }), label));
|
|
1057
1039
|
}))));
|
|
1058
|
-
};
|
|
1059
|
-
|
|
1060
|
-
const Wrapper$a = styled.div `
|
|
1061
|
-
border-radius: 4px;
|
|
1062
|
-
height: 40px;
|
|
1063
|
-
background-color: ${props => (props.$readOnly ? '#f5f5f5' : '#ffffff')};
|
|
1064
|
-
position: relative;
|
|
1065
|
-
cursor: ${props => (props.$readOnly ? 'default' : 'pointer')};
|
|
1066
|
-
border-width: 1px;
|
|
1067
|
-
border-style: solid;
|
|
1068
|
-
border-color: ${props => (props.$invalid ? Colors.RED.Hex : '#cccccc')};
|
|
1069
|
-
border-radius: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.borderRadius) || '4px'};
|
|
1070
|
-
flex-grow: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.flexGrow) || 0};
|
|
1071
|
-
box-sizing: border-box;
|
|
1072
|
-
padding: 10px 0px;
|
|
1073
|
-
display: flex;
|
|
1074
|
-
align-items: center;
|
|
1075
|
-
width: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.width) || 'auto'};
|
|
1076
|
-
|
|
1077
|
-
&:focus-within {
|
|
1078
|
-
border-color: ${props => (props.$readOnly ? '#cccccc' : props.theme.PRIMARY_COLOR.Hex)};
|
|
1079
|
-
}
|
|
1040
|
+
};
|
|
1041
|
+
|
|
1042
|
+
const Wrapper$a = styled.div `
|
|
1043
|
+
border-radius: 4px;
|
|
1044
|
+
height: 40px;
|
|
1045
|
+
background-color: ${props => (props.$readOnly ? '#f5f5f5' : '#ffffff')};
|
|
1046
|
+
position: relative;
|
|
1047
|
+
cursor: ${props => (props.$readOnly ? 'default' : 'pointer')};
|
|
1048
|
+
border-width: 1px;
|
|
1049
|
+
border-style: solid;
|
|
1050
|
+
border-color: ${props => (props.$invalid ? Colors.RED.Hex : '#cccccc')};
|
|
1051
|
+
border-radius: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.borderRadius) || '4px'};
|
|
1052
|
+
flex-grow: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.flexGrow) || 0};
|
|
1053
|
+
box-sizing: border-box;
|
|
1054
|
+
padding: 10px 0px;
|
|
1055
|
+
display: flex;
|
|
1056
|
+
align-items: center;
|
|
1057
|
+
width: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.width) || 'auto'};
|
|
1058
|
+
|
|
1059
|
+
&:focus-within {
|
|
1060
|
+
border-color: ${props => (props.$readOnly ? '#cccccc' : props.theme.PRIMARY_COLOR.Hex)};
|
|
1061
|
+
}
|
|
1080
1062
|
`;
|
|
1081
1063
|
Wrapper$a.defaultProps = { theme: EditableTheme };
|
|
1082
|
-
const Trigger$1 = styled.select `
|
|
1083
|
-
appearance: none;
|
|
1084
|
-
box-shadow: none;
|
|
1085
|
-
outline: none;
|
|
1086
|
-
border: none;
|
|
1087
|
-
color: ${Colors.BLACK.Hex};
|
|
1088
|
-
font-size: ${FontSizes.DEFAULT};
|
|
1089
|
-
font-weight: 400;
|
|
1090
|
-
font-family: ${FontStyles.DEFAULT};
|
|
1091
|
-
line-height: 3.1em;
|
|
1092
|
-
background-color: transparent;
|
|
1093
|
-
background-image: none;
|
|
1094
|
-
width: 100%;
|
|
1095
|
-
box-sizing: border-box;
|
|
1096
|
-
padding: 0px 30px 0px 10px;
|
|
1097
|
-
box-sizing: border-box;
|
|
1098
|
-
position: relative;
|
|
1099
|
-
z-index: 2;
|
|
1100
|
-
`;
|
|
1101
|
-
const IconWrapper$2 = styled(Icon) `
|
|
1102
|
-
position: absolute;
|
|
1103
|
-
right: 9px;
|
|
1104
|
-
z-index: 1;
|
|
1105
|
-
`;
|
|
1106
|
-
const SearchInput$1 = styled.input `
|
|
1107
|
-
position: absolute;
|
|
1108
|
-
left: 2px;
|
|
1109
|
-
top: 2px;
|
|
1110
|
-
z-index: 999;
|
|
1111
|
-
width: 90%;
|
|
1112
|
-
height: 30px;
|
|
1113
|
-
border: none;
|
|
1114
|
-
outline: none;
|
|
1115
|
-
color: ${Colors.BLACK.Hex};
|
|
1116
|
-
font-family: ${FontStyles.DEFAULT};
|
|
1117
|
-
font-size: ${FontSizes.DEFAULT};
|
|
1118
|
-
font-weight: 400;
|
|
1119
|
-
line-height: 2.9em;
|
|
1120
|
-
overflow: hidden;
|
|
1121
|
-
white-space: nowrap;
|
|
1064
|
+
const Trigger$1 = styled.select `
|
|
1065
|
+
appearance: none;
|
|
1066
|
+
box-shadow: none;
|
|
1067
|
+
outline: none;
|
|
1068
|
+
border: none;
|
|
1069
|
+
color: ${Colors.BLACK.Hex};
|
|
1070
|
+
font-size: ${FontSizes.DEFAULT};
|
|
1071
|
+
font-weight: 400;
|
|
1072
|
+
font-family: ${FontStyles.DEFAULT};
|
|
1073
|
+
line-height: 3.1em;
|
|
1074
|
+
background-color: transparent;
|
|
1075
|
+
background-image: none;
|
|
1076
|
+
width: 100%;
|
|
1077
|
+
box-sizing: border-box;
|
|
1078
|
+
padding: 0px 30px 0px 10px;
|
|
1079
|
+
box-sizing: border-box;
|
|
1080
|
+
position: relative;
|
|
1081
|
+
z-index: 2;
|
|
1082
|
+
`;
|
|
1083
|
+
const IconWrapper$2 = styled(Icon) `
|
|
1084
|
+
position: absolute;
|
|
1085
|
+
right: 9px;
|
|
1086
|
+
z-index: 1;
|
|
1087
|
+
`;
|
|
1088
|
+
const SearchInput$1 = styled.input `
|
|
1089
|
+
position: absolute;
|
|
1090
|
+
left: 2px;
|
|
1091
|
+
top: 2px;
|
|
1092
|
+
z-index: 999;
|
|
1093
|
+
width: 90%;
|
|
1094
|
+
height: 30px;
|
|
1095
|
+
border: none;
|
|
1096
|
+
outline: none;
|
|
1097
|
+
color: ${Colors.BLACK.Hex};
|
|
1098
|
+
font-family: ${FontStyles.DEFAULT};
|
|
1099
|
+
font-size: ${FontSizes.DEFAULT};
|
|
1100
|
+
font-weight: 400;
|
|
1101
|
+
line-height: 2.9em;
|
|
1102
|
+
overflow: hidden;
|
|
1103
|
+
white-space: nowrap;
|
|
1122
1104
|
`;
|
|
1123
1105
|
const Select = (_a) => {
|
|
1124
|
-
var { options, optionGroups, placeholder = '--Select-One--', readOnly, invalid, searchable = false, value: propValue, onChange, style, tabIndex } = _a, accessibleProps = __rest(_a, ["options", "optionGroups", "placeholder", "readOnly", "invalid", "searchable", "value", "onChange", "style", "tabIndex"]);
|
|
1106
|
+
var { options, optionGroups, placeholder = '--Select-One--', readOnly, invalid, searchable = false, value: propValue, onChange, style, tabIndex, id } = _a, accessibleProps = __rest(_a, ["options", "optionGroups", "placeholder", "readOnly", "invalid", "searchable", "value", "onChange", "style", "tabIndex", "id"]);
|
|
1125
1107
|
const [searchTerm, setSearchTerm] = React.useState('');
|
|
1126
1108
|
const [value, setValue] = React.useState(propValue || '');
|
|
1127
|
-
const
|
|
1109
|
+
const baseId = id || 'select';
|
|
1128
1110
|
// Update the value when the prop changes
|
|
1129
1111
|
React.useEffect(() => {
|
|
1130
1112
|
setValue(propValue || '');
|
|
@@ -1144,28 +1126,28 @@ const Select = (_a) => {
|
|
|
1144
1126
|
const filteredOptionGroups = searchable
|
|
1145
1127
|
? optionGroups === null || optionGroups === void 0 ? void 0 : optionGroups.map(group => (Object.assign(Object.assign({}, group), { options: group.options.filter(option => { var _a; return (_a = option.label) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(searchTerm.toLowerCase()); }) })))
|
|
1146
1128
|
: optionGroups;
|
|
1147
|
-
return (React.createElement(Wrapper$a, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, id: `${
|
|
1148
|
-
searchable && (React.createElement(SearchInput$1, Object.assign({ id: `${
|
|
1149
|
-
React.createElement(Trigger$1, Object.assign({ disabled: readOnly, id: `${
|
|
1150
|
-
placeholder && !value && (React.createElement("option", { disabled: true, id: `${
|
|
1129
|
+
return (React.createElement(Wrapper$a, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, id: `${baseId}-wrapper` },
|
|
1130
|
+
searchable && (React.createElement(SearchInput$1, Object.assign({ id: `${baseId}-search-input`, onChange: handleSearch, placeholder: placeholder, tabIndex: readOnly ? -1 : tabIndex, type: 'text', value: searchTerm }, accessibleProps))),
|
|
1131
|
+
React.createElement(Trigger$1, Object.assign({ disabled: readOnly, id: `${baseId}-trigger`, onChange: handleChange, placeholder: placeholder, tabIndex: readOnly ? -1 : tabIndex, value: value }, accessibleProps),
|
|
1132
|
+
placeholder && !value && (React.createElement("option", { disabled: true, id: `${baseId}-placeholder`, value: '' }, placeholder)),
|
|
1151
1133
|
filteredOptionGroups &&
|
|
1152
|
-
filteredOptionGroups.map((group, i) => (React.createElement("optgroup", { id: `${
|
|
1134
|
+
filteredOptionGroups.map((group, i) => (React.createElement("optgroup", { id: `${baseId}-optgroup-${i}`, key: i, label: group.label || `Group ${i}` }, group.options.map((option, j) => (React.createElement("option", { id: `${baseId}-option-${i}-${j}`, key: j, style: { color: option.color }, value: option.value }, option.label || option.value)))))),
|
|
1153
1135
|
filteredOptions &&
|
|
1154
|
-
filteredOptions.map((option, i) => (React.createElement("option", { id: `${
|
|
1155
|
-
React.createElement(IconWrapper$2, { color: Colors.BLACK.Hex, id: `${
|
|
1156
|
-
};
|
|
1157
|
-
|
|
1158
|
-
const DatePickerWrapper = styled.div `
|
|
1159
|
-
display: flex;
|
|
1160
|
-
width: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.width) || 'auto'};
|
|
1161
|
-
`;
|
|
1162
|
-
const Middle = styled.div `
|
|
1163
|
-
margin: 0px -1px;
|
|
1164
|
-
flex-grow: 1;
|
|
1136
|
+
filteredOptions.map((option, i) => (React.createElement("option", { id: `${baseId}-option-${i}`, key: i, style: { color: option.color }, value: option.value }, option.label || option.value)))),
|
|
1137
|
+
React.createElement(IconWrapper$2, { color: Colors.BLACK.Hex, id: `${baseId}-icon`, path: js.mdiChevronDown, size: '22px' })));
|
|
1138
|
+
};
|
|
1139
|
+
|
|
1140
|
+
const DatePickerWrapper = styled.div `
|
|
1141
|
+
display: flex;
|
|
1142
|
+
width: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.width) || 'auto'};
|
|
1143
|
+
`;
|
|
1144
|
+
const Middle = styled.div `
|
|
1145
|
+
margin: 0px -1px;
|
|
1146
|
+
flex-grow: 1;
|
|
1165
1147
|
`;
|
|
1166
1148
|
const DatePicker = ({ readOnly = false, invalid = false, maxDate = null, minDate = null, date,
|
|
1167
1149
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1168
|
-
onChange = () => { }, style, }) => {
|
|
1150
|
+
onChange = () => { }, style, id, }) => {
|
|
1169
1151
|
const [selectedDay, setSelectedDay] = React.useState(date ? dayjs(date).date().toString() : '');
|
|
1170
1152
|
const [selectedMonth, setSelectedMonth] = React.useState(date ? (dayjs(date).month() + 1).toString() : '');
|
|
1171
1153
|
const [selectedYear, setSelectedYear] = React.useState(date ? dayjs(date).year().toString() : '');
|
|
@@ -1242,76 +1224,76 @@ onChange = () => { }, style, }) => {
|
|
|
1242
1224
|
setSelectedYear(e.target.value);
|
|
1243
1225
|
setDDate(new_date);
|
|
1244
1226
|
};
|
|
1245
|
-
const
|
|
1227
|
+
const baseId = id || 'date-picker';
|
|
1246
1228
|
return (React.createElement(React.Fragment, null,
|
|
1247
|
-
React.createElement(DatePickerWrapper, { "$style": style, id: `${
|
|
1248
|
-
React.createElement(Select, { id: `${
|
|
1249
|
-
React.createElement(Middle, { id: `${
|
|
1250
|
-
React.createElement(Select, { id: `${
|
|
1251
|
-
React.createElement(Select, { id: `${
|
|
1252
|
-
};
|
|
1253
|
-
|
|
1254
|
-
const Scrim$1 = styled.div `
|
|
1255
|
-
position: ${({ $position }) => $position};
|
|
1256
|
-
top: 0;
|
|
1257
|
-
right: 0;
|
|
1258
|
-
bottom: 0;
|
|
1259
|
-
left: 0;
|
|
1260
|
-
z-index: ${({ $position }) => ($position === 'fixed' ? 9998 : 10)};
|
|
1261
|
-
background: ${({ $scrim }) => ($scrim === 'dark' ? 'rgba(0,0,0,0.8)' : 'transparent')};
|
|
1262
|
-
`;
|
|
1263
|
-
const Container$2 = styled.div `
|
|
1264
|
-
z-index: ${({ $position }) => ($position === 'fixed' ? 9999 : 11)};
|
|
1265
|
-
min-width: 400px;
|
|
1266
|
-
width: ${({ $width }) => $width || '400px'};
|
|
1267
|
-
overflow: hidden;
|
|
1268
|
-
box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.2);
|
|
1269
|
-
outline: none;
|
|
1270
|
-
border: none;
|
|
1271
|
-
position: ${({ $position }) => $position};
|
|
1272
|
-
top: 0;
|
|
1273
|
-
right: 0;
|
|
1274
|
-
bottom: 0;
|
|
1275
|
-
padding: 0px;
|
|
1276
|
-
display: flex;
|
|
1277
|
-
flex-direction: column;
|
|
1278
|
-
box-sizing: border-box;
|
|
1279
|
-
background: #fff;
|
|
1280
|
-
`;
|
|
1281
|
-
const Header$2 = styled.div `
|
|
1282
|
-
padding: 30px 20px;
|
|
1283
|
-
display: flex;
|
|
1284
|
-
align-items: flex-start;
|
|
1285
|
-
box-sizing: border-box;
|
|
1286
|
-
flex-shrink: 0;
|
|
1287
|
-
background: #fff;
|
|
1288
|
-
`;
|
|
1289
|
-
const Close$1 = styled.div `
|
|
1290
|
-
margin-left: auto;
|
|
1291
|
-
display: flex;
|
|
1292
|
-
align-items: center;
|
|
1293
|
-
padding-left: 20px;
|
|
1294
|
-
cursor: pointer;
|
|
1295
|
-
`;
|
|
1296
|
-
const ContentWrapper$1 = styled.div `
|
|
1297
|
-
overflow-x: hidden;
|
|
1298
|
-
overflow-y: auto;
|
|
1299
|
-
box-sizing: border-box;
|
|
1300
|
-
flex: 1;
|
|
1301
|
-
background: #fff;
|
|
1302
|
-
`;
|
|
1303
|
-
const ButtonBar$1 = styled.div `
|
|
1304
|
-
padding: 20px;
|
|
1305
|
-
display: flex;
|
|
1306
|
-
align-items: center;
|
|
1307
|
-
justify-content: flex-end;
|
|
1308
|
-
box-sizing: border-box;
|
|
1309
|
-
gap: 10px;
|
|
1310
|
-
flex-shrink: 0;
|
|
1311
|
-
background: #fff;
|
|
1229
|
+
React.createElement(DatePickerWrapper, { "$style": style, id: `${baseId}-wrapper` },
|
|
1230
|
+
React.createElement(Select, { id: `${baseId}-month-select`, invalid: invalid, onChange: handleMonthChange, options: months, placeholder: 'Select Month', readOnly: readOnly, style: { borderRadius: '4px 0px 0px 4px', flexGrow: 3 }, value: selectedMonth }),
|
|
1231
|
+
React.createElement(Middle, { id: `${baseId}-middle` },
|
|
1232
|
+
React.createElement(Select, { id: `${baseId}-day-select`, invalid: invalid, onChange: handleDayChange, options: dayOptions, placeholder: 'Select Day', readOnly: readOnly, style: { borderRadius: '0px' }, value: selectedDay })),
|
|
1233
|
+
React.createElement(Select, { id: `${baseId}-year-select`, invalid: invalid, onChange: handleYearChange, options: years, placeholder: 'Select Year', readOnly: readOnly, style: { borderRadius: '0px 4px 4px 0px', flexGrow: 2 }, value: selectedYear }))));
|
|
1234
|
+
};
|
|
1235
|
+
|
|
1236
|
+
const Scrim$1 = styled.div `
|
|
1237
|
+
position: ${({ $position }) => $position};
|
|
1238
|
+
top: 0;
|
|
1239
|
+
right: 0;
|
|
1240
|
+
bottom: 0;
|
|
1241
|
+
left: 0;
|
|
1242
|
+
z-index: ${({ $position }) => ($position === 'fixed' ? 9998 : 10)};
|
|
1243
|
+
background: ${({ $scrim }) => ($scrim === 'dark' ? 'rgba(0,0,0,0.8)' : 'transparent')};
|
|
1244
|
+
`;
|
|
1245
|
+
const Container$2 = styled.div `
|
|
1246
|
+
z-index: ${({ $position }) => ($position === 'fixed' ? 9999 : 11)};
|
|
1247
|
+
min-width: 400px;
|
|
1248
|
+
width: ${({ $width }) => $width || '400px'};
|
|
1249
|
+
overflow: hidden;
|
|
1250
|
+
box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.2);
|
|
1251
|
+
outline: none;
|
|
1252
|
+
border: none;
|
|
1253
|
+
position: ${({ $position }) => $position};
|
|
1254
|
+
top: 0;
|
|
1255
|
+
right: 0;
|
|
1256
|
+
bottom: 0;
|
|
1257
|
+
padding: 0px;
|
|
1258
|
+
display: flex;
|
|
1259
|
+
flex-direction: column;
|
|
1260
|
+
box-sizing: border-box;
|
|
1261
|
+
background: #fff;
|
|
1262
|
+
`;
|
|
1263
|
+
const Header$2 = styled.div `
|
|
1264
|
+
padding: 30px 20px;
|
|
1265
|
+
display: flex;
|
|
1266
|
+
align-items: flex-start;
|
|
1267
|
+
box-sizing: border-box;
|
|
1268
|
+
flex-shrink: 0;
|
|
1269
|
+
background: #fff;
|
|
1270
|
+
`;
|
|
1271
|
+
const Close$1 = styled.div `
|
|
1272
|
+
margin-left: auto;
|
|
1273
|
+
display: flex;
|
|
1274
|
+
align-items: center;
|
|
1275
|
+
padding-left: 20px;
|
|
1276
|
+
cursor: pointer;
|
|
1277
|
+
`;
|
|
1278
|
+
const ContentWrapper$1 = styled.div `
|
|
1279
|
+
overflow-x: hidden;
|
|
1280
|
+
overflow-y: auto;
|
|
1281
|
+
box-sizing: border-box;
|
|
1282
|
+
flex: 1;
|
|
1283
|
+
background: #fff;
|
|
1284
|
+
`;
|
|
1285
|
+
const ButtonBar$1 = styled.div `
|
|
1286
|
+
padding: 20px;
|
|
1287
|
+
display: flex;
|
|
1288
|
+
align-items: center;
|
|
1289
|
+
justify-content: flex-end;
|
|
1290
|
+
box-sizing: border-box;
|
|
1291
|
+
gap: 10px;
|
|
1292
|
+
flex-shrink: 0;
|
|
1293
|
+
background: #fff;
|
|
1312
1294
|
`;
|
|
1313
1295
|
const Drawer = (_a) => {
|
|
1314
|
-
var { children, description, title, onClose, primaryButton, position = 'fixed', secondaryButton, tertiaryButton, scrim = 'dark', width } = _a, accessibleProps = __rest(_a, ["children", "description", "title", "onClose", "primaryButton", "position", "secondaryButton", "tertiaryButton", "scrim", "width"]);
|
|
1296
|
+
var { children, description, title, onClose, primaryButton, position = 'fixed', secondaryButton, tertiaryButton, scrim = 'dark', width, id } = _a, accessibleProps = __rest(_a, ["children", "description", "title", "onClose", "primaryButton", "position", "secondaryButton", "tertiaryButton", "scrim", "width", "id"]);
|
|
1315
1297
|
React.useEffect(() => {
|
|
1316
1298
|
document.onkeydown = e => {
|
|
1317
1299
|
if (e.key === 'Escape') {
|
|
@@ -1321,195 +1303,195 @@ const Drawer = (_a) => {
|
|
|
1321
1303
|
return function cleanup() {
|
|
1322
1304
|
document.onkeydown = null;
|
|
1323
1305
|
};
|
|
1324
|
-
}, []);
|
|
1325
|
-
const
|
|
1306
|
+
}, [onClose]);
|
|
1307
|
+
const baseId = id || 'drawer';
|
|
1326
1308
|
return (React.createElement(React.Fragment, null,
|
|
1327
|
-
React.createElement(Container$2, Object.assign({}, accessibleProps, { "$position": position, "$width": width, id: `${
|
|
1328
|
-
React.createElement(Header$2, { id: `${
|
|
1329
|
-
React.createElement("div", { id: `${
|
|
1330
|
-
title ? (React.createElement(Heading, { id: `${
|
|
1331
|
-
description ? (React.createElement(Copy, { color: 'GRAY', id: `${
|
|
1332
|
-
React.createElement(Close$1, { id: `${
|
|
1333
|
-
React.createElement(Button, { format: 'secondary', icon: js.mdiClose, id: `${
|
|
1334
|
-
React.createElement(ContentWrapper$1, { id: `${
|
|
1335
|
-
primaryButton || secondaryButton || tertiaryButton ? (React.createElement(ButtonBar$1, { id: `${
|
|
1336
|
-
tertiaryButton ? (React.createElement(Button, Object.assign({}, tertiaryButton, { format: tertiaryButton.format || 'secondary', id: `${
|
|
1337
|
-
secondaryButton ? (React.createElement(Button, Object.assign({}, secondaryButton, { format: secondaryButton.format || 'secondary', id: `${
|
|
1338
|
-
primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { format: primaryButton.format || 'primary', id: `${
|
|
1339
|
-
scrim ? (React.createElement(Scrim$1, { "$position": position, "$scrim": scrim, id: `${
|
|
1340
|
-
};
|
|
1341
|
-
|
|
1309
|
+
React.createElement(Container$2, Object.assign({}, accessibleProps, { "$position": position, "$width": width, id: `${baseId}-container` }),
|
|
1310
|
+
React.createElement(Header$2, { id: `${baseId}-header` },
|
|
1311
|
+
React.createElement("div", { id: `${baseId}-header-content` },
|
|
1312
|
+
title ? (React.createElement(Heading, { id: `${baseId}-title`, type: 'secondary' }, title)) : null,
|
|
1313
|
+
description ? (React.createElement(Copy, { color: 'GRAY', id: `${baseId}-description` }, description)) : null),
|
|
1314
|
+
React.createElement(Close$1, { id: `${baseId}-close`, onClick: onClose },
|
|
1315
|
+
React.createElement(Button, { format: 'secondary', icon: js.mdiClose, id: `${baseId}-close-button`, small: true }))),
|
|
1316
|
+
React.createElement(ContentWrapper$1, { id: `${baseId}-content-wrapper` }, children),
|
|
1317
|
+
primaryButton || secondaryButton || tertiaryButton ? (React.createElement(ButtonBar$1, { id: `${baseId}-button-bar` },
|
|
1318
|
+
tertiaryButton ? (React.createElement(Button, Object.assign({}, tertiaryButton, { format: tertiaryButton.format || 'secondary', id: `${baseId}-tertiary-button` }))) : null,
|
|
1319
|
+
secondaryButton ? (React.createElement(Button, Object.assign({}, secondaryButton, { format: secondaryButton.format || 'secondary', id: `${baseId}-secondary-button` }))) : null,
|
|
1320
|
+
primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { format: primaryButton.format || 'primary', id: `${baseId}-primary-button` }))) : null)) : null),
|
|
1321
|
+
scrim ? (React.createElement(Scrim$1, { "$position": position, "$scrim": scrim, id: `${baseId}-scrim`, onClick: onClose })) : null));
|
|
1322
|
+
};
|
|
1323
|
+
|
|
1342
1324
|
const Wrapper$9 = styled.div(props => (Object.assign({ margin: '0px 0px 18px 0px' }, props.$customStyle)));
|
|
1343
|
-
const LabelRow = styled.div `
|
|
1344
|
-
display: flex;
|
|
1345
|
-
align-items: center;
|
|
1346
|
-
justify-content: space-between;
|
|
1347
|
-
margin: 0 0 4px 0;
|
|
1348
|
-
box-sizing: border-box;
|
|
1349
|
-
`;
|
|
1350
|
-
const Label$2 = styled.label `
|
|
1351
|
-
font-size: ${FontSizes.DEFAULT};
|
|
1352
|
-
font-weight: 500;
|
|
1353
|
-
line-height: 1.3em;
|
|
1354
|
-
font-family: ${FontStyles.DEFAULT};
|
|
1355
|
-
color: ${Colors.BLACK.Hex};
|
|
1356
|
-
display: flex;
|
|
1357
|
-
align-items: center;
|
|
1358
|
-
`;
|
|
1359
|
-
const Required = styled.span `
|
|
1360
|
-
color: ${Colors.RED.Hex};
|
|
1361
|
-
margin-left: 4px;
|
|
1362
|
-
`;
|
|
1363
|
-
const Action = styled.span `
|
|
1364
|
-
font-size: ${FontSizes.DEFAULT};
|
|
1365
|
-
font-weight: 500;
|
|
1366
|
-
line-height: 1em;
|
|
1367
|
-
font-family: ${FontStyles.DEFAULT};
|
|
1368
|
-
color: ${props => props.theme.PRIMARY_COLOR.Hex};
|
|
1369
|
-
cursor: pointer;
|
|
1325
|
+
const LabelRow = styled.div `
|
|
1326
|
+
display: flex;
|
|
1327
|
+
align-items: center;
|
|
1328
|
+
justify-content: space-between;
|
|
1329
|
+
margin: 0 0 4px 0;
|
|
1330
|
+
box-sizing: border-box;
|
|
1331
|
+
`;
|
|
1332
|
+
const Label$2 = styled.label `
|
|
1333
|
+
font-size: ${FontSizes.DEFAULT};
|
|
1334
|
+
font-weight: 500;
|
|
1335
|
+
line-height: 1.3em;
|
|
1336
|
+
font-family: ${FontStyles.DEFAULT};
|
|
1337
|
+
color: ${Colors.BLACK.Hex};
|
|
1338
|
+
display: flex;
|
|
1339
|
+
align-items: center;
|
|
1340
|
+
`;
|
|
1341
|
+
const Required = styled.span `
|
|
1342
|
+
color: ${Colors.RED.Hex};
|
|
1343
|
+
margin-left: 4px;
|
|
1344
|
+
`;
|
|
1345
|
+
const Action = styled.span `
|
|
1346
|
+
font-size: ${FontSizes.DEFAULT};
|
|
1347
|
+
font-weight: 500;
|
|
1348
|
+
line-height: 1em;
|
|
1349
|
+
font-family: ${FontStyles.DEFAULT};
|
|
1350
|
+
color: ${props => props.theme.PRIMARY_COLOR.Hex};
|
|
1351
|
+
cursor: pointer;
|
|
1370
1352
|
`;
|
|
1371
1353
|
Action.defaultProps = { theme: EditableTheme };
|
|
1372
|
-
const Description = styled.div `
|
|
1373
|
-
font-size: ${FontSizes.SMALL};
|
|
1374
|
-
font-weight: 400;
|
|
1375
|
-
line-height: 1.3em;
|
|
1376
|
-
font-family: ${FontStyles.DEFAULT};
|
|
1377
|
-
color: ${Colors.BLACK.Hex};
|
|
1378
|
-
margin: 0 0 8px 0;
|
|
1379
|
-
box-sizing: border-box;
|
|
1380
|
-
`;
|
|
1381
|
-
const Validation = styled.div `
|
|
1382
|
-
font-size: ${FontSizes.SMALL};
|
|
1383
|
-
font-weight: 400;
|
|
1384
|
-
line-height: 1.3em;
|
|
1385
|
-
font-family: ${FontStyles.DEFAULT};
|
|
1386
|
-
color: ${Colors.RED.Hex};
|
|
1387
|
-
margin: 4px 0 0 0;
|
|
1388
|
-
box-sizing: border-box;
|
|
1354
|
+
const Description = styled.div `
|
|
1355
|
+
font-size: ${FontSizes.SMALL};
|
|
1356
|
+
font-weight: 400;
|
|
1357
|
+
line-height: 1.3em;
|
|
1358
|
+
font-family: ${FontStyles.DEFAULT};
|
|
1359
|
+
color: ${Colors.BLACK.Hex};
|
|
1360
|
+
margin: 0 0 8px 0;
|
|
1361
|
+
box-sizing: border-box;
|
|
1362
|
+
`;
|
|
1363
|
+
const Validation = styled.div `
|
|
1364
|
+
font-size: ${FontSizes.SMALL};
|
|
1365
|
+
font-weight: 400;
|
|
1366
|
+
line-height: 1.3em;
|
|
1367
|
+
font-family: ${FontStyles.DEFAULT};
|
|
1368
|
+
color: ${Colors.RED.Hex};
|
|
1369
|
+
margin: 4px 0 0 0;
|
|
1370
|
+
box-sizing: border-box;
|
|
1389
1371
|
`;
|
|
1390
1372
|
const Field = (_a) => {
|
|
1391
|
-
var { action, children, validationText, label, description, required, htmlFor, style = {}, tooltip } = _a, accessibleProps = __rest(_a, ["action", "children", "validationText", "label", "description", "required", "htmlFor", "style", "tooltip"]);
|
|
1392
|
-
const
|
|
1393
|
-
return (React.createElement(Wrapper$9, Object.assign({ "$customStyle": style }, accessibleProps, { id: `${
|
|
1394
|
-
React.createElement(LabelRow, { id: `${
|
|
1395
|
-
label || required || tooltip ? (React.createElement(Label$2, { htmlFor: htmlFor, id: `${
|
|
1373
|
+
var { action, children, validationText, label, description, required, htmlFor, style = {}, tooltip, id } = _a, accessibleProps = __rest(_a, ["action", "children", "validationText", "label", "description", "required", "htmlFor", "style", "tooltip", "id"]);
|
|
1374
|
+
const baseId = id || 'field';
|
|
1375
|
+
return (React.createElement(Wrapper$9, Object.assign({ "$customStyle": style }, accessibleProps, { id: `${baseId}-wrapper` }),
|
|
1376
|
+
React.createElement(LabelRow, { id: `${baseId}-label-row` },
|
|
1377
|
+
label || required || tooltip ? (React.createElement(Label$2, { htmlFor: htmlFor, id: `${baseId}-label` },
|
|
1396
1378
|
label,
|
|
1397
|
-
required ? React.createElement(Required, { id: `${
|
|
1379
|
+
required ? React.createElement(Required, { id: `${baseId}-required` }, "*") : null,
|
|
1398
1380
|
tooltip ? React.createElement(Tooltip, Object.assign({}, tooltip)) : null)) : null,
|
|
1399
|
-
action ? (React.createElement(Action, { id: action.id || `${
|
|
1400
|
-
description ? React.createElement(Description, { id: `${
|
|
1401
|
-
React.createElement("div", { id: `${
|
|
1402
|
-
|
|
1403
|
-
};
|
|
1404
|
-
|
|
1405
|
-
const Wrapper$8 = styled.fieldset `
|
|
1406
|
-
margin-inline-start: 0px;
|
|
1407
|
-
margin-inline-end: 0px;
|
|
1408
|
-
padding-block-start: 0px;
|
|
1409
|
-
padding-inline-start: 0px;
|
|
1410
|
-
padding-inline-end: 0px;
|
|
1411
|
-
padding-block-end: 0px;
|
|
1412
|
-
min-inline-size: min-content;
|
|
1413
|
-
border-width: 0px;
|
|
1414
|
-
border-style: none;
|
|
1415
|
-
border-color: transparent;
|
|
1416
|
-
border-image: none;
|
|
1417
|
-
`;
|
|
1418
|
-
const Label$1 = styled.legend `
|
|
1419
|
-
padding-inline-start: 0px;
|
|
1420
|
-
padding-inline-end: 0px;
|
|
1421
|
-
|
|
1422
|
-
color: ${Colors.BLACK.Hex};
|
|
1423
|
-
font-family: ${FontStyles.DEFAULT};
|
|
1424
|
-
font-size: ${FontSizes.DEFAULT};
|
|
1425
|
-
font-weight: 500;
|
|
1426
|
-
line-height: 22px;
|
|
1427
|
-
margin-bottom: 6px;
|
|
1428
|
-
`;
|
|
1429
|
-
const Content$1 = styled.div `
|
|
1430
|
-
padding: 20px;
|
|
1431
|
-
border-radius: 8px;
|
|
1432
|
-
background: #fcfcfc;
|
|
1433
|
-
`;
|
|
1434
|
-
const FieldGroup = ({ children, label }) => {
|
|
1435
|
-
const
|
|
1436
|
-
return (React.createElement(Wrapper$8, { id: `${
|
|
1437
|
-
React.createElement(Label$1, { id: `${
|
|
1438
|
-
React.createElement(Content$1, { id: `${
|
|
1439
|
-
};
|
|
1440
|
-
|
|
1441
|
-
const Dropzone = styled.div `
|
|
1442
|
-
border-radius: 8px;
|
|
1443
|
-
border-width: 1px;
|
|
1444
|
-
border-style: dashed;
|
|
1445
|
-
border-color: ${props => (props.$dragging ? props.theme.PRIMARY_COLOR.Hex : '#cccccc')};
|
|
1446
|
-
background: ${props => props.$dragging ? `rgba(${props.theme.PRIMARY_COLOR.Rgb}, 0.05)` : '#ffffff'};
|
|
1447
|
-
cursor: copy;
|
|
1381
|
+
action ? (React.createElement(Action, { id: action.id || `${baseId}-action`, onClick: action.onClick }, action.label)) : null),
|
|
1382
|
+
description ? React.createElement(Description, { id: `${baseId}-description` }, description) : null,
|
|
1383
|
+
React.createElement("div", { id: `${baseId}-children` }, children),
|
|
1384
|
+
React.createElement(Validation, { className: 'field-validation-wrapper', id: `${baseId}-validation`, title: validationText }, validationText ? validationText : '\u00A0')));
|
|
1385
|
+
};
|
|
1386
|
+
|
|
1387
|
+
const Wrapper$8 = styled.fieldset `
|
|
1388
|
+
margin-inline-start: 0px;
|
|
1389
|
+
margin-inline-end: 0px;
|
|
1390
|
+
padding-block-start: 0px;
|
|
1391
|
+
padding-inline-start: 0px;
|
|
1392
|
+
padding-inline-end: 0px;
|
|
1393
|
+
padding-block-end: 0px;
|
|
1394
|
+
min-inline-size: min-content;
|
|
1395
|
+
border-width: 0px;
|
|
1396
|
+
border-style: none;
|
|
1397
|
+
border-color: transparent;
|
|
1398
|
+
border-image: none;
|
|
1399
|
+
`;
|
|
1400
|
+
const Label$1 = styled.legend `
|
|
1401
|
+
padding-inline-start: 0px;
|
|
1402
|
+
padding-inline-end: 0px;
|
|
1403
|
+
|
|
1404
|
+
color: ${Colors.BLACK.Hex};
|
|
1405
|
+
font-family: ${FontStyles.DEFAULT};
|
|
1406
|
+
font-size: ${FontSizes.DEFAULT};
|
|
1407
|
+
font-weight: 500;
|
|
1408
|
+
line-height: 22px;
|
|
1409
|
+
margin-bottom: 6px;
|
|
1410
|
+
`;
|
|
1411
|
+
const Content$1 = styled.div `
|
|
1412
|
+
padding: 20px;
|
|
1413
|
+
border-radius: 8px;
|
|
1414
|
+
background: #fcfcfc;
|
|
1415
|
+
`;
|
|
1416
|
+
const FieldGroup = ({ children, label, id }) => {
|
|
1417
|
+
const baseId = id || 'field-group';
|
|
1418
|
+
return (React.createElement(Wrapper$8, { id: `${baseId}-wrapper` },
|
|
1419
|
+
React.createElement(Label$1, { id: `${baseId}-label` }, label),
|
|
1420
|
+
React.createElement(Content$1, { id: `${baseId}-content` }, children)));
|
|
1421
|
+
};
|
|
1422
|
+
|
|
1423
|
+
const Dropzone = styled.div `
|
|
1424
|
+
border-radius: 8px;
|
|
1425
|
+
border-width: 1px;
|
|
1426
|
+
border-style: dashed;
|
|
1427
|
+
border-color: ${props => (props.$dragging ? props.theme.PRIMARY_COLOR.Hex : '#cccccc')};
|
|
1428
|
+
background: ${props => props.$dragging ? `rgba(${props.theme.PRIMARY_COLOR.Rgb}, 0.05)` : '#ffffff'};
|
|
1429
|
+
cursor: copy;
|
|
1448
1430
|
`;
|
|
1449
1431
|
Dropzone.defaultProps = { theme: EditableTheme };
|
|
1450
|
-
const IconWrapper$1 = styled.div `
|
|
1451
|
-
width: 80px;
|
|
1452
|
-
height: 80px;
|
|
1453
|
-
border-radius: 40px;
|
|
1454
|
-
background: ${props => (props.$dragging ? '#ffffff' : '#f5f5f5')};
|
|
1455
|
-
display: flex;
|
|
1456
|
-
align-items: center;
|
|
1457
|
-
justify-content: center;
|
|
1458
|
-
`;
|
|
1459
|
-
const StyledIcon$3 = styled(Icon) `
|
|
1460
|
-
width: 40px !important;
|
|
1461
|
-
height: 40px !important;
|
|
1462
|
-
|
|
1463
|
-
> path {
|
|
1464
|
-
fill: ${Colors.GRAY.Hex} !important;
|
|
1465
|
-
}
|
|
1466
|
-
`;
|
|
1467
|
-
const ClickZone = styled.div `
|
|
1468
|
-
margin: 40px 20px;
|
|
1469
|
-
display: flex;
|
|
1470
|
-
flex-direction: column;
|
|
1471
|
-
align-items: center;
|
|
1472
|
-
gap: 16px;
|
|
1473
|
-
`;
|
|
1474
|
-
const Content = styled.div `
|
|
1475
|
-
display: flex;
|
|
1476
|
-
flex-direction: column;
|
|
1477
|
-
align-items: center;
|
|
1478
|
-
z-index: 99999;
|
|
1479
|
-
gap: 2px;
|
|
1480
|
-
`;
|
|
1481
|
-
const Files = styled.div `
|
|
1482
|
-
display: flex;
|
|
1483
|
-
flex-direction: column;
|
|
1484
|
-
align-self: stretch;
|
|
1485
|
-
gap: 10px;
|
|
1486
|
-
margin: 20px;
|
|
1487
|
-
`;
|
|
1488
|
-
const MessageDiv = styled.div `
|
|
1489
|
-
display: flex;
|
|
1490
|
-
align-items: center;
|
|
1491
|
-
justify-content: center;
|
|
1492
|
-
`;
|
|
1493
|
-
const File = styled.div `
|
|
1494
|
-
display: flex;
|
|
1495
|
-
padding: 10px;
|
|
1496
|
-
align-items: center;
|
|
1497
|
-
justify-content: space-between;
|
|
1498
|
-
gap: 10px;
|
|
1499
|
-
border-radius: 4px;
|
|
1500
|
-
border: 1px solid #cccccc;
|
|
1501
|
-
background: #ffffff;
|
|
1502
|
-
`;
|
|
1503
|
-
const Remove = styled(Icon) `
|
|
1504
|
-
width: 24px;
|
|
1505
|
-
height: 24px;
|
|
1506
|
-
cursor: pointer;
|
|
1507
|
-
|
|
1508
|
-
> path {
|
|
1509
|
-
fill: ${Colors.RED.Hex} !important;
|
|
1510
|
-
}
|
|
1511
|
-
`;
|
|
1512
|
-
const FileUpload = ({ accept, onChange, onError, maxFiles = 10, maxSize = 2, value = [], message, tooltipInfo = '', validateFile, }) => {
|
|
1432
|
+
const IconWrapper$1 = styled.div `
|
|
1433
|
+
width: 80px;
|
|
1434
|
+
height: 80px;
|
|
1435
|
+
border-radius: 40px;
|
|
1436
|
+
background: ${props => (props.$dragging ? '#ffffff' : '#f5f5f5')};
|
|
1437
|
+
display: flex;
|
|
1438
|
+
align-items: center;
|
|
1439
|
+
justify-content: center;
|
|
1440
|
+
`;
|
|
1441
|
+
const StyledIcon$3 = styled(Icon) `
|
|
1442
|
+
width: 40px !important;
|
|
1443
|
+
height: 40px !important;
|
|
1444
|
+
|
|
1445
|
+
> path {
|
|
1446
|
+
fill: ${Colors.GRAY.Hex} !important;
|
|
1447
|
+
}
|
|
1448
|
+
`;
|
|
1449
|
+
const ClickZone = styled.div `
|
|
1450
|
+
margin: 40px 20px;
|
|
1451
|
+
display: flex;
|
|
1452
|
+
flex-direction: column;
|
|
1453
|
+
align-items: center;
|
|
1454
|
+
gap: 16px;
|
|
1455
|
+
`;
|
|
1456
|
+
const Content = styled.div `
|
|
1457
|
+
display: flex;
|
|
1458
|
+
flex-direction: column;
|
|
1459
|
+
align-items: center;
|
|
1460
|
+
z-index: 99999;
|
|
1461
|
+
gap: 2px;
|
|
1462
|
+
`;
|
|
1463
|
+
const Files = styled.div `
|
|
1464
|
+
display: flex;
|
|
1465
|
+
flex-direction: column;
|
|
1466
|
+
align-self: stretch;
|
|
1467
|
+
gap: 10px;
|
|
1468
|
+
margin: 20px;
|
|
1469
|
+
`;
|
|
1470
|
+
const MessageDiv = styled.div `
|
|
1471
|
+
display: flex;
|
|
1472
|
+
align-items: center;
|
|
1473
|
+
justify-content: center;
|
|
1474
|
+
`;
|
|
1475
|
+
const File = styled.div `
|
|
1476
|
+
display: flex;
|
|
1477
|
+
padding: 10px;
|
|
1478
|
+
align-items: center;
|
|
1479
|
+
justify-content: space-between;
|
|
1480
|
+
gap: 10px;
|
|
1481
|
+
border-radius: 4px;
|
|
1482
|
+
border: 1px solid #cccccc;
|
|
1483
|
+
background: #ffffff;
|
|
1484
|
+
`;
|
|
1485
|
+
const Remove = styled(Icon) `
|
|
1486
|
+
width: 24px;
|
|
1487
|
+
height: 24px;
|
|
1488
|
+
cursor: pointer;
|
|
1489
|
+
|
|
1490
|
+
> path {
|
|
1491
|
+
fill: ${Colors.RED.Hex} !important;
|
|
1492
|
+
}
|
|
1493
|
+
`;
|
|
1494
|
+
const FileUpload = ({ accept, onChange, onError, maxFiles = 10, maxSize = 2, value = [], message, tooltipInfo = '', validateFile, id, }) => {
|
|
1513
1495
|
const inputRef = React.useRef(null);
|
|
1514
1496
|
const [files, setFiles] = React.useState(value || []);
|
|
1515
1497
|
const [dragging, setDragging] = React.useState(false);
|
|
@@ -1608,27 +1590,27 @@ const FileUpload = ({ accept, onChange, onError, maxFiles = 10, maxSize = 2, val
|
|
|
1608
1590
|
setAllowMoreFiles(false);
|
|
1609
1591
|
}
|
|
1610
1592
|
}, [files]);
|
|
1611
|
-
const
|
|
1593
|
+
const baseId = id || 'file-upload';
|
|
1612
1594
|
return (React.createElement(React.Fragment, null,
|
|
1613
|
-
React.createElement("input", { accept: accept, id: `${
|
|
1614
|
-
React.createElement(Dropzone, { "$dragging": dragging, id: `${
|
|
1615
|
-
files.length ? (React.createElement(Files, { id: `${
|
|
1616
|
-
const fileId =
|
|
1595
|
+
React.createElement("input", { accept: accept, id: `${baseId}-input`, multiple: true, onChange: allowMoreFiles ? handleChange : undefined, ref: inputRef, style: { display: 'none' }, type: 'file' }),
|
|
1596
|
+
React.createElement(Dropzone, { "$dragging": dragging, id: `${baseId}-dropzone`, onDragEnter: allowMoreFiles ? handleDrag : undefined, onDragLeave: allowMoreFiles ? handleDrag : undefined, onDragOver: allowMoreFiles ? handleDrag : undefined, onDrop: allowMoreFiles ? handleDrop : undefined, value: files ? files : [] },
|
|
1597
|
+
files.length ? (React.createElement(Files, { id: `${baseId}-files` }, files.map((file, index) => {
|
|
1598
|
+
const fileId = `${baseId}-file-${index}`;
|
|
1617
1599
|
return (React.createElement(File, { id: `${fileId}-file`, key: file.name },
|
|
1618
1600
|
React.createElement(Copy, { id: `${fileId}-file-name`, type: 'bold' }, file.name),
|
|
1619
1601
|
React.createElement(Remove, { id: `${fileId}-remove`, onClick: handleRemove.bind(null, file), path: js.mdiMinusCircle })));
|
|
1620
1602
|
}))) : null,
|
|
1621
|
-
allowMoreFiles ? (React.createElement(ClickZone, { id: `${
|
|
1622
|
-
files.length ? null : (React.createElement(IconWrapper$1, { "$dragging": dragging, id: `${
|
|
1623
|
-
React.createElement(StyledIcon$3, { id: `${
|
|
1624
|
-
React.createElement(Content, { id: `${
|
|
1625
|
-
React.createElement(Copy, { align: 'center', id: `${
|
|
1626
|
-
message ? (React.createElement(MessageDiv, { id: `${
|
|
1627
|
-
React.createElement(Copy, { align: 'center', color: 'GRAY', id: `${
|
|
1628
|
-
tooltipInfo && (React.createElement("span", { id: `${
|
|
1603
|
+
allowMoreFiles ? (React.createElement(ClickZone, { id: `${baseId}-click-zone`, onClick: triggerFileExplorer },
|
|
1604
|
+
files.length ? null : (React.createElement(IconWrapper$1, { "$dragging": dragging, id: `${baseId}-icon-wrapper` },
|
|
1605
|
+
React.createElement(StyledIcon$3, { id: `${baseId}-icon`, path: js.mdiFolderPlusOutline }))),
|
|
1606
|
+
React.createElement(Content, { id: `${baseId}-content` },
|
|
1607
|
+
React.createElement(Copy, { align: 'center', id: `${baseId}-copy`, type: 'bold' }, "Drag & drop files here or click to select files"),
|
|
1608
|
+
message ? (React.createElement(MessageDiv, { id: `${baseId}-message-div` },
|
|
1609
|
+
React.createElement(Copy, { align: 'center', color: 'GRAY', id: `${baseId}-message` }, message),
|
|
1610
|
+
tooltipInfo && (React.createElement("span", { id: `${baseId}-tooltip` },
|
|
1629
1611
|
React.createElement(Tooltip, { children: tooltipInfo, position: 'left-center' }))))) : null))) : null)));
|
|
1630
|
-
};
|
|
1631
|
-
|
|
1612
|
+
};
|
|
1613
|
+
|
|
1632
1614
|
const getAgesFromDob = (dob) => {
|
|
1633
1615
|
let calculated_current_age = null;
|
|
1634
1616
|
let calculated_nearest_age = null;
|
|
@@ -1701,154 +1683,154 @@ const formatAsSsn = (number) => {
|
|
|
1701
1683
|
formatted_value = `${formatted_value.substring(0, 3)}-${formatted_value.substring(3, 5)}-${formatted_value.substring(5, 9)}`;
|
|
1702
1684
|
}
|
|
1703
1685
|
return formatted_value;
|
|
1704
|
-
};
|
|
1705
|
-
|
|
1706
|
-
const StyledInput = styled.input `
|
|
1707
|
-
border: none !important;
|
|
1708
|
-
background: none !important;
|
|
1709
|
-
font-size: ${FontSizes.DEFAULT};
|
|
1710
|
-
font-weight: 400;
|
|
1711
|
-
font-family: ${FontStyles.DEFAULT};
|
|
1712
|
-
line-height: 1.28em;
|
|
1686
|
+
};
|
|
1687
|
+
|
|
1688
|
+
const StyledInput = styled.input `
|
|
1689
|
+
border: none !important;
|
|
1690
|
+
background: none !important;
|
|
1691
|
+
font-size: ${FontSizes.DEFAULT};
|
|
1692
|
+
font-weight: 400;
|
|
1693
|
+
font-family: ${FontStyles.DEFAULT};
|
|
1694
|
+
line-height: 1.28em;
|
|
1713
1695
|
color: ${props => props.$showErrorTextColor && props.$invalid && !props.$readOnly
|
|
1714
1696
|
? Colors.RED.Hex
|
|
1715
|
-
: Colors.BLACK.Hex};
|
|
1716
|
-
position: relative;
|
|
1717
|
-
height: ${props => props.$height || 'auto'};
|
|
1718
|
-
padding: 10px;
|
|
1719
|
-
opacity: ${props => (props.$readOnly ? 0.6 : 1)};
|
|
1720
|
-
box-shadow: none;
|
|
1721
|
-
outline: none;
|
|
1722
|
-
margin: 0px;
|
|
1723
|
-
text-indent: 0px;
|
|
1724
|
-
--webkit-appearance: none;
|
|
1725
|
-
box-sizing: border-box;
|
|
1726
|
-
display: block;
|
|
1727
|
-
width: 100%;
|
|
1728
|
-
`;
|
|
1729
|
-
const StyledTextArea = styled.textarea `
|
|
1730
|
-
border: none !important;
|
|
1731
|
-
background: none !important;
|
|
1732
|
-
overflow-y: scroll !important;
|
|
1733
|
-
font-size: 14px;
|
|
1734
|
-
font-weight: 400;
|
|
1735
|
-
height: ${props => props.$height || 'auto'};
|
|
1736
|
-
font-family: 'Roboto', Helvetica, Arial, sans-serif;
|
|
1737
|
-
line-height: 1.28em;
|
|
1697
|
+
: Colors.BLACK.Hex};
|
|
1698
|
+
position: relative;
|
|
1699
|
+
height: ${props => props.$height || 'auto'};
|
|
1700
|
+
padding: 10px;
|
|
1701
|
+
opacity: ${props => (props.$readOnly ? 0.6 : 1)};
|
|
1702
|
+
box-shadow: none;
|
|
1703
|
+
outline: none;
|
|
1704
|
+
margin: 0px;
|
|
1705
|
+
text-indent: 0px;
|
|
1706
|
+
--webkit-appearance: none;
|
|
1707
|
+
box-sizing: border-box;
|
|
1708
|
+
display: block;
|
|
1709
|
+
width: 100%;
|
|
1710
|
+
`;
|
|
1711
|
+
const StyledTextArea = styled.textarea `
|
|
1712
|
+
border: none !important;
|
|
1713
|
+
background: none !important;
|
|
1714
|
+
overflow-y: scroll !important;
|
|
1715
|
+
font-size: 14px;
|
|
1716
|
+
font-weight: 400;
|
|
1717
|
+
height: ${props => props.$height || 'auto'};
|
|
1718
|
+
font-family: 'Roboto', Helvetica, Arial, sans-serif;
|
|
1719
|
+
line-height: 1.28em;
|
|
1738
1720
|
color: ${props => props.$showErrorTextColor && props.$invalid && !props.$readOnly
|
|
1739
1721
|
? Colors.RED.Hex
|
|
1740
|
-
: Colors.BLACK.Hex};
|
|
1741
|
-
position: relative;
|
|
1742
|
-
padding: 10px;
|
|
1743
|
-
opacity: 1;
|
|
1744
|
-
box-shadow: none;
|
|
1745
|
-
outline: none;
|
|
1746
|
-
margin: 0px;
|
|
1747
|
-
text-indent: 0px;
|
|
1748
|
-
--webkit-appearance: none;
|
|
1749
|
-
overflow-wrap: break-word;
|
|
1750
|
-
box-sizing: border-box;
|
|
1751
|
-
display: block;
|
|
1752
|
-
width: 100%;
|
|
1722
|
+
: Colors.BLACK.Hex};
|
|
1723
|
+
position: relative;
|
|
1724
|
+
padding: 10px;
|
|
1725
|
+
opacity: 1;
|
|
1726
|
+
box-shadow: none;
|
|
1727
|
+
outline: none;
|
|
1728
|
+
margin: 0px;
|
|
1729
|
+
text-indent: 0px;
|
|
1730
|
+
--webkit-appearance: none;
|
|
1731
|
+
overflow-wrap: break-word;
|
|
1732
|
+
box-sizing: border-box;
|
|
1733
|
+
display: block;
|
|
1734
|
+
width: 100%;
|
|
1753
1735
|
${({ $readOnly }) => $readOnly &&
|
|
1754
|
-
`
|
|
1755
|
-
background-color: #f0f0f0;
|
|
1756
|
-
color: #999999;
|
|
1757
|
-
overflow-y: scroll;
|
|
1758
|
-
`}
|
|
1759
|
-
`;
|
|
1760
|
-
const StyledSuffix = styled.div `
|
|
1761
|
-
box-sizing: border-box;
|
|
1762
|
-
border-radius: 0px 4px 4px 0px;
|
|
1763
|
-
display: flex;
|
|
1764
|
-
justify-content: center;
|
|
1765
|
-
align-items: center;
|
|
1766
|
-
padding: 10px;
|
|
1767
|
-
height: auto;
|
|
1768
|
-
background: #f5f5f5;
|
|
1769
|
-
border-width: 0px 0px 0px 1px;
|
|
1770
|
-
border-style: solid;
|
|
1771
|
-
border-color: #cccccc;
|
|
1772
|
-
font-family: ${FontStyles.DEFAULT};
|
|
1773
|
-
font-style: normal;
|
|
1774
|
-
font-weight: 400;
|
|
1775
|
-
font-size: ${FontSizes.DEFAULT};
|
|
1776
|
-
color: ${Colors.BLACK.Hex};
|
|
1777
|
-
`;
|
|
1778
|
-
const StyledWrapper = styled.div `
|
|
1779
|
-
display: flex;
|
|
1780
|
-
width: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.width) || 'auto'};
|
|
1781
|
-
background-color: ${props => (props.$readOnly ? '#f5f5f5' : '#ffffff')};
|
|
1782
|
-
position: relative;
|
|
1783
|
-
border-width: 1px;
|
|
1784
|
-
border-style: solid;
|
|
1785
|
-
border-color: ${props => (props.$invalid && !props.$readOnly ? Colors.RED.Hex : '#cccccc')};
|
|
1786
|
-
border-radius: ${props => (props.$suggestions ? '4px 4px 0px 0px' : '4px')};
|
|
1787
|
-
|
|
1788
|
-
&:focus-within {
|
|
1789
|
-
border-color: ${props => (props.$readOnly ? '#cccccc' : props.theme.PRIMARY_COLOR.Hex)};
|
|
1790
|
-
}
|
|
1736
|
+
`
|
|
1737
|
+
background-color: #f0f0f0;
|
|
1738
|
+
color: #999999;
|
|
1739
|
+
overflow-y: scroll;
|
|
1740
|
+
`}
|
|
1741
|
+
`;
|
|
1742
|
+
const StyledSuffix = styled.div `
|
|
1743
|
+
box-sizing: border-box;
|
|
1744
|
+
border-radius: 0px 4px 4px 0px;
|
|
1745
|
+
display: flex;
|
|
1746
|
+
justify-content: center;
|
|
1747
|
+
align-items: center;
|
|
1748
|
+
padding: 10px;
|
|
1749
|
+
height: auto;
|
|
1750
|
+
background: #f5f5f5;
|
|
1751
|
+
border-width: 0px 0px 0px 1px;
|
|
1752
|
+
border-style: solid;
|
|
1753
|
+
border-color: #cccccc;
|
|
1754
|
+
font-family: ${FontStyles.DEFAULT};
|
|
1755
|
+
font-style: normal;
|
|
1756
|
+
font-weight: 400;
|
|
1757
|
+
font-size: ${FontSizes.DEFAULT};
|
|
1758
|
+
color: ${Colors.BLACK.Hex};
|
|
1759
|
+
`;
|
|
1760
|
+
const StyledWrapper = styled.div `
|
|
1761
|
+
display: flex;
|
|
1762
|
+
width: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.width) || 'auto'};
|
|
1763
|
+
background-color: ${props => (props.$readOnly ? '#f5f5f5' : '#ffffff')};
|
|
1764
|
+
position: relative;
|
|
1765
|
+
border-width: 1px;
|
|
1766
|
+
border-style: solid;
|
|
1767
|
+
border-color: ${props => (props.$invalid && !props.$readOnly ? Colors.RED.Hex : '#cccccc')};
|
|
1768
|
+
border-radius: ${props => (props.$suggestions ? '4px 4px 0px 0px' : '4px')};
|
|
1769
|
+
|
|
1770
|
+
&:focus-within {
|
|
1771
|
+
border-color: ${props => (props.$readOnly ? '#cccccc' : props.theme.PRIMARY_COLOR.Hex)};
|
|
1772
|
+
}
|
|
1791
1773
|
`;
|
|
1792
1774
|
StyledWrapper.defaultProps = { theme: EditableTheme };
|
|
1793
|
-
const SuggestedValues = styled.div `
|
|
1794
|
-
background: #fff;
|
|
1795
|
-
box-shadow: 0px 5px 30px -15px rgba(0, 0, 0, 0.2);
|
|
1796
|
-
border-color: ${props => props.theme.PRIMARY_COLOR.Hex};
|
|
1797
|
-
border-radius: 0px 0px 4px 4px;
|
|
1798
|
-
border-style: solid;
|
|
1799
|
-
border-top: none;
|
|
1800
|
-
border-width: 1px;
|
|
1801
|
-
left: -1px;
|
|
1802
|
-
position: absolute;
|
|
1803
|
-
right: -1px;
|
|
1804
|
-
top: 39px;
|
|
1805
|
-
z-index: 9999;
|
|
1806
|
-
max-height: 220px;
|
|
1807
|
-
overflow: auto;
|
|
1775
|
+
const SuggestedValues = styled.div `
|
|
1776
|
+
background: #fff;
|
|
1777
|
+
box-shadow: 0px 5px 30px -15px rgba(0, 0, 0, 0.2);
|
|
1778
|
+
border-color: ${props => props.theme.PRIMARY_COLOR.Hex};
|
|
1779
|
+
border-radius: 0px 0px 4px 4px;
|
|
1780
|
+
border-style: solid;
|
|
1781
|
+
border-top: none;
|
|
1782
|
+
border-width: 1px;
|
|
1783
|
+
left: -1px;
|
|
1784
|
+
position: absolute;
|
|
1785
|
+
right: -1px;
|
|
1786
|
+
top: 39px;
|
|
1787
|
+
z-index: 9999;
|
|
1788
|
+
max-height: 220px;
|
|
1789
|
+
overflow: auto;
|
|
1808
1790
|
`;
|
|
1809
1791
|
SuggestedValues.defaultProps = { theme: EditableTheme };
|
|
1810
|
-
const SuggestedSummary = styled.div `
|
|
1811
|
-
color: ${Colors.MEDIUM_GRAY.Hex};
|
|
1812
|
-
font-size: 12px;
|
|
1813
|
-
font-family: ${FontStyles.DEFAULT};
|
|
1814
|
-
font-weight: 500;
|
|
1815
|
-
line-height: 18px;
|
|
1816
|
-
padding: 10px 12px;
|
|
1817
|
-
border-bottom: 1px solid #e5e5e5;
|
|
1818
|
-
background: #fff;
|
|
1819
|
-
z-index: 1;
|
|
1820
|
-
position: sticky;
|
|
1821
|
-
top: 0px;
|
|
1822
|
-
`;
|
|
1823
|
-
const SuggestedValue = styled.div `
|
|
1824
|
-
cursor: pointer;
|
|
1825
|
-
padding: 8px 12px;
|
|
1826
|
-
font-size: ${FontSizes.DEFAULT};
|
|
1827
|
-
font-family: ${FontStyles.DEFAULT};
|
|
1828
|
-
font-weight: 400;
|
|
1829
|
-
line-height: 1.6em;
|
|
1830
|
-
color: ${Colors.BLACK.Hex};
|
|
1831
|
-
|
|
1832
|
-
&:hover {
|
|
1833
|
-
background: rgba(${props => props.theme.PRIMARY_COLOR.Rgb}, 0.05);
|
|
1834
|
-
}
|
|
1792
|
+
const SuggestedSummary = styled.div `
|
|
1793
|
+
color: ${Colors.MEDIUM_GRAY.Hex};
|
|
1794
|
+
font-size: 12px;
|
|
1795
|
+
font-family: ${FontStyles.DEFAULT};
|
|
1796
|
+
font-weight: 500;
|
|
1797
|
+
line-height: 18px;
|
|
1798
|
+
padding: 10px 12px;
|
|
1799
|
+
border-bottom: 1px solid #e5e5e5;
|
|
1800
|
+
background: #fff;
|
|
1801
|
+
z-index: 1;
|
|
1802
|
+
position: sticky;
|
|
1803
|
+
top: 0px;
|
|
1804
|
+
`;
|
|
1805
|
+
const SuggestedValue = styled.div `
|
|
1806
|
+
cursor: pointer;
|
|
1807
|
+
padding: 8px 12px;
|
|
1808
|
+
font-size: ${FontSizes.DEFAULT};
|
|
1809
|
+
font-family: ${FontStyles.DEFAULT};
|
|
1810
|
+
font-weight: 400;
|
|
1811
|
+
line-height: 1.6em;
|
|
1812
|
+
color: ${Colors.BLACK.Hex};
|
|
1813
|
+
|
|
1814
|
+
&:hover {
|
|
1815
|
+
background: rgba(${props => props.theme.PRIMARY_COLOR.Rgb}, 0.05);
|
|
1816
|
+
}
|
|
1835
1817
|
`;
|
|
1836
1818
|
SuggestedValue.defaultProps = { theme: EditableTheme };
|
|
1837
|
-
const CharacterCount = styled.div `
|
|
1838
|
-
font-family: ${FontStyles.DEFAULT};
|
|
1839
|
-
font-size: ${FontSizes.SMALL};
|
|
1840
|
-
color: ${Colors.MEDIUM_GRAY.Hex};
|
|
1841
|
-
padding: 10px;
|
|
1819
|
+
const CharacterCount = styled.div `
|
|
1820
|
+
font-family: ${FontStyles.DEFAULT};
|
|
1821
|
+
font-size: ${FontSizes.SMALL};
|
|
1822
|
+
color: ${Colors.MEDIUM_GRAY.Hex};
|
|
1823
|
+
padding: 10px;
|
|
1842
1824
|
`;
|
|
1843
|
-
const Loader$1 = styled.div `
|
|
1844
|
-
padding: 0px 10px;
|
|
1845
|
-
display: flex;
|
|
1846
|
-
align-items: center;
|
|
1825
|
+
const Loader$1 = styled.div `
|
|
1826
|
+
padding: 0px 10px;
|
|
1827
|
+
display: flex;
|
|
1828
|
+
align-items: center;
|
|
1847
1829
|
`;
|
|
1848
1830
|
const Input$1 = (_a) => {
|
|
1849
1831
|
var { format, suffix, height, invalid, loading, max, maxLength, min, onBlur, onChange, onFocus, onKeyDown,
|
|
1850
1832
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1851
|
-
onSuggestedSelect = () => { }, placeholder, readOnly, showCharCount, step, style, suggestedValues, showErrorTextColor = false, type = 'text', value = '', innerRef = null, tabIndex, isAutoComplete = false } = _a, accessibleProps = __rest(_a, ["format", "suffix", "height", "invalid", "loading", "max", "maxLength", "min", "onBlur", "onChange", "onFocus", "onKeyDown", "onSuggestedSelect", "placeholder", "readOnly", "showCharCount", "step", "style", "suggestedValues", "showErrorTextColor", "type", "value", "innerRef", "tabIndex", "isAutoComplete"]);
|
|
1833
|
+
onSuggestedSelect = () => { }, placeholder, readOnly, showCharCount, step, style, suggestedValues, showErrorTextColor = false, type = 'text', value = '', innerRef = null, tabIndex, isAutoComplete = false, id } = _a, accessibleProps = __rest(_a, ["format", "suffix", "height", "invalid", "loading", "max", "maxLength", "min", "onBlur", "onChange", "onFocus", "onKeyDown", "onSuggestedSelect", "placeholder", "readOnly", "showCharCount", "step", "style", "suggestedValues", "showErrorTextColor", "type", "value", "innerRef", "tabIndex", "isAutoComplete", "id"]);
|
|
1852
1834
|
const [show_options, setShowOptions] = React.useState(false);
|
|
1853
1835
|
const [internalValue, setInternalValue] = React.useState(value);
|
|
1854
1836
|
const [internalSuggestedValues, setInternalSuggestedValues] = React.useState(suggestedValues || []);
|
|
@@ -1920,8 +1902,8 @@ const Input$1 = (_a) => {
|
|
|
1920
1902
|
if (format === 'ssn' && type !== 'password') {
|
|
1921
1903
|
formatted_value = formatAsSsn(internalValue);
|
|
1922
1904
|
}
|
|
1923
|
-
const
|
|
1924
|
-
return type === 'textarea' ? (React.createElement(StyledWrapper, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, "$suggestions": show_options && !!internalSuggestedValues.length, id: `${
|
|
1905
|
+
const baseId = id || 'input';
|
|
1906
|
+
return type === 'textarea' ? (React.createElement(StyledWrapper, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, "$suggestions": show_options && !!internalSuggestedValues.length, id: `${baseId}-wrapper` },
|
|
1925
1907
|
React.createElement(StyledTextArea, Object.assign({ "$height": height, "$invalid": invalid, "$readOnly": readOnly, "$showErrorTextColor": showErrorTextColor, maxLength: maxLength, onBlur: readOnly
|
|
1926
1908
|
? e => e.preventDefault()
|
|
1927
1909
|
: e => {
|
|
@@ -1936,12 +1918,12 @@ const Input$1 = (_a) => {
|
|
|
1936
1918
|
setShowOptions(true);
|
|
1937
1919
|
if (onFocus)
|
|
1938
1920
|
onFocus(e);
|
|
1939
|
-
}, onKeyDown: readOnly ? e => e.preventDefault() : onKeyDown, placeholder: placeholder, readOnly: readOnly, ref: innerRef, tabIndex: readOnly ? -1 : tabIndex, value: formatted_value }, accessibleProps, { id: `${
|
|
1940
|
-
loading ? (React.createElement(Loader$1, { id: `${
|
|
1921
|
+
}, onKeyDown: readOnly ? e => e.preventDefault() : onKeyDown, placeholder: placeholder, readOnly: readOnly, ref: innerRef, tabIndex: readOnly ? -1 : tabIndex, value: formatted_value }, accessibleProps, { id: `${baseId}-textarea` })),
|
|
1922
|
+
loading ? (React.createElement(Loader$1, { id: `${baseId}-loader` },
|
|
1941
1923
|
React.createElement(Icon, { color: Colors.MEDIUM_GRAY.Hex, path: js.mdiLoading, size: '20px', spin: true }))) : null,
|
|
1942
|
-
showCharCount ? (React.createElement(CharacterCount, { id: `${
|
|
1924
|
+
showCharCount ? (React.createElement(CharacterCount, { id: `${baseId}-char-count` },
|
|
1943
1925
|
internalValue.length,
|
|
1944
|
-
maxLength ? ` / ${maxLength}` : null)) : null)) : (React.createElement(StyledWrapper, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, "$suggestions": show_options && !!internalSuggestedValues.length, id: `${
|
|
1926
|
+
maxLength ? ` / ${maxLength}` : null)) : null)) : (React.createElement(StyledWrapper, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, "$suggestions": show_options && !!internalSuggestedValues.length, id: `${baseId}-wrapper` },
|
|
1945
1927
|
React.createElement(StyledInput, Object.assign({ "$height": height, "$invalid": invalid, "$readOnly": readOnly, "$showErrorTextColor": showErrorTextColor, max: max, maxLength: maxLength, min: min, onBlur: readOnly
|
|
1946
1928
|
? e => e.preventDefault()
|
|
1947
1929
|
: e => {
|
|
@@ -1958,216 +1940,216 @@ const Input$1 = (_a) => {
|
|
|
1958
1940
|
setIsFocused(true);
|
|
1959
1941
|
if (onFocus)
|
|
1960
1942
|
onFocus(e);
|
|
1961
|
-
}, onKeyDown: readOnly ? e => e.preventDefault() : onKeyDown, placeholder: placeholder, readOnly: readOnly, ref: innerRef, step: step, tabIndex: readOnly ? -1 : tabIndex, type: type, value: format === 'currency_decimal' && internalValue ? `$${formatted_value}` : formatted_value }, accessibleProps, { id: `${
|
|
1962
|
-
loading ? (React.createElement(Loader$1, { id: `${
|
|
1943
|
+
}, onKeyDown: readOnly ? e => e.preventDefault() : onKeyDown, placeholder: placeholder, readOnly: readOnly, ref: innerRef, step: step, tabIndex: readOnly ? -1 : tabIndex, type: type, value: format === 'currency_decimal' && internalValue ? `$${formatted_value}` : formatted_value }, accessibleProps, { id: `${baseId}-input` })),
|
|
1944
|
+
loading ? (React.createElement(Loader$1, { id: `${baseId}-loader` },
|
|
1963
1945
|
React.createElement(Icon, { color: Colors.MEDIUM_GRAY.Hex, path: js.mdiLoading, size: '20px', spin: true }))) : null,
|
|
1964
|
-
showCharCount ? (React.createElement(CharacterCount, { id: `${
|
|
1946
|
+
showCharCount ? (React.createElement(CharacterCount, { id: `${baseId}-char-count` },
|
|
1965
1947
|
internalValue.length,
|
|
1966
1948
|
maxLength ? ` / ${maxLength}` : null)) : null,
|
|
1967
|
-
suffix && React.createElement(StyledSuffix, { id: `${
|
|
1968
|
-
show_options && internalSuggestedValues.length ? (React.createElement(SuggestedValues, { id: `${
|
|
1969
|
-
isAutoComplete ? null : (React.createElement(SuggestedSummary, { id: `${
|
|
1949
|
+
suffix && React.createElement(StyledSuffix, { id: `${baseId}-suffix` }, suffix),
|
|
1950
|
+
show_options && internalSuggestedValues.length ? (React.createElement(SuggestedValues, { id: `${baseId}-suggested-values` },
|
|
1951
|
+
isAutoComplete ? null : (React.createElement(SuggestedSummary, { id: `${baseId}-suggested-summary` },
|
|
1970
1952
|
internalSuggestedValues.length,
|
|
1971
1953
|
" Results Match \"",
|
|
1972
1954
|
internalValue,
|
|
1973
1955
|
"\"")),
|
|
1974
|
-
internalSuggestedValues.map((suggestedValue, index) => (React.createElement(SuggestedValue, { id: `${
|
|
1956
|
+
internalSuggestedValues.map((suggestedValue, index) => (React.createElement(SuggestedValue, { id: `${baseId}-suggested-value-${index}`, key: index, onClick: () => {
|
|
1975
1957
|
handleInputChange({ target: { value: suggestedValue } });
|
|
1976
1958
|
onSuggestedSelect();
|
|
1977
1959
|
setShowOptions(false);
|
|
1978
1960
|
} }, suggestedValue))))) : null));
|
|
1979
|
-
};
|
|
1980
|
-
|
|
1981
|
-
const Wrapper$7 = styled.a `
|
|
1982
|
-
color: ${props => props.theme.PRIMARY_COLOR.Hex};
|
|
1983
|
-
font-size: ${props => (props.$small ? FontSizes.SMALL : FontSizes.DEFAULT)};
|
|
1984
|
-
line-height: ${props => (props.$small ? '1.5em' : '1.6em')};
|
|
1985
|
-
letter-spacing: ${props => (props.$small ? '1px' : '0px')};
|
|
1986
|
-
font-weight: 500;
|
|
1987
|
-
font-style: normal;
|
|
1988
|
-
text-decoration:
|
|
1989
|
-
font-family: 'Roboto', Helvetica, Arial, sans-serif;
|
|
1990
|
-
margin: 0px;
|
|
1991
|
-
padding: 0px;
|
|
1992
|
-
box-sizing: border-box;
|
|
1993
|
-
cursor: pointer;
|
|
1961
|
+
};
|
|
1962
|
+
|
|
1963
|
+
const Wrapper$7 = styled.a `
|
|
1964
|
+
color: ${props => props.theme.PRIMARY_COLOR.Hex};
|
|
1965
|
+
font-size: ${props => (props.$small ? FontSizes.SMALL : FontSizes.DEFAULT)};
|
|
1966
|
+
line-height: ${props => (props.$small ? '1.5em' : '1.6em')};
|
|
1967
|
+
letter-spacing: ${props => (props.$small ? '1px' : '0px')};
|
|
1968
|
+
font-weight: 500;
|
|
1969
|
+
font-style: normal;
|
|
1970
|
+
text-decoration: none;
|
|
1971
|
+
font-family: 'Roboto', Helvetica, Arial, sans-serif;
|
|
1972
|
+
margin: 0px;
|
|
1973
|
+
padding: 0px;
|
|
1974
|
+
box-sizing: border-box;
|
|
1975
|
+
cursor: pointer;
|
|
1994
1976
|
`;
|
|
1995
1977
|
Wrapper$7.defaultProps = { theme: EditableTheme };
|
|
1996
1978
|
const Link = (_a) => {
|
|
1997
|
-
var { children, onClick, small } = _a, accessibleProps = __rest(_a, ["children", "onClick", "small"]);
|
|
1998
|
-
const
|
|
1999
|
-
return (React.createElement(Wrapper$7, Object.assign({ "$small": small, onClick: onClick }, accessibleProps, { id: `${
|
|
2000
|
-
};
|
|
2001
|
-
|
|
2002
|
-
const dash = styled.keyframes `
|
|
2003
|
-
0% {
|
|
2004
|
-
stroke-dasharray: 1, 160;
|
|
2005
|
-
stroke-dashoffset: 0;
|
|
2006
|
-
}
|
|
2007
|
-
50% {
|
|
2008
|
-
stroke-dasharray: 80, 160;
|
|
2009
|
-
stroke-dashoffset: -32;
|
|
2010
|
-
}
|
|
2011
|
-
100% {
|
|
2012
|
-
stroke-dasharray: 80, 160;
|
|
2013
|
-
stroke-dashoffset: -124;
|
|
2014
|
-
}
|
|
2015
|
-
`;
|
|
2016
|
-
const Spinner = styled.svg `
|
|
2017
|
-
z-index: 2;
|
|
2018
|
-
position: absolute;
|
|
2019
|
-
top: 50%;
|
|
2020
|
-
left: 50%;
|
|
2021
|
-
transform: translate(-50%, -50%);
|
|
2022
|
-
margin: 0 auto;
|
|
2023
|
-
width: 40px;
|
|
2024
|
-
height: 40px;
|
|
2025
|
-
`;
|
|
2026
|
-
const Path = styled.path `
|
|
2027
|
-
stroke: #0193d7;
|
|
2028
|
-
stroke-linecap: round;
|
|
2029
|
-
-webkit-animation: ${dash} 1.1s ease-in-out infinite;
|
|
2030
|
-
animation: ${dash} 1.1s ease-in-out infinite;
|
|
2031
|
-
`;
|
|
2032
|
-
const Loader = () => {
|
|
2033
|
-
const
|
|
2034
|
-
return (React.createElement(Spinner, { id: `${
|
|
2035
|
-
React.createElement(Path, { d: 'M7.21487 1.2868C7.88431 0.9044 8.73031 0.9044 9.39974 1.2868L9.40283 1.28856L14.4613 4.20761C15.1684 4.598 15.5746 5.33558 15.5746 6.11465V8.99996V11.8853C15.5746 12.6507 15.1632 13.3848 14.4617 13.7721L9.37973 16.7132C8.71029 17.0956 7.86428 17.0956 7.19485 16.7132L7.19088 16.7109L2.11279 13.772C1.40602 13.3816 1 12.6441 1 11.8653V8.98995V6.11465C1 5.31458 1.44381 4.59039 2.10827 4.21051L7.21487 1.2868Z', fill: 'none', id: `${
|
|
2036
|
-
};
|
|
2037
|
-
|
|
2038
|
-
const Steps = styled.div `
|
|
2039
|
-
padding: 20px;
|
|
2040
|
-
border-bottom: 1px solid #e7e6e6;
|
|
2041
|
-
background: #f5f5f5;
|
|
2042
|
-
display: flex;
|
|
2043
|
-
gap: 30px;
|
|
2044
|
-
align-items: center;
|
|
2045
|
-
`;
|
|
2046
|
-
const Step = styled.div `
|
|
2047
|
-
display: flex;
|
|
2048
|
-
align-items: center;
|
|
2049
|
-
gap: 8px;
|
|
2050
|
-
`;
|
|
2051
|
-
const StyledIcon$2 = styled(Icon) `
|
|
2052
|
-
> path {
|
|
2053
|
-
fill: ${props => props.theme.PRIMARY_COLOR.Hex} !important;
|
|
2054
|
-
}
|
|
1979
|
+
var { children, onClick, small, id } = _a, accessibleProps = __rest(_a, ["children", "onClick", "small", "id"]);
|
|
1980
|
+
const baseId = id || 'link';
|
|
1981
|
+
return (React.createElement(Wrapper$7, Object.assign({ "$small": small, onClick: onClick }, accessibleProps, { id: `${baseId}-wrapper` }), children));
|
|
1982
|
+
};
|
|
1983
|
+
|
|
1984
|
+
const dash = styled.keyframes `
|
|
1985
|
+
0% {
|
|
1986
|
+
stroke-dasharray: 1, 160;
|
|
1987
|
+
stroke-dashoffset: 0;
|
|
1988
|
+
}
|
|
1989
|
+
50% {
|
|
1990
|
+
stroke-dasharray: 80, 160;
|
|
1991
|
+
stroke-dashoffset: -32;
|
|
1992
|
+
}
|
|
1993
|
+
100% {
|
|
1994
|
+
stroke-dasharray: 80, 160;
|
|
1995
|
+
stroke-dashoffset: -124;
|
|
1996
|
+
}
|
|
1997
|
+
`;
|
|
1998
|
+
const Spinner = styled.svg `
|
|
1999
|
+
z-index: 2;
|
|
2000
|
+
position: absolute;
|
|
2001
|
+
top: 50%;
|
|
2002
|
+
left: 50%;
|
|
2003
|
+
transform: translate(-50%, -50%);
|
|
2004
|
+
margin: 0 auto;
|
|
2005
|
+
width: 40px;
|
|
2006
|
+
height: 40px;
|
|
2007
|
+
`;
|
|
2008
|
+
const Path = styled.path `
|
|
2009
|
+
stroke: #0193d7;
|
|
2010
|
+
stroke-linecap: round;
|
|
2011
|
+
-webkit-animation: ${dash} 1.1s ease-in-out infinite;
|
|
2012
|
+
animation: ${dash} 1.1s ease-in-out infinite;
|
|
2013
|
+
`;
|
|
2014
|
+
const Loader = ({ id }) => {
|
|
2015
|
+
const baseId = id || 'loader';
|
|
2016
|
+
return (React.createElement(Spinner, { id: `${baseId}-spinner`, viewBox: '0 0 16 18' },
|
|
2017
|
+
React.createElement(Path, { d: 'M7.21487 1.2868C7.88431 0.9044 8.73031 0.9044 9.39974 1.2868L9.40283 1.28856L14.4613 4.20761C15.1684 4.598 15.5746 5.33558 15.5746 6.11465V8.99996V11.8853C15.5746 12.6507 15.1632 13.3848 14.4617 13.7721L9.37973 16.7132C8.71029 17.0956 7.86428 17.0956 7.19485 16.7132L7.19088 16.7109L2.11279 13.772C1.40602 13.3816 1 12.6441 1 11.8653V8.98995V6.11465C1 5.31458 1.44381 4.59039 2.10827 4.21051L7.21487 1.2868Z', fill: 'none', id: `${baseId}-path`, strokeWidth: '2' })));
|
|
2018
|
+
};
|
|
2019
|
+
|
|
2020
|
+
const Steps = styled.div `
|
|
2021
|
+
padding: 20px;
|
|
2022
|
+
border-bottom: 1px solid #e7e6e6;
|
|
2023
|
+
background: #f5f5f5;
|
|
2024
|
+
display: flex;
|
|
2025
|
+
gap: 30px;
|
|
2026
|
+
align-items: center;
|
|
2027
|
+
`;
|
|
2028
|
+
const Step = styled.div `
|
|
2029
|
+
display: flex;
|
|
2030
|
+
align-items: center;
|
|
2031
|
+
gap: 8px;
|
|
2032
|
+
`;
|
|
2033
|
+
const StyledIcon$2 = styled(Icon) `
|
|
2034
|
+
> path {
|
|
2035
|
+
fill: ${props => props.theme.PRIMARY_COLOR.Hex} !important;
|
|
2036
|
+
}
|
|
2055
2037
|
`;
|
|
2056
2038
|
StyledIcon$2.defaultProps = { theme: EditableTheme };
|
|
2057
|
-
const StepIndicator = styled.div `
|
|
2058
|
-
width: 30px;
|
|
2059
|
-
height: 30px;
|
|
2060
|
-
border-radius: 15px;
|
|
2061
|
-
background: ${props => (props.$active ? props.theme.PRIMARY_COLOR.Hex : Colors.LIGHT_GRAY.Hex)};
|
|
2062
|
-
color: ${props => (props.$active ? '#fff' : Colors.MEDIUM_GRAY.Hex)};
|
|
2063
|
-
font-family: 'Roboto', Helvetica, Arial, sans-serif;
|
|
2064
|
-
font-size: 14px;
|
|
2065
|
-
font-weight: 500;
|
|
2066
|
-
line-height: 1;
|
|
2067
|
-
display: flex;
|
|
2068
|
-
align-items: center;
|
|
2069
|
-
justify-content: center;
|
|
2070
|
-
flex-shrink: 0;
|
|
2039
|
+
const StepIndicator = styled.div `
|
|
2040
|
+
width: 30px;
|
|
2041
|
+
height: 30px;
|
|
2042
|
+
border-radius: 15px;
|
|
2043
|
+
background: ${props => (props.$active ? props.theme.PRIMARY_COLOR.Hex : Colors.LIGHT_GRAY.Hex)};
|
|
2044
|
+
color: ${props => (props.$active ? '#fff' : Colors.MEDIUM_GRAY.Hex)};
|
|
2045
|
+
font-family: 'Roboto', Helvetica, Arial, sans-serif;
|
|
2046
|
+
font-size: 14px;
|
|
2047
|
+
font-weight: 500;
|
|
2048
|
+
line-height: 1;
|
|
2049
|
+
display: flex;
|
|
2050
|
+
align-items: center;
|
|
2051
|
+
justify-content: center;
|
|
2052
|
+
flex-shrink: 0;
|
|
2071
2053
|
`;
|
|
2072
2054
|
StepIndicator.defaultProps = { theme: EditableTheme };
|
|
2073
|
-
const StepLabel = styled.div `
|
|
2074
|
-
color: #000;
|
|
2075
|
-
font-family: 'Roboto', Helvetica, Arial, sans-serif;
|
|
2076
|
-
font-size: 14px;
|
|
2077
|
-
font-weight: 500;
|
|
2078
|
-
line-height: 1;
|
|
2079
|
-
`;
|
|
2080
|
-
const StepLine = styled.div `
|
|
2081
|
-
height: 2px;
|
|
2082
|
-
flex-grow: 1;
|
|
2083
|
-
background-color: ${props => (props.$active ? Colors.PRIMARY.Hex : Colors.MEDIUM_GRAY.Hex)};
|
|
2084
|
-
transition: background-color 0.5s ease-in-out;
|
|
2085
|
-
`;
|
|
2086
|
-
const ProgressBar = ({ steps, showStepLine = false }) => {
|
|
2087
|
-
const
|
|
2088
|
-
return (React.createElement(Steps, { id: `${
|
|
2089
|
-
const stepId =
|
|
2055
|
+
const StepLabel = styled.div `
|
|
2056
|
+
color: #000;
|
|
2057
|
+
font-family: 'Roboto', Helvetica, Arial, sans-serif;
|
|
2058
|
+
font-size: 14px;
|
|
2059
|
+
font-weight: 500;
|
|
2060
|
+
line-height: 1;
|
|
2061
|
+
`;
|
|
2062
|
+
const StepLine = styled.div `
|
|
2063
|
+
height: 2px;
|
|
2064
|
+
flex-grow: 1;
|
|
2065
|
+
background-color: ${props => (props.$active ? Colors.PRIMARY.Hex : Colors.MEDIUM_GRAY.Hex)};
|
|
2066
|
+
transition: background-color 0.5s ease-in-out;
|
|
2067
|
+
`;
|
|
2068
|
+
const ProgressBar = ({ steps, showStepLine = false, id }) => {
|
|
2069
|
+
const baseId = id || 'progress-bar';
|
|
2070
|
+
return (React.createElement(Steps, { id: `${baseId}-steps` }, steps.map((step, i) => {
|
|
2071
|
+
const stepId = `${baseId}-step-${i}`;
|
|
2090
2072
|
return (React.createElement(React.Fragment, { key: i },
|
|
2091
2073
|
i !== 0 && showStepLine && React.createElement(StepLine, { "$active": step.active, id: `${stepId}-line` }),
|
|
2092
2074
|
React.createElement(Step, { id: `${stepId}-step` },
|
|
2093
2075
|
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)),
|
|
2094
2076
|
React.createElement(StepLabel, { id: `${stepId}-label` }, step.label))));
|
|
2095
2077
|
})));
|
|
2096
|
-
};
|
|
2097
|
-
|
|
2098
|
-
const Wrapper$6 = styled.div `
|
|
2099
|
-
position: fixed;
|
|
2100
|
-
top: 0;
|
|
2101
|
-
right: 0;
|
|
2102
|
-
bottom: 0;
|
|
2103
|
-
left: 0;
|
|
2104
|
-
z-index: 9999;
|
|
2105
|
-
background: rgba(0, 0, 0, 0.8);
|
|
2106
|
-
display: flex;
|
|
2107
|
-
align-items: center;
|
|
2108
|
-
justify-content: center;
|
|
2109
|
-
`;
|
|
2110
|
-
const Container$1 = styled.dialog `
|
|
2111
|
-
width: ${props => (props.$fullscreen ? 'calc(100vw - 80px)' : props.$maxWidth || '900px')};
|
|
2112
|
-
max-width: calc(100vw - 80px);
|
|
2113
|
-
height: ${props => (props.$fullscreen ? 'calc(100vh - 80px)' : 'auto')};
|
|
2114
|
-
max-height: calc(100vh - 80px);
|
|
2115
|
-
border-radius: 8px;
|
|
2116
|
-
overflow: hidden;
|
|
2117
|
-
box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.2);
|
|
2118
|
-
outline: none;
|
|
2119
|
-
border: none;
|
|
2120
|
-
position: relative;
|
|
2121
|
-
padding: 0px;
|
|
2122
|
-
box-sizing: border-box;
|
|
2123
|
-
display: flex;
|
|
2124
|
-
flex-direction: column;
|
|
2125
|
-
`;
|
|
2126
|
-
const Header$1 = styled.div `
|
|
2127
|
-
flex-shrink: 0;
|
|
2128
|
-
padding: 20px;
|
|
2129
|
-
border-bottom: 1px solid #e7e6e6;
|
|
2130
|
-
display: flex;
|
|
2131
|
-
align-items: center;
|
|
2132
|
-
background: #ffffff;
|
|
2133
|
-
box-sizing: border-box;
|
|
2134
|
-
`;
|
|
2135
|
-
const Close = styled.div `
|
|
2136
|
-
margin-left: auto;
|
|
2137
|
-
display: flex;
|
|
2138
|
-
align-items: center;
|
|
2139
|
-
padding-left: 20px;
|
|
2140
|
-
cursor: pointer;
|
|
2141
|
-
`;
|
|
2142
|
-
const CloseMsg = styled.span `
|
|
2143
|
-
font-size: ${FontSizes.SMALL};
|
|
2144
|
-
font-weight: 400;
|
|
2145
|
-
font-family: ${FontStyles.DEFAULT};
|
|
2146
|
-
line-height: 1em;
|
|
2147
|
-
color: ${Colors.MEDIUM_GRAY.Hex};
|
|
2148
|
-
`;
|
|
2149
|
-
const ContentWrapper = styled.div `
|
|
2150
|
-
overflow-x: hidden;
|
|
2151
|
-
overflow-y: auto;
|
|
2152
|
-
background: #ffffff;
|
|
2153
|
-
flex: 1;
|
|
2154
|
-
box-sizing: border-box;
|
|
2155
|
-
`;
|
|
2156
|
-
const ButtonBar = styled.div `
|
|
2157
|
-
flex-shrink: 0;
|
|
2158
|
-
background: #ffffff;
|
|
2159
|
-
padding: 20px;
|
|
2160
|
-
border-top: 1px solid #e7e6e6;
|
|
2161
|
-
display: flex;
|
|
2162
|
-
align-items: center;
|
|
2163
|
-
justify-self: flex-end;
|
|
2164
|
-
box-sizing: border-box;
|
|
2165
|
-
`;
|
|
2166
|
-
const ButtonContainer = styled.div `
|
|
2167
|
-
margin: 0 10px;
|
|
2078
|
+
};
|
|
2079
|
+
|
|
2080
|
+
const Wrapper$6 = styled.div `
|
|
2081
|
+
position: fixed;
|
|
2082
|
+
top: 0;
|
|
2083
|
+
right: 0;
|
|
2084
|
+
bottom: 0;
|
|
2085
|
+
left: 0;
|
|
2086
|
+
z-index: 9999;
|
|
2087
|
+
background: rgba(0, 0, 0, 0.8);
|
|
2088
|
+
display: flex;
|
|
2089
|
+
align-items: center;
|
|
2090
|
+
justify-content: center;
|
|
2091
|
+
`;
|
|
2092
|
+
const Container$1 = styled.dialog `
|
|
2093
|
+
width: ${props => (props.$fullscreen ? 'calc(100vw - 80px)' : props.$maxWidth || '900px')};
|
|
2094
|
+
max-width: calc(100vw - 80px);
|
|
2095
|
+
height: ${props => (props.$fullscreen ? 'calc(100vh - 80px)' : 'auto')};
|
|
2096
|
+
max-height: calc(100vh - 80px);
|
|
2097
|
+
border-radius: 8px;
|
|
2098
|
+
overflow: hidden;
|
|
2099
|
+
box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.2);
|
|
2100
|
+
outline: none;
|
|
2101
|
+
border: none;
|
|
2102
|
+
position: relative;
|
|
2103
|
+
padding: 0px;
|
|
2104
|
+
box-sizing: border-box;
|
|
2105
|
+
display: flex;
|
|
2106
|
+
flex-direction: column;
|
|
2107
|
+
`;
|
|
2108
|
+
const Header$1 = styled.div `
|
|
2109
|
+
flex-shrink: 0;
|
|
2110
|
+
padding: 20px;
|
|
2111
|
+
border-bottom: 1px solid #e7e6e6;
|
|
2112
|
+
display: flex;
|
|
2113
|
+
align-items: center;
|
|
2114
|
+
background: #ffffff;
|
|
2115
|
+
box-sizing: border-box;
|
|
2116
|
+
`;
|
|
2117
|
+
const Close = styled.div `
|
|
2118
|
+
margin-left: auto;
|
|
2119
|
+
display: flex;
|
|
2120
|
+
align-items: center;
|
|
2121
|
+
padding-left: 20px;
|
|
2122
|
+
cursor: pointer;
|
|
2123
|
+
`;
|
|
2124
|
+
const CloseMsg = styled.span `
|
|
2125
|
+
font-size: ${FontSizes.SMALL};
|
|
2126
|
+
font-weight: 400;
|
|
2127
|
+
font-family: ${FontStyles.DEFAULT};
|
|
2128
|
+
line-height: 1em;
|
|
2129
|
+
color: ${Colors.MEDIUM_GRAY.Hex};
|
|
2130
|
+
`;
|
|
2131
|
+
const ContentWrapper = styled.div `
|
|
2132
|
+
overflow-x: hidden;
|
|
2133
|
+
overflow-y: auto;
|
|
2134
|
+
background: #ffffff;
|
|
2135
|
+
flex: 1;
|
|
2136
|
+
box-sizing: border-box;
|
|
2137
|
+
`;
|
|
2138
|
+
const ButtonBar = styled.div `
|
|
2139
|
+
flex-shrink: 0;
|
|
2140
|
+
background: #ffffff;
|
|
2141
|
+
padding: 20px;
|
|
2142
|
+
border-top: 1px solid #e7e6e6;
|
|
2143
|
+
display: flex;
|
|
2144
|
+
align-items: center;
|
|
2145
|
+
justify-self: flex-end;
|
|
2146
|
+
box-sizing: border-box;
|
|
2147
|
+
`;
|
|
2148
|
+
const ButtonContainer = styled.div `
|
|
2149
|
+
margin: 0 10px;
|
|
2168
2150
|
`;
|
|
2169
2151
|
const Modal = (_a) => {
|
|
2170
|
-
var { children, title, onClose, maxWidth, fullscreen, steps, primaryButton, secondaryButton, tertiaryButton, quarternaryButton } = _a, accessibleProps = __rest(_a, ["children", "title", "onClose", "maxWidth", "fullscreen", "steps", "primaryButton", "secondaryButton", "tertiaryButton", "quarternaryButton"]);
|
|
2152
|
+
var { children, title, onClose, maxWidth, fullscreen, steps, primaryButton, secondaryButton, tertiaryButton, quarternaryButton, id } = _a, accessibleProps = __rest(_a, ["children", "title", "onClose", "maxWidth", "fullscreen", "steps", "primaryButton", "secondaryButton", "tertiaryButton", "quarternaryButton", "id"]);
|
|
2171
2153
|
React.useEffect(() => {
|
|
2172
2154
|
document.onkeydown = e => {
|
|
2173
2155
|
if (e.key === 'Escape') {
|
|
@@ -2177,51 +2159,51 @@ const Modal = (_a) => {
|
|
|
2177
2159
|
return function cleanup() {
|
|
2178
2160
|
document.onkeydown = null;
|
|
2179
2161
|
};
|
|
2180
|
-
}, []);
|
|
2181
|
-
const
|
|
2182
|
-
return (React.createElement(Wrapper$6, { id: `${
|
|
2183
|
-
React.createElement(Container$1, Object.assign({ "$fullscreen": fullscreen, "$maxWidth": maxWidth, open: true }, accessibleProps, { id: `${
|
|
2184
|
-
React.createElement(Header$1, { id: `${
|
|
2185
|
-
title ? (React.createElement(Heading, { id: `${
|
|
2186
|
-
React.createElement(Close, { id: `${
|
|
2187
|
-
React.createElement(CloseMsg, { id: `${
|
|
2188
|
-
React.createElement(Icon, { color: Colors.BLACK.Hex, id: `${
|
|
2162
|
+
}, [onClose]);
|
|
2163
|
+
const baseId = id || 'modal';
|
|
2164
|
+
return (React.createElement(Wrapper$6, { id: `${baseId}-wrapper` },
|
|
2165
|
+
React.createElement(Container$1, Object.assign({ "$fullscreen": fullscreen, "$maxWidth": maxWidth, open: true }, accessibleProps, { id: `${baseId}-container` }),
|
|
2166
|
+
React.createElement(Header$1, { id: `${baseId}-header` },
|
|
2167
|
+
title ? (React.createElement(Heading, { id: `${baseId}-title`, type: 'secondary' }, title)) : null,
|
|
2168
|
+
React.createElement(Close, { id: `${baseId}-close`, onClick: onClose },
|
|
2169
|
+
React.createElement(CloseMsg, { id: `${baseId}-close-msg` }, "(Esc)"),
|
|
2170
|
+
React.createElement(Icon, { color: Colors.BLACK.Hex, id: `${baseId}-close-icon`, path: js.mdiClose, size: '24px' }))),
|
|
2189
2171
|
steps ? React.createElement(ProgressBar, { steps: steps }) : null,
|
|
2190
|
-
React.createElement(ContentWrapper, { id: `${
|
|
2191
|
-
primaryButton || secondaryButton || tertiaryButton || quarternaryButton ? (React.createElement(ButtonBar, { id: `${
|
|
2192
|
-
tertiaryButton || quarternaryButton ? (React.createElement("div", { id: `${
|
|
2172
|
+
React.createElement(ContentWrapper, { id: `${baseId}-content-wrapper` }, children),
|
|
2173
|
+
primaryButton || secondaryButton || tertiaryButton || quarternaryButton ? (React.createElement(ButtonBar, { id: `${baseId}-button-bar` },
|
|
2174
|
+
tertiaryButton || quarternaryButton ? (React.createElement("div", { id: `${baseId}-left-buttons`, style: {
|
|
2193
2175
|
marginRight: 'auto',
|
|
2194
2176
|
paddingRight: 40,
|
|
2195
2177
|
display: 'flex',
|
|
2196
2178
|
alignItems: 'center',
|
|
2197
2179
|
} },
|
|
2198
|
-
tertiaryButton ? (React.createElement(Button, Object.assign({}, tertiaryButton, { format: tertiaryButton.format || 'secondary', id: `${
|
|
2199
|
-
quarternaryButton ? (React.createElement(ButtonContainer, { id: `${
|
|
2200
|
-
React.createElement(Button, Object.assign({}, quarternaryButton, { format: quarternaryButton.format || 'secondary', id: `${
|
|
2201
|
-
primaryButton || secondaryButton ? (React.createElement("div", { id: `${
|
|
2180
|
+
tertiaryButton ? (React.createElement(Button, Object.assign({}, tertiaryButton, { format: tertiaryButton.format || 'secondary', id: `${baseId}-tertiary-button` }))) : null,
|
|
2181
|
+
quarternaryButton ? (React.createElement(ButtonContainer, { id: `${baseId}-quarternary-button-container` },
|
|
2182
|
+
React.createElement(Button, Object.assign({}, quarternaryButton, { format: quarternaryButton.format || 'secondary', id: `${baseId}-quarternary-button` })))) : null)) : null,
|
|
2183
|
+
primaryButton || secondaryButton ? (React.createElement("div", { id: `${baseId}-right-buttons`, style: {
|
|
2202
2184
|
marginLeft: 'auto',
|
|
2203
2185
|
paddingLeft: 40,
|
|
2204
2186
|
display: 'flex',
|
|
2205
2187
|
alignItems: 'center',
|
|
2206
2188
|
} },
|
|
2207
|
-
secondaryButton ? (React.createElement(ButtonContainer, { id: `${
|
|
2208
|
-
React.createElement(Button, Object.assign({}, secondaryButton, { format: secondaryButton.format || 'secondary', id: `${
|
|
2209
|
-
primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { format: primaryButton.format || 'primary', id: `${
|
|
2210
|
-
};
|
|
2211
|
-
|
|
2212
|
-
const Wrapper$5 = styled.div `
|
|
2213
|
-
position: relative;
|
|
2214
|
-
width: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.width) || 'auto'};
|
|
2215
|
-
`;
|
|
2216
|
-
const Trigger = styled.div `
|
|
2217
|
-
box-sizing: border-box;
|
|
2218
|
-
border-radius: ${props => (props.$showOptions ? '4px 4px 0px 0px' : '4px')};
|
|
2219
|
-
height: 40px;
|
|
2220
|
-
padding: 0 10px;
|
|
2221
|
-
position: relative;
|
|
2222
|
-
cursor: pointer;
|
|
2223
|
-
border-width: 1px;
|
|
2224
|
-
border-style: solid;
|
|
2189
|
+
secondaryButton ? (React.createElement(ButtonContainer, { id: `${baseId}-secondary-button-container` },
|
|
2190
|
+
React.createElement(Button, Object.assign({}, secondaryButton, { format: secondaryButton.format || 'secondary', id: `${baseId}-secondary-button` })))) : null,
|
|
2191
|
+
primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { format: primaryButton.format || 'primary', id: `${baseId}-primary-button` }))) : null)) : null)) : null)));
|
|
2192
|
+
};
|
|
2193
|
+
|
|
2194
|
+
const Wrapper$5 = styled.div `
|
|
2195
|
+
position: relative;
|
|
2196
|
+
width: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.width) || 'auto'};
|
|
2197
|
+
`;
|
|
2198
|
+
const Trigger = styled.div `
|
|
2199
|
+
box-sizing: border-box;
|
|
2200
|
+
border-radius: ${props => (props.$showOptions ? '4px 4px 0px 0px' : '4px')};
|
|
2201
|
+
height: 40px;
|
|
2202
|
+
padding: 0 10px;
|
|
2203
|
+
position: relative;
|
|
2204
|
+
cursor: pointer;
|
|
2205
|
+
border-width: 1px;
|
|
2206
|
+
border-style: solid;
|
|
2225
2207
|
border-color: ${props => {
|
|
2226
2208
|
if (props.$invalid) {
|
|
2227
2209
|
return Colors.RED.Hex;
|
|
@@ -2232,149 +2214,149 @@ const Trigger = styled.div `
|
|
|
2232
2214
|
else {
|
|
2233
2215
|
return '#cccccc';
|
|
2234
2216
|
}
|
|
2235
|
-
}};
|
|
2236
|
-
background-color: ${props => (props.$readOnly ? '#f5f5f5' : '#ffffff')};
|
|
2237
|
-
background-image: none;
|
|
2238
|
-
display: flex;
|
|
2239
|
-
width: 100%;
|
|
2240
|
-
align-items: center;
|
|
2241
|
-
justify-content: space-between;
|
|
2242
|
-
z-index: 1;
|
|
2217
|
+
}};
|
|
2218
|
+
background-color: ${props => (props.$readOnly ? '#f5f5f5' : '#ffffff')};
|
|
2219
|
+
background-image: none;
|
|
2220
|
+
display: flex;
|
|
2221
|
+
width: 100%;
|
|
2222
|
+
align-items: center;
|
|
2223
|
+
justify-content: space-between;
|
|
2224
|
+
z-index: 1;
|
|
2243
2225
|
`;
|
|
2244
2226
|
Trigger.defaultProps = { theme: EditableTheme };
|
|
2245
|
-
const Value = styled.div `
|
|
2246
|
-
color: ${Colors.BLACK.Hex};
|
|
2247
|
-
font-family: ${FontStyles.DEFAULT};
|
|
2248
|
-
font-size: ${FontSizes.DEFAULT};
|
|
2249
|
-
font-weight: 400;
|
|
2250
|
-
line-height: 2.9em;
|
|
2251
|
-
overflow: hidden;
|
|
2252
|
-
text-overflow: ellipsis;
|
|
2253
|
-
white-space: nowrap;
|
|
2254
|
-
width: 100%;
|
|
2255
|
-
`;
|
|
2256
|
-
const Options = styled.div `
|
|
2257
|
-
background: #fff;
|
|
2258
|
-
box-shadow: 0px 5px 30px -15px rgba(0, 0, 0, 0.2);
|
|
2259
|
-
border-color: ${props => props.theme.PRIMARY_COLOR.Hex};
|
|
2260
|
-
border-radius: 0px 0px 4px 4px;
|
|
2261
|
-
border-style: solid;
|
|
2262
|
-
border-top: none;
|
|
2263
|
-
border-width: 1px;
|
|
2264
|
-
left: 0;
|
|
2265
|
-
position: absolute;
|
|
2266
|
-
right: 0;
|
|
2267
|
-
z-index: 10;
|
|
2268
|
-
max-height: 220px;
|
|
2269
|
-
overflow: auto;
|
|
2227
|
+
const Value = styled.div `
|
|
2228
|
+
color: ${Colors.BLACK.Hex};
|
|
2229
|
+
font-family: ${FontStyles.DEFAULT};
|
|
2230
|
+
font-size: ${FontSizes.DEFAULT};
|
|
2231
|
+
font-weight: 400;
|
|
2232
|
+
line-height: 2.9em;
|
|
2233
|
+
overflow: hidden;
|
|
2234
|
+
text-overflow: ellipsis;
|
|
2235
|
+
white-space: nowrap;
|
|
2236
|
+
width: 100%;
|
|
2237
|
+
`;
|
|
2238
|
+
const Options = styled.div `
|
|
2239
|
+
background: #fff;
|
|
2240
|
+
box-shadow: 0px 5px 30px -15px rgba(0, 0, 0, 0.2);
|
|
2241
|
+
border-color: ${props => props.theme.PRIMARY_COLOR.Hex};
|
|
2242
|
+
border-radius: 0px 0px 4px 4px;
|
|
2243
|
+
border-style: solid;
|
|
2244
|
+
border-top: none;
|
|
2245
|
+
border-width: 1px;
|
|
2246
|
+
left: 0;
|
|
2247
|
+
position: absolute;
|
|
2248
|
+
right: 0;
|
|
2249
|
+
z-index: 10;
|
|
2250
|
+
max-height: 220px;
|
|
2251
|
+
overflow: auto;
|
|
2270
2252
|
`;
|
|
2271
2253
|
Options.defaultProps = { theme: EditableTheme };
|
|
2272
|
-
const Scrim = styled.div `
|
|
2273
|
-
bottom: 0;
|
|
2274
|
-
left: 0;
|
|
2275
|
-
position: fixed;
|
|
2276
|
-
right: 0;
|
|
2277
|
-
top: 0;
|
|
2278
|
-
z-index: 9;
|
|
2279
|
-
`;
|
|
2280
|
-
const SearchInput = styled.input `
|
|
2281
|
-
position: absolute;
|
|
2282
|
-
left: 2px;
|
|
2283
|
-
top: 2px;
|
|
2284
|
-
z-index: 999;
|
|
2285
|
-
width: 90%;
|
|
2286
|
-
height: 30px;
|
|
2287
|
-
border: none;
|
|
2288
|
-
outline: none;
|
|
2289
|
-
color: ${Colors.BLACK.Hex};
|
|
2290
|
-
font-family: ${FontStyles.DEFAULT};
|
|
2291
|
-
font-size: ${FontSizes.DEFAULT};
|
|
2292
|
-
font-weight: 400;
|
|
2293
|
-
line-height: 2.9em;
|
|
2294
|
-
overflow: hidden;
|
|
2295
|
-
white-space: nowrap;
|
|
2254
|
+
const Scrim = styled.div `
|
|
2255
|
+
bottom: 0;
|
|
2256
|
+
left: 0;
|
|
2257
|
+
position: fixed;
|
|
2258
|
+
right: 0;
|
|
2259
|
+
top: 0;
|
|
2260
|
+
z-index: 9;
|
|
2261
|
+
`;
|
|
2262
|
+
const SearchInput = styled.input `
|
|
2263
|
+
position: absolute;
|
|
2264
|
+
left: 2px;
|
|
2265
|
+
top: 2px;
|
|
2266
|
+
z-index: 999;
|
|
2267
|
+
width: 90%;
|
|
2268
|
+
height: 30px;
|
|
2269
|
+
border: none;
|
|
2270
|
+
outline: none;
|
|
2271
|
+
color: ${Colors.BLACK.Hex};
|
|
2272
|
+
font-family: ${FontStyles.DEFAULT};
|
|
2273
|
+
font-size: ${FontSizes.DEFAULT};
|
|
2274
|
+
font-weight: 400;
|
|
2275
|
+
line-height: 2.9em;
|
|
2276
|
+
overflow: hidden;
|
|
2277
|
+
white-space: nowrap;
|
|
2296
2278
|
`;
|
|
2297
2279
|
const MultiSelect = (_a) => {
|
|
2298
|
-
var { readOnly, displayCount = 3, invalid, onChange, options = [], selected = [], showSelectAll, searchable = false, style } = _a, accessibleProps = __rest(_a, ["readOnly", "displayCount", "invalid", "onChange", "options", "selected", "showSelectAll", "searchable", "style"]);
|
|
2280
|
+
var { readOnly, displayCount = 3, invalid, onChange, options = [], selected = [], showSelectAll, searchable = false, style, id } = _a, accessibleProps = __rest(_a, ["readOnly", "displayCount", "invalid", "onChange", "options", "selected", "showSelectAll", "searchable", "style", "id"]);
|
|
2299
2281
|
const [showOptions, setShowOptions] = React.useState(false);
|
|
2300
2282
|
const selected_options = options.filter(o => selected.includes(o.value));
|
|
2301
2283
|
const [filter, setFilter] = React.useState('');
|
|
2302
|
-
const
|
|
2284
|
+
const baseId = id || 'multiselect';
|
|
2303
2285
|
// Filter the options based on the filter state
|
|
2304
2286
|
const filteredOptions = options.filter(o => { var _a, _b; return ((_a = o.label) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(filter)) || ((_b = o.value) === null || _b === void 0 ? void 0 : _b.toString().toLowerCase().includes(filter)); });
|
|
2305
|
-
return (React.createElement(Wrapper$5, { "$style": style, id: `${
|
|
2306
|
-
searchable && (React.createElement(SearchInput, { id: `${
|
|
2307
|
-
React.createElement(Trigger, Object.assign({ "$invalid": invalid, "$readOnly": readOnly, "$showOptions": showOptions, id: `${
|
|
2308
|
-
React.createElement(Value, { id: `${
|
|
2287
|
+
return (React.createElement(Wrapper$5, { "$style": style, id: `${baseId}-wrapper` },
|
|
2288
|
+
searchable && (React.createElement(SearchInput, { id: `${baseId}-search-input`, onChange: e => setFilter(e.target.value), onClick: () => setShowOptions(!showOptions), placeholder: `${showSelectAll ? options.length : selected_options.length} Selected`, type: 'text', value: filter })),
|
|
2289
|
+
React.createElement(Trigger, Object.assign({ "$invalid": invalid, "$readOnly": readOnly, "$showOptions": showOptions, id: `${baseId}-trigger`, onClick: readOnly ? undefined : setShowOptions.bind(null, !showOptions) }, accessibleProps),
|
|
2290
|
+
React.createElement(Value, { id: `${baseId}-value` }, selected.length > 0 && selected.length <= displayCount
|
|
2309
2291
|
? selected_options.map(o => o.label || o.value).join(', ')
|
|
2310
2292
|
: `${selected_options.length} Selected`),
|
|
2311
|
-
React.createElement(Icon, { color: Colors.BLACK.Hex, id: `${
|
|
2312
|
-
showOptions ? (React.createElement(Options, { id: `${
|
|
2313
|
-
React.createElement(Checklist, { id: `${
|
|
2314
|
-
showOptions ? (React.createElement(Scrim, { id: `${
|
|
2315
|
-
};
|
|
2316
|
-
|
|
2317
|
-
const Wrapper$4 = styled.div `
|
|
2318
|
-
display: flex;
|
|
2319
|
-
padding: 16px 30px;
|
|
2320
|
-
align-items: center;
|
|
2321
|
-
gap: 20px;
|
|
2322
|
-
align-self: stretch;
|
|
2323
|
-
border-bottom: 1px solid ${Colors.LIGHT_GRAY.Hex};
|
|
2324
|
-
`;
|
|
2325
|
-
const Title = styled.div `
|
|
2326
|
-
display: flex;
|
|
2327
|
-
align-items: center;
|
|
2328
|
-
gap: 20px;
|
|
2329
|
-
`;
|
|
2330
|
-
const Info = styled.div `
|
|
2331
|
-
display: flex;
|
|
2332
|
-
flex-direction: column;
|
|
2333
|
-
align-items: flex-start;
|
|
2334
|
-
gap: 4px;
|
|
2335
|
-
flex: 1 0 0;
|
|
2336
|
-
`;
|
|
2337
|
-
const Breadcrumbs = styled.div `
|
|
2338
|
-
display: flex;
|
|
2339
|
-
align-items: center;
|
|
2340
|
-
gap: 4px;
|
|
2341
|
-
`;
|
|
2342
|
-
const Actions = styled.div `
|
|
2343
|
-
display: flex;
|
|
2344
|
-
align-items: center;
|
|
2345
|
-
gap: 8px;
|
|
2346
|
-
`;
|
|
2347
|
-
const PageHeader = ({ title = '', breadcrumbs, actions, buttonMenu, tag }) => {
|
|
2293
|
+
React.createElement(Icon, { color: Colors.BLACK.Hex, id: `${baseId}-icon`, path: showOptions ? js.mdiChevronUp : js.mdiChevronDown, size: '22px' })),
|
|
2294
|
+
showOptions ? (React.createElement(Options, { id: `${baseId}-options` },
|
|
2295
|
+
React.createElement(Checklist, { id: `${baseId}-checklist`, onChange: onChange, options: filteredOptions, selected: selected, showSelectAll: showSelectAll }))) : null,
|
|
2296
|
+
showOptions ? (React.createElement(Scrim, { id: `${baseId}-scrim`, onClick: setShowOptions.bind(null, !showOptions) })) : null));
|
|
2297
|
+
};
|
|
2298
|
+
|
|
2299
|
+
const Wrapper$4 = styled.div `
|
|
2300
|
+
display: flex;
|
|
2301
|
+
padding: 16px 30px;
|
|
2302
|
+
align-items: center;
|
|
2303
|
+
gap: 20px;
|
|
2304
|
+
align-self: stretch;
|
|
2305
|
+
border-bottom: 1px solid ${Colors.LIGHT_GRAY.Hex};
|
|
2306
|
+
`;
|
|
2307
|
+
const Title = styled.div `
|
|
2308
|
+
display: flex;
|
|
2309
|
+
align-items: center;
|
|
2310
|
+
gap: 20px;
|
|
2311
|
+
`;
|
|
2312
|
+
const Info = styled.div `
|
|
2313
|
+
display: flex;
|
|
2314
|
+
flex-direction: column;
|
|
2315
|
+
align-items: flex-start;
|
|
2316
|
+
gap: 4px;
|
|
2317
|
+
flex: 1 0 0;
|
|
2318
|
+
`;
|
|
2319
|
+
const Breadcrumbs = styled.div `
|
|
2320
|
+
display: flex;
|
|
2321
|
+
align-items: center;
|
|
2322
|
+
gap: 4px;
|
|
2323
|
+
`;
|
|
2324
|
+
const Actions = styled.div `
|
|
2325
|
+
display: flex;
|
|
2326
|
+
align-items: center;
|
|
2327
|
+
gap: 8px;
|
|
2328
|
+
`;
|
|
2329
|
+
const PageHeader = ({ title = '', breadcrumbs, actions, buttonMenu, tag, id, }) => {
|
|
2348
2330
|
const { format = 'primary', menuItems = [], label = '', enableHover = true, enableClick = false, show = false, } = buttonMenu || {};
|
|
2349
|
-
const
|
|
2350
|
-
return (React.createElement(Wrapper$4, { id: `${
|
|
2351
|
-
React.createElement(Info, { id: `${
|
|
2352
|
-
React.createElement(Title, { id: `${
|
|
2353
|
-
React.createElement(Heading, { id: `${
|
|
2354
|
-
tag ? React.createElement(Tag, Object.assign({}, tag, { id: `${
|
|
2355
|
-
breadcrumbs ? (React.createElement(Breadcrumbs, { id: `${
|
|
2356
|
-
const crumbId =
|
|
2331
|
+
const baseId = id || 'page-header';
|
|
2332
|
+
return (React.createElement(Wrapper$4, { id: `${baseId}-wrapper` },
|
|
2333
|
+
React.createElement(Info, { id: `${baseId}-info` },
|
|
2334
|
+
React.createElement(Title, { id: `${baseId}-title` },
|
|
2335
|
+
React.createElement(Heading, { id: `${baseId}-heading`, type: 'secondary' }, title),
|
|
2336
|
+
tag ? React.createElement(Tag, Object.assign({}, tag, { id: `${baseId}-tag` })) : null),
|
|
2337
|
+
breadcrumbs ? (React.createElement(Breadcrumbs, { id: `${baseId}-breadcrumbs` }, breadcrumbs.map((crumb, i) => {
|
|
2338
|
+
const crumbId = `${baseId}-breadcrumb-${i}`;
|
|
2357
2339
|
return (React.createElement(React.Fragment, { key: i },
|
|
2358
2340
|
crumb.onClick ? (React.createElement(Link, { id: `${crumbId}-link`, onClick: crumb.onClick, small: true }, crumb.label)) : (React.createElement(Copy, { id: `${crumbId}-copy`, type: 'small' }, crumb.label)),
|
|
2359
2341
|
i + 1 < breadcrumbs.length ? (React.createElement(Icon.Icon, { id: `${crumbId}-icon`, path: js.mdiChevronRight, size: '14px' })) : null));
|
|
2360
2342
|
}))) : null),
|
|
2361
|
-
actions ? (React.createElement(Actions, { id: `${
|
|
2343
|
+
actions ? (React.createElement(Actions, { id: `${baseId}-actions` },
|
|
2362
2344
|
actions.map((action, i) => {
|
|
2363
2345
|
const { label } = action, buttonProps = __rest(action, ["label"]);
|
|
2364
|
-
const actionId =
|
|
2346
|
+
const actionId = `${baseId}-action-${i}`;
|
|
2365
2347
|
return (React.createElement(Button, Object.assign({}, buttonProps, { id: `${actionId}-button`, key: i, small: true }), label));
|
|
2366
2348
|
}),
|
|
2367
|
-
menuItems.length ? (React.createElement(ButtonMenu, { enableClick: enableClick, enableHover: enableHover, format: format, label: label, menuItems: menuItems, show: show, small: true })) : null)) : null));
|
|
2368
|
-
};
|
|
2369
|
-
|
|
2370
|
-
const Wrapper$3 = styled.nav `
|
|
2371
|
-
box-sizing: border-box;
|
|
2372
|
-
display: flex;
|
|
2373
|
-
align-items: center;
|
|
2374
|
-
column-gap: 10px;
|
|
2349
|
+
menuItems.length ? (React.createElement(ButtonMenu, { enableClick: enableClick, enableHover: enableHover, format: format, id: `${baseId}-button-menu`, label: label, menuItems: menuItems, show: show, small: true })) : null)) : null));
|
|
2350
|
+
};
|
|
2351
|
+
|
|
2352
|
+
const Wrapper$3 = styled.nav `
|
|
2353
|
+
box-sizing: border-box;
|
|
2354
|
+
display: flex;
|
|
2355
|
+
align-items: center;
|
|
2356
|
+
column-gap: 10px;
|
|
2375
2357
|
`;
|
|
2376
2358
|
const Pagination = (_a) => {
|
|
2377
|
-
var { currentPage = 1, onClick, pageCount = 0 } = _a, accessibleProps = __rest(_a, ["currentPage", "onClick", "pageCount"]);
|
|
2359
|
+
var { currentPage = 1, onClick, pageCount = 0, id } = _a, accessibleProps = __rest(_a, ["currentPage", "onClick", "pageCount", "id"]);
|
|
2378
2360
|
const is_first_page = currentPage === 1;
|
|
2379
2361
|
const is_last_page = currentPage === pageCount;
|
|
2380
2362
|
const handlePrevClick = () => {
|
|
@@ -2393,370 +2375,372 @@ const Pagination = (_a) => {
|
|
|
2393
2375
|
onClick(new_page);
|
|
2394
2376
|
}
|
|
2395
2377
|
};
|
|
2396
|
-
const
|
|
2397
|
-
return (React.createElement(Wrapper$3, Object.assign({}, accessibleProps, { id: `${
|
|
2398
|
-
React.createElement(Button, { disabled: is_first_page, icon: js.mdiChevronLeft, id: `${
|
|
2399
|
-
React.createElement(Select, { id: `${
|
|
2378
|
+
const baseId = id || 'pagination';
|
|
2379
|
+
return (React.createElement(Wrapper$3, Object.assign({}, accessibleProps, { id: `${baseId}-wrapper` }),
|
|
2380
|
+
React.createElement(Button, { disabled: is_first_page, icon: js.mdiChevronLeft, id: `${baseId}-prev-button`, onClick: handlePrevClick, small: true }),
|
|
2381
|
+
React.createElement(Select, { id: `${baseId}-select`, onChange: handlePageChange, options: Array.from(Array(pageCount).keys(), p => p + 1).map(p => ({
|
|
2400
2382
|
label: `Page ${p}`,
|
|
2401
2383
|
value: `${p}`,
|
|
2402
2384
|
})), value: `${currentPage}` }),
|
|
2403
|
-
React.createElement(Button, { disabled: is_last_page, icon: js.mdiChevronRight, id: `${
|
|
2404
|
-
};
|
|
2405
|
-
|
|
2406
|
-
const Wrapper$2 = styled.label `
|
|
2407
|
-
border-radius: 4px;
|
|
2408
|
-
padding: 4px 0px 4px 6px;
|
|
2409
|
-
margin-left: -6px;
|
|
2410
|
-
cursor: ${props => (props.$disabled ? 'default' : 'pointer')};
|
|
2411
|
-
display: flex;
|
|
2412
|
-
align-items: center;
|
|
2413
|
-
font-size: ${FontSizes.DEFAULT};
|
|
2414
|
-
line-height: 1.6em;
|
|
2415
|
-
box-sizing: border-box;
|
|
2416
|
-
position: relative;
|
|
2417
|
-
|
|
2418
|
-
&:focus-within {
|
|
2419
|
-
background: ${props => `rgba(${props.theme.PRIMARY_COLOR.Rgb}, 0.05)`};
|
|
2420
|
-
}
|
|
2385
|
+
React.createElement(Button, { disabled: is_last_page, icon: js.mdiChevronRight, id: `${baseId}-next-button`, onClick: handleNextClick, small: true })));
|
|
2386
|
+
};
|
|
2387
|
+
|
|
2388
|
+
const Wrapper$2 = styled.label `
|
|
2389
|
+
border-radius: 4px;
|
|
2390
|
+
padding: 4px 0px 4px 6px;
|
|
2391
|
+
margin-left: -6px;
|
|
2392
|
+
cursor: ${props => (props.$disabled ? 'default' : 'pointer')};
|
|
2393
|
+
display: flex;
|
|
2394
|
+
align-items: center;
|
|
2395
|
+
font-size: ${FontSizes.DEFAULT};
|
|
2396
|
+
line-height: 1.6em;
|
|
2397
|
+
box-sizing: border-box;
|
|
2398
|
+
position: relative;
|
|
2399
|
+
|
|
2400
|
+
&:focus-within {
|
|
2401
|
+
background: ${props => `rgba(${props.theme.PRIMARY_COLOR.Rgb}, 0.05)`};
|
|
2402
|
+
}
|
|
2421
2403
|
`;
|
|
2422
2404
|
Wrapper$2.defaultProps = { theme: EditableTheme };
|
|
2423
|
-
const Input = styled.input `
|
|
2424
|
-
font-size: 20px;
|
|
2425
|
-
margin: 0px;
|
|
2426
|
-
line-height: 1.6em;
|
|
2427
|
-
box-sizing: border-box;
|
|
2428
|
-
position: absolute;
|
|
2429
|
-
opacity: 0;
|
|
2430
|
-
cursor: pointer;
|
|
2431
|
-
height: 0;
|
|
2432
|
-
width: 0;
|
|
2433
|
-
&:checked + span {
|
|
2434
|
-
border-color: ${Colors.PRIMARY.Hex};
|
|
2435
|
-
}
|
|
2436
|
-
&:checked + span:after {
|
|
2437
|
-
background-color: ${Colors.PRIMARY.Hex};
|
|
2438
|
-
display: block;
|
|
2439
|
-
}
|
|
2440
|
-
&:disabled + span {
|
|
2441
|
-
background-color: #d3d3d3;
|
|
2442
|
-
border-color: #d3d3d3;
|
|
2443
|
-
}
|
|
2444
|
-
&:disabled + span:after {
|
|
2445
|
-
background-color: #fff;
|
|
2446
|
-
}
|
|
2447
|
-
&:checked:disabled + span:after {
|
|
2448
|
-
background-color: ${Colors.MEDIUM_GRAY.Hex};
|
|
2449
|
-
}
|
|
2450
|
-
`;
|
|
2451
|
-
const Check = styled.span `
|
|
2452
|
-
height: 17px;
|
|
2453
|
-
width: 17px;
|
|
2454
|
-
border-radius: 50%;
|
|
2455
|
-
background-color: #fff;
|
|
2456
|
-
border-width: 2px;
|
|
2457
|
-
border-style: solid;
|
|
2458
|
-
border-color: ${props => (props.$invalid ? `${Colors.RED.Hex}` : `${Colors.GRAY.Hex}`)};
|
|
2459
|
-
box-sizing: border-box;
|
|
2460
|
-
position: relative;
|
|
2461
|
-
&:after {
|
|
2462
|
-
content: '';
|
|
2463
|
-
position: absolute;
|
|
2464
|
-
top: 2px;
|
|
2465
|
-
left: 2px;
|
|
2466
|
-
width: 9px;
|
|
2467
|
-
height: 9px;
|
|
2468
|
-
border-radius: 50%;
|
|
2469
|
-
box-sizing: border-box;
|
|
2470
|
-
display: none;
|
|
2471
|
-
}
|
|
2472
|
-
`;
|
|
2473
|
-
const Label = styled.span `
|
|
2474
|
-
font-family: ${FontStyles.DEFAULT};
|
|
2475
|
-
font-size: ${FontSizes.DEFAULT};
|
|
2476
|
-
font-weight: 400;
|
|
2477
|
-
color: ${Colors.BLACK.Hex};
|
|
2478
|
-
line-height: 1.6em;
|
|
2479
|
-
margin-left: 6px;
|
|
2405
|
+
const Input = styled.input `
|
|
2406
|
+
font-size: 20px;
|
|
2407
|
+
margin: 0px;
|
|
2408
|
+
line-height: 1.6em;
|
|
2409
|
+
box-sizing: border-box;
|
|
2410
|
+
position: absolute;
|
|
2411
|
+
opacity: 0;
|
|
2412
|
+
cursor: pointer;
|
|
2413
|
+
height: 0;
|
|
2414
|
+
width: 0;
|
|
2415
|
+
&:checked + span {
|
|
2416
|
+
border-color: ${Colors.PRIMARY.Hex};
|
|
2417
|
+
}
|
|
2418
|
+
&:checked + span:after {
|
|
2419
|
+
background-color: ${Colors.PRIMARY.Hex};
|
|
2420
|
+
display: block;
|
|
2421
|
+
}
|
|
2422
|
+
&:disabled + span {
|
|
2423
|
+
background-color: #d3d3d3;
|
|
2424
|
+
border-color: #d3d3d3;
|
|
2425
|
+
}
|
|
2426
|
+
&:disabled + span:after {
|
|
2427
|
+
background-color: #fff;
|
|
2428
|
+
}
|
|
2429
|
+
&:checked:disabled + span:after {
|
|
2430
|
+
background-color: ${Colors.MEDIUM_GRAY.Hex};
|
|
2431
|
+
}
|
|
2432
|
+
`;
|
|
2433
|
+
const Check = styled.span `
|
|
2434
|
+
height: 17px;
|
|
2435
|
+
width: 17px;
|
|
2436
|
+
border-radius: 50%;
|
|
2437
|
+
background-color: #fff;
|
|
2438
|
+
border-width: 2px;
|
|
2439
|
+
border-style: solid;
|
|
2440
|
+
border-color: ${props => (props.$invalid ? `${Colors.RED.Hex}` : `${Colors.GRAY.Hex}`)};
|
|
2441
|
+
box-sizing: border-box;
|
|
2442
|
+
position: relative;
|
|
2443
|
+
&:after {
|
|
2444
|
+
content: '';
|
|
2445
|
+
position: absolute;
|
|
2446
|
+
top: 2px;
|
|
2447
|
+
left: 2px;
|
|
2448
|
+
width: 9px;
|
|
2449
|
+
height: 9px;
|
|
2450
|
+
border-radius: 50%;
|
|
2451
|
+
box-sizing: border-box;
|
|
2452
|
+
display: none;
|
|
2453
|
+
}
|
|
2454
|
+
`;
|
|
2455
|
+
const Label = styled.span `
|
|
2456
|
+
font-family: ${FontStyles.DEFAULT};
|
|
2457
|
+
font-size: ${FontSizes.DEFAULT};
|
|
2458
|
+
font-weight: 400;
|
|
2459
|
+
color: ${Colors.BLACK.Hex};
|
|
2460
|
+
line-height: 1.6em;
|
|
2461
|
+
margin-left: 6px;
|
|
2480
2462
|
`;
|
|
2481
2463
|
const Radio = (_a) => {
|
|
2482
|
-
var { children, disabled, checked, onChange, value, invalid, tooltip, tabIndex } = _a, accessibleProps = __rest(_a, ["children", "disabled", "checked", "onChange", "value", "invalid", "tooltip", "tabIndex"]);
|
|
2483
|
-
const
|
|
2484
|
-
return (React.createElement(Wrapper$2, Object.assign({}, accessibleProps, { id: `${
|
|
2485
|
-
React.createElement(Input, { checked: checked, disabled: disabled, id: `${
|
|
2486
|
-
React.createElement(Check, { "$invalid": invalid, id: `${
|
|
2487
|
-
React.createElement(Label, { id: `${
|
|
2464
|
+
var { children, disabled, checked, onChange, value, invalid, tooltip, tabIndex, id } = _a, accessibleProps = __rest(_a, ["children", "disabled", "checked", "onChange", "value", "invalid", "tooltip", "tabIndex", "id"]);
|
|
2465
|
+
const baseId = id || 'radio';
|
|
2466
|
+
return (React.createElement(Wrapper$2, Object.assign({}, accessibleProps, { id: `${baseId}-wrapper` }),
|
|
2467
|
+
React.createElement(Input, { checked: checked, disabled: disabled, id: `${baseId}-input`, name: accessibleProps.name, onChange: disabled ? undefined : onChange, tabIndex: disabled ? -1 : tabIndex, type: 'radio', value: value }),
|
|
2468
|
+
React.createElement(Check, { "$invalid": invalid, id: `${baseId}-check` }),
|
|
2469
|
+
React.createElement(Label, { id: `${baseId}-label` },
|
|
2488
2470
|
children,
|
|
2489
2471
|
tooltip ? React.createElement(Tooltip, Object.assign({}, tooltip)) : null)));
|
|
2490
|
-
};
|
|
2491
|
-
|
|
2472
|
+
};
|
|
2473
|
+
|
|
2492
2474
|
const RadioList = (_a) => {
|
|
2493
|
-
var { disabled, onChange, options, value } = _a, accessibleProps = __rest(_a, ["disabled", "onChange", "options", "value"]);
|
|
2494
|
-
|
|
2475
|
+
var { disabled, onChange, options, value, id } = _a, accessibleProps = __rest(_a, ["disabled", "onChange", "options", "value", "id"]);
|
|
2476
|
+
const baseId = id || 'radio-list';
|
|
2477
|
+
return (React.createElement(React.Fragment, null, options.map((option, index) => {
|
|
2495
2478
|
const label = option.label || option.value;
|
|
2496
|
-
|
|
2479
|
+
const optionId = `${baseId}-option-${index}`;
|
|
2480
|
+
return (React.createElement(Radio, Object.assign({ checked: value === option.value, disabled: disabled, id: optionId, key: option.value, onChange: onChange, value: option.value }, accessibleProps), label));
|
|
2497
2481
|
})));
|
|
2498
|
-
};
|
|
2499
|
-
|
|
2500
|
-
const StyledTable = styled.table `
|
|
2501
|
-
width: 100%;
|
|
2502
|
-
margin-top: 1px;
|
|
2503
|
-
table-layout: ${props => props.$tableLayout || 'auto'};
|
|
2504
|
-
border-collapse: collapse;
|
|
2505
|
-
text-indent: 0px;
|
|
2506
|
-
border-spacing: 0px;
|
|
2507
|
-
border-color: none;
|
|
2508
|
-
box-sizing: border-box;
|
|
2509
|
-
`;
|
|
2510
|
-
const Header = styled.th `
|
|
2511
|
-
padding: 12px !important;
|
|
2512
|
-
text-align: left;
|
|
2513
|
-
font-weight: 500;
|
|
2514
|
-
border-bottom: 1px solid #e5e5e5;
|
|
2515
|
-
border-top: 1px solid #e5e5e5;
|
|
2516
|
-
text-transform: uppercase;
|
|
2517
|
-
font-size: 12px;
|
|
2518
|
-
font-family: ${FontStyles.DEFAULT};
|
|
2519
|
-
letter-spacing: 1px;
|
|
2520
|
-
white-space: nowrap;
|
|
2521
|
-
line-height: 1;
|
|
2522
|
-
position: relative;
|
|
2523
|
-
box-sizing: border-box;
|
|
2524
|
-
width: ${props => props.$width || 'auto'};
|
|
2525
|
-
cursor: ${props => (props.$isSortable ? 'pointer' : 'default')};
|
|
2526
|
-
color: ${props => (props.$isSortable ? props.theme.PRIMARY_COLOR.Hex : Colors.BLACK.Hex)};
|
|
2482
|
+
};
|
|
2483
|
+
|
|
2484
|
+
const StyledTable = styled.table `
|
|
2485
|
+
width: 100%;
|
|
2486
|
+
margin-top: 1px;
|
|
2487
|
+
table-layout: ${props => props.$tableLayout || 'auto'};
|
|
2488
|
+
border-collapse: collapse;
|
|
2489
|
+
text-indent: 0px;
|
|
2490
|
+
border-spacing: 0px;
|
|
2491
|
+
border-color: none;
|
|
2492
|
+
box-sizing: border-box;
|
|
2493
|
+
`;
|
|
2494
|
+
const Header = styled.th `
|
|
2495
|
+
padding: 12px !important;
|
|
2496
|
+
text-align: left;
|
|
2497
|
+
font-weight: 500;
|
|
2498
|
+
border-bottom: 1px solid #e5e5e5;
|
|
2499
|
+
border-top: 1px solid #e5e5e5;
|
|
2500
|
+
text-transform: uppercase;
|
|
2501
|
+
font-size: 12px;
|
|
2502
|
+
font-family: ${FontStyles.DEFAULT};
|
|
2503
|
+
letter-spacing: 1px;
|
|
2504
|
+
white-space: nowrap;
|
|
2505
|
+
line-height: 1;
|
|
2506
|
+
position: relative;
|
|
2507
|
+
box-sizing: border-box;
|
|
2508
|
+
width: ${props => props.$width || 'auto'};
|
|
2509
|
+
cursor: ${props => (props.$isSortable ? 'pointer' : 'default')};
|
|
2510
|
+
color: ${props => (props.$isSortable ? props.theme.PRIMARY_COLOR.Hex : Colors.BLACK.Hex)};
|
|
2527
2511
|
`;
|
|
2528
2512
|
Header.defaultProps = { theme: EditableTheme };
|
|
2529
|
-
const Row = styled.tr `
|
|
2530
|
-
cursor: ${props => (props.$isClickable ? 'pointer' : 'default')};
|
|
2531
|
-
transition: all 0.2s;
|
|
2532
|
-
background-color: ${props => props.$bgColor};
|
|
2533
|
-
box-sizing: border-box;
|
|
2534
|
-
&:hover {
|
|
2535
|
-
background-color: ${props => props.$isClickable ? `rgba(${props.theme.PRIMARY_COLOR.Rgb}, 0.1)` : props.$bgColor};
|
|
2536
|
-
}
|
|
2513
|
+
const Row = styled.tr `
|
|
2514
|
+
cursor: ${props => (props.$isClickable ? 'pointer' : 'default')};
|
|
2515
|
+
transition: all 0.2s;
|
|
2516
|
+
background-color: ${props => props.$bgColor};
|
|
2517
|
+
box-sizing: border-box;
|
|
2518
|
+
&:hover {
|
|
2519
|
+
background-color: ${props => props.$isClickable ? `rgba(${props.theme.PRIMARY_COLOR.Rgb}, 0.1)` : props.$bgColor};
|
|
2520
|
+
}
|
|
2537
2521
|
`;
|
|
2538
2522
|
Row.defaultProps = { theme: EditableTheme };
|
|
2539
|
-
const Column = styled.td `
|
|
2540
|
-
padding: 16px 12px !important;
|
|
2541
|
-
font-size: ${FontSizes.DEFAULT} !important;
|
|
2542
|
-
font-weight: 400 !important;
|
|
2543
|
-
font-family: ${FontStyles.DEFAULT};
|
|
2544
|
-
border: none !important;
|
|
2545
|
-
word-break: break-word;
|
|
2546
|
-
line-height: 1.4em;
|
|
2547
|
-
box-sizing: border-box;
|
|
2548
|
-
text-align: ${props => props.$align || 'left'};
|
|
2549
|
-
width: ${props => props.$width || 'auto'};
|
|
2550
|
-
`;
|
|
2551
|
-
const IconWrapper = styled.span `
|
|
2552
|
-
position: absolute;
|
|
2553
|
-
top: 50%;
|
|
2554
|
-
transform: translateY(-50%);
|
|
2555
|
-
margin-left: 2px;
|
|
2556
|
-
`;
|
|
2557
|
-
const StyledIcon$1 = styled(Icon) `
|
|
2558
|
-
> path {
|
|
2559
|
-
fill: ${props => props.theme.PRIMARY_COLOR.Hex} !important;
|
|
2560
|
-
}
|
|
2523
|
+
const Column = styled.td `
|
|
2524
|
+
padding: 16px 12px !important;
|
|
2525
|
+
font-size: ${FontSizes.DEFAULT} !important;
|
|
2526
|
+
font-weight: 400 !important;
|
|
2527
|
+
font-family: ${FontStyles.DEFAULT};
|
|
2528
|
+
border: none !important;
|
|
2529
|
+
word-break: break-word;
|
|
2530
|
+
line-height: 1.4em;
|
|
2531
|
+
box-sizing: border-box;
|
|
2532
|
+
text-align: ${props => props.$align || 'left'};
|
|
2533
|
+
width: ${props => props.$width || 'auto'};
|
|
2534
|
+
`;
|
|
2535
|
+
const IconWrapper = styled.span `
|
|
2536
|
+
position: absolute;
|
|
2537
|
+
top: 50%;
|
|
2538
|
+
transform: translateY(-50%);
|
|
2539
|
+
margin-left: 2px;
|
|
2540
|
+
`;
|
|
2541
|
+
const StyledIcon$1 = styled(Icon) `
|
|
2542
|
+
> path {
|
|
2543
|
+
fill: ${props => props.theme.PRIMARY_COLOR.Hex} !important;
|
|
2544
|
+
}
|
|
2561
2545
|
`;
|
|
2562
2546
|
StyledIcon$1.defaultProps = { theme: EditableTheme };
|
|
2563
2547
|
const Table = (_a) => {
|
|
2564
|
-
var { columns = [], data = [], sortBy, sortDirection, hideHeaders, onRowClick, onSortChange, tableLayout } = _a, accessibleProps = __rest(_a, ["columns", "data", "sortBy", "sortDirection", "hideHeaders", "onRowClick", "onSortChange", "tableLayout"]);
|
|
2565
|
-
const
|
|
2566
|
-
return (React.createElement(StyledTable, Object.assign({ "$tableLayout": tableLayout }, accessibleProps, { id: `${
|
|
2567
|
-
hideHeaders ? null : (React.createElement("thead", { id: `${
|
|
2568
|
-
React.createElement("tr", { id: `${
|
|
2569
|
-
const columnId =
|
|
2548
|
+
var { columns = [], data = [], sortBy, sortDirection, hideHeaders, onRowClick, onSortChange, tableLayout, id } = _a, accessibleProps = __rest(_a, ["columns", "data", "sortBy", "sortDirection", "hideHeaders", "onRowClick", "onSortChange", "tableLayout", "id"]);
|
|
2549
|
+
const baseId = id || 'table';
|
|
2550
|
+
return (React.createElement(StyledTable, Object.assign({ "$tableLayout": tableLayout }, accessibleProps, { id: `${baseId}-styled-table` }),
|
|
2551
|
+
hideHeaders ? null : (React.createElement("thead", { id: `${baseId}-thead` },
|
|
2552
|
+
React.createElement("tr", { id: `${baseId}-header-row` }, columns.map((column, i) => {
|
|
2553
|
+
const columnId = `${baseId}-column-${i}`;
|
|
2570
2554
|
return (React.createElement(Header, { "$isSortable": column.isSortable, "$width": column.width, id: `${columnId}-header`, key: i, onClick: onSortChange === null || onSortChange === void 0 ? void 0 : onSortChange.bind(null, column.id) },
|
|
2571
2555
|
column.label,
|
|
2572
2556
|
column.isSortable && sortBy === column.id ? (React.createElement(IconWrapper, { id: `${columnId}-icon-wrapper` },
|
|
2573
2557
|
React.createElement(StyledIcon$1, { id: `${columnId}-icon`, path: sortDirection === 'asc' ? js.mdiChevronUp : js.mdiChevronDown, size: '20px' }))) : null));
|
|
2574
2558
|
})))),
|
|
2575
|
-
data.length ? (React.createElement("tbody", { id: `${
|
|
2576
|
-
const rowId =
|
|
2559
|
+
data.length ? (React.createElement("tbody", { id: `${baseId}-tbody` }, data.map((row, i) => {
|
|
2560
|
+
const rowId = `${baseId}-row-${i}`;
|
|
2577
2561
|
return (React.createElement(Row, { "$bgColor": i % 2 === 0 ? '#ffffff' : '#f9f9f9', "$isClickable": !!onRowClick, id: `${rowId}-row`, key: i, onClick: onRowClick ? onRowClick.bind(null, row) : undefined }, columns.map((column, j) => {
|
|
2578
|
-
const columnId =
|
|
2562
|
+
const columnId = `${baseId}-column-${j}`;
|
|
2579
2563
|
return (React.createElement(Column, { "$align": columns[j].align, "$width": columns[j].width, id: `${columnId}-column`, key: j }, column.render ? column.render(row) : row[column.id] || 'N/A'));
|
|
2580
2564
|
})));
|
|
2581
2565
|
}))) : null));
|
|
2582
|
-
};
|
|
2583
|
-
|
|
2584
|
-
const Wrapper$1 = styled.div `
|
|
2585
|
-
display: flex;
|
|
2586
|
-
box-sizing: border-box;
|
|
2587
|
-
align-items: flex-end;
|
|
2588
|
-
border-top: 1px solid #e5e5e5;
|
|
2589
|
-
border-bottom: 1px solid #e5e5e5;
|
|
2590
|
-
flex-shrink: 0;
|
|
2591
|
-
align-self: stretch;
|
|
2592
|
-
padding: 0;
|
|
2593
|
-
margin: 0;
|
|
2594
|
-
`;
|
|
2595
|
-
const Tab = styled.div `
|
|
2596
|
-
display: flex;
|
|
2597
|
-
align-items: center;
|
|
2598
|
-
gap: 6px;
|
|
2599
|
-
font-size: ${FontSizes.DEFAULT};
|
|
2600
|
-
font-family: ${FontStyles.DEFAULT};
|
|
2601
|
-
font-weight: ${props => (props.$isActive ? 500 : 400)};
|
|
2602
|
-
color: ${props => (props.$isActive ? Colors.BLACK.Hex : Colors.MEDIUM_GRAY.Hex)};
|
|
2603
|
-
line-height: 1em;
|
|
2604
|
-
padding: 16px 30px 12px;
|
|
2605
|
-
margin: 0 0 -1px 0;
|
|
2606
|
-
border-bottom-width: 4px;
|
|
2607
|
-
border-bottom-style: solid;
|
|
2608
|
-
border-bottom-color: ${props => props.$isActive ? props.theme.PRIMARY_COLOR.Hex : 'transparent'};
|
|
2609
|
-
cursor: ${props => (props.$isActive ? 'default' : 'pointer')};
|
|
2610
|
-
box-sizing: border-box;
|
|
2611
|
-
&:hover {
|
|
2612
|
-
color: ${props => (props.$isActive ? Colors.BLACK.Hex : props.theme.PRIMARY_COLOR.Hex)};
|
|
2613
|
-
font-weight: 500;
|
|
2614
|
-
}
|
|
2566
|
+
};
|
|
2567
|
+
|
|
2568
|
+
const Wrapper$1 = styled.div `
|
|
2569
|
+
display: flex;
|
|
2570
|
+
box-sizing: border-box;
|
|
2571
|
+
align-items: flex-end;
|
|
2572
|
+
border-top: 1px solid #e5e5e5;
|
|
2573
|
+
border-bottom: 1px solid #e5e5e5;
|
|
2574
|
+
flex-shrink: 0;
|
|
2575
|
+
align-self: stretch;
|
|
2576
|
+
padding: 0;
|
|
2577
|
+
margin: 0;
|
|
2578
|
+
`;
|
|
2579
|
+
const Tab = styled.div `
|
|
2580
|
+
display: flex;
|
|
2581
|
+
align-items: center;
|
|
2582
|
+
gap: 6px;
|
|
2583
|
+
font-size: ${FontSizes.DEFAULT};
|
|
2584
|
+
font-family: ${FontStyles.DEFAULT};
|
|
2585
|
+
font-weight: ${props => (props.$isActive ? 500 : 400)};
|
|
2586
|
+
color: ${props => (props.$isActive ? Colors.BLACK.Hex : Colors.MEDIUM_GRAY.Hex)};
|
|
2587
|
+
line-height: 1em;
|
|
2588
|
+
padding: 16px 30px 12px;
|
|
2589
|
+
margin: 0 0 -1px 0;
|
|
2590
|
+
border-bottom-width: 4px;
|
|
2591
|
+
border-bottom-style: solid;
|
|
2592
|
+
border-bottom-color: ${props => props.$isActive ? props.theme.PRIMARY_COLOR.Hex : 'transparent'};
|
|
2593
|
+
cursor: ${props => (props.$isActive ? 'default' : 'pointer')};
|
|
2594
|
+
box-sizing: border-box;
|
|
2595
|
+
&:hover {
|
|
2596
|
+
color: ${props => (props.$isActive ? Colors.BLACK.Hex : props.theme.PRIMARY_COLOR.Hex)};
|
|
2597
|
+
font-weight: 500;
|
|
2598
|
+
}
|
|
2615
2599
|
`;
|
|
2616
2600
|
Tab.defaultProps = { theme: EditableTheme };
|
|
2617
|
-
const Badge = styled.div `
|
|
2618
|
-
display: flex;
|
|
2619
|
-
width: 18px;
|
|
2620
|
-
height: 18px;
|
|
2621
|
-
justify-content: center;
|
|
2622
|
-
align-items: center;
|
|
2623
|
-
border-radius: 9px;
|
|
2624
|
-
background: ${props => (props.$isError ? Colors.RED.Hex : props.theme.PRIMARY_COLOR.Hex)};
|
|
2625
|
-
color: #fff;
|
|
2626
|
-
font-family: ${FontStyles.DEFAULT};
|
|
2627
|
-
font-size: 12px;
|
|
2628
|
-
font-weight: 500;
|
|
2629
|
-
line-height: 1;
|
|
2630
|
-
letter-spacing: 1px;
|
|
2601
|
+
const Badge = styled.div `
|
|
2602
|
+
display: flex;
|
|
2603
|
+
width: 18px;
|
|
2604
|
+
height: 18px;
|
|
2605
|
+
justify-content: center;
|
|
2606
|
+
align-items: center;
|
|
2607
|
+
border-radius: 9px;
|
|
2608
|
+
background: ${props => (props.$isError ? Colors.RED.Hex : props.theme.PRIMARY_COLOR.Hex)};
|
|
2609
|
+
color: #fff;
|
|
2610
|
+
font-family: ${FontStyles.DEFAULT};
|
|
2611
|
+
font-size: 12px;
|
|
2612
|
+
font-weight: 500;
|
|
2613
|
+
line-height: 1;
|
|
2614
|
+
letter-spacing: 1px;
|
|
2631
2615
|
`;
|
|
2632
2616
|
Badge.defaultProps = { theme: EditableTheme };
|
|
2633
2617
|
const Tabs = (_a) => {
|
|
2634
|
-
var { tabs } = _a, accessibleProps = __rest(_a, ["tabs"]);
|
|
2635
|
-
const
|
|
2636
|
-
return (React.createElement(Wrapper$1, Object.assign({}, accessibleProps, { id: `${
|
|
2618
|
+
var { tabs, id } = _a, accessibleProps = __rest(_a, ["tabs", "id"]);
|
|
2619
|
+
const baseId = id || 'tabs';
|
|
2620
|
+
return (React.createElement(Wrapper$1, Object.assign({}, accessibleProps, { id: `${baseId}-wrapper` }), tabs.map((_a, i) => {
|
|
2637
2621
|
var { isActive, label, badgeCount, errorBadge, onClick } = _a, accessibleProps = __rest(_a, ["isActive", "label", "badgeCount", "errorBadge", "onClick"]);
|
|
2638
|
-
const tabId =
|
|
2622
|
+
const tabId = `${baseId}-tab-${i}`;
|
|
2639
2623
|
return (React.createElement(Tab, Object.assign({ "$isActive": isActive || false, key: i, onClick: isActive ? undefined : onClick }, accessibleProps, { id: `${tabId}-tab` }),
|
|
2640
2624
|
badgeCount ? (React.createElement(Badge, { "$isError": errorBadge || false, id: `${tabId}-badge` }, badgeCount)) : null,
|
|
2641
2625
|
label));
|
|
2642
2626
|
})));
|
|
2643
2627
|
};
|
|
2644
|
-
Tabs.defaultProps = {};
|
|
2645
|
-
|
|
2646
|
-
const Track = styled.div `
|
|
2647
|
-
height: 24px;
|
|
2648
|
-
border-radius: 12px;
|
|
2649
|
-
background: ${props => (props.$on ? Colors.GREEN.Hex : Colors.BLACK.Hex)};
|
|
2650
|
-
display: flex;
|
|
2651
|
-
align-items: center;
|
|
2652
|
-
cursor: pointer;
|
|
2653
|
-
width: 40px;
|
|
2654
|
-
padding: 2px;
|
|
2655
|
-
box-sizing: border-box;
|
|
2656
|
-
`;
|
|
2657
|
-
const Handle = styled.div `
|
|
2658
|
-
width: 20px;
|
|
2659
|
-
height: 20px;
|
|
2660
|
-
border-radius: 10px;
|
|
2661
|
-
background: #ffffff;
|
|
2662
|
-
margin-left: ${props => (props.$on ? 'auto' : '0px')};
|
|
2663
|
-
display: flex;
|
|
2664
|
-
align-items: center;
|
|
2665
|
-
justify-content: center;
|
|
2666
|
-
box-sizing: border-box;
|
|
2628
|
+
Tabs.defaultProps = {};
|
|
2629
|
+
|
|
2630
|
+
const Track = styled.div `
|
|
2631
|
+
height: 24px;
|
|
2632
|
+
border-radius: 12px;
|
|
2633
|
+
background: ${props => (props.$on ? Colors.GREEN.Hex : Colors.BLACK.Hex)};
|
|
2634
|
+
display: flex;
|
|
2635
|
+
align-items: center;
|
|
2636
|
+
cursor: pointer;
|
|
2637
|
+
width: 40px;
|
|
2638
|
+
padding: 2px;
|
|
2639
|
+
box-sizing: border-box;
|
|
2640
|
+
`;
|
|
2641
|
+
const Handle = styled.div `
|
|
2642
|
+
width: 20px;
|
|
2643
|
+
height: 20px;
|
|
2644
|
+
border-radius: 10px;
|
|
2645
|
+
background: #ffffff;
|
|
2646
|
+
margin-left: ${props => (props.$on ? 'auto' : '0px')};
|
|
2647
|
+
display: flex;
|
|
2648
|
+
align-items: center;
|
|
2649
|
+
justify-content: center;
|
|
2650
|
+
box-sizing: border-box;
|
|
2667
2651
|
`;
|
|
2668
2652
|
const Toggle = (_a) => {
|
|
2669
|
-
var { onClick, on } = _a, accessibleProps = __rest(_a, ["onClick", "on"]);
|
|
2670
|
-
const
|
|
2671
|
-
return (React.createElement(Track, Object.assign({ "$on": on, onClick: onClick }, accessibleProps, { id: `${
|
|
2672
|
-
React.createElement("input", { checked: on, id: `${
|
|
2673
|
-
React.createElement(Handle, { "$on": on, id: `${
|
|
2674
|
-
React.createElement(Icon, { color: on ? Colors.GREEN.Hex : Colors.BLACK.Hex, id: `${
|
|
2653
|
+
var { onClick, on, id } = _a, accessibleProps = __rest(_a, ["onClick", "on", "id"]);
|
|
2654
|
+
const baseId = id || 'toggle';
|
|
2655
|
+
return (React.createElement(Track, Object.assign({ "$on": on, onClick: onClick }, accessibleProps, { id: `${baseId}-track` }),
|
|
2656
|
+
React.createElement("input", { checked: on, id: `${baseId}-input`, name: accessibleProps.name, type: 'hidden' }),
|
|
2657
|
+
React.createElement(Handle, { "$on": on, id: `${baseId}-handle` },
|
|
2658
|
+
React.createElement(Icon, { color: on ? Colors.GREEN.Hex : Colors.BLACK.Hex, id: `${baseId}-icon`, path: on ? js.mdiCheck : js.mdiClose, size: '16px' }))));
|
|
2675
2659
|
};
|
|
2676
|
-
Toggle.defaultProps = {};
|
|
2677
|
-
|
|
2678
|
-
const Container = styled.div `
|
|
2679
|
-
width: 100%;
|
|
2680
|
-
padding: 40px auto;
|
|
2681
|
-
gap: 20px;
|
|
2682
|
-
display: flex;
|
|
2683
|
-
flex-direction: column;
|
|
2684
|
-
justify-items: center;
|
|
2685
|
-
align-items: center;
|
|
2686
|
-
`;
|
|
2687
|
-
const Wrapper = styled.div `
|
|
2688
|
-
gap: 10px;
|
|
2689
|
-
display: flex;
|
|
2690
|
-
flex-direction: column;
|
|
2691
|
-
justify-items: center;
|
|
2692
|
-
align-items: center;
|
|
2693
|
-
`;
|
|
2694
|
-
const StyledIcon = styled.div `
|
|
2695
|
-
display: flex;
|
|
2696
|
-
align-items: center;
|
|
2697
|
-
justify-content: center;
|
|
2698
|
-
width: 80px;
|
|
2699
|
-
height: 80px;
|
|
2700
|
-
border-radius: 40px;
|
|
2701
|
-
background: #f5f5f5;
|
|
2660
|
+
Toggle.defaultProps = {};
|
|
2661
|
+
|
|
2662
|
+
const Container = styled.div `
|
|
2663
|
+
width: 100%;
|
|
2664
|
+
padding: 40px auto;
|
|
2665
|
+
gap: 20px;
|
|
2666
|
+
display: flex;
|
|
2667
|
+
flex-direction: column;
|
|
2668
|
+
justify-items: center;
|
|
2669
|
+
align-items: center;
|
|
2670
|
+
`;
|
|
2671
|
+
const Wrapper = styled.div `
|
|
2672
|
+
gap: 10px;
|
|
2673
|
+
display: flex;
|
|
2674
|
+
flex-direction: column;
|
|
2675
|
+
justify-items: center;
|
|
2676
|
+
align-items: center;
|
|
2677
|
+
`;
|
|
2678
|
+
const StyledIcon = styled.div `
|
|
2679
|
+
display: flex;
|
|
2680
|
+
align-items: center;
|
|
2681
|
+
justify-content: center;
|
|
2682
|
+
width: 80px;
|
|
2683
|
+
height: 80px;
|
|
2684
|
+
border-radius: 40px;
|
|
2685
|
+
background: #f5f5f5;
|
|
2702
2686
|
`;
|
|
2703
2687
|
const ZeroState = (_a) => {
|
|
2704
|
-
var { icon, title, description, action } = _a, accessibleProps = __rest(_a, ["icon", "title", "description", "action"]);
|
|
2705
|
-
const
|
|
2706
|
-
return (React.createElement(Container, Object.assign({}, accessibleProps, { id: `${
|
|
2707
|
-
React.createElement(StyledIcon, { id: `${
|
|
2708
|
-
React.createElement(Icon, { color: Colors.MEDIUM_GRAY.Hex, id: `${
|
|
2709
|
-
React.createElement(Wrapper, { id: `${
|
|
2710
|
-
React.createElement(Heading, { children: title, id: `${
|
|
2711
|
-
description && (React.createElement(Copy, { align: 'center', children: description, color: 'GRAY', id: `${
|
|
2712
|
-
action && (React.createElement(Button, { children: action.children, disabled: action.disabled, format: action.format, icon: action.icon, id: `${
|
|
2713
|
-
};
|
|
2714
|
-
|
|
2715
|
-
exports.Accordion = Accordion;
|
|
2716
|
-
exports.ActionDialog = ActionDialog;
|
|
2717
|
-
exports.Alert = Alert;
|
|
2718
|
-
exports.AppHeader = AppHeader;
|
|
2719
|
-
exports.AppMenu = AppMenu;
|
|
2720
|
-
exports.BulkActionBar = BulkActionBar;
|
|
2721
|
-
exports.Button = Button;
|
|
2722
|
-
exports.ButtonMenu = ButtonMenu;
|
|
2723
|
-
exports.Checkbox = Checkbox;
|
|
2724
|
-
exports.Checklist = Checklist;
|
|
2725
|
-
exports.Colors = Colors;
|
|
2726
|
-
exports.Copy = Copy;
|
|
2727
|
-
exports.DatePicker = DatePicker;
|
|
2728
|
-
exports.Drawer = Drawer;
|
|
2729
|
-
exports.EditableTheme = EditableTheme;
|
|
2730
|
-
exports.Field = Field;
|
|
2731
|
-
exports.FieldGroup = FieldGroup;
|
|
2732
|
-
exports.FileUpload = FileUpload;
|
|
2733
|
-
exports.FontSizes = FontSizes;
|
|
2734
|
-
exports.FontStyles = FontStyles;
|
|
2735
|
-
exports.Heading = Heading;
|
|
2736
|
-
exports.Input = Input$1;
|
|
2737
|
-
exports.Link = Link;
|
|
2738
|
-
exports.Loader = Loader;
|
|
2739
|
-
exports.Logo = Logo;
|
|
2740
|
-
exports.Modal = Modal;
|
|
2741
|
-
exports.MoreMenu = MoreMenu;
|
|
2742
|
-
exports.MultiSelect = MultiSelect;
|
|
2743
|
-
exports.PageHeader = PageHeader;
|
|
2744
|
-
exports.Pagination = Pagination;
|
|
2745
|
-
exports.ProgressBar = ProgressBar;
|
|
2746
|
-
exports.Radio = Radio;
|
|
2747
|
-
exports.RadioList = RadioList;
|
|
2748
|
-
exports.Select = Select;
|
|
2749
|
-
exports.Table = Table;
|
|
2750
|
-
exports.Tabs = Tabs;
|
|
2751
|
-
exports.Tag = Tag;
|
|
2752
|
-
exports.Toggle = Toggle;
|
|
2753
|
-
exports.Tooltip = Tooltip;
|
|
2754
|
-
exports.ZeroState = ZeroState;
|
|
2755
|
-
exports.formatAsPhone = formatAsPhone;
|
|
2756
|
-
exports.formatAsSsn = formatAsSsn;
|
|
2757
|
-
exports.getAgesFromDob = getAgesFromDob;
|
|
2758
|
-
exports.getDaysForMonth = getDaysForMonth;
|
|
2759
|
-
exports.getYears = getYears;
|
|
2760
|
-
exports.validateEmail = validateEmail;
|
|
2761
|
-
exports.validatePhone = validatePhone;
|
|
2762
|
-
//# sourceMappingURL=index.js.map
|
|
2688
|
+
var { icon, title, description, action, id } = _a, accessibleProps = __rest(_a, ["icon", "title", "description", "action", "id"]);
|
|
2689
|
+
const baseId = id || 'zero-state';
|
|
2690
|
+
return (React.createElement(Container, Object.assign({}, accessibleProps, { id: `${baseId}-container` }),
|
|
2691
|
+
React.createElement(StyledIcon, { id: `${baseId}-icon-wrapper` },
|
|
2692
|
+
React.createElement(Icon, { color: Colors.MEDIUM_GRAY.Hex, id: `${baseId}-icon`, path: icon, size: '40px' })),
|
|
2693
|
+
React.createElement(Wrapper, { id: `${baseId}-wrapper` },
|
|
2694
|
+
React.createElement(Heading, { children: title, id: `${baseId}-heading`, type: 'tertiary' }),
|
|
2695
|
+
description && (React.createElement(Copy, { align: 'center', children: description, color: 'GRAY', id: `${baseId}-description`, type: 'default' }))),
|
|
2696
|
+
action && (React.createElement(Button, { children: action.children, disabled: action.disabled, format: action.format, icon: action.icon, id: `${baseId}-button`, onClick: action.onClick }))));
|
|
2697
|
+
};
|
|
2698
|
+
|
|
2699
|
+
exports.Accordion = Accordion;
|
|
2700
|
+
exports.ActionDialog = ActionDialog;
|
|
2701
|
+
exports.Alert = Alert;
|
|
2702
|
+
exports.AppHeader = AppHeader;
|
|
2703
|
+
exports.AppMenu = AppMenu;
|
|
2704
|
+
exports.BulkActionBar = BulkActionBar;
|
|
2705
|
+
exports.Button = Button;
|
|
2706
|
+
exports.ButtonMenu = ButtonMenu;
|
|
2707
|
+
exports.Checkbox = Checkbox;
|
|
2708
|
+
exports.Checklist = Checklist;
|
|
2709
|
+
exports.Colors = Colors;
|
|
2710
|
+
exports.Copy = Copy;
|
|
2711
|
+
exports.DatePicker = DatePicker;
|
|
2712
|
+
exports.Drawer = Drawer;
|
|
2713
|
+
exports.EditableTheme = EditableTheme;
|
|
2714
|
+
exports.Field = Field;
|
|
2715
|
+
exports.FieldGroup = FieldGroup;
|
|
2716
|
+
exports.FileUpload = FileUpload;
|
|
2717
|
+
exports.FontSizes = FontSizes;
|
|
2718
|
+
exports.FontStyles = FontStyles;
|
|
2719
|
+
exports.Heading = Heading;
|
|
2720
|
+
exports.Input = Input$1;
|
|
2721
|
+
exports.Link = Link;
|
|
2722
|
+
exports.Loader = Loader;
|
|
2723
|
+
exports.Logo = Logo;
|
|
2724
|
+
exports.Modal = Modal;
|
|
2725
|
+
exports.MoreMenu = MoreMenu;
|
|
2726
|
+
exports.MultiSelect = MultiSelect;
|
|
2727
|
+
exports.PageHeader = PageHeader;
|
|
2728
|
+
exports.Pagination = Pagination;
|
|
2729
|
+
exports.ProgressBar = ProgressBar;
|
|
2730
|
+
exports.Radio = Radio;
|
|
2731
|
+
exports.RadioList = RadioList;
|
|
2732
|
+
exports.Select = Select;
|
|
2733
|
+
exports.Table = Table;
|
|
2734
|
+
exports.Tabs = Tabs;
|
|
2735
|
+
exports.Tag = Tag;
|
|
2736
|
+
exports.Toggle = Toggle;
|
|
2737
|
+
exports.Tooltip = Tooltip;
|
|
2738
|
+
exports.ZeroState = ZeroState;
|
|
2739
|
+
exports.formatAsPhone = formatAsPhone;
|
|
2740
|
+
exports.formatAsSsn = formatAsSsn;
|
|
2741
|
+
exports.getAgesFromDob = getAgesFromDob;
|
|
2742
|
+
exports.getDaysForMonth = getDaysForMonth;
|
|
2743
|
+
exports.getYears = getYears;
|
|
2744
|
+
exports.validateEmail = validateEmail;
|
|
2745
|
+
exports.validatePhone = validatePhone;
|
|
2746
|
+
//# sourceMappingURL=index.js.map
|