@hexure/ui 1.7.0 → 1.8.1
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 +1387 -526
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/ButtonMenu/ButtonMenu.d.ts +12 -0
- package/dist/cjs/types/components/ButtonMenu/index.d.ts +1 -0
- package/dist/cjs/types/components/FileUpload/FileUpload.d.ts +19 -19
- package/dist/cjs/types/components/MoreMenu/MoreMenu.d.ts +1 -1
- package/dist/cjs/types/components/PageHeader/PageHeader.d.ts +24 -0
- package/dist/cjs/types/components/PageHeader/index.d.ts +1 -0
- package/dist/cjs/types/index.d.ts +2 -0
- package/dist/esm/index.js +1388 -529
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/ButtonMenu/ButtonMenu.d.ts +12 -0
- package/dist/esm/types/components/ButtonMenu/index.d.ts +1 -0
- package/dist/esm/types/components/FileUpload/FileUpload.d.ts +19 -19
- package/dist/esm/types/components/MoreMenu/MoreMenu.d.ts +1 -1
- package/dist/esm/types/components/PageHeader/PageHeader.d.ts +24 -0
- package/dist/esm/types/components/PageHeader/index.d.ts +1 -0
- package/dist/esm/types/index.d.ts +2 -0
- package/dist/index.d.ts +63 -30
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useRef, useDebugValue, useContext, createElement, useState, useEffect } from 'react';
|
|
2
|
-
import Icon from '@mdi/react';
|
|
3
|
-
import { mdiChevronUp, mdiChevronDown, mdiLoading, mdiInformationOutline, mdiAlertOctagonOutline, mdiAlertOutline, mdiCheckboxMarkedCircleOutline, mdiClose, mdiMinusCircle, mdiFolderPlusOutline,
|
|
2
|
+
import Icon, { Icon as Icon$1 } from '@mdi/react';
|
|
3
|
+
import { mdiChevronUp, mdiChevronDown, mdiLoading, mdiInformationOutline, mdiAlertOctagonOutline, mdiAlertOutline, mdiCheckboxMarkedCircleOutline, mdiDotsHorizontal, mdiClose, mdiMinusCircle, mdiFolderPlusOutline, mdiChevronRight, mdiChevronLeft, mdiCheck } from '@mdi/js';
|
|
4
4
|
import Numeral from 'numeral';
|
|
5
5
|
import 'moment';
|
|
6
6
|
|
|
@@ -20,16 +20,6 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
20
20
|
***************************************************************************** */
|
|
21
21
|
/* global Reflect, Promise */
|
|
22
22
|
|
|
23
|
-
var __assign = function () {
|
|
24
|
-
__assign = Object.assign || function __assign(t) {
|
|
25
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
26
|
-
s = arguments[i];
|
|
27
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
28
|
-
}
|
|
29
|
-
return t;
|
|
30
|
-
};
|
|
31
|
-
return __assign.apply(this, arguments);
|
|
32
|
-
};
|
|
33
23
|
function __rest(s, e) {
|
|
34
24
|
var t = {};
|
|
35
25
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
@@ -38,25 +28,6 @@ function __rest(s, e) {
|
|
|
38
28
|
}
|
|
39
29
|
return t;
|
|
40
30
|
}
|
|
41
|
-
function __spreadArray(to, from, pack) {
|
|
42
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
43
|
-
if (ar || !(i in from)) {
|
|
44
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
45
|
-
ar[i] = from[i];
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
49
|
-
}
|
|
50
|
-
function __makeTemplateObject(cooked, raw) {
|
|
51
|
-
if (Object.defineProperty) {
|
|
52
|
-
Object.defineProperty(cooked, "raw", {
|
|
53
|
-
value: raw
|
|
54
|
-
});
|
|
55
|
-
} else {
|
|
56
|
-
cooked.raw = raw;
|
|
57
|
-
}
|
|
58
|
-
return cooked;
|
|
59
|
-
}
|
|
60
31
|
|
|
61
32
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
62
33
|
|
|
@@ -1991,7 +1962,7 @@ var qe = function (e) {
|
|
|
1991
1962
|
"production" !== process.env.NODE_ENV && "undefined" != typeof navigator && "ReactNative" === navigator.product && console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native"), "production" !== process.env.NODE_ENV && "test" !== process.env.NODE_ENV && "undefined" != typeof window && (window["__styled-components-init__"] = window["__styled-components-init__"] || 0, 1 === window["__styled-components-init__"] && console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."), window["__styled-components-init__"] += 1);
|
|
1992
1963
|
var styled = qe;
|
|
1993
1964
|
|
|
1994
|
-
|
|
1965
|
+
const Colors = {
|
|
1995
1966
|
PRIMARY: {
|
|
1996
1967
|
Hex: '#0193D7',
|
|
1997
1968
|
Rgb: '1, 147, 215',
|
|
@@ -2029,28 +2000,44 @@ var Colors = {
|
|
|
2029
2000
|
Rgb: '245, 245, 245',
|
|
2030
2001
|
},
|
|
2031
2002
|
};
|
|
2032
|
-
|
|
2003
|
+
const FontStyles = {
|
|
2033
2004
|
DEFAULT: '"Roboto", Helvetica, Arial, sans-serif',
|
|
2034
2005
|
HEADING: '"Roboto Slab", "Roboto", Helvetica, Arial, sans-serif',
|
|
2035
2006
|
};
|
|
2036
|
-
|
|
2007
|
+
const FontSizes = {
|
|
2037
2008
|
DEFAULT: '14px',
|
|
2038
2009
|
SMALL: '13px',
|
|
2039
2010
|
};
|
|
2040
2011
|
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2012
|
+
const Header$3 = styled.div `
|
|
2013
|
+
display: flex;
|
|
2014
|
+
align-items: center;
|
|
2015
|
+
justify-content: space-between;
|
|
2016
|
+
box-sizing: border-box;
|
|
2017
|
+
background: #f5f5f5;
|
|
2018
|
+
border: 1px solid #e5e5e5;
|
|
2019
|
+
padding: 14px 20px;
|
|
2020
|
+
height: 50px;
|
|
2021
|
+
cursor: pointer;
|
|
2022
|
+
`;
|
|
2023
|
+
const Title$1 = styled.div `
|
|
2024
|
+
font-size: ${FontSizes.DEFAULT};
|
|
2025
|
+
font-weight: 400;
|
|
2026
|
+
color: ${Colors.BLACK.Hex};
|
|
2027
|
+
line-height: 1.6em;
|
|
2028
|
+
font-family: ${FontStyles.DEFAULT};
|
|
2029
|
+
box-sizing: border-box;
|
|
2030
|
+
`;
|
|
2031
|
+
const Accordion = (_a) => {
|
|
2032
|
+
var { title, children, open, onClick } = _a, accessibleProps = __rest(_a, ["title", "children", "open", "onClick"]);
|
|
2045
2033
|
return (React.createElement(React.Fragment, null,
|
|
2046
|
-
React.createElement(Header$3,
|
|
2034
|
+
React.createElement(Header$3, Object.assign({ onClick: onClick }, accessibleProps),
|
|
2047
2035
|
React.createElement(Title$1, null, title),
|
|
2048
2036
|
React.createElement(Icon, { color: Colors.BLACK.Hex, path: open ? mdiChevronUp : mdiChevronDown, size: '24px' })),
|
|
2049
2037
|
open ? children : null));
|
|
2050
|
-
};
|
|
2051
|
-
var templateObject_1$q, templateObject_2$n;
|
|
2038
|
+
};
|
|
2052
2039
|
|
|
2053
|
-
|
|
2040
|
+
const button_type_mapping = {
|
|
2054
2041
|
primary: {
|
|
2055
2042
|
background_color: Colors.PRIMARY.Hex,
|
|
2056
2043
|
border_color: Colors.PRIMARY.Hex,
|
|
@@ -2073,7 +2060,12 @@ var button_type_mapping = {
|
|
|
2073
2060
|
badge_content_color: Colors.RED.Hex,
|
|
2074
2061
|
},
|
|
2075
2062
|
};
|
|
2076
|
-
|
|
2063
|
+
const StyledButton = styled.button `
|
|
2064
|
+
height: ${props => (props.$small ? '30px' : '40px')};
|
|
2065
|
+
line-height: 1em;
|
|
2066
|
+
border-radius: ${props => (props.$small ? '15px' : '20px')};
|
|
2067
|
+
margin: ${props => props.$margin || '0px'};
|
|
2068
|
+
padding: ${props => {
|
|
2077
2069
|
if (props.$hasChildren) {
|
|
2078
2070
|
if (props.$small) {
|
|
2079
2071
|
return '0 10px';
|
|
@@ -2083,9 +2075,10 @@ var StyledButton = styled.button(templateObject_1$p || (templateObject_1$p = __m
|
|
|
2083
2075
|
}
|
|
2084
2076
|
}
|
|
2085
2077
|
return '0px';
|
|
2086
|
-
}
|
|
2087
|
-
|
|
2088
|
-
|
|
2078
|
+
}};
|
|
2079
|
+
outline: none;
|
|
2080
|
+
background: ${props => props.$format ? button_type_mapping[props.$format].background_color : Colors.PRIMARY.Hex};
|
|
2081
|
+
width: ${props => {
|
|
2089
2082
|
if (props.$hasChildren) {
|
|
2090
2083
|
return 'auto';
|
|
2091
2084
|
}
|
|
@@ -2093,84 +2086,201 @@ var StyledButton = styled.button(templateObject_1$p || (templateObject_1$p = __m
|
|
|
2093
2086
|
return '30px';
|
|
2094
2087
|
}
|
|
2095
2088
|
return '40px';
|
|
2096
|
-
}
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2089
|
+
}};
|
|
2090
|
+
cursor: ${props => (props.$disabled ? 'default' : 'pointer')};
|
|
2091
|
+
display: flex;
|
|
2092
|
+
align-items: center;
|
|
2093
|
+
justify-content: center;
|
|
2094
|
+
opacity: ${props => (props.$disabled ? 0.6 : 0.9)};
|
|
2095
|
+
border-width: 1px;
|
|
2096
|
+
border-style: solid;
|
|
2097
|
+
border-color: ${props => props.$format ? button_type_mapping[props.$format].border_color : Colors.PRIMARY.Hex};
|
|
2098
|
+
box-sizing: border-box;
|
|
2099
|
+
&:hover {
|
|
2100
|
+
opacity: ${props => (props.$disabled ? 0.6 : 1)};
|
|
2101
|
+
}
|
|
2102
|
+
`;
|
|
2103
|
+
const Label$4 = styled.span `
|
|
2104
|
+
color: ${props => (props.$format ? button_type_mapping[props.$format].content_color : '#fff')};
|
|
2105
|
+
font-size: ${props => (props.$small ? FontSizes.SMALL : FontSizes.DEFAULT)};
|
|
2106
|
+
font-family: ${FontStyles.DEFAULT};
|
|
2107
|
+
font-weight: 500;
|
|
2108
|
+
line-height: 1;
|
|
2109
|
+
`;
|
|
2110
|
+
const StyledIcon$3 = styled.span `
|
|
2111
|
+
margin-left: ${props => (props.$hasChildren ? '6px' : '0px')};
|
|
2112
|
+
margin-right: ${props => (props.$hasChildren ? '-4px' : '0px')};
|
|
2113
|
+
display: flex;
|
|
2114
|
+
align-items: center;
|
|
2115
|
+
box-sizing: border-box;
|
|
2116
|
+
`;
|
|
2117
|
+
const Badge$1 = styled.span `
|
|
2118
|
+
width: ${props => (props.$small ? '20px' : '24px')};
|
|
2119
|
+
height: ${props => (props.$small ? '20px' : '24px')};
|
|
2120
|
+
line-height: 1;
|
|
2121
|
+
display: flex;
|
|
2122
|
+
align-items: center;
|
|
2123
|
+
justify-content: center;
|
|
2124
|
+
border-radius: 100%;
|
|
2125
|
+
background-color: ${props => props.$format ? button_type_mapping[props.$format].badge_bg_color : '#fff'};
|
|
2126
|
+
color: ${props => props.$format ? button_type_mapping[props.$format].badge_content_color : Colors.PRIMARY.Hex};
|
|
2127
|
+
font-size: ${props => (props.$small ? '10px' : '12px')};
|
|
2128
|
+
font-weight: 600;
|
|
2129
|
+
font-family: ${FontStyles.DEFAULT};
|
|
2130
|
+
letter-spacing: -1px;
|
|
2131
|
+
margin-left: ${props => (props.$small ? '5px' : '10px')};
|
|
2132
|
+
margin-right: ${props => (props.$small ? '-5px' : '-10px')};
|
|
2133
|
+
`;
|
|
2134
|
+
const Button = (_a) => {
|
|
2135
|
+
var { badge, children, disabled = false, icon, isForm = false, loading = false, margin = '', onClick, small = false, format = 'primary' } = _a, accessibleProps = __rest(_a, ["badge", "children", "disabled", "icon", "isForm", "loading", "margin", "onClick", "small", "format"]);
|
|
2136
|
+
const has_children = children && children.length > 0;
|
|
2137
|
+
return (React.createElement(StyledButton, Object.assign({ "$disabled": disabled || loading, "$format": format, "$hasChildren": !!has_children, "$margin": margin, "$small": small, onClick: disabled || loading ? undefined : onClick, type: isForm ? 'submit' : undefined }, accessibleProps),
|
|
2110
2138
|
children ? (React.createElement(Label$4, { "$format": format, "$small": small }, children)) : null,
|
|
2111
2139
|
icon && !badge ? (React.createElement(StyledIcon$3, { "$hasChildren": !!has_children },
|
|
2112
2140
|
React.createElement(Icon, { color: format ? button_type_mapping[format].content_color : '#fff', path: loading ? mdiLoading : icon, size: small ? '20px' : '24px', spin: loading }))) : null,
|
|
2113
2141
|
badge && !icon ? (React.createElement(Badge$1, { "$format": format, "$small": small }, badge)) : null));
|
|
2114
|
-
};
|
|
2115
|
-
var templateObject_1$p, templateObject_2$m, templateObject_3$i, templateObject_4$9;
|
|
2142
|
+
};
|
|
2116
2143
|
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2144
|
+
const StyledComponent = styled.p `
|
|
2145
|
+
color: ${props => Colors[props.$color || 'BLACK'].Hex};
|
|
2146
|
+
font-size: ${props => (props.$type === 'small' ? FontSizes.SMALL : FontSizes.DEFAULT)};
|
|
2147
|
+
line-height: ${props => (props.$type === 'small' ? '1.5em' : '1.6em')};
|
|
2148
|
+
letter-spacing: ${props => (props.$type === 'small' ? '1px' : '0px')};
|
|
2149
|
+
font-weight: ${props => (props.$type === 'bold' ? '500' : '400')};
|
|
2150
|
+
font-style: ${props => (props.$type === 'italic' ? 'italic' : 'normal')};
|
|
2151
|
+
text-decoration: ${props => ['underline', 'line-through'].includes(props.$type) ? props.$type : 'none'};
|
|
2152
|
+
font-family: 'Roboto', Helvetica, Arial, sans-serif;
|
|
2153
|
+
margin: ${props => props.$margin || '0px'};
|
|
2154
|
+
padding: ${props => props.$padding || '0px'};
|
|
2155
|
+
text-align: ${props => props.$align || 'left'};
|
|
2156
|
+
box-sizing: border-box;
|
|
2157
|
+
`;
|
|
2158
|
+
const Copy = ({ children, align = '', margin = '', padding = '', type = 'default', color = 'BLACK', }) => {
|
|
2122
2159
|
return (React.createElement(StyledComponent, { "$align": align, "$color": color, "$margin": margin, "$padding": padding, "$type": type }, children));
|
|
2123
2160
|
};
|
|
2124
2161
|
Copy.defaultProps = {
|
|
2125
2162
|
type: 'default',
|
|
2126
|
-
};
|
|
2127
|
-
var templateObject_1$o;
|
|
2163
|
+
};
|
|
2128
2164
|
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2165
|
+
const H1 = styled.h1 `
|
|
2166
|
+
color: ${Colors.BLACK.Hex};
|
|
2167
|
+
font-size: 30px;
|
|
2168
|
+
font-weight: ${props => (props.$bold ? '500' : '400')};
|
|
2169
|
+
line-height: 1.4em;
|
|
2170
|
+
font-family: 'Roboto Slab', Roboto, Helvetica, Arial, sans-serif;
|
|
2171
|
+
margin: ${props => props.$margin || '0px'};
|
|
2172
|
+
padding: ${props => props.$padding || '0px'};
|
|
2173
|
+
box-sizing: border-box;
|
|
2174
|
+
`;
|
|
2175
|
+
const H2 = styled.h2 `
|
|
2176
|
+
color: ${Colors.BLACK.Hex};
|
|
2177
|
+
font-size: 24px;
|
|
2178
|
+
font-weight: ${props => (props.$bold ? '500' : '400')};
|
|
2179
|
+
line-height: 1.33em;
|
|
2180
|
+
font-family: 'Roboto Slab', Roboto, Helvetica, Arial, sans-serif;
|
|
2181
|
+
margin: ${props => props.$margin || '0px'};
|
|
2182
|
+
padding: ${props => props.$padding || '0px'};
|
|
2183
|
+
box-sizing: border-box;
|
|
2184
|
+
`;
|
|
2185
|
+
const H3 = styled.h3 `
|
|
2186
|
+
color: ${Colors.BLACK.Hex};
|
|
2187
|
+
font-size: 18px;
|
|
2188
|
+
font-weight: ${props => (props.$bold ? '500' : '400')};
|
|
2189
|
+
line-height: 1.33em;
|
|
2190
|
+
font-family: 'Roboto Slab', Roboto, Helvetica, Arial, sans-serif;
|
|
2191
|
+
margin: ${props => props.$margin || '0px'};
|
|
2192
|
+
padding: ${props => props.$padding || '0px'};
|
|
2193
|
+
box-sizing: border-box;
|
|
2194
|
+
`;
|
|
2195
|
+
const Heading = (_a) => {
|
|
2196
|
+
var { bold, children, margin, padding, type } = _a, accessibleProps = __rest(_a, ["bold", "children", "margin", "padding", "type"]);
|
|
2134
2197
|
switch (type) {
|
|
2135
2198
|
case 'secondary': {
|
|
2136
|
-
return (React.createElement(H2,
|
|
2199
|
+
return (React.createElement(H2, Object.assign({ "$bold": bold, "$margin": margin, "$padding": padding }, accessibleProps), children));
|
|
2137
2200
|
}
|
|
2138
2201
|
case 'tertiary': {
|
|
2139
|
-
return (React.createElement(H3,
|
|
2202
|
+
return (React.createElement(H3, Object.assign({ "$bold": bold, "$margin": margin, "$padding": padding }, accessibleProps), children));
|
|
2140
2203
|
}
|
|
2141
2204
|
default: {
|
|
2142
|
-
return (React.createElement(H1,
|
|
2205
|
+
return (React.createElement(H1, Object.assign({ "$bold": bold, "$margin": margin, "$padding": padding }, accessibleProps), children));
|
|
2143
2206
|
}
|
|
2144
2207
|
}
|
|
2145
2208
|
};
|
|
2146
2209
|
Heading.defaultProps = {
|
|
2147
2210
|
bold: false,
|
|
2148
2211
|
type: 'primary',
|
|
2149
|
-
};
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2212
|
+
};
|
|
2213
|
+
|
|
2214
|
+
const Wrapper$h = styled.div `
|
|
2215
|
+
position: fixed;
|
|
2216
|
+
top: 0;
|
|
2217
|
+
right: 0;
|
|
2218
|
+
bottom: 0;
|
|
2219
|
+
left: 0;
|
|
2220
|
+
z-index: 9999;
|
|
2221
|
+
background: rgba(0, 0, 0, 0.8);
|
|
2222
|
+
display: flex;
|
|
2223
|
+
align-items: center;
|
|
2224
|
+
justify-content: center;
|
|
2225
|
+
box-sizing: border-box;
|
|
2226
|
+
`;
|
|
2227
|
+
const Container$3 = styled.dialog `
|
|
2228
|
+
max-width: 600px;
|
|
2229
|
+
width: auto;
|
|
2230
|
+
border-radius: 8px;
|
|
2231
|
+
overflow: hidden;
|
|
2232
|
+
box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.2);
|
|
2233
|
+
outline: none;
|
|
2234
|
+
border: none;
|
|
2235
|
+
position: relative;
|
|
2236
|
+
padding: 40px;
|
|
2237
|
+
text-align: center;
|
|
2238
|
+
box-sizing: border-box;
|
|
2239
|
+
`;
|
|
2240
|
+
const Buttons = styled.div `
|
|
2241
|
+
display: flex;
|
|
2242
|
+
gap: 10px;
|
|
2243
|
+
align-items: center;
|
|
2244
|
+
justify-content: center;
|
|
2245
|
+
margin-top: 30px;
|
|
2246
|
+
box-sizing: border-box;
|
|
2247
|
+
`;
|
|
2248
|
+
const ActionDialog = (_a) => {
|
|
2249
|
+
var { description, title, primaryButton, secondaryButton, tertiaryButton } = _a, accessibleProps = __rest(_a, ["description", "title", "primaryButton", "secondaryButton", "tertiaryButton"]);
|
|
2250
|
+
return (React.createElement(Wrapper$h, Object.assign({}, accessibleProps),
|
|
2158
2251
|
React.createElement(Container$3, { open: true },
|
|
2159
2252
|
title ? (React.createElement(Heading, { margin: '0px 0px 20px 0px', type: 'secondary' }, title)) : null,
|
|
2160
2253
|
description ? React.createElement(Copy, { align: 'center' }, description) : null,
|
|
2161
2254
|
primaryButton || secondaryButton || tertiaryButton ? (React.createElement(Buttons, null,
|
|
2162
|
-
tertiaryButton ? React.createElement(Button,
|
|
2163
|
-
secondaryButton ? React.createElement(Button,
|
|
2164
|
-
primaryButton ? (React.createElement(Button,
|
|
2165
|
-
};
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2255
|
+
tertiaryButton ? React.createElement(Button, Object.assign({}, tertiaryButton, { format: 'secondary' })) : null,
|
|
2256
|
+
secondaryButton ? React.createElement(Button, Object.assign({}, secondaryButton, { format: 'secondary' })) : null,
|
|
2257
|
+
primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { format: primaryButton.format === 'red' ? 'red' : 'primary' }))) : null)) : null)));
|
|
2258
|
+
};
|
|
2259
|
+
|
|
2260
|
+
const Wrapper$g = styled.div `
|
|
2261
|
+
border: 1px solid #f1f1f1;
|
|
2262
|
+
border-radius: 4px;
|
|
2263
|
+
border-left-width: 4px;
|
|
2264
|
+
box-shadow: 0px 4px 12px -6px rgba(0, 0, 0, 0.2);
|
|
2265
|
+
display: flex;
|
|
2266
|
+
align-items: flex-start;
|
|
2267
|
+
padding: 20px;
|
|
2268
|
+
box-sizing: border-box;
|
|
2269
|
+
`;
|
|
2270
|
+
const Content$3 = styled.div `
|
|
2271
|
+
margin-left: 20px;
|
|
2272
|
+
`;
|
|
2273
|
+
const Action$1 = styled.div `
|
|
2274
|
+
color: ${Colors.PRIMARY.Hex};
|
|
2275
|
+
font-size: ${FontSizes.DEFAULT};
|
|
2276
|
+
font-family: ${FontStyles.DEFAULT};
|
|
2277
|
+
font-weight: 500;
|
|
2278
|
+
cursor: pointer;
|
|
2279
|
+
margin-top: 6px;
|
|
2280
|
+
`;
|
|
2281
|
+
const Alert = (_a) => {
|
|
2282
|
+
var { action, type = 'info', title, description } = _a, accessibleProps = __rest(_a, ["action", "type", "title", "description"]);
|
|
2283
|
+
const type_mapping = {
|
|
2174
2284
|
info: {
|
|
2175
2285
|
color: Colors.PRIMARY.Hex,
|
|
2176
2286
|
icon: mdiInformationOutline,
|
|
@@ -2188,90 +2298,237 @@ var Alert = function (_a) {
|
|
|
2188
2298
|
icon: mdiCheckboxMarkedCircleOutline,
|
|
2189
2299
|
},
|
|
2190
2300
|
};
|
|
2191
|
-
return (React.createElement(Wrapper$
|
|
2301
|
+
return (React.createElement(Wrapper$g, Object.assign({}, accessibleProps, { style: { borderLeftColor: type_mapping[type].color } }),
|
|
2192
2302
|
React.createElement("div", { style: { flexShrink: 0 } },
|
|
2193
2303
|
React.createElement(Icon, { color: type_mapping[type].color, path: type_mapping[type].icon, size: '30px' })),
|
|
2194
|
-
React.createElement(Content$
|
|
2304
|
+
React.createElement(Content$3, null,
|
|
2195
2305
|
title ? (React.createElement(Heading, { bold: true, margin: '2px 0 0 0', type: 'tertiary' }, title)) : null,
|
|
2196
2306
|
description ? React.createElement(Copy, { margin: '6px 0 0 0 !important' }, description) : null,
|
|
2197
2307
|
action ? React.createElement(Action$1, { onClick: action.onClick }, action.label) : null)));
|
|
2198
|
-
};
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2308
|
+
};
|
|
2309
|
+
|
|
2310
|
+
const Wrapper$f = styled.div `
|
|
2311
|
+
border: 1px solid ${Colors.PRIMARY.Hex};
|
|
2312
|
+
border-radius: 8px;
|
|
2313
|
+
box-sizing: border-box;
|
|
2314
|
+
display: flex;
|
|
2315
|
+
align-items: center;
|
|
2316
|
+
justify-content: space-between;
|
|
2317
|
+
padding: 16px 20px;
|
|
2318
|
+
`;
|
|
2319
|
+
const Left = styled.div `
|
|
2320
|
+
box-sizing: border-box;
|
|
2321
|
+
display: flex;
|
|
2322
|
+
align-items: center;
|
|
2323
|
+
justify-content: space-between;
|
|
2324
|
+
flex-shrink: 0;
|
|
2325
|
+
`;
|
|
2326
|
+
const Info$1 = styled.div `
|
|
2327
|
+
box-sizing: border-box;
|
|
2328
|
+
display: flex;
|
|
2329
|
+
align-items: center;
|
|
2330
|
+
margin-right: 30px;
|
|
2331
|
+
`;
|
|
2332
|
+
const Selected = styled.span `
|
|
2333
|
+
font-size: 14px;
|
|
2334
|
+
font-weight: 400;
|
|
2335
|
+
font-family: ${FontStyles.DEFAULT};
|
|
2336
|
+
color: ${Colors.BLACK.Hex};
|
|
2337
|
+
line-height: 1;
|
|
2338
|
+
`;
|
|
2339
|
+
const Clear = styled.span `
|
|
2340
|
+
font-size: 14px;
|
|
2341
|
+
font-weight: 400;
|
|
2342
|
+
font-family: ${FontStyles.DEFAULT};
|
|
2343
|
+
color: ${Colors.PRIMARY.Hex};
|
|
2344
|
+
line-height: 1;
|
|
2345
|
+
cursor: pointer;
|
|
2346
|
+
padding-left: 10px;
|
|
2347
|
+
margin-left: 10px;
|
|
2348
|
+
border-left: 1px solid #ccc;
|
|
2349
|
+
`;
|
|
2350
|
+
const Actions$1 = styled.div `
|
|
2351
|
+
box-sizing: border-box;
|
|
2352
|
+
display: flex;
|
|
2353
|
+
align-items: center;
|
|
2354
|
+
column-gap: 10px;
|
|
2355
|
+
`;
|
|
2356
|
+
const Error$1 = styled.div `
|
|
2357
|
+
box-sizing: border-box;
|
|
2358
|
+
display: flex;
|
|
2359
|
+
align-items: center;
|
|
2360
|
+
background: rgba(${Colors.RED.Rgb}, 0.1);
|
|
2361
|
+
border-radius: 4px;
|
|
2362
|
+
padding: 6px 8px;
|
|
2363
|
+
text-overflow: ellipsis;
|
|
2364
|
+
white-space: nowrap;
|
|
2365
|
+
overflow: hidden;
|
|
2366
|
+
margin-left: 30px;
|
|
2367
|
+
`;
|
|
2368
|
+
const ErrorMsg = styled.span `
|
|
2369
|
+
font-size: 14px;
|
|
2370
|
+
font-weight: 500;
|
|
2371
|
+
font-family: ${FontStyles.DEFAULT};
|
|
2372
|
+
line-height: 1em;
|
|
2373
|
+
color: ${Colors.RED.Hex};
|
|
2374
|
+
margin-left: 8px;
|
|
2375
|
+
`;
|
|
2376
|
+
const BulkActionBar = (_a) => {
|
|
2377
|
+
var { actions = [], errorMsg, onClear, selectedCount = 0 } = _a, accessibleProps = __rest(_a, ["actions", "errorMsg", "onClear", "selectedCount"]);
|
|
2378
|
+
return (React.createElement(Wrapper$f, Object.assign({}, accessibleProps),
|
|
2212
2379
|
React.createElement(Left, null,
|
|
2213
|
-
React.createElement(Info, null,
|
|
2380
|
+
React.createElement(Info$1, null,
|
|
2214
2381
|
React.createElement(Selected, null,
|
|
2215
2382
|
selectedCount,
|
|
2216
2383
|
" Selected"),
|
|
2217
2384
|
onClear ? React.createElement(Clear, { onClick: onClear }, "Clear") : null),
|
|
2218
|
-
React.createElement(Actions, null, actions.map(
|
|
2385
|
+
React.createElement(Actions$1, null, actions.map(action => (React.createElement(Button, Object.assign({}, action, { small: true })))))),
|
|
2219
2386
|
errorMsg ? (React.createElement(Error$1, null,
|
|
2220
2387
|
React.createElement(Icon, { color: Colors.RED.Hex, path: mdiInformationOutline, size: '20px' }),
|
|
2221
2388
|
React.createElement(ErrorMsg, null, errorMsg))) : null));
|
|
2222
|
-
};
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2389
|
+
};
|
|
2390
|
+
|
|
2391
|
+
const Wrapper$e = styled.div `
|
|
2392
|
+
background: #fff;
|
|
2393
|
+
border-radius: 8px;
|
|
2394
|
+
box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.2);
|
|
2395
|
+
display: flex;
|
|
2396
|
+
flex-direction: column;
|
|
2397
|
+
gap: 4px;
|
|
2398
|
+
max-height: ${props => props.$maxHeight || '312px'};
|
|
2399
|
+
padding: 10px;
|
|
2400
|
+
width: 200px;
|
|
2401
|
+
`;
|
|
2402
|
+
const MenuItem = styled.div `
|
|
2403
|
+
align-items: center;
|
|
2404
|
+
border-radius: 8px;
|
|
2405
|
+
border: 1px solid transparent;
|
|
2406
|
+
display: flex;
|
|
2407
|
+
gap: 8px;
|
|
2408
|
+
height: 38px;
|
|
2409
|
+
padding: 8px;
|
|
2410
|
+
&:hover {
|
|
2411
|
+
background: rgba(1, 147, 215, 0.1);
|
|
2412
|
+
cursor: pointer;
|
|
2413
|
+
|
|
2414
|
+
svg,
|
|
2415
|
+
path {
|
|
2416
|
+
fill: ${Colors.PRIMARY.Hex} !important;
|
|
2417
|
+
}
|
|
2418
|
+
}
|
|
2419
|
+
`;
|
|
2420
|
+
const Title = styled.span `
|
|
2421
|
+
font-family: Roboto;
|
|
2422
|
+
font-size: 14px;
|
|
2423
|
+
font-weight: 400;
|
|
2424
|
+
height: auto;
|
|
2425
|
+
letter-spacing: 0px;
|
|
2426
|
+
line-height: 22px;
|
|
2427
|
+
text-align: left;
|
|
2428
|
+
`;
|
|
2429
|
+
const MoreMenu = (_a) => {
|
|
2430
|
+
var { maxHeight, menuItems = [] } = _a, accessibleProps = __rest(_a, ["maxHeight", "menuItems"]);
|
|
2431
|
+
return (React.createElement(Wrapper$e, Object.assign({ "$maxHeight": maxHeight }, accessibleProps), menuItems.map((item) => {
|
|
2432
|
+
return (React.createElement(MenuItem, { onClick: item.onClick },
|
|
2433
|
+
item.icon ? (React.createElement(Icon, { color: Colors.MEDIUM_GRAY.Hex, path: item.icon, size: '20px' })) : null,
|
|
2434
|
+
React.createElement(Title, null, item.label)));
|
|
2435
|
+
})));
|
|
2436
|
+
};
|
|
2437
|
+
|
|
2438
|
+
const Wrapper$d = styled.div `
|
|
2439
|
+
position: relative;
|
|
2440
|
+
display: inline-block;
|
|
2441
|
+
`;
|
|
2442
|
+
const StyledMoreMenu = styled(MoreMenu) `
|
|
2443
|
+
position: absolute;
|
|
2444
|
+
right: ${props => (props.$position === 'right' ? '0px' : 'auto')};
|
|
2445
|
+
left: ${props => (props.$position === 'left' ? '0px' : 'auto')};
|
|
2446
|
+
top: ${props => (props.$small ? '30px' : '40px')};
|
|
2447
|
+
z-index: 10;
|
|
2448
|
+
`;
|
|
2449
|
+
const ButtonMenu = ({ disabled, label, maxHeight, menuItems, small, position = 'right', }) => {
|
|
2450
|
+
const [show_menu, toggleMenu] = useState(false);
|
|
2451
|
+
return (React.createElement(Wrapper$d, { onMouseEnter: disabled ? undefined : toggleMenu.bind(null, true), onMouseLeave: disabled ? undefined : toggleMenu.bind(null, false) },
|
|
2452
|
+
React.createElement(Button, { disabled: disabled, format: 'primary', icon: mdiDotsHorizontal, small: small }, label),
|
|
2453
|
+
show_menu ? (React.createElement(StyledMoreMenu, { "$position": position, "$small": small, maxHeight: maxHeight, menuItems: menuItems })) : null));
|
|
2454
|
+
};
|
|
2455
|
+
|
|
2456
|
+
const Wrapper$c = styled.label `
|
|
2457
|
+
padding: 4px 0;
|
|
2458
|
+
cursor: ${props => (props.$disabled ? 'default' : 'pointer')};
|
|
2459
|
+
display: flex;
|
|
2460
|
+
align-items: flex-start;
|
|
2461
|
+
font-size: ${FontSizes.DEFAULT};
|
|
2462
|
+
line-height: 1.6em;
|
|
2463
|
+
box-sizing: border-box;
|
|
2464
|
+
`;
|
|
2465
|
+
const Input$2 = styled.input `
|
|
2466
|
+
font-size: 20px;
|
|
2467
|
+
margin: 5px 0px 0px 0px;
|
|
2468
|
+
line-height: 1.1em;
|
|
2469
|
+
box-sizing: border-box;
|
|
2470
|
+
`;
|
|
2471
|
+
const Label$3 = styled.span `
|
|
2472
|
+
font-family: ${FontStyles.DEFAULT};
|
|
2473
|
+
font-size: ${FontSizes.DEFAULT};
|
|
2474
|
+
font-weight: 400;
|
|
2475
|
+
line-height: 1.6em;
|
|
2476
|
+
color: ${Colors.BLACK.Hex};
|
|
2477
|
+
margin-left: 6px;
|
|
2478
|
+
box-sizing: border-box;
|
|
2479
|
+
`;
|
|
2480
|
+
const Checkbox = (_a) => {
|
|
2481
|
+
var { children, disabled, checked, onChange } = _a, accessibleProps = __rest(_a, ["children", "disabled", "checked", "onChange"]);
|
|
2482
|
+
return (React.createElement(Wrapper$c, Object.assign({}, accessibleProps),
|
|
2231
2483
|
React.createElement(Input$2, { checked: checked, disabled: disabled, name: accessibleProps.name, onChange: disabled ? undefined : onChange, type: 'checkbox' }),
|
|
2232
2484
|
children ? React.createElement(Label$3, null, children) : null));
|
|
2233
|
-
};
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2485
|
+
};
|
|
2486
|
+
|
|
2487
|
+
const SelectAll = styled.div `
|
|
2488
|
+
padding: 8px 12px;
|
|
2489
|
+
border-bottom: 1px solid ${Colors.LIGHT_GRAY.Hex};
|
|
2490
|
+
box-sizing: border-box;
|
|
2491
|
+
`;
|
|
2492
|
+
const Options$1 = styled.div `
|
|
2493
|
+
padding: 12px;
|
|
2494
|
+
box-sizing: border-box;
|
|
2495
|
+
`;
|
|
2496
|
+
const Checklist = (_a) => {
|
|
2497
|
+
var { disabled, onChange, options, selected = [], showSelectAll } = _a, accessibleProps = __rest(_a, ["disabled", "onChange", "options", "selected", "showSelectAll"]);
|
|
2498
|
+
const values = options.map((option) => option.value);
|
|
2499
|
+
const selected_options = options.filter(o => selected.includes(o.value));
|
|
2500
|
+
const handleToggleAll = () => {
|
|
2243
2501
|
if (selected_options.length === options.length) {
|
|
2244
2502
|
triggerChange([]);
|
|
2245
2503
|
}
|
|
2246
2504
|
else {
|
|
2247
|
-
triggerChange(options.map(
|
|
2505
|
+
triggerChange(options.map((option) => option.value));
|
|
2248
2506
|
}
|
|
2249
2507
|
};
|
|
2250
|
-
|
|
2251
|
-
|
|
2508
|
+
const handleChange = (option) => {
|
|
2509
|
+
const new_selected = selected_options.filter(o => o.value !== option.value).map(o => o.value);
|
|
2252
2510
|
if (!selected.includes(option.value)) {
|
|
2253
2511
|
new_selected.push(option.value);
|
|
2254
2512
|
}
|
|
2255
2513
|
// Mimic input event so it's easier to share onChange methods
|
|
2256
2514
|
triggerChange(new_selected);
|
|
2257
2515
|
};
|
|
2258
|
-
|
|
2516
|
+
const triggerChange = (value) => {
|
|
2259
2517
|
onChange({
|
|
2260
2518
|
target: {
|
|
2261
|
-
value
|
|
2519
|
+
value,
|
|
2262
2520
|
},
|
|
2263
2521
|
});
|
|
2264
2522
|
};
|
|
2265
2523
|
return (React.createElement(React.Fragment, null,
|
|
2266
2524
|
showSelectAll && values.length ? (React.createElement(SelectAll, null,
|
|
2267
2525
|
React.createElement(Checkbox, { checked: selected.length === values.length, disabled: disabled, onChange: handleToggleAll }, "Select All"))) : null,
|
|
2268
|
-
React.createElement(Options$1, null, options.map(
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
return (React.createElement(Checkbox,
|
|
2526
|
+
React.createElement(Options$1, null, options.map((option, i) => {
|
|
2527
|
+
const label = `${option.label || option.value}`;
|
|
2528
|
+
const checked = selected.includes(option.value);
|
|
2529
|
+
return (React.createElement(Checkbox, Object.assign({ key: i }, accessibleProps, { checked: checked, disabled: disabled, onChange: handleChange.bind(null, option) }), label));
|
|
2272
2530
|
}))));
|
|
2273
|
-
};
|
|
2274
|
-
var templateObject_1$i, templateObject_2$g;
|
|
2531
|
+
};
|
|
2275
2532
|
|
|
2276
2533
|
var dayjs_min = {exports: {}};
|
|
2277
2534
|
|
|
@@ -2591,51 +2848,82 @@ var dayjs_min = {exports: {}};
|
|
|
2591
2848
|
var dayjs_minExports = dayjs_min.exports;
|
|
2592
2849
|
var dayjs = /*@__PURE__*/getDefaultExportFromCjs(dayjs_minExports);
|
|
2593
2850
|
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
});
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2851
|
+
const Wrapper$b = styled.div `
|
|
2852
|
+
border-radius: 4px;
|
|
2853
|
+
height: 40px;
|
|
2854
|
+
background-color: ${props => (props.$readOnly ? '#f5f5f5' : '#ffffff')};
|
|
2855
|
+
position: relative;
|
|
2856
|
+
cursor: pointer;
|
|
2857
|
+
border-width: 1px;
|
|
2858
|
+
border-style: solid;
|
|
2859
|
+
border-color: ${props => (props.$invalid ? Colors.RED.Hex : '#cccccc')};
|
|
2860
|
+
border-radius: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.borderRadius) || '4px'};
|
|
2861
|
+
flex-grow: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.flexGrow) || 0};
|
|
2862
|
+
box-sizing: border-box;
|
|
2863
|
+
padding: 10px 0px;
|
|
2864
|
+
display: flex;
|
|
2865
|
+
align-items: center;
|
|
2866
|
+
width: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.width) || 'auto'};
|
|
2867
|
+
`;
|
|
2868
|
+
const Trigger$1 = styled.select `
|
|
2869
|
+
appearance: none;
|
|
2870
|
+
box-shadow: none;
|
|
2871
|
+
outline: none;
|
|
2872
|
+
border: none;
|
|
2873
|
+
color: ${Colors.BLACK.Hex};
|
|
2874
|
+
font-size: ${FontSizes.DEFAULT};
|
|
2875
|
+
font-weight: 400;
|
|
2876
|
+
font-family: ${FontStyles.DEFAULT};
|
|
2877
|
+
line-height: 2.9em;
|
|
2878
|
+
background-color: transparent;
|
|
2879
|
+
background-image: none;
|
|
2880
|
+
cursor: pointer;
|
|
2881
|
+
width: 100%;
|
|
2882
|
+
box-sizing: border-box;
|
|
2883
|
+
padding: 0px 30px 0px 10px;
|
|
2884
|
+
box-sizing: border-box;
|
|
2885
|
+
position: relative;
|
|
2886
|
+
z-index: 2;
|
|
2887
|
+
`;
|
|
2888
|
+
const IconWrapper$2 = styled(Icon) `
|
|
2889
|
+
position: absolute;
|
|
2890
|
+
right: 9px;
|
|
2891
|
+
z-index: 1;
|
|
2892
|
+
`;
|
|
2893
|
+
const Select = (_a) => {
|
|
2894
|
+
var { options, optionGroups, placeholder, readOnly, invalid, value, onChange, style } = _a, accessibleProps = __rest(_a, ["options", "optionGroups", "placeholder", "readOnly", "invalid", "value", "onChange", "style"]);
|
|
2895
|
+
return (React.createElement(Wrapper$b, { "$invalid": invalid, "$readOnly": readOnly, "$style": style },
|
|
2896
|
+
React.createElement(Trigger$1, Object.assign({ disabled: readOnly, onChange: onChange, placeholder: placeholder, value: value }, accessibleProps),
|
|
2610
2897
|
placeholder ? (React.createElement("option", { disabled: true, value: '' }, placeholder)) : null,
|
|
2611
2898
|
optionGroups &&
|
|
2612
|
-
optionGroups.map(
|
|
2613
|
-
return (React.createElement("optgroup", { key: i, label: group.label ||
|
|
2899
|
+
optionGroups.map((group, i) => {
|
|
2900
|
+
return (React.createElement("optgroup", { key: i, label: group.label || `Group ${i}` }, group.options.map((option, i) => {
|
|
2614
2901
|
return (React.createElement("option", { key: i, value: option.value }, option.label || option.value));
|
|
2615
2902
|
})));
|
|
2616
2903
|
}),
|
|
2617
2904
|
options &&
|
|
2618
|
-
options.map(
|
|
2905
|
+
options.map((option, i) => {
|
|
2619
2906
|
return (React.createElement("option", { key: i, value: option.value }, option.label || option.value));
|
|
2620
2907
|
})),
|
|
2621
2908
|
React.createElement(IconWrapper$2, { color: Colors.BLACK.Hex, path: mdiChevronDown, size: '22px' })));
|
|
2622
|
-
};
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2909
|
+
};
|
|
2910
|
+
|
|
2911
|
+
const DatePickerWrapper = styled.div `
|
|
2912
|
+
display: flex;
|
|
2913
|
+
width: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.width) || 'auto'};
|
|
2914
|
+
`;
|
|
2915
|
+
const Middle = styled.div `
|
|
2916
|
+
margin: 0px -1px;
|
|
2917
|
+
flex-grow: 1;
|
|
2918
|
+
`;
|
|
2919
|
+
const DatePicker = ({ readOnly = false, invalid = false, maxDate = null, minDate = null, date, onChange, style, }) => {
|
|
2920
|
+
const dMaxDate = maxDate ? dayjs(maxDate) : dayjs();
|
|
2921
|
+
const dMinDate = minDate ? dayjs(minDate) : dMaxDate.subtract(100, 'year');
|
|
2922
|
+
const [dDate, setDate] = useState(dayjs(date));
|
|
2923
|
+
const [dayOptions, setDayOptions] = useState(Array.from({ length: dDate.daysInMonth() - 1 }, (_, i) => ({
|
|
2636
2924
|
value: i + 1,
|
|
2637
|
-
})
|
|
2638
|
-
|
|
2925
|
+
})));
|
|
2926
|
+
const months = [
|
|
2639
2927
|
{ label: 'January', value: 1 },
|
|
2640
2928
|
{ label: 'Feburary', value: 2 },
|
|
2641
2929
|
{ label: 'March', value: 3 },
|
|
@@ -2649,14 +2937,14 @@ var DatePicker = function (_a) {
|
|
|
2649
2937
|
{ label: 'November', value: 11 },
|
|
2650
2938
|
{ label: 'December', value: 12 },
|
|
2651
2939
|
];
|
|
2652
|
-
|
|
2940
|
+
const years = Array.from({ length: dMaxDate.year() - dMinDate.year() + 1 }, (_, i) => ({
|
|
2653
2941
|
label: (dMinDate.year() + i).toString(),
|
|
2654
2942
|
value: dMinDate.year() + i,
|
|
2655
|
-
})
|
|
2656
|
-
useEffect(
|
|
2657
|
-
setDayOptions(Array.from({ length: dDate.daysInMonth() },
|
|
2943
|
+
}));
|
|
2944
|
+
useEffect(() => {
|
|
2945
|
+
setDayOptions(Array.from({ length: dDate.daysInMonth() }, (_, i) => ({
|
|
2658
2946
|
value: i + 1,
|
|
2659
|
-
})
|
|
2947
|
+
})));
|
|
2660
2948
|
// Mimicing browser event structure
|
|
2661
2949
|
onChange({
|
|
2662
2950
|
target: {
|
|
@@ -2664,19 +2952,19 @@ var DatePicker = function (_a) {
|
|
|
2664
2952
|
},
|
|
2665
2953
|
});
|
|
2666
2954
|
}, [dDate]);
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2955
|
+
const handleDayChange = (e) => {
|
|
2956
|
+
const date = parseInt(e.target.value, 10);
|
|
2957
|
+
const new_date = dDate.date(date);
|
|
2670
2958
|
setDate(new_date);
|
|
2671
2959
|
};
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2960
|
+
const handleMonthChange = (e) => {
|
|
2961
|
+
const month = parseInt(e.target.value, 10);
|
|
2962
|
+
const new_date = dDate.month(month - 1); // dayjs month is zero based
|
|
2675
2963
|
setDate(new_date);
|
|
2676
2964
|
};
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2965
|
+
const handleYearChange = (e) => {
|
|
2966
|
+
const year = parseInt(e.target.value, 10);
|
|
2967
|
+
const new_date = dDate.year(year);
|
|
2680
2968
|
setDate(new_date);
|
|
2681
2969
|
};
|
|
2682
2970
|
return (React.createElement(React.Fragment, null,
|
|
@@ -2685,37 +2973,71 @@ var DatePicker = function (_a) {
|
|
|
2685
2973
|
React.createElement(Middle, null,
|
|
2686
2974
|
React.createElement(Select, { invalid: invalid, onChange: handleDayChange, options: dayOptions, readOnly: readOnly, style: { borderRadius: '0px' }, value: dDate.format('D') })),
|
|
2687
2975
|
React.createElement(Select, { invalid: invalid, onChange: handleYearChange, options: years, readOnly: readOnly, style: { borderRadius: '0px 4px 4px 0px', flexGrow: 2 }, value: dDate.format('YYYY') }))));
|
|
2688
|
-
};
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
}
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
});
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2976
|
+
};
|
|
2977
|
+
|
|
2978
|
+
const Scrim$1 = styled.div `
|
|
2979
|
+
position: ${({ $position }) => $position};
|
|
2980
|
+
top: 0;
|
|
2981
|
+
right: 0;
|
|
2982
|
+
bottom: 0;
|
|
2983
|
+
left: 0;
|
|
2984
|
+
z-index: ${({ $position }) => ($position === 'fixed' ? 9998 : 10)};
|
|
2985
|
+
background: ${({ $scrim }) => ($scrim === 'dark' ? 'rgba(0,0,0,0.8)' : 'transparent')};
|
|
2986
|
+
`;
|
|
2987
|
+
const Container$2 = styled.div `
|
|
2988
|
+
z-index: ${({ $position }) => ($position === 'fixed' ? 9999 : 11)};
|
|
2989
|
+
min-width: 400px;
|
|
2990
|
+
width: ${({ $width }) => $width || '400px'};
|
|
2991
|
+
overflow: hidden;
|
|
2992
|
+
box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.2);
|
|
2993
|
+
outline: none;
|
|
2994
|
+
border: none;
|
|
2995
|
+
position: ${({ $position }) => $position};
|
|
2996
|
+
top: 0;
|
|
2997
|
+
right: 0;
|
|
2998
|
+
bottom: 0;
|
|
2999
|
+
padding: 0px;
|
|
3000
|
+
display: flex;
|
|
3001
|
+
flex-direction: column;
|
|
3002
|
+
box-sizing: border-box;
|
|
3003
|
+
background: #fff;
|
|
3004
|
+
`;
|
|
3005
|
+
const Header$2 = styled.div `
|
|
3006
|
+
padding: 30px 20px;
|
|
3007
|
+
display: flex;
|
|
3008
|
+
align-items: flex-start;
|
|
3009
|
+
box-sizing: border-box;
|
|
3010
|
+
flex-shrink: 0;
|
|
3011
|
+
background: #fff;
|
|
3012
|
+
`;
|
|
3013
|
+
const Close$1 = styled.div `
|
|
3014
|
+
margin-left: auto;
|
|
3015
|
+
display: flex;
|
|
3016
|
+
align-items: center;
|
|
3017
|
+
padding-left: 20px;
|
|
3018
|
+
cursor: pointer;
|
|
3019
|
+
`;
|
|
3020
|
+
const ContentWrapper$1 = styled.div `
|
|
3021
|
+
overflow-x: hidden;
|
|
3022
|
+
overflow-y: auto;
|
|
3023
|
+
box-sizing: border-box;
|
|
3024
|
+
flex: 1;
|
|
3025
|
+
background: #fff;
|
|
3026
|
+
`;
|
|
3027
|
+
const ButtonBar$1 = styled.div `
|
|
3028
|
+
padding: 20px;
|
|
3029
|
+
display: flex;
|
|
3030
|
+
align-items: center;
|
|
3031
|
+
justify-content: flex-end;
|
|
3032
|
+
box-sizing: border-box;
|
|
3033
|
+
gap: 10px;
|
|
3034
|
+
flex-shrink: 0;
|
|
3035
|
+
background: #fff;
|
|
3036
|
+
`;
|
|
3037
|
+
const Drawer = (_a) => {
|
|
3038
|
+
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"]);
|
|
3039
|
+
useEffect(() => {
|
|
3040
|
+
document.onkeydown = e => {
|
|
2719
3041
|
if (e.key === 'Escape') {
|
|
2720
3042
|
onClose();
|
|
2721
3043
|
}
|
|
@@ -2725,7 +3047,7 @@ var Drawer = function (_a) {
|
|
|
2725
3047
|
};
|
|
2726
3048
|
}, []);
|
|
2727
3049
|
return (React.createElement(React.Fragment, null,
|
|
2728
|
-
React.createElement(Container$2,
|
|
3050
|
+
React.createElement(Container$2, Object.assign({}, accessibleProps, { "$position": position, "$width": width }),
|
|
2729
3051
|
React.createElement(Header$2, null,
|
|
2730
3052
|
React.createElement("div", null,
|
|
2731
3053
|
title ? React.createElement(Heading, { type: 'secondary' }, title) : null,
|
|
@@ -2734,16 +3056,25 @@ var Drawer = function (_a) {
|
|
|
2734
3056
|
React.createElement(Button, { format: 'secondary', icon: mdiClose, small: true }))),
|
|
2735
3057
|
React.createElement(ContentWrapper$1, null, children),
|
|
2736
3058
|
primaryButton || secondaryButton || tertiaryButton ? (React.createElement(ButtonBar$1, null,
|
|
2737
|
-
tertiaryButton ? React.createElement(Button,
|
|
2738
|
-
secondaryButton ? React.createElement(Button,
|
|
2739
|
-
primaryButton ? React.createElement(Button,
|
|
3059
|
+
tertiaryButton ? React.createElement(Button, Object.assign({}, tertiaryButton, { format: 'secondary' })) : null,
|
|
3060
|
+
secondaryButton ? React.createElement(Button, Object.assign({}, secondaryButton, { format: 'secondary' })) : null,
|
|
3061
|
+
primaryButton ? React.createElement(Button, Object.assign({}, primaryButton, { format: 'primary' })) : null)) : null),
|
|
2740
3062
|
scrim ? React.createElement(Scrim$1, { "$position": position, "$scrim": scrim, onClick: onClose }) : null));
|
|
2741
|
-
};
|
|
2742
|
-
var templateObject_1$f, templateObject_2$d, templateObject_3$b, templateObject_4$7, templateObject_5$5, templateObject_6$3;
|
|
3063
|
+
};
|
|
2743
3064
|
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
3065
|
+
const Wrapper$a = styled.div `
|
|
3066
|
+
display: inline-block;
|
|
3067
|
+
position: relative;
|
|
3068
|
+
height: 16px;
|
|
3069
|
+
`;
|
|
3070
|
+
const StyledIcon$2 = styled(Icon) `
|
|
3071
|
+
width: 16px;
|
|
3072
|
+
height: 16px;
|
|
3073
|
+
padding: 0px 6px;
|
|
3074
|
+
color: ${Colors.PRIMARY.Hex};
|
|
3075
|
+
cursor: pointer;
|
|
3076
|
+
`;
|
|
3077
|
+
const positions = {
|
|
2747
3078
|
'right-top': {
|
|
2748
3079
|
top: '0px',
|
|
2749
3080
|
left: '28px',
|
|
@@ -2771,177 +3102,357 @@ var positions = {
|
|
|
2771
3102
|
transform: 'translateY(-50%)',
|
|
2772
3103
|
},
|
|
2773
3104
|
};
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
return (React.createElement(Wrapper$b, { onMouseEnter: toggleContent.bind(null, true), onMouseLeave: toggleContent.bind(null, false) },
|
|
3105
|
+
const Content$2 = styled.div(props => (Object.assign({ position: 'absolute', borderRadius: '4px', borderWidth: '1px', borderStyle: 'solid', borderColor: Colors.PRIMARY.Hex, background: '#ffffff', boxShadow: '0px 5px 30px -10px rgba(0, 0, 0, 0.5)', width: props.$width || '240px', padding: '10px 12px', zIndex: 10 }, positions[props.$position])));
|
|
3106
|
+
const Tooltip = ({ children, position = 'right-top', width = '240px' }) => {
|
|
3107
|
+
const [show_content, toggleContent] = useState(false);
|
|
3108
|
+
return (React.createElement(Wrapper$a, { onMouseEnter: toggleContent.bind(null, true), onMouseLeave: toggleContent.bind(null, false) },
|
|
2779
3109
|
React.createElement(StyledIcon$2, { path: mdiInformationOutline }),
|
|
2780
|
-
show_content ? (React.createElement(Content$
|
|
2781
|
-
};
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
3110
|
+
show_content ? (React.createElement(Content$2, { "$position": position, "$width": width }, children && React.createElement(Copy, { type: 'small' }, children))) : null));
|
|
3111
|
+
};
|
|
3112
|
+
|
|
3113
|
+
const Wrapper$9 = styled.div(props => (Object.assign({ margin: '0px 0px 18px 0px' }, props.style)));
|
|
3114
|
+
const LabelRow = styled.div `
|
|
3115
|
+
display: flex;
|
|
3116
|
+
align-items: center;
|
|
3117
|
+
justify-content: space-between;
|
|
3118
|
+
margin: 0 0 4px 0;
|
|
3119
|
+
box-sizing: border-box;
|
|
3120
|
+
`;
|
|
3121
|
+
const Label$2 = styled.label `
|
|
3122
|
+
font-size: ${FontSizes.DEFAULT};
|
|
3123
|
+
font-weight: 500;
|
|
3124
|
+
line-height: 1em;
|
|
3125
|
+
font-family: ${FontStyles.DEFAULT};
|
|
3126
|
+
color: ${Colors.BLACK.Hex};
|
|
3127
|
+
display: flex;
|
|
3128
|
+
align-items: center;
|
|
3129
|
+
`;
|
|
3130
|
+
const Required = styled.span `
|
|
3131
|
+
color: ${Colors.RED.Hex};
|
|
3132
|
+
margin-left: 4px;
|
|
3133
|
+
`;
|
|
3134
|
+
const Action = styled.span `
|
|
3135
|
+
font-size: ${FontSizes.DEFAULT};
|
|
3136
|
+
font-weight: 500;
|
|
3137
|
+
line-height: 1em;
|
|
3138
|
+
font-family: ${FontStyles.DEFAULT};
|
|
3139
|
+
color: ${Colors.PRIMARY.Hex};
|
|
3140
|
+
cursor: pointer;
|
|
3141
|
+
`;
|
|
3142
|
+
const Description = styled.div `
|
|
3143
|
+
font-size: ${FontSizes.SMALL};
|
|
3144
|
+
font-weight: 400;
|
|
3145
|
+
line-height: 1.3em;
|
|
3146
|
+
font-family: ${FontStyles.DEFAULT};
|
|
3147
|
+
color: ${Colors.BLACK.Hex};
|
|
3148
|
+
margin: 0 0 8px 0;
|
|
3149
|
+
box-sizing: border-box;
|
|
3150
|
+
`;
|
|
3151
|
+
const Validation = styled.div `
|
|
3152
|
+
font-size: ${FontSizes.SMALL};
|
|
3153
|
+
font-weight: 400;
|
|
3154
|
+
line-height: 1.3em;
|
|
3155
|
+
font-family: ${FontStyles.DEFAULT};
|
|
3156
|
+
color: ${Colors.RED.Hex};
|
|
3157
|
+
margin: 4px 0 0 0;
|
|
3158
|
+
box-sizing: border-box;
|
|
3159
|
+
`;
|
|
3160
|
+
const Field = (_a) => {
|
|
3161
|
+
var { action, children, validationText, label, description, required, htmlFor, style, tooltip } = _a, accessibleProps = __rest(_a, ["action", "children", "validationText", "label", "description", "required", "htmlFor", "style", "tooltip"]);
|
|
3162
|
+
return (React.createElement(Wrapper$9, Object.assign({ style: style }, accessibleProps),
|
|
2794
3163
|
React.createElement(LabelRow, null,
|
|
2795
3164
|
React.createElement(Label$2, { htmlFor: htmlFor },
|
|
2796
3165
|
label,
|
|
2797
3166
|
required ? React.createElement(Required, null, "*") : null,
|
|
2798
|
-
tooltip ? React.createElement(Tooltip,
|
|
3167
|
+
tooltip ? React.createElement(Tooltip, Object.assign({}, tooltip)) : null),
|
|
2799
3168
|
action ? React.createElement(Action, { onClick: action.onClick }, action.label) : null),
|
|
2800
3169
|
description ? React.createElement(Description, null, description) : null,
|
|
2801
3170
|
children,
|
|
2802
3171
|
validationText ? React.createElement(Validation, null, validationText) : null));
|
|
2803
|
-
};
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
3172
|
+
};
|
|
3173
|
+
|
|
3174
|
+
const Dropzone = styled.div `
|
|
3175
|
+
border-radius: 8px;
|
|
3176
|
+
border-width: 1px;
|
|
3177
|
+
border-style: dashed;
|
|
3178
|
+
border-color: ${props => (props.$dragging ? Colors.PRIMARY.Hex : '#cccccc')};
|
|
3179
|
+
background: ${props => (props.$dragging ? `rgba(${Colors.PRIMARY.Rgb}, 0.05)` : '#ffffff')};
|
|
3180
|
+
cursor: copy;
|
|
3181
|
+
`;
|
|
3182
|
+
const IconWrapper$1 = styled.div `
|
|
3183
|
+
width: 80px;
|
|
3184
|
+
height: 80px;
|
|
3185
|
+
border-radius: 40px;
|
|
3186
|
+
background: ${props => (props.$dragging ? '#ffffff' : '#f5f5f5')};
|
|
3187
|
+
display: flex;
|
|
3188
|
+
align-items: center;
|
|
3189
|
+
justify-content: center;
|
|
3190
|
+
`;
|
|
3191
|
+
const StyledIcon$1 = styled(Icon) `
|
|
3192
|
+
width: 40px !important;
|
|
3193
|
+
height: 40px !important;
|
|
3194
|
+
|
|
3195
|
+
> path {
|
|
3196
|
+
fill: ${Colors.GRAY.Hex} !important;
|
|
3197
|
+
}
|
|
3198
|
+
`;
|
|
3199
|
+
const ClickZone = styled.div `
|
|
3200
|
+
margin: 40px 20px;
|
|
3201
|
+
display: flex;
|
|
3202
|
+
flex-direction: column;
|
|
3203
|
+
align-items: center;
|
|
3204
|
+
gap: 16px;
|
|
3205
|
+
`;
|
|
3206
|
+
const Content$1 = styled.div `
|
|
3207
|
+
display: flex;
|
|
3208
|
+
flex-direction: column;
|
|
3209
|
+
align-items: center;
|
|
3210
|
+
gap: 2px;
|
|
3211
|
+
`;
|
|
3212
|
+
const Files = styled.div `
|
|
3213
|
+
display: flex;
|
|
3214
|
+
flex-direction: column;
|
|
3215
|
+
align-self: stretch;
|
|
3216
|
+
gap: 10px;
|
|
3217
|
+
margin: 20px;
|
|
3218
|
+
`;
|
|
3219
|
+
const File = styled.div `
|
|
3220
|
+
display: flex;
|
|
3221
|
+
padding: 10px;
|
|
3222
|
+
align-items: center;
|
|
3223
|
+
justify-content: space-between;
|
|
3224
|
+
gap: 10px;
|
|
3225
|
+
border-radius: 4px;
|
|
3226
|
+
border: 1px solid #cccccc;
|
|
3227
|
+
background: #ffffff;
|
|
3228
|
+
`;
|
|
3229
|
+
const Remove$1 = styled(Icon) `
|
|
3230
|
+
width: 24px;
|
|
3231
|
+
height: 24px;
|
|
3232
|
+
cursor: pointer;
|
|
3233
|
+
|
|
3234
|
+
> path {
|
|
3235
|
+
fill: ${Colors.RED.Hex} !important;
|
|
3236
|
+
}
|
|
3237
|
+
`;
|
|
3238
|
+
const FileUpload = ({ accept, onChange, onError, maxFiles = 10, maxSize = 2, message, validateFile, }) => {
|
|
3239
|
+
const inputRef = useRef(null);
|
|
3240
|
+
const [files, setFiles] = useState([]);
|
|
3241
|
+
const [dragging, setDragging] = useState(false);
|
|
3242
|
+
const [allowMoreFiles, setAllowMoreFiles] = useState(true);
|
|
3243
|
+
const handleDrag = (e) => {
|
|
3244
|
+
e.preventDefault();
|
|
3245
|
+
e.stopPropagation();
|
|
3246
|
+
if (e.type === 'dragenter' || e.type === 'dragover') {
|
|
3247
|
+
setDragging(true);
|
|
3248
|
+
}
|
|
3249
|
+
else if (e.type === 'dragleave') {
|
|
3250
|
+
setDragging(false);
|
|
3251
|
+
}
|
|
3252
|
+
};
|
|
3253
|
+
const handleDrop = (e) => {
|
|
3254
|
+
var _a, _b;
|
|
3255
|
+
e.preventDefault();
|
|
3256
|
+
e.stopPropagation();
|
|
3257
|
+
setDragging(true);
|
|
3258
|
+
if ((_a = e.dataTransfer) === null || _a === void 0 ? void 0 : _a.items) {
|
|
3259
|
+
const newFiles = [];
|
|
3260
|
+
[...e.dataTransfer.items].forEach(file => {
|
|
3261
|
+
if (file.kind === 'file') {
|
|
3262
|
+
const f = file.getAsFile();
|
|
3263
|
+
if (f) {
|
|
3264
|
+
newFiles.push(f);
|
|
3265
|
+
}
|
|
2846
3266
|
}
|
|
2847
3267
|
});
|
|
2848
|
-
|
|
3268
|
+
addFiles(newFiles);
|
|
2849
3269
|
}
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
onChange(files);
|
|
2853
|
-
}, [files]);
|
|
2854
|
-
var assignFiles = function (newFiles) {
|
|
2855
|
-
var _loop_1 = function (i) {
|
|
2856
|
-
if (newFiles[i].size < MAX_FILE_SIZE) {
|
|
2857
|
-
setFiles(function (files) { return __spreadArray(__spreadArray([], files, true), [{ file: newFiles[i], uploadProgress: 0 }], false); });
|
|
2858
|
-
}
|
|
2859
|
-
};
|
|
2860
|
-
for (var i = 0; i < newFiles.length; i++) {
|
|
2861
|
-
_loop_1(i);
|
|
3270
|
+
else if ((_b = e.dataTransfer) === null || _b === void 0 ? void 0 : _b.files) {
|
|
3271
|
+
addFiles([...e.dataTransfer.files]);
|
|
2862
3272
|
}
|
|
3273
|
+
setDragging(false);
|
|
2863
3274
|
};
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
assignFiles(Array.from(e.dataTransfer.files || []));
|
|
3275
|
+
const handleChange = (e) => {
|
|
3276
|
+
const input = e.target;
|
|
3277
|
+
if (input.files) {
|
|
3278
|
+
addFiles([...input.files]);
|
|
3279
|
+
}
|
|
2870
3280
|
};
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
3281
|
+
const addFiles = (addedFiles) => {
|
|
3282
|
+
const newFiles = [];
|
|
3283
|
+
const errors = [];
|
|
3284
|
+
addedFiles.forEach(file => {
|
|
3285
|
+
let valid = true;
|
|
3286
|
+
if (accept) {
|
|
3287
|
+
if (!accept.includes(file.type)) {
|
|
3288
|
+
valid = false;
|
|
3289
|
+
errors.push({
|
|
3290
|
+
file,
|
|
3291
|
+
message: 'File type is not permitted.',
|
|
3292
|
+
});
|
|
3293
|
+
}
|
|
3294
|
+
}
|
|
3295
|
+
if (file.size > maxSize * 1000000 || files.length + newFiles.length === maxFiles) {
|
|
3296
|
+
valid = false;
|
|
3297
|
+
errors.push({
|
|
3298
|
+
file,
|
|
3299
|
+
message: 'File size exceeds limit.',
|
|
3300
|
+
});
|
|
3301
|
+
}
|
|
3302
|
+
if (validateFile && !validateFile(file)) {
|
|
3303
|
+
valid = false;
|
|
3304
|
+
}
|
|
3305
|
+
if (valid) {
|
|
3306
|
+
newFiles.push(file);
|
|
3307
|
+
}
|
|
3308
|
+
});
|
|
3309
|
+
if (errors.length && onError) {
|
|
3310
|
+
onError(errors);
|
|
3311
|
+
}
|
|
3312
|
+
setFiles([...files, ...newFiles]);
|
|
2874
3313
|
};
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
3314
|
+
const triggerFileExplorer = () => {
|
|
3315
|
+
if (inputRef.current) {
|
|
3316
|
+
inputRef.current.click();
|
|
3317
|
+
}
|
|
2878
3318
|
};
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
newArray.splice(index, 1);
|
|
2882
|
-
setFiles(newArray);
|
|
2883
|
-
onFileDelete(files[index]);
|
|
3319
|
+
const handleRemove = (file) => {
|
|
3320
|
+
setFiles(files.filter(f => f !== file));
|
|
2884
3321
|
};
|
|
3322
|
+
useEffect(() => {
|
|
3323
|
+
if (onChange) {
|
|
3324
|
+
onChange(files);
|
|
3325
|
+
}
|
|
3326
|
+
if (files.length < maxFiles) {
|
|
3327
|
+
setAllowMoreFiles(true);
|
|
3328
|
+
}
|
|
3329
|
+
else {
|
|
3330
|
+
setAllowMoreFiles(false);
|
|
3331
|
+
}
|
|
3332
|
+
}, [files]);
|
|
2885
3333
|
return (React.createElement(React.Fragment, null,
|
|
2886
|
-
React.createElement(
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
return (React.createElement(File, { key:
|
|
2890
|
-
React.createElement(Copy, {
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
React.createElement(
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
React.createElement(Copy, { align: 'center', children: 'Drag & drop files here or click to choose', type: 'bold' }),
|
|
2901
|
-
React.createElement(Copy, { align: 'center', children: "".concat(maxFileSize, " MB max file size"), color: 'GRAY' }))))));
|
|
2902
|
-
};
|
|
2903
|
-
var templateObject_1$c, templateObject_2$a, templateObject_3$9, templateObject_4$5, templateObject_5$3, templateObject_6$1, templateObject_7$1, templateObject_8$1;
|
|
3334
|
+
React.createElement("input", { accept: accept, multiple: true, onChange: allowMoreFiles ? handleChange : undefined, ref: inputRef, style: { display: 'none' }, type: 'file' }),
|
|
3335
|
+
React.createElement(Dropzone, { "$dragging": dragging, onDragEnter: allowMoreFiles ? handleDrag : undefined, onDragLeave: allowMoreFiles ? handleDrag : undefined, onDragOver: allowMoreFiles ? handleDrag : undefined, onDrop: allowMoreFiles ? handleDrop : undefined },
|
|
3336
|
+
files.length ? (React.createElement(Files, null, files.map(file => {
|
|
3337
|
+
return (React.createElement(File, { key: file.name },
|
|
3338
|
+
React.createElement(Copy, { type: 'bold' }, file.name),
|
|
3339
|
+
React.createElement(Remove$1, { onClick: handleRemove.bind(null, file), path: mdiMinusCircle })));
|
|
3340
|
+
}))) : null,
|
|
3341
|
+
allowMoreFiles ? (React.createElement(ClickZone, { onClick: triggerFileExplorer },
|
|
3342
|
+
files.length ? null : (React.createElement(IconWrapper$1, { "$dragging": dragging },
|
|
3343
|
+
React.createElement(StyledIcon$1, { path: mdiFolderPlusOutline }))),
|
|
3344
|
+
React.createElement(Content$1, null,
|
|
3345
|
+
React.createElement(Copy, { align: 'center', type: 'bold' }, "Drag & drop files here or click to select files"),
|
|
3346
|
+
message ? (React.createElement(Copy, { align: 'center', color: 'GRAY' }, message)) : null))) : null)));
|
|
3347
|
+
};
|
|
2904
3348
|
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
3349
|
+
const formatAsPhone = (number) => {
|
|
3350
|
+
let formatted_value = `${number}`.replace(/[^0-9.]/g, '');
|
|
3351
|
+
const size = formatted_value.length;
|
|
2908
3352
|
if (size < 1) ;
|
|
2909
3353
|
else if (size < 4) {
|
|
2910
|
-
formatted_value =
|
|
3354
|
+
formatted_value = `(${formatted_value}`;
|
|
2911
3355
|
}
|
|
2912
3356
|
else if (size < 7) {
|
|
2913
|
-
formatted_value =
|
|
3357
|
+
formatted_value = `(${formatted_value.substring(0, 3)}) ${formatted_value.substring(3, 6)}`;
|
|
2914
3358
|
}
|
|
2915
3359
|
else {
|
|
2916
|
-
formatted_value =
|
|
3360
|
+
formatted_value = `(${formatted_value.substring(0, 3)}) ${formatted_value.substring(3, 6)}-${formatted_value.substring(6, 10)}`;
|
|
2917
3361
|
}
|
|
2918
3362
|
return formatted_value;
|
|
2919
3363
|
};
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
3364
|
+
const formatAsSsn = (number) => {
|
|
3365
|
+
let formatted_value = `${number}`.replace(/[^0-9.]/g, '');
|
|
3366
|
+
const size = formatted_value.length;
|
|
2923
3367
|
if (size > 3 && size < 6) {
|
|
2924
|
-
formatted_value =
|
|
3368
|
+
formatted_value = `${formatted_value.substring(0, 3)}-${formatted_value.substring(3, 5)}`;
|
|
2925
3369
|
}
|
|
2926
3370
|
else if (size > 5) {
|
|
2927
|
-
formatted_value =
|
|
3371
|
+
formatted_value = `${formatted_value.substring(0, 3)}-${formatted_value.substring(3, 5)}-${formatted_value.substring(5, 9)}`;
|
|
2928
3372
|
}
|
|
2929
3373
|
return formatted_value;
|
|
2930
3374
|
};
|
|
2931
3375
|
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
}
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
3376
|
+
const StyledInput = styled.input `
|
|
3377
|
+
background-color: ${props => (props.$readOnly ? '#f5f5f5' : '#ffffff')};
|
|
3378
|
+
border-radius: ${props => (props.$suffix ? '4px 0px 0px 4px' : '4px')};
|
|
3379
|
+
border-width: 1px;
|
|
3380
|
+
border-style: solid;
|
|
3381
|
+
border-color: ${props => (props.$invalid && !props.$readOnly ? Colors.RED.Hex : '#cccccc')};
|
|
3382
|
+
font-size: ${FontSizes.DEFAULT};
|
|
3383
|
+
font-weight: 400;
|
|
3384
|
+
font-family: ${FontStyles.DEFAULT};
|
|
3385
|
+
line-height: 1.28em;
|
|
3386
|
+
color: ${props => (props.$invalid && !props.$readOnly ? Colors.RED.Hex : Colors.BLACK.Hex)};
|
|
3387
|
+
position: relative;
|
|
3388
|
+
height: auto;
|
|
3389
|
+
padding: 10px;
|
|
3390
|
+
opacity: ${props => (props.$readOnly ? 0.6 : 1)};
|
|
3391
|
+
box-shadow: none;
|
|
3392
|
+
outline: none;
|
|
3393
|
+
margin: 0px;
|
|
3394
|
+
text-indent: 0px;
|
|
3395
|
+
--webkit-appearance: none;
|
|
3396
|
+
box-sizing: border-box;
|
|
3397
|
+
display: block;
|
|
3398
|
+
width: 100%;
|
|
3399
|
+
&:focus {
|
|
3400
|
+
border-color: ${props => (props.$readOnly ? '#cccccc' : Colors.PRIMARY.Hex)};
|
|
3401
|
+
}
|
|
3402
|
+
`;
|
|
3403
|
+
const StyledSuffix = styled.div `
|
|
3404
|
+
box-sizing: border-box;
|
|
3405
|
+
display: flex;
|
|
3406
|
+
justify-content: center;
|
|
3407
|
+
align-items: center;
|
|
3408
|
+
padding: 10px;
|
|
3409
|
+
height: auto;
|
|
3410
|
+
background: #f5f5f5;
|
|
3411
|
+
border-width: 1px 1px 1px 0px;
|
|
3412
|
+
border-style: solid;
|
|
3413
|
+
border-color: #cccccc;
|
|
3414
|
+
border-radius: 0px 4px 4px 0px;
|
|
3415
|
+
font-family: ${FontStyles.DEFAULT};
|
|
3416
|
+
font-style: normal;
|
|
3417
|
+
font-weight: 400;
|
|
3418
|
+
font-size: ${FontSizes.DEFAULT};
|
|
3419
|
+
color: Colors.BLACK.Hex;
|
|
3420
|
+
`;
|
|
3421
|
+
const StyledWrapper = styled.div `
|
|
3422
|
+
display: flex;
|
|
3423
|
+
width: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.width) || 'auto'};
|
|
3424
|
+
`;
|
|
3425
|
+
const StyledTextarea = styled.textarea `
|
|
3426
|
+
background-color: ${props => (props.$readOnly ? '#f5f5f5' : '#ffffff')};
|
|
3427
|
+
border-radius: 4px;
|
|
3428
|
+
border-width: 1px;
|
|
3429
|
+
border-style: solid;
|
|
3430
|
+
border-color: ${props => (props.$invalid && !props.$readOnly ? Colors.RED.Hex : '#cccccc')};
|
|
3431
|
+
font-size: ${FontSizes.DEFAULT};
|
|
3432
|
+
font-weight: 400;
|
|
3433
|
+
font-family: ${FontStyles.DEFAULT};
|
|
3434
|
+
line-height: 1.6em;
|
|
3435
|
+
color: ${props => (props.$invalid && !props.$readOnly ? Colors.RED.Hex : Colors.BLACK.Hex)};
|
|
3436
|
+
position: relative;
|
|
3437
|
+
height: ${props => props.$height || '40px'};
|
|
3438
|
+
padding: 10px;
|
|
3439
|
+
opacity: ${props => (props.$readOnly ? 0.6 : 1)};
|
|
3440
|
+
box-shadow: none;
|
|
3441
|
+
outline: none;
|
|
3442
|
+
padding: 10px,
|
|
3443
|
+
margin: 0px,
|
|
3444
|
+
text-indent: 0px,
|
|
3445
|
+
--webkit-appearance: none;
|
|
3446
|
+
box-sizing: border-box;
|
|
3447
|
+
display: block;
|
|
3448
|
+
width: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.width) || 'auto'};
|
|
3449
|
+
&:focus {
|
|
3450
|
+
border-color: ${props => (props.$readOnly ? '#cccccc' : Colors.PRIMARY.Hex)};
|
|
3451
|
+
}
|
|
3452
|
+
`;
|
|
3453
|
+
const Input$1 = (_a) => {
|
|
3454
|
+
var { format, suffix, height, invalid, max, maxLength, min, onBlur, onChange, onKeyDown, placeholder, readOnly, step, style, type = 'text', value = '' } = _a, accessibleProps = __rest(_a, ["format", "suffix", "height", "invalid", "max", "maxLength", "min", "onBlur", "onChange", "onKeyDown", "placeholder", "readOnly", "step", "style", "type", "value"]);
|
|
3455
|
+
const handleInputChange = (e) => {
|
|
2945
3456
|
if (format === 'currency' || format === 'currency_decimal') {
|
|
2946
3457
|
e.target.value = e.target.value.replace(/[^0-9.]/g, '');
|
|
2947
3458
|
}
|
|
@@ -2955,44 +3466,55 @@ var Input$1 = function (_a) {
|
|
|
2955
3466
|
e.target.value = e.target.value.toLowerCase();
|
|
2956
3467
|
}
|
|
2957
3468
|
if (type === 'number' && max && parseInt(e.target.value, 10) > parseInt(max, 10)) {
|
|
2958
|
-
e.target.value =
|
|
3469
|
+
e.target.value = `${max}`;
|
|
2959
3470
|
}
|
|
2960
3471
|
if (!readOnly && onChange)
|
|
2961
3472
|
onChange(e);
|
|
2962
3473
|
};
|
|
2963
|
-
|
|
3474
|
+
const handleTextareaChange = (e) => {
|
|
2964
3475
|
if (!readOnly && onChange)
|
|
2965
3476
|
onChange(e);
|
|
2966
3477
|
};
|
|
2967
|
-
|
|
3478
|
+
let formatted_value = value;
|
|
2968
3479
|
if (format === 'phone') {
|
|
2969
3480
|
formatted_value = formatAsPhone(value);
|
|
2970
3481
|
}
|
|
2971
3482
|
if (format === 'currency') {
|
|
2972
|
-
if (
|
|
3483
|
+
if (`${value}`.length) {
|
|
2973
3484
|
formatted_value = Numeral(value).format('$0,0');
|
|
2974
3485
|
}
|
|
2975
3486
|
}
|
|
2976
3487
|
if (format === 'currency_decimal') {
|
|
2977
|
-
formatted_value =
|
|
3488
|
+
formatted_value = `$${formatted_value}`;
|
|
2978
3489
|
}
|
|
2979
3490
|
if (format === 'ssn' && type !== 'password') {
|
|
2980
3491
|
formatted_value = formatAsSsn(value);
|
|
2981
3492
|
}
|
|
2982
|
-
return type === 'textarea' ? (React.createElement(StyledTextarea,
|
|
2983
|
-
React.createElement(StyledInput,
|
|
3493
|
+
return type === 'textarea' ? (React.createElement(StyledTextarea, Object.assign({ "$height": height, "$invalid": invalid, "$readOnly": readOnly, "$style": style, maxLength: maxLength, onBlur: onBlur, onChange: handleTextareaChange, placeholder: placeholder, value: value }, accessibleProps))) : (React.createElement(StyledWrapper, { "$style": style },
|
|
3494
|
+
React.createElement(StyledInput, Object.assign({ "$invalid": invalid, "$readOnly": readOnly, "$suffix": suffix, max: max, maxLength: maxLength, min: min, onBlur: onBlur, onChange: handleInputChange, onKeyDown: onKeyDown, placeholder: placeholder, step: step, type: type, value: formatted_value }, accessibleProps)),
|
|
2984
3495
|
suffix && React.createElement(StyledSuffix, null, suffix)));
|
|
2985
|
-
};
|
|
2986
|
-
var templateObject_1$b, templateObject_2$9, templateObject_3$8, templateObject_4$4;
|
|
3496
|
+
};
|
|
2987
3497
|
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
};
|
|
2993
|
-
|
|
3498
|
+
const Wrapper$8 = styled.a `
|
|
3499
|
+
color: ${Colors.PRIMARY.Hex};
|
|
3500
|
+
font-size: ${props => (props.$small ? FontSizes.SMALL : FontSizes.DEFAULT)};
|
|
3501
|
+
line-height: ${props => (props.$small ? '1.5em' : '1.6em')};
|
|
3502
|
+
letter-spacing: ${props => (props.$small ? '1px' : '0px')};
|
|
3503
|
+
font-weight: 500;
|
|
3504
|
+
font-style: normal;
|
|
3505
|
+
text-decoration: 'none';
|
|
3506
|
+
font-family: 'Roboto', Helvetica, Arial, sans-serif;
|
|
3507
|
+
margin: 0px;
|
|
3508
|
+
padding: 0px;
|
|
3509
|
+
box-sizing: border-box;
|
|
3510
|
+
cursor: pointer;
|
|
3511
|
+
`;
|
|
3512
|
+
const Link = (_a) => {
|
|
3513
|
+
var { children, onClick, small } = _a, accessibleProps = __rest(_a, ["children", "onClick", "small"]);
|
|
3514
|
+
return (React.createElement(Wrapper$8, Object.assign({ "$small": small, onClick: onClick }, accessibleProps), children));
|
|
3515
|
+
};
|
|
2994
3516
|
|
|
2995
|
-
|
|
3517
|
+
const colorMapping = {
|
|
2996
3518
|
black: {
|
|
2997
3519
|
fill_1: '#000000',
|
|
2998
3520
|
fill_2: '#000000',
|
|
@@ -3014,15 +3536,15 @@ var colorMapping = {
|
|
|
3014
3536
|
fill_3: '#E82425',
|
|
3015
3537
|
},
|
|
3016
3538
|
};
|
|
3017
|
-
|
|
3018
|
-
var
|
|
3019
|
-
|
|
3539
|
+
const Logo = (_a) => {
|
|
3540
|
+
var { type = 'standard_full', height = '50px' } = _a, accessibleProps = __rest(_a, ["type", "height"]);
|
|
3541
|
+
const type_parts = type.split('_');
|
|
3020
3542
|
switch (type_parts[0]) {
|
|
3021
3543
|
case 'mark':
|
|
3022
|
-
return (React.createElement("svg",
|
|
3544
|
+
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),
|
|
3023
3545
|
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] })));
|
|
3024
3546
|
default:
|
|
3025
|
-
return (React.createElement("svg",
|
|
3547
|
+
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),
|
|
3026
3548
|
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 }),
|
|
3027
3549
|
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 }),
|
|
3028
3550
|
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 }),
|
|
@@ -3034,21 +3556,111 @@ var Logo = function (_a) {
|
|
|
3034
3556
|
}
|
|
3035
3557
|
};
|
|
3036
3558
|
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3559
|
+
const Wrapper$7 = styled.div `
|
|
3560
|
+
position: fixed;
|
|
3561
|
+
top: 0;
|
|
3562
|
+
right: 0;
|
|
3563
|
+
bottom: 0;
|
|
3564
|
+
left: 0;
|
|
3565
|
+
z-index: 9999;
|
|
3566
|
+
background: rgba(0, 0, 0, 0.8);
|
|
3567
|
+
display: flex;
|
|
3568
|
+
align-items: center;
|
|
3569
|
+
justify-content: center;
|
|
3570
|
+
`;
|
|
3571
|
+
const Container$1 = styled.dialog `
|
|
3572
|
+
max-width: ${props => props.$maxWidth || '90vw'};
|
|
3573
|
+
width: auto;
|
|
3574
|
+
border-radius: 8px;
|
|
3575
|
+
overflow: hidden;
|
|
3576
|
+
box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.2);
|
|
3577
|
+
outline: none;
|
|
3578
|
+
border: none;
|
|
3579
|
+
position: relative;
|
|
3580
|
+
padding: 0px;
|
|
3581
|
+
box-sizing: border-box;
|
|
3582
|
+
`;
|
|
3583
|
+
const Header$1 = styled.div `
|
|
3584
|
+
position: sticky;
|
|
3585
|
+
top: 0;
|
|
3586
|
+
padding: 20px;
|
|
3587
|
+
border-bottom: 1px solid #e7e6e6;
|
|
3588
|
+
display: flex;
|
|
3589
|
+
align-items: center;
|
|
3590
|
+
background: #ffffff;
|
|
3591
|
+
box-sizing: border-box;
|
|
3592
|
+
`;
|
|
3593
|
+
const Close = styled.div `
|
|
3594
|
+
margin-left: auto;
|
|
3595
|
+
display: flex;
|
|
3596
|
+
align-items: center;
|
|
3597
|
+
padding-left: 20px;
|
|
3598
|
+
cursor: pointer;
|
|
3599
|
+
`;
|
|
3600
|
+
const CloseMsg = styled.span `
|
|
3601
|
+
font-size: ${FontSizes.SMALL};
|
|
3602
|
+
font-weight: 400;
|
|
3603
|
+
font-family: ${FontStyles.DEFAULT};
|
|
3604
|
+
line-height: 1em;
|
|
3605
|
+
color: ${Colors.MEDIUM_GRAY.Hex};
|
|
3606
|
+
`;
|
|
3607
|
+
const Steps = styled.div `
|
|
3608
|
+
padding: 20px;
|
|
3609
|
+
border-bottom: 1px solid #e7e6e6;
|
|
3610
|
+
background: #f5f5f5;
|
|
3611
|
+
display: flex;
|
|
3612
|
+
gap: 30px;
|
|
3613
|
+
align-items: center;
|
|
3614
|
+
`;
|
|
3615
|
+
const Step = styled.div `
|
|
3616
|
+
display: flex;
|
|
3617
|
+
align-items: center;
|
|
3618
|
+
gap: 8px;
|
|
3619
|
+
`;
|
|
3620
|
+
const StepIndicator = styled.div `
|
|
3621
|
+
width: 30px;
|
|
3622
|
+
height: 30px;
|
|
3623
|
+
border-radius: 15px;
|
|
3624
|
+
background: ${props => (props.$active ? Colors.PRIMARY.Hex : Colors.LIGHT_GRAY.Hex)};
|
|
3625
|
+
color: ${props => (props.$active ? '#fff' : Colors.MEDIUM_GRAY.Hex)};
|
|
3626
|
+
font-family: 'Roboto', Helvetica, Arial, sans-serif;
|
|
3627
|
+
font-size: 14px;
|
|
3628
|
+
font-weight: 500;
|
|
3629
|
+
line-height: 1;
|
|
3630
|
+
display: flex;
|
|
3631
|
+
align-items: center;
|
|
3632
|
+
justify-content: center;
|
|
3633
|
+
flex-shrink: 0;
|
|
3634
|
+
`;
|
|
3635
|
+
const StepLabel = styled.div `
|
|
3636
|
+
color: #000;
|
|
3637
|
+
font-family: 'Roboto', Helvetica, Arial, sans-serif;
|
|
3638
|
+
font-size: 14px;
|
|
3639
|
+
font-weight: 500;
|
|
3640
|
+
line-height: 1;
|
|
3641
|
+
`;
|
|
3642
|
+
const ContentWrapper = styled.div `
|
|
3643
|
+
overflow-x: hidden;
|
|
3644
|
+
overflow-y: auto;
|
|
3645
|
+
background: #ffffff;
|
|
3646
|
+
max-height: calc(100vh - 260px);
|
|
3647
|
+
box-sizing: border-box;
|
|
3648
|
+
`;
|
|
3649
|
+
const ButtonBar = styled.div `
|
|
3650
|
+
position: sticky;
|
|
3651
|
+
bottom: 0;
|
|
3652
|
+
background: #ffffff;
|
|
3653
|
+
padding: 20px;
|
|
3654
|
+
border-top: 1px solid #e7e6e6;
|
|
3655
|
+
display: flex;
|
|
3656
|
+
align-items: center;
|
|
3657
|
+
justify-self: flex-end;
|
|
3658
|
+
box-sizing: border-box;
|
|
3659
|
+
`;
|
|
3660
|
+
const Modal = (_a) => {
|
|
3661
|
+
var { children, title, onClose, maxWidth, steps, primaryButton, secondaryButton, tertiaryButton } = _a, accessibleProps = __rest(_a, ["children", "title", "onClose", "maxWidth", "steps", "primaryButton", "secondaryButton", "tertiaryButton"]);
|
|
3662
|
+
useEffect(() => {
|
|
3663
|
+
document.onkeydown = e => {
|
|
3052
3664
|
if (e.key === 'Escape') {
|
|
3053
3665
|
onClose();
|
|
3054
3666
|
}
|
|
@@ -3058,49 +3670,44 @@ var Modal = function (_a) {
|
|
|
3058
3670
|
};
|
|
3059
3671
|
}, []);
|
|
3060
3672
|
return (React.createElement(Wrapper$7, null,
|
|
3061
|
-
React.createElement(Container$1,
|
|
3673
|
+
React.createElement(Container$1, Object.assign({ "$maxWidth": maxWidth, open: true }, accessibleProps),
|
|
3062
3674
|
React.createElement(Header$1, null,
|
|
3063
3675
|
title ? React.createElement(Heading, { type: 'secondary' }, title) : null,
|
|
3064
3676
|
React.createElement(Close, { onClick: onClose },
|
|
3065
3677
|
React.createElement(CloseMsg, null, "(Esc)"),
|
|
3066
3678
|
React.createElement(Icon, { color: Colors.BLACK.Hex, path: mdiClose, size: '24px' }))),
|
|
3067
|
-
steps ? (React.createElement(Steps, null, steps.map(
|
|
3679
|
+
steps ? (React.createElement(Steps, null, steps.map((step, i) => {
|
|
3068
3680
|
return (React.createElement(Step, { key: i },
|
|
3069
3681
|
step.complete ? (React.createElement(Icon, { color: Colors.PRIMARY.Hex, path: mdiCheckboxMarkedCircleOutline, size: '32px' })) : (React.createElement(StepIndicator, { "$active": step.active }, i + 1)),
|
|
3070
3682
|
React.createElement(StepLabel, null, step.label)));
|
|
3071
3683
|
}))) : null,
|
|
3072
3684
|
React.createElement(ContentWrapper, null, children),
|
|
3073
3685
|
primaryButton || secondaryButton || tertiaryButton ? (React.createElement(ButtonBar, null,
|
|
3074
|
-
tertiaryButton ? React.createElement(Button,
|
|
3686
|
+
tertiaryButton ? React.createElement(Button, Object.assign({}, tertiaryButton, { format: 'secondary' })) : null,
|
|
3075
3687
|
primaryButton || secondaryButton ? (React.createElement("div", { style: {
|
|
3076
3688
|
marginLeft: 'auto',
|
|
3077
3689
|
paddingLeft: 40,
|
|
3078
3690
|
display: 'flex',
|
|
3079
3691
|
alignItems: 'center',
|
|
3080
3692
|
} },
|
|
3081
|
-
secondaryButton ? React.createElement(Button,
|
|
3082
|
-
primaryButton ? (React.createElement(Button,
|
|
3083
|
-
};
|
|
3084
|
-
var templateObject_1$9, templateObject_2$8, templateObject_3$7, templateObject_4$3, templateObject_5$2, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
|
|
3085
|
-
|
|
3086
|
-
var Wrapper$6 = styled.div(templateObject_1$8 || (templateObject_1$8 = __makeTemplateObject(["\n background: #fff;\n border-radius: 8px;\n box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.2);\n display: flex;\n flex-direction: column;\n gap: 4px;\n max-height: ", ";\n padding: 10px;\n width: 200px;\n"], ["\n background: #fff;\n border-radius: 8px;\n box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.2);\n display: flex;\n flex-direction: column;\n gap: 4px;\n max-height: ", ";\n padding: 10px;\n width: 200px;\n"])), function (props) { return props.$maxHeight || '312px'; });
|
|
3087
|
-
var MenuItem = styled.div(templateObject_2$7 || (templateObject_2$7 = __makeTemplateObject(["\n align-items: center;\n border-radius: 8px;\n border: 1px solid transparent;\n display: flex;\n gap: 8px;\n height: 38px;\n padding: 8px;\n &:hover {\n background: rgba(1, 147, 215, 0.1);\n cursor: pointer;\n\n svg,\n path {\n fill: ", " !important;\n }\n }\n"], ["\n align-items: center;\n border-radius: 8px;\n border: 1px solid transparent;\n display: flex;\n gap: 8px;\n height: 38px;\n padding: 8px;\n &:hover {\n background: rgba(1, 147, 215, 0.1);\n cursor: pointer;\n\n svg,\n path {\n fill: ", " !important;\n }\n }\n"])), Colors.PRIMARY.Hex);
|
|
3088
|
-
var Title = styled.span(templateObject_3$6 || (templateObject_3$6 = __makeTemplateObject(["\n font-family: Roboto;\n font-size: 14px;\n font-weight: 400;\n height: auto;\n letter-spacing: 0px;\n line-height: 22px;\n text-align: left;\n"], ["\n font-family: Roboto;\n font-size: 14px;\n font-weight: 400;\n height: auto;\n letter-spacing: 0px;\n line-height: 22px;\n text-align: left;\n"])));
|
|
3089
|
-
var MoreMenu = function (_a) {
|
|
3090
|
-
var maxHeight = _a.maxHeight, _b = _a.menuItems, menuItems = _b === void 0 ? [] : _b, accessibleProps = __rest(_a, ["maxHeight", "menuItems"]);
|
|
3091
|
-
return (React.createElement(Wrapper$6, __assign({ "$maxHeight": maxHeight }, accessibleProps), menuItems.map(function (item) {
|
|
3092
|
-
return (React.createElement(MenuItem, { onClick: item.onClick },
|
|
3093
|
-
item.icon ? (React.createElement(Icon, { color: Colors.MEDIUM_GRAY.Hex, path: item.icon, size: '20px' })) : null,
|
|
3094
|
-
React.createElement(Title, null, item.label)));
|
|
3095
|
-
})));
|
|
3096
|
-
};
|
|
3097
|
-
var templateObject_1$8, templateObject_2$7, templateObject_3$6;
|
|
3693
|
+
secondaryButton ? React.createElement(Button, Object.assign({}, secondaryButton, { format: 'secondary' })) : null,
|
|
3694
|
+
primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { format: 'primary', margin: '0px 0px 0px 10px' }))) : null)) : null)) : null)));
|
|
3695
|
+
};
|
|
3098
3696
|
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3697
|
+
const Wrapper$6 = styled.div `
|
|
3698
|
+
position: relative;
|
|
3699
|
+
width: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.width) || 'auto'};
|
|
3700
|
+
`;
|
|
3701
|
+
const Trigger = styled.div `
|
|
3702
|
+
box-sizing: border-box;
|
|
3703
|
+
border-radius: ${props => (props.$showOptions ? '4px 4px 0px 0px' : '4px')};
|
|
3704
|
+
height: 40px;
|
|
3705
|
+
padding: 0 10px;
|
|
3706
|
+
position: relative;
|
|
3707
|
+
cursor: pointer;
|
|
3708
|
+
border-width: 1px;
|
|
3709
|
+
border-style: solid;
|
|
3710
|
+
border-color: ${props => {
|
|
3104
3711
|
if (props.$invalid) {
|
|
3105
3712
|
return Colors.RED.Hex;
|
|
3106
3713
|
}
|
|
@@ -3110,156 +3717,408 @@ var Trigger = styled.div(templateObject_2$6 || (templateObject_2$6 = __makeTempl
|
|
|
3110
3717
|
else {
|
|
3111
3718
|
return '#cccccc';
|
|
3112
3719
|
}
|
|
3113
|
-
}
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3720
|
+
}};
|
|
3721
|
+
background-color: ${props => (props.$readOnly ? '#f5f5f5' : '#ffffff')};
|
|
3722
|
+
background-image: none;
|
|
3723
|
+
display: flex;
|
|
3724
|
+
width: 100%;
|
|
3725
|
+
align-items: center;
|
|
3726
|
+
justify-content: space-between;
|
|
3727
|
+
z-index: 1;
|
|
3728
|
+
`;
|
|
3729
|
+
const Value = styled.div `
|
|
3730
|
+
color: ${Colors.BLACK.Hex};
|
|
3731
|
+
font-family: ${FontStyles.DEFAULT};
|
|
3732
|
+
font-size: ${FontSizes.DEFAULT};
|
|
3733
|
+
font-weight: 400;
|
|
3734
|
+
line-height: 2.9em;
|
|
3735
|
+
overflow: hidden;
|
|
3736
|
+
text-overflow: ellipsis;
|
|
3737
|
+
white-space: nowrap;
|
|
3738
|
+
width: 100%;
|
|
3739
|
+
`;
|
|
3740
|
+
const Options = styled.div `
|
|
3741
|
+
background: #fff;
|
|
3742
|
+
box-shadow: 0px 5px 30px -15px rgba(0, 0, 0, 0.2);
|
|
3743
|
+
border-color: ${Colors.PRIMARY.Hex};
|
|
3744
|
+
border-radius: 0px 0px 4px 4px;
|
|
3745
|
+
border-style: solid;
|
|
3746
|
+
border-top: none;
|
|
3747
|
+
border-width: 1px;
|
|
3748
|
+
left: 0;
|
|
3749
|
+
position: absolute;
|
|
3750
|
+
right: 0;
|
|
3751
|
+
z-index: 10;
|
|
3752
|
+
max-height: 220px;
|
|
3753
|
+
overflow: auto;
|
|
3754
|
+
`;
|
|
3755
|
+
const Scrim = styled.div `
|
|
3756
|
+
bottom: 0;
|
|
3757
|
+
left: 0;
|
|
3758
|
+
position: fixed;
|
|
3759
|
+
right: 0;
|
|
3760
|
+
top: 0;
|
|
3761
|
+
z-index: 9;
|
|
3762
|
+
`;
|
|
3763
|
+
const MultiSelect = (_a) => {
|
|
3764
|
+
var { readOnly, displayCount = 3, invalid, onChange, options = [], selected = [], showSelectAll, style } = _a, accessibleProps = __rest(_a, ["readOnly", "displayCount", "invalid", "onChange", "options", "selected", "showSelectAll", "style"]);
|
|
3765
|
+
const [showOptions, setShowOptions] = useState(false);
|
|
3766
|
+
const selected_options = options.filter(o => selected.includes(o.value));
|
|
3767
|
+
return (React.createElement(Wrapper$6, { "$style": style },
|
|
3768
|
+
React.createElement(Trigger, Object.assign({ "$invalid": invalid, "$readOnly": readOnly, "$showOptions": showOptions, onClick: readOnly ? undefined : setShowOptions.bind(null, !showOptions) }, accessibleProps),
|
|
3123
3769
|
React.createElement(Value, null, selected.length > 0 && selected.length <= displayCount
|
|
3124
|
-
? selected_options.map(
|
|
3125
|
-
:
|
|
3770
|
+
? selected_options.map(o => o.label || o.value).join(', ')
|
|
3771
|
+
: `${selected_options.length} Selected`),
|
|
3126
3772
|
React.createElement(Icon, { color: Colors.BLACK.Hex, path: showOptions ? mdiChevronUp : mdiChevronDown, size: '22px' })),
|
|
3127
3773
|
showOptions ? (React.createElement(Options, null,
|
|
3128
3774
|
React.createElement(Checklist, { onChange: onChange, options: options, selected: selected, showSelectAll: showSelectAll }))) : null,
|
|
3129
3775
|
showOptions ? React.createElement(Scrim, { onClick: setShowOptions.bind(null, !showOptions) }) : null));
|
|
3130
|
-
};
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3776
|
+
};
|
|
3777
|
+
|
|
3778
|
+
const Wrapper$5 = styled.div `
|
|
3779
|
+
display: flex;
|
|
3780
|
+
padding: 16px 30px;
|
|
3781
|
+
align-items: center;
|
|
3782
|
+
gap: 20px;
|
|
3783
|
+
align-self: stretch;
|
|
3784
|
+
border-bottom: 1px solid ${Colors.LIGHT_GRAY.Hex};
|
|
3785
|
+
`;
|
|
3786
|
+
const Info = styled.div `
|
|
3787
|
+
display: flex;
|
|
3788
|
+
flex-direction: column;
|
|
3789
|
+
align-items: flex-start;
|
|
3790
|
+
gap: 4px;
|
|
3791
|
+
flex: 1 0 0;
|
|
3792
|
+
`;
|
|
3793
|
+
const Breadcrumbs = styled.div `
|
|
3794
|
+
display: flex;
|
|
3795
|
+
align-items: center;
|
|
3796
|
+
gap: 4px;
|
|
3797
|
+
`;
|
|
3798
|
+
const Actions = styled.div `
|
|
3799
|
+
display: flex;
|
|
3800
|
+
align-items: center;
|
|
3801
|
+
gap: 8px;
|
|
3802
|
+
`;
|
|
3803
|
+
const PageHeader = ({ title = '', breadcrumbs, actions, buttonMenu }) => {
|
|
3804
|
+
const { menuItems = [], label = '', } = buttonMenu || {};
|
|
3805
|
+
return (React.createElement(Wrapper$5, null,
|
|
3806
|
+
React.createElement(Info, null,
|
|
3807
|
+
React.createElement(Heading, { type: 'secondary' }, title),
|
|
3808
|
+
breadcrumbs ? (React.createElement(Breadcrumbs, null, breadcrumbs.map((crumb, i) => {
|
|
3809
|
+
return (React.createElement(React.Fragment, null,
|
|
3810
|
+
crumb.onClick ? (React.createElement(Link, { onClick: crumb.onClick, small: true }, crumb.label)) : (React.createElement(Copy, { type: 'small' }, crumb.label)),
|
|
3811
|
+
i + 1 < breadcrumbs.length ? React.createElement(Icon$1, { path: mdiChevronRight, size: '14px' }) : null));
|
|
3812
|
+
}))) : null),
|
|
3813
|
+
actions ? (React.createElement(Actions, null,
|
|
3814
|
+
actions.map(action => {
|
|
3815
|
+
const { label } = action, buttonProps = __rest(action, ["label"]);
|
|
3816
|
+
return (React.createElement(Button, Object.assign({}, buttonProps, { small: true }), label));
|
|
3817
|
+
}),
|
|
3818
|
+
menuItems.length ? (React.createElement(ButtonMenu, { label: label, menuItems: menuItems, small: true })) : null)) : null));
|
|
3819
|
+
};
|
|
3820
|
+
|
|
3821
|
+
const Wrapper$4 = styled.nav `
|
|
3822
|
+
box-sizing: border-box;
|
|
3823
|
+
display: flex;
|
|
3824
|
+
align-items: center;
|
|
3825
|
+
column-gap: 10px;
|
|
3826
|
+
`;
|
|
3827
|
+
const Pagination = (_a) => {
|
|
3828
|
+
var { currentPage = 1, onClick, pageCount = 0 } = _a, accessibleProps = __rest(_a, ["currentPage", "onClick", "pageCount"]);
|
|
3829
|
+
const is_first_page = currentPage === 1;
|
|
3830
|
+
const is_last_page = currentPage === pageCount;
|
|
3831
|
+
const handlePrevClick = () => {
|
|
3139
3832
|
if (!is_first_page) {
|
|
3140
3833
|
onClick(currentPage - 1);
|
|
3141
3834
|
}
|
|
3142
3835
|
};
|
|
3143
|
-
|
|
3836
|
+
const handleNextClick = () => {
|
|
3144
3837
|
if (!is_last_page) {
|
|
3145
3838
|
onClick(currentPage + 1);
|
|
3146
3839
|
}
|
|
3147
3840
|
};
|
|
3148
|
-
|
|
3149
|
-
|
|
3841
|
+
const handlePageChange = (e) => {
|
|
3842
|
+
const new_page = parseInt(e.target.value, 10);
|
|
3150
3843
|
if (new_page !== currentPage) {
|
|
3151
3844
|
onClick(new_page);
|
|
3152
3845
|
}
|
|
3153
3846
|
};
|
|
3154
|
-
return (React.createElement(Wrapper$4,
|
|
3847
|
+
return (React.createElement(Wrapper$4, Object.assign({}, accessibleProps),
|
|
3155
3848
|
React.createElement(Button, { disabled: is_first_page, icon: mdiChevronLeft, onClick: handlePrevClick, small: true }),
|
|
3156
|
-
React.createElement(Select, { onChange: handlePageChange, options: Array.from(Array(pageCount).keys(),
|
|
3157
|
-
label:
|
|
3158
|
-
value:
|
|
3159
|
-
})
|
|
3849
|
+
React.createElement(Select, { onChange: handlePageChange, options: Array.from(Array(pageCount).keys(), p => p + 1).map(p => ({
|
|
3850
|
+
label: `Page ${p}`,
|
|
3851
|
+
value: `${p}`,
|
|
3852
|
+
})), value: `${currentPage}` }),
|
|
3160
3853
|
React.createElement(Button, { disabled: is_last_page, icon: mdiChevronRight, onClick: handleNextClick, small: true })));
|
|
3161
|
-
};
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3854
|
+
};
|
|
3855
|
+
|
|
3856
|
+
const Wrapper$3 = styled.label `
|
|
3857
|
+
padding: 4px 0;
|
|
3858
|
+
cursor: ${props => (props.$disabled ? 'default' : 'pointer')};
|
|
3859
|
+
display: flex;
|
|
3860
|
+
align-items: center;
|
|
3861
|
+
font-size: ${FontSizes.DEFAULT};
|
|
3862
|
+
line-height: 1.6rm;
|
|
3863
|
+
box-sizing: border-box;
|
|
3864
|
+
`;
|
|
3865
|
+
const Input = styled.input `
|
|
3866
|
+
font-size: 20px;
|
|
3867
|
+
margin: 0px 0px 2px 0px;
|
|
3868
|
+
line-height: 1.1em;
|
|
3869
|
+
`;
|
|
3870
|
+
const Label$1 = styled.span `
|
|
3871
|
+
font-family: ${FontStyles.DEFAULT};
|
|
3872
|
+
font-size: ${FontSizes.DEFAULT};
|
|
3873
|
+
font-weight: 400;
|
|
3874
|
+
color: ${Colors.BLACK.Hex};
|
|
3875
|
+
line-height: 1.6em;
|
|
3876
|
+
margin-left: 6px;
|
|
3877
|
+
`;
|
|
3878
|
+
const Radio = (_a) => {
|
|
3879
|
+
var { children, disabled, checked, onChange, value } = _a, accessibleProps = __rest(_a, ["children", "disabled", "checked", "onChange", "value"]);
|
|
3880
|
+
return (React.createElement(Wrapper$3, Object.assign({ "$disabled": disabled }, accessibleProps),
|
|
3170
3881
|
React.createElement(Input, { checked: checked, disabled: disabled, name: accessibleProps.name, onChange: disabled ? undefined : onChange, type: 'radio', value: value }),
|
|
3171
3882
|
React.createElement(Label$1, null, children)));
|
|
3172
|
-
};
|
|
3173
|
-
var templateObject_1$5, templateObject_2$5, templateObject_3$4;
|
|
3883
|
+
};
|
|
3174
3884
|
|
|
3175
|
-
|
|
3176
|
-
var
|
|
3177
|
-
return (React.createElement(React.Fragment, null, options.map(
|
|
3178
|
-
|
|
3179
|
-
return (React.createElement(Radio,
|
|
3885
|
+
const RadioList = (_a) => {
|
|
3886
|
+
var { disabled, onChange, options, value } = _a, accessibleProps = __rest(_a, ["disabled", "onChange", "options", "value"]);
|
|
3887
|
+
return (React.createElement(React.Fragment, null, options.map((option) => {
|
|
3888
|
+
const label = option.label || option.value;
|
|
3889
|
+
return (React.createElement(Radio, Object.assign({ checked: value === option.value, disabled: disabled, onChange: onChange, value: option.value }, accessibleProps), label));
|
|
3180
3890
|
})));
|
|
3181
3891
|
};
|
|
3182
3892
|
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3893
|
+
const StyledTable = styled.table `
|
|
3894
|
+
width: 100%;
|
|
3895
|
+
margin-top: 1px;
|
|
3896
|
+
table-layout: ${props => props.$tableLayout || 'auto'};
|
|
3897
|
+
border-collapse: collapse;
|
|
3898
|
+
text-indent: 0px;
|
|
3899
|
+
border-spacing: 0px;
|
|
3900
|
+
border-color: none;
|
|
3901
|
+
box-sizing: border-box;
|
|
3902
|
+
`;
|
|
3903
|
+
const Header = styled.th `
|
|
3904
|
+
padding: 12px !important;
|
|
3905
|
+
text-align: left;
|
|
3906
|
+
font-weight: 500;
|
|
3907
|
+
border-bottom: 1px solid #e5e5e5;
|
|
3908
|
+
border-top: 1px solid #e5e5e5;
|
|
3909
|
+
text-transform: uppercase;
|
|
3910
|
+
font-size: 12px;
|
|
3911
|
+
font-family: ${FontStyles.DEFAULT};
|
|
3912
|
+
letter-spacing: 1px;
|
|
3913
|
+
white-space: nowrap;
|
|
3914
|
+
line-height: 1;
|
|
3915
|
+
position: relative;
|
|
3916
|
+
box-sizing: border-box;
|
|
3917
|
+
width: ${props => props.$width || 'auto'};
|
|
3918
|
+
cursor: ${props => (props.$isSortable ? 'pointer' : 'default')};
|
|
3919
|
+
color: ${props => (props.$isSortable ? Colors.PRIMARY.Hex : Colors.BLACK.Hex)};
|
|
3920
|
+
`;
|
|
3921
|
+
const Row = styled.tr `
|
|
3922
|
+
cursor: ${props => (props.$isClickable ? 'pointer' : 'default')};
|
|
3923
|
+
transition: all 0.2s;
|
|
3924
|
+
background-color: ${props => props.$bgColor};
|
|
3925
|
+
box-sizing: border-box;
|
|
3926
|
+
&:hover {
|
|
3927
|
+
background-color: ${props => props.$isClickable ? `rgba(${Colors.PRIMARY.Rgb}, 0.1)` : props.$bgColor};
|
|
3928
|
+
}
|
|
3929
|
+
`;
|
|
3930
|
+
const Column = styled.td `
|
|
3931
|
+
padding: 16px 12px !important;
|
|
3932
|
+
font-size: ${FontSizes.DEFAULT} !important;
|
|
3933
|
+
font-weight: 400 !important;
|
|
3934
|
+
font-family: ${FontStyles.DEFAULT};
|
|
3935
|
+
border: none !important;
|
|
3936
|
+
word-break: break-word;
|
|
3937
|
+
line-height: 1.4em;
|
|
3938
|
+
box-sizing: border-box;
|
|
3939
|
+
width: ${props => props.$width || 'auto'};
|
|
3940
|
+
`;
|
|
3941
|
+
const IconWrapper = styled.span `
|
|
3942
|
+
position: absolute;
|
|
3943
|
+
top: 50%;
|
|
3944
|
+
transform: translateY(-50%);
|
|
3945
|
+
margin-left: 2px;
|
|
3946
|
+
`;
|
|
3947
|
+
const Table = (_a) => {
|
|
3948
|
+
var { columns = [], data = [], sortBy, sortDirection, hideHeaders, onRowClick, onSortChange, tableLayout } = _a, accessibleProps = __rest(_a, ["columns", "data", "sortBy", "sortDirection", "hideHeaders", "onRowClick", "onSortChange", "tableLayout"]);
|
|
3949
|
+
return (React.createElement(StyledTable, Object.assign({ "$tableLayout": tableLayout }, accessibleProps),
|
|
3193
3950
|
hideHeaders ? null : (React.createElement("thead", null,
|
|
3194
|
-
React.createElement("tr", null, columns.map(
|
|
3951
|
+
React.createElement("tr", null, columns.map((column, i) => {
|
|
3195
3952
|
return (React.createElement(Header, { "$isSortable": column.isSortable, "$width": column.width, key: i, onClick: onSortChange === null || onSortChange === void 0 ? void 0 : onSortChange.bind(null, column.id) },
|
|
3196
3953
|
column.label,
|
|
3197
3954
|
column.isSortable && sortBy === column.id ? (React.createElement(IconWrapper, null,
|
|
3198
3955
|
React.createElement(Icon, { color: Colors.PRIMARY.Hex, path: sortDirection === 'asc' ? mdiChevronUp : mdiChevronDown, size: '20px' }))) : null));
|
|
3199
3956
|
})))),
|
|
3200
|
-
data.length ? (React.createElement("tbody", null, data.map(
|
|
3201
|
-
return (React.createElement(Row, { "$bgColor": i % 2 === 0 ? '#ffffff' : '#f9f9f9', "$isClickable": !!onRowClick, key: i, onClick: onRowClick ? onRowClick.bind(null, row) : undefined }, columns.map(
|
|
3957
|
+
data.length ? (React.createElement("tbody", null, data.map((row, i) => {
|
|
3958
|
+
return (React.createElement(Row, { "$bgColor": i % 2 === 0 ? '#ffffff' : '#f9f9f9', "$isClickable": !!onRowClick, key: i, onClick: onRowClick ? onRowClick.bind(null, row) : undefined }, columns.map((column, i) => {
|
|
3202
3959
|
return (React.createElement(Column, { "$width": columns[i].width, key: i }, column.render ? column.render(row) : row[column.id] || 'N/A'));
|
|
3203
3960
|
})));
|
|
3204
3961
|
}))) : null));
|
|
3205
|
-
};
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3962
|
+
};
|
|
3963
|
+
|
|
3964
|
+
const Wrapper$2 = styled.div `
|
|
3965
|
+
display: flex;
|
|
3966
|
+
box-sizing: border-box;
|
|
3967
|
+
align-items: flex-end;
|
|
3968
|
+
border-top: 1px solid #e5e5e5;
|
|
3969
|
+
border-bottom: 1px solid #e5e5e5;
|
|
3970
|
+
flex-shrink: 0;
|
|
3971
|
+
align-self: stretch;
|
|
3972
|
+
padding: 0;
|
|
3973
|
+
margin: 0;
|
|
3974
|
+
`;
|
|
3975
|
+
const Tab = styled.div `
|
|
3976
|
+
display: flex;
|
|
3977
|
+
align-items: center;
|
|
3978
|
+
gap: 6px;
|
|
3979
|
+
font-size: ${FontSizes.DEFAULT};
|
|
3980
|
+
font-family: ${FontStyles.DEFAULT};
|
|
3981
|
+
font-weight: ${props => (props.$isActive ? 500 : 400)};
|
|
3982
|
+
color: ${props => (props.$isActive ? Colors.BLACK.Hex : Colors.MEDIUM_GRAY.Hex)};
|
|
3983
|
+
line-height: 1em;
|
|
3984
|
+
padding: 16px 30px 12px;
|
|
3985
|
+
margin: 0 0 -1px 0;
|
|
3986
|
+
border-bottom-width: 4px;
|
|
3987
|
+
border-bottom-style: solid;
|
|
3988
|
+
border-bottom-color: ${props => (props.$isActive ? Colors.PRIMARY.Hex : 'transparent')};
|
|
3989
|
+
cursor: ${props => (props.$isActive ? 'default' : 'pointer')};
|
|
3990
|
+
box-sizing: border-box;
|
|
3991
|
+
&:hover {
|
|
3992
|
+
color: ${props => (props.$isActive ? Colors.BLACK.Hex : Colors.PRIMARY.Hex)};
|
|
3993
|
+
font-weight: 500;
|
|
3994
|
+
}
|
|
3995
|
+
`;
|
|
3996
|
+
const Badge = styled.div `
|
|
3997
|
+
display: flex;
|
|
3998
|
+
width: 18px;
|
|
3999
|
+
height: 18px;
|
|
4000
|
+
justify-content: center;
|
|
4001
|
+
align-items: center;
|
|
4002
|
+
border-radius: 9px;
|
|
4003
|
+
background: ${props => (props.$isError ? Colors.RED.Hex : Colors.PRIMARY.Hex)};
|
|
4004
|
+
color: #fff;
|
|
4005
|
+
font-family: ${FontStyles.DEFAULT};
|
|
4006
|
+
font-size: 12px;
|
|
4007
|
+
font-weight: 500;
|
|
4008
|
+
line-height: 1;
|
|
4009
|
+
letter-spacing: 1px;
|
|
4010
|
+
`;
|
|
4011
|
+
const Tabs = (_a) => {
|
|
4012
|
+
var { tabs } = _a, accessibleProps = __rest(_a, ["tabs"]);
|
|
4013
|
+
return (React.createElement(Wrapper$2, Object.assign({}, accessibleProps), tabs.map((_a, i) => {
|
|
4014
|
+
var { isActive, label, badgeCount, errorBadge, onClick } = _a, accessibleProps = __rest(_a, ["isActive", "label", "badgeCount", "errorBadge", "onClick"]);
|
|
4015
|
+
return (React.createElement(Tab, Object.assign({ "$isActive": isActive || false, key: i, onClick: isActive ? undefined : onClick }, accessibleProps),
|
|
3216
4016
|
badgeCount ? React.createElement(Badge, { "$isError": errorBadge || false }, badgeCount) : null,
|
|
3217
4017
|
label));
|
|
3218
4018
|
})));
|
|
3219
4019
|
};
|
|
3220
|
-
Tabs.defaultProps = {};
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
4020
|
+
Tabs.defaultProps = {};
|
|
4021
|
+
|
|
4022
|
+
const Wrapper$1 = styled.div `
|
|
4023
|
+
display: inline-block;
|
|
4024
|
+
border-radius: 4px;
|
|
4025
|
+
padding: 4px 6px;
|
|
4026
|
+
background: ${props => Colors[props.$color].Hex};
|
|
4027
|
+
color: #ffffff;
|
|
4028
|
+
box-sizing: border-box;
|
|
4029
|
+
cursor: ${props => (props.$removable ? 'pointer' : 'default')};
|
|
4030
|
+
`;
|
|
4031
|
+
const Content = styled.div `
|
|
4032
|
+
display: flex;
|
|
4033
|
+
align-items: center;
|
|
4034
|
+
`;
|
|
4035
|
+
const Label = styled.div `
|
|
4036
|
+
color: ${props => (props.$color === 'SUBTLE_GRAY' ? '#000000' : '#ffffff')};
|
|
4037
|
+
font-size: ${FontSizes.SMALL};
|
|
4038
|
+
font-weight: 500;
|
|
4039
|
+
font-family: ${FontStyles.DEFAULT};
|
|
4040
|
+
line-height: 1.2em;
|
|
4041
|
+
`;
|
|
4042
|
+
const Remove = styled.div `
|
|
4043
|
+
margin-left: 10px;
|
|
4044
|
+
display: flex;
|
|
4045
|
+
align-items: center;
|
|
4046
|
+
`;
|
|
4047
|
+
const Tag = (_a) => {
|
|
4048
|
+
var { children, color = 'PRIMARY', removable, onClick } = _a, accessibleProps = __rest(_a, ["children", "color", "removable", "onClick"]);
|
|
4049
|
+
return (React.createElement(Wrapper$1, Object.assign({ "$color": color, "$removable": removable, onClick: onClick }, accessibleProps),
|
|
3230
4050
|
React.createElement(Content, null,
|
|
3231
4051
|
React.createElement(Label, { "$color": color }, children),
|
|
3232
4052
|
removable ? (React.createElement(Remove, null,
|
|
3233
4053
|
React.createElement(Icon, { color: color === 'SUBTLE_GRAY' ? '#000000' : '#ffffff', path: mdiClose, size: '15px' }))) : null)));
|
|
3234
|
-
};
|
|
3235
|
-
var templateObject_1$2, templateObject_2$2, templateObject_3$1, templateObject_4;
|
|
4054
|
+
};
|
|
3236
4055
|
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
4056
|
+
const Track = styled.div `
|
|
4057
|
+
height: 24px;
|
|
4058
|
+
border-radius: 12px;
|
|
4059
|
+
background: ${props => (props.$on ? Colors.GREEN.Hex : Colors.BLACK.Hex)};
|
|
4060
|
+
display: flex;
|
|
4061
|
+
align-items: center;
|
|
4062
|
+
cursor: pointer;
|
|
4063
|
+
width: 40px;
|
|
4064
|
+
padding: 2px;
|
|
4065
|
+
box-sizing: border-box;
|
|
4066
|
+
`;
|
|
4067
|
+
const Handle = styled.div `
|
|
4068
|
+
width: 20px;
|
|
4069
|
+
height: 20px;
|
|
4070
|
+
border-radius: 10px;
|
|
4071
|
+
background: #ffffff;
|
|
4072
|
+
margin-left: ${props => (props.$on ? 'auto' : '0px')};
|
|
4073
|
+
display: flex;
|
|
4074
|
+
align-items: center;
|
|
4075
|
+
justify-content: center;
|
|
4076
|
+
box-sizing: border-box;
|
|
4077
|
+
`;
|
|
4078
|
+
const Toggle = (_a) => {
|
|
4079
|
+
var { onClick, on } = _a, accessibleProps = __rest(_a, ["onClick", "on"]);
|
|
4080
|
+
return (React.createElement(Track, Object.assign({ "$on": on, onClick: onClick }, accessibleProps),
|
|
3242
4081
|
React.createElement("input", { checked: on, name: accessibleProps.name, type: 'hidden' }),
|
|
3243
4082
|
React.createElement(Handle, { "$on": on },
|
|
3244
4083
|
React.createElement(Icon, { color: on ? Colors.GREEN.Hex : Colors.BLACK.Hex, path: on ? mdiCheck : mdiClose, size: '16px' }))));
|
|
3245
4084
|
};
|
|
3246
|
-
Toggle.defaultProps = {};
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
4085
|
+
Toggle.defaultProps = {};
|
|
4086
|
+
|
|
4087
|
+
const Container = styled.div `
|
|
4088
|
+
width: 100%;
|
|
4089
|
+
padding: 40px auto;
|
|
4090
|
+
gap: 20px;
|
|
4091
|
+
display: flex;
|
|
4092
|
+
flex-direction: column;
|
|
4093
|
+
justify-items: center;
|
|
4094
|
+
align-items: center;
|
|
4095
|
+
`;
|
|
4096
|
+
const Wrapper = styled.div `
|
|
4097
|
+
gap: 10px;
|
|
4098
|
+
display: flex;
|
|
4099
|
+
flex-direction: column;
|
|
4100
|
+
justify-items: center;
|
|
4101
|
+
align-items: center;
|
|
4102
|
+
`;
|
|
4103
|
+
const StyledIcon = styled.div `
|
|
4104
|
+
display: flex;
|
|
4105
|
+
align-items: center;
|
|
4106
|
+
justify-content: center;
|
|
4107
|
+
width: 80px;
|
|
4108
|
+
height: 80px;
|
|
4109
|
+
border-radius: 40px;
|
|
4110
|
+
background: #f5f5f5;
|
|
4111
|
+
`;
|
|
4112
|
+
const ZeroState = (_a) => {
|
|
4113
|
+
var { icon, title, description, action } = _a, accessibleProps = __rest(_a, ["icon", "title", "description", "action"]);
|
|
4114
|
+
return (React.createElement(Container, Object.assign({}, accessibleProps),
|
|
3255
4115
|
React.createElement(StyledIcon, null,
|
|
3256
4116
|
React.createElement(Icon, { color: Colors.MEDIUM_GRAY.Hex, path: icon, size: '40px' })),
|
|
3257
4117
|
React.createElement(Wrapper, null,
|
|
3258
4118
|
React.createElement(Heading, { children: title, type: 'tertiary' }),
|
|
3259
4119
|
description && React.createElement(Copy, { align: 'center', children: description, color: 'GRAY', type: 'default' })),
|
|
3260
4120
|
action && (React.createElement(Button, { children: action === null || action === void 0 ? void 0 : action.children, icon: action === null || action === void 0 ? void 0 : action.icon, onClick: action === null || action === void 0 ? void 0 : action.onClick }))));
|
|
3261
|
-
};
|
|
3262
|
-
var templateObject_1, templateObject_2, templateObject_3;
|
|
4121
|
+
};
|
|
3263
4122
|
|
|
3264
|
-
export { Accordion, ActionDialog, Alert, BulkActionBar, Button, Checkbox, Checklist, Copy, DatePicker, Drawer, Field, FileUpload, Heading, Input$1 as Input, Link, Logo, Modal, MoreMenu, MultiSelect, Pagination, Radio, RadioList, Select, Table, Tabs, Tag, Toggle, Tooltip, ZeroState };
|
|
4123
|
+
export { Accordion, ActionDialog, Alert, BulkActionBar, Button, ButtonMenu, Checkbox, Checklist, Copy, DatePicker, Drawer, Field, FileUpload, Heading, Input$1 as Input, Link, Logo, Modal, MoreMenu, MultiSelect, PageHeader, Pagination, Radio, RadioList, Select, Table, Tabs, Tag, Toggle, Tooltip, ZeroState };
|
|
3265
4124
|
//# sourceMappingURL=index.js.map
|