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