@hexure/ui 1.1.1 → 1.2.0
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/README.md +10 -9
- package/dist/cjs/index.js +107 -44
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/Button/Button.d.ts +1 -1
- package/dist/cjs/types/components/Copy/Copy.d.ts +2 -0
- package/dist/cjs/types/components/Drawer/Drawer.d.ts +28 -0
- package/dist/cjs/types/components/Drawer/Drawer.stories.d.ts +5 -0
- package/dist/cjs/types/components/Drawer/index.d.ts +1 -0
- package/dist/cjs/types/components/Modal/Modal.d.ts +2 -2
- package/dist/cjs/types/components/Multiselect/MultiSelect.d.ts +1 -1
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/esm/index.js +107 -45
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Button/Button.d.ts +1 -1
- package/dist/esm/types/components/Copy/Copy.d.ts +2 -0
- package/dist/esm/types/components/Drawer/Drawer.d.ts +28 -0
- package/dist/esm/types/components/Drawer/Drawer.stories.d.ts +5 -0
- package/dist/esm/types/components/Drawer/index.d.ts +1 -0
- package/dist/esm/types/components/Modal/Modal.d.ts +2 -2
- package/dist/esm/types/components/Multiselect/MultiSelect.d.ts +1 -1
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/index.d.ts +40 -12
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ export interface ButtonProps extends AccessibleProps {
|
|
|
13
13
|
/** If enabled, the small button format will be used. */
|
|
14
14
|
small?: boolean;
|
|
15
15
|
/** Define which button type to display. By default the Primary button will be used. */
|
|
16
|
-
type?: 'primary' | 'secondary';
|
|
16
|
+
type?: 'primary' | 'secondary' | 'red';
|
|
17
17
|
}
|
|
18
18
|
declare const Button: FC<ButtonProps>;
|
|
19
19
|
export default Button;
|
|
@@ -10,6 +10,8 @@ export interface CopyProps extends AccessibleProps {
|
|
|
10
10
|
padding?: string;
|
|
11
11
|
/** Set the type of copy to display */
|
|
12
12
|
type?: 'default' | 'bold' | 'italic' | 'underline' | 'line-through' | 'small';
|
|
13
|
+
/** Set the color of the copy based on the design system color pallette */
|
|
14
|
+
color?: 'PRIMARY' | 'GREEN' | 'RED' | 'YELLOW' | 'BLACK' | 'GRAY' | 'MEDIUM_GRAY' | 'LIGHT_GRAY';
|
|
13
15
|
}
|
|
14
16
|
declare const Copy: FC<CopyProps>;
|
|
15
17
|
export default Copy;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { AccessibleProps } from '../../utils/Accessibility';
|
|
3
|
+
interface ButtonProps extends AccessibleProps {
|
|
4
|
+
disabled: boolean;
|
|
5
|
+
children: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
onClick: (e?: any) => void;
|
|
8
|
+
tabIndex?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface DrawerProps extends AccessibleProps {
|
|
11
|
+
primaryButton: ButtonProps;
|
|
12
|
+
secondaryButton?: ButtonProps;
|
|
13
|
+
tertiaryButton?: ButtonProps;
|
|
14
|
+
/** It is used to pass child nodes, string values and number as child components. */
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
/** It is used to give title. */
|
|
17
|
+
title: string;
|
|
18
|
+
/** Define an optional description that's displayed under the title */
|
|
19
|
+
description?: string;
|
|
20
|
+
/** Set a width wider than 400px */
|
|
21
|
+
width?: string | number;
|
|
22
|
+
/** Display an scrim over the main content, forcing users to interact with the drawer */
|
|
23
|
+
scrim?: 'transparent' | 'dark';
|
|
24
|
+
/** It is used to close drawer. */
|
|
25
|
+
onClose: (e?: any) => void;
|
|
26
|
+
}
|
|
27
|
+
declare const Drawer: FC<DrawerProps>;
|
|
28
|
+
export default Drawer;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
+
declare const _default: ComponentMeta<React.FC<import("./Drawer").DrawerProps>>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const _Drawer: ComponentStory<React.FC<import("./Drawer").DrawerProps>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Drawer';
|
|
@@ -9,8 +9,8 @@ interface ButtonProps {
|
|
|
9
9
|
}
|
|
10
10
|
export interface ModalProps extends AccessibleProps {
|
|
11
11
|
primaryButton: ButtonProps;
|
|
12
|
-
secondaryButton
|
|
13
|
-
tertiaryButton
|
|
12
|
+
secondaryButton?: ButtonProps;
|
|
13
|
+
tertiaryButton?: ButtonProps;
|
|
14
14
|
maxWidth?: string | number;
|
|
15
15
|
/** It is used to pass child nodes, string values and number as child components. */
|
|
16
16
|
children: ReactNode;
|
|
@@ -8,7 +8,7 @@ export interface MultiSelectProps extends AccessibleProps {
|
|
|
8
8
|
readOnly?: boolean;
|
|
9
9
|
displayCount?: number;
|
|
10
10
|
invalid?: boolean;
|
|
11
|
-
onChange: (e
|
|
11
|
+
onChange: (e: any) => void;
|
|
12
12
|
options?: OptionProps[];
|
|
13
13
|
selected: (string | number)[];
|
|
14
14
|
showSelectAll?: boolean;
|
|
@@ -6,6 +6,7 @@ export { default as Button } from './components/Button';
|
|
|
6
6
|
export { default as Checkbox } from './components/Checkbox';
|
|
7
7
|
export { default as Checklist } from './components/Checklist';
|
|
8
8
|
export { default as Copy } from './components/Copy';
|
|
9
|
+
export { default as Drawer } from './components/Drawer';
|
|
9
10
|
export { default as Field } from './components/Field';
|
|
10
11
|
export { default as Heading } from './components/Heading';
|
|
11
12
|
export { default as Input } from './components/Input';
|
package/dist/esm/index.js
CHANGED
|
@@ -2023,19 +2023,36 @@ var FontSizes = {
|
|
|
2023
2023
|
SMALL: '13px',
|
|
2024
2024
|
};
|
|
2025
2025
|
|
|
2026
|
-
var Header$
|
|
2027
|
-
var Title = styled.div(templateObject_2$
|
|
2026
|
+
var Header$3 = styled.div(templateObject_1$k || (templateObject_1$k = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n box-sizing: border-box;\n background: #f5f5f5;\n border: 1px solid #e5e5e5;\n padding: 14px 20px;\n height: 50px;\n cursor: pointer;\n"], ["\n display: flex;\n align-items: center;\n justify-content: space-between;\n box-sizing: border-box;\n background: #f5f5f5;\n border: 1px solid #e5e5e5;\n padding: 14px 20px;\n height: 50px;\n cursor: pointer;\n"])));
|
|
2027
|
+
var Title = styled.div(templateObject_2$i || (templateObject_2$i = __makeTemplateObject(["\n font-size: ", ";\n font-weight: 400;\n color: ", ";\n line-height: 1.6em;\n font-family: ", ";\n box-sizing: border-box;\n"], ["\n font-size: ", ";\n font-weight: 400;\n color: ", ";\n line-height: 1.6em;\n font-family: ", ";\n box-sizing: border-box;\n"])), FontSizes.DEFAULT, Colors.BLACK.Hex, FontStyles.DEFAULT);
|
|
2028
2028
|
var Accordion = function (_a) {
|
|
2029
2029
|
var title = _a.title, children = _a.children, open = _a.open, onClick = _a.onClick, accessibleProps = __rest(_a, ["title", "children", "open", "onClick"]);
|
|
2030
2030
|
return (React.createElement(React.Fragment, null,
|
|
2031
|
-
React.createElement(Header$
|
|
2031
|
+
React.createElement(Header$3, __assign({ onClick: onClick }, accessibleProps),
|
|
2032
2032
|
React.createElement(Title, null, title),
|
|
2033
2033
|
React.createElement(Icon, { color: Colors.BLACK.Hex, path: open ? mdiChevronUp : mdiChevronDown, size: '24px' })),
|
|
2034
2034
|
open ? children : null));
|
|
2035
2035
|
};
|
|
2036
|
-
var templateObject_1$
|
|
2036
|
+
var templateObject_1$k, templateObject_2$i;
|
|
2037
2037
|
|
|
2038
|
-
var
|
|
2038
|
+
var button_type_mapping = {
|
|
2039
|
+
primary: {
|
|
2040
|
+
background_color: Colors.PRIMARY.Hex,
|
|
2041
|
+
border_color: Colors.PRIMARY.Hex,
|
|
2042
|
+
content_color: '#fff',
|
|
2043
|
+
},
|
|
2044
|
+
secondary: {
|
|
2045
|
+
background_color: 'transparent',
|
|
2046
|
+
border_color: Colors.PRIMARY.Hex,
|
|
2047
|
+
content_color: Colors.PRIMARY.Hex,
|
|
2048
|
+
},
|
|
2049
|
+
red: {
|
|
2050
|
+
background_color: Colors.RED.Hex,
|
|
2051
|
+
border_color: Colors.RED.Hex,
|
|
2052
|
+
content_color: '#fff',
|
|
2053
|
+
},
|
|
2054
|
+
};
|
|
2055
|
+
var StyledButton = styled.button(templateObject_1$j || (templateObject_1$j = __makeTemplateObject(["\n height: ", ";\n line-height: 1em;\n border-radius: ", ";\n margin: ", ";\n padding: ", ";\n outline: none;\n background: ", ";\n width: ", ";\n cursor: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: ", ";\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n box-sizing: border-box;\n &:hover {\n opacity: ", ";\n }\n"], ["\n height: ", ";\n line-height: 1em;\n border-radius: ", ";\n margin: ", ";\n padding: ", ";\n outline: none;\n background: ", ";\n width: ", ";\n cursor: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: ", ";\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n box-sizing: border-box;\n &:hover {\n opacity: ", ";\n }\n"])), function (props) { return (props.$small ? '30px' : '40px'); }, function (props) { return (props.$small ? '15px' : '20px'); }, function (props) { return props.$margin || '0px'; }, function (props) {
|
|
2039
2056
|
if (props.$hasChildren) {
|
|
2040
2057
|
if (props.$small) {
|
|
2041
2058
|
return '0 10px';
|
|
@@ -2045,7 +2062,9 @@ var StyledButton = styled.button(templateObject_1$i || (templateObject_1$i = __m
|
|
|
2045
2062
|
}
|
|
2046
2063
|
}
|
|
2047
2064
|
return '0px';
|
|
2048
|
-
}, function (props) {
|
|
2065
|
+
}, function (props) {
|
|
2066
|
+
return props.$type ? button_type_mapping[props.$type].background_color : Colors.PRIMARY.Hex;
|
|
2067
|
+
}, function (props) {
|
|
2049
2068
|
if (props.$hasChildren) {
|
|
2050
2069
|
return 'auto';
|
|
2051
2070
|
}
|
|
@@ -2053,34 +2072,36 @@ var StyledButton = styled.button(templateObject_1$i || (templateObject_1$i = __m
|
|
|
2053
2072
|
return '30px';
|
|
2054
2073
|
}
|
|
2055
2074
|
return '40px';
|
|
2056
|
-
}, function (props) { return (props.$disabled ? 'default' : 'pointer'); }, function (props) { return (props.$disabled ? 0.6 : 0.9); },
|
|
2057
|
-
|
|
2058
|
-
|
|
2075
|
+
}, function (props) { return (props.$disabled ? 'default' : 'pointer'); }, function (props) { return (props.$disabled ? 0.6 : 0.9); }, function (props) {
|
|
2076
|
+
return props.$type ? button_type_mapping[props.$type].border_color : Colors.PRIMARY.Hex;
|
|
2077
|
+
}, function (props) { return (props.$disabled ? 0.6 : 1); });
|
|
2078
|
+
var Label$3 = styled.span(templateObject_2$h || (templateObject_2$h = __makeTemplateObject(["\n color: ", ";\n font-size: ", ";\n font-family: ", ";\n font-weight: 500;\n line-height: ", ";\n"], ["\n color: ", ";\n font-size: ", ";\n font-family: ", ";\n font-weight: 500;\n line-height: ", ";\n"])), function (props) { return (props.$type ? button_type_mapping[props.$type].content_color : '#fff'); }, function (props) { return (props.$small ? FontSizes.SMALL : FontSizes.DEFAULT); }, FontStyles.DEFAULT, function (props) { return (props.$small ? '2.2em' : '2.9em'); });
|
|
2079
|
+
var StyledIcon = styled.span(templateObject_3$c || (templateObject_3$c = __makeTemplateObject(["\n margin-left: ", ";\n margin-right: ", ";\n display: flex;\n align-items: center;\n box-sizing: border-box;\n"], ["\n margin-left: ", ";\n margin-right: ", ";\n display: flex;\n align-items: center;\n box-sizing: border-box;\n"])), function (props) { return (props.$hasChildren ? '6px' : '0px'); }, function (props) { return (props.$hasChildren ? '-4px' : '0px'); });
|
|
2059
2080
|
var Button = function (_a) {
|
|
2060
2081
|
var children = _a.children, _b = _a.disabled, disabled = _b === void 0 ? false : _b, icon = _a.icon, _c = _a.margin, margin = _c === void 0 ? '' : _c, onClick = _a.onClick, _d = _a.small, small = _d === void 0 ? false : _d, _e = _a.type, type = _e === void 0 ? 'primary' : _e, accessibleProps = __rest(_a, ["children", "disabled", "icon", "margin", "onClick", "small", "type"]);
|
|
2061
2082
|
var has_children = children && children.length > 0;
|
|
2062
|
-
return (React.createElement(StyledButton, __assign({ "$disabled": disabled, "$hasChildren": !!has_children, "$margin": margin, "$
|
|
2083
|
+
return (React.createElement(StyledButton, __assign({ "$disabled": disabled, "$hasChildren": !!has_children, "$margin": margin, "$small": small, "$type": type, onClick: disabled ? undefined : onClick }, accessibleProps),
|
|
2063
2084
|
children ? (React.createElement(Label$3, { "$small": small, "$type": type }, children)) : null,
|
|
2064
2085
|
icon ? (React.createElement(StyledIcon, { "$hasChildren": !!has_children },
|
|
2065
|
-
React.createElement(Icon, { color: type
|
|
2086
|
+
React.createElement(Icon, { color: type ? button_type_mapping[type].content_color : '#fff', path: icon, size: small ? '20px' : '24px' }))) : null));
|
|
2066
2087
|
};
|
|
2067
|
-
var templateObject_1$
|
|
2088
|
+
var templateObject_1$j, templateObject_2$h, templateObject_3$c;
|
|
2068
2089
|
|
|
2069
|
-
var StyledComponent = styled.p(templateObject_1$
|
|
2090
|
+
var StyledComponent = styled.p(templateObject_1$i || (templateObject_1$i = __makeTemplateObject(["\n color: ", ";\n font-size: ", ";\n line-height: ", ";\n letter-spacing: ", ";\n font-weight: ", ";\n font-style: ", ";\n text-decoration: ", ";\n font-family: 'Roboto', Helvetica, Arial, sans-serif;\n margin: ", ";\n padding: ", ";\n text-align: ", ";\n box-sizing: border-box;\n"], ["\n color: ", ";\n font-size: ", ";\n line-height: ", ";\n letter-spacing: ", ";\n font-weight: ", ";\n font-style: ", ";\n text-decoration: ", ";\n font-family: 'Roboto', Helvetica, Arial, sans-serif;\n margin: ", ";\n padding: ", ";\n text-align: ", ";\n box-sizing: border-box;\n"])), function (props) { return Colors[props.$color].Hex; }, function (props) { return (props.$type === 'small' ? FontSizes.SMALL : FontSizes.DEFAULT); }, function (props) { return (props.$type === 'small' ? '1.5em' : '1.6em'); }, function (props) { return (props.$type === 'small' ? '1px' : '0px'); }, function (props) { return (props.$type === 'bold' ? '500' : '400'); }, function (props) { return (props.$type === 'italic' ? 'italic' : 'normal'); }, function (props) {
|
|
2070
2091
|
return ['underline', 'line-through'].includes(props.$type) ? props.$type : 'none';
|
|
2071
2092
|
}, function (props) { return props.$margin || '0px'; }, function (props) { return props.$padding || '0px'; }, function (props) { return props.$align || 'left'; });
|
|
2072
2093
|
var Copy = function (_a) {
|
|
2073
|
-
var children = _a.children, _b = _a.align, align = _b === void 0 ? '' : _b, _c = _a.margin, margin = _c === void 0 ? '' : _c, _d = _a.padding, padding = _d === void 0 ? '' : _d, _e = _a.type, type = _e === void 0 ? 'default' : _e;
|
|
2074
|
-
return (React.createElement(StyledComponent, { "$align": align, "$margin": margin, "$padding": padding, "$type": type }, children));
|
|
2094
|
+
var children = _a.children, _b = _a.align, align = _b === void 0 ? '' : _b, _c = _a.margin, margin = _c === void 0 ? '' : _c, _d = _a.padding, padding = _d === void 0 ? '' : _d, _e = _a.type, type = _e === void 0 ? 'default' : _e, _f = _a.color, color = _f === void 0 ? 'BLACK' : _f;
|
|
2095
|
+
return (React.createElement(StyledComponent, { "$align": align, "$color": color, "$margin": margin, "$padding": padding, "$type": type }, children));
|
|
2075
2096
|
};
|
|
2076
2097
|
Copy.defaultProps = {
|
|
2077
2098
|
type: 'default',
|
|
2078
2099
|
};
|
|
2079
|
-
var templateObject_1$
|
|
2100
|
+
var templateObject_1$i;
|
|
2080
2101
|
|
|
2081
|
-
var H1 = styled.h1(templateObject_1$
|
|
2082
|
-
var H2 = styled.h2(templateObject_2$
|
|
2083
|
-
var H3 = styled.h3(templateObject_3$
|
|
2102
|
+
var H1 = styled.h1(templateObject_1$h || (templateObject_1$h = __makeTemplateObject(["\n color: ", ";\n font-size: 30px;\n font-weight: ", ";\n line-height: 1.4em;\n font-family: 'Roboto Slab', Roboto, Helvetica, Arial, sans-serif;\n margin: ", ";\n padding: ", ";\n box-sizing: border-box;\n"], ["\n color: ", ";\n font-size: 30px;\n font-weight: ", ";\n line-height: 1.4em;\n font-family: 'Roboto Slab', Roboto, Helvetica, Arial, sans-serif;\n margin: ", ";\n padding: ", ";\n box-sizing: border-box;\n"])), Colors.BLACK.Hex, function (props) { return (props.$bold ? '500' : '400'); }, function (props) { return props.$margin || '0px'; }, function (props) { return props.$padding || '0px'; });
|
|
2103
|
+
var H2 = styled.h2(templateObject_2$g || (templateObject_2$g = __makeTemplateObject(["\n color: ", ";\n font-size: 24px;\n font-weight: ", ";\n line-height: 1.33em;\n font-family: 'Roboto Slab', Roboto, Helvetica, Arial, sans-serif;\n margin: ", ";\n padding: ", ";\n box-sizing: border-box;\n"], ["\n color: ", ";\n font-size: 24px;\n font-weight: ", ";\n line-height: 1.33em;\n font-family: 'Roboto Slab', Roboto, Helvetica, Arial, sans-serif;\n margin: ", ";\n padding: ", ";\n box-sizing: border-box;\n"])), Colors.BLACK.Hex, function (props) { return (props.$bold ? '500' : '400'); }, function (props) { return props.$margin || '0px'; }, function (props) { return props.$padding || '0px'; });
|
|
2104
|
+
var H3 = styled.h3(templateObject_3$b || (templateObject_3$b = __makeTemplateObject(["\n color: ", ";\n font-size: 18px;\n font-weight: ", ";\n line-height: 1.33em;\n font-family: 'Roboto Slab', Roboto, Helvetica, Arial, sans-serif;\n margin: ", ";\n padding: ", ";\n box-sizing: border-box;\n"], ["\n color: ", ";\n font-size: 18px;\n font-weight: ", ";\n line-height: 1.33em;\n font-family: 'Roboto Slab', Roboto, Helvetica, Arial, sans-serif;\n margin: ", ";\n padding: ", ";\n box-sizing: border-box;\n"])), Colors.BLACK.Hex, function (props) { return (props.$bold ? '500' : '400'); }, function (props) { return props.$margin || '0px'; }, function (props) { return props.$padding || '0px'; });
|
|
2084
2105
|
var Heading = function (_a) {
|
|
2085
2106
|
var bold = _a.bold, children = _a.children, margin = _a.margin, padding = _a.padding, type = _a.type, accessibleProps = __rest(_a, ["bold", "children", "margin", "padding", "type"]);
|
|
2086
2107
|
switch (type) {
|
|
@@ -2099,11 +2120,11 @@ Heading.defaultProps = {
|
|
|
2099
2120
|
bold: false,
|
|
2100
2121
|
type: 'primary',
|
|
2101
2122
|
};
|
|
2102
|
-
var templateObject_1$
|
|
2123
|
+
var templateObject_1$h, templateObject_2$g, templateObject_3$b;
|
|
2103
2124
|
|
|
2104
|
-
var Wrapper$9 = styled.div(templateObject_1$
|
|
2105
|
-
var Container$
|
|
2106
|
-
var Buttons = styled.div(templateObject_3$
|
|
2125
|
+
var Wrapper$9 = styled.div(templateObject_1$g || (templateObject_1$g = __makeTemplateObject(["\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 9999;\n background: rgba(0, 0, 0, 0.8);\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n"], ["\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 9999;\n background: rgba(0, 0, 0, 0.8);\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n"])));
|
|
2126
|
+
var Container$2 = styled.dialog(templateObject_2$f || (templateObject_2$f = __makeTemplateObject(["\n max-width: 600px;\n width: auto;\n border-radius: 8px;\n overflow: hidden;\n box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.2);\n outline: none;\n border: none;\n position: relative;\n padding: 40px;\n text-align: center;\n box-sizing: border-box;\n"], ["\n max-width: 600px;\n width: auto;\n border-radius: 8px;\n overflow: hidden;\n box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.2);\n outline: none;\n border: none;\n position: relative;\n padding: 40px;\n text-align: center;\n box-sizing: border-box;\n"])));
|
|
2127
|
+
var Buttons = styled.div(templateObject_3$a || (templateObject_3$a = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n margin-top: 30px;\n box-sizing: border-box;\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n margin-top: 30px;\n box-sizing: border-box;\n"])));
|
|
2107
2128
|
var ActionDialog = function (_a) {
|
|
2108
2129
|
var description = _a.description, title = _a.title, onClose = _a.onClose, primaryButton = _a.primaryButton, secondaryButton = _a.secondaryButton, accessibleProps = __rest(_a, ["description", "title", "onClose", "primaryButton", "secondaryButton"]);
|
|
2109
2130
|
useEffect(function () {
|
|
@@ -2117,17 +2138,17 @@ var ActionDialog = function (_a) {
|
|
|
2117
2138
|
};
|
|
2118
2139
|
}, []);
|
|
2119
2140
|
return (React.createElement(Wrapper$9, __assign({}, accessibleProps),
|
|
2120
|
-
React.createElement(Container$
|
|
2141
|
+
React.createElement(Container$2, { open: true },
|
|
2121
2142
|
title ? (React.createElement(Heading, { margin: '0px 0px 20px 0px', type: 'secondary' }, title)) : null,
|
|
2122
2143
|
description ? React.createElement(Copy, { align: 'center' }, description) : null,
|
|
2123
2144
|
primaryButton || secondaryButton ? (React.createElement(Buttons, null,
|
|
2124
2145
|
secondaryButton ? (React.createElement(Button, __assign({}, secondaryButton, { margin: '0px 5px', type: 'secondary' }))) : null,
|
|
2125
2146
|
primaryButton ? React.createElement(Button, __assign({}, primaryButton, { margin: '0px 5px', type: 'primary' })) : null)) : null)));
|
|
2126
2147
|
};
|
|
2127
|
-
var templateObject_1$
|
|
2148
|
+
var templateObject_1$g, templateObject_2$f, templateObject_3$a;
|
|
2128
2149
|
|
|
2129
|
-
var Wrapper$8 = styled.div(templateObject_1$
|
|
2130
|
-
var Content$1 = styled.div(templateObject_2$
|
|
2150
|
+
var Wrapper$8 = styled.div(templateObject_1$f || (templateObject_1$f = __makeTemplateObject(["\n border: 1px solid #f1f1f1;\n border-radius: 4px;\n border-left-width: 4px;\n box-shadow: 0px 4px 12px -6px rgba(0, 0, 0, 0.2);\n display: flex;\n align-items: flex-start;\n padding: 20px;\n box-sizing: border-box;\n"], ["\n border: 1px solid #f1f1f1;\n border-radius: 4px;\n border-left-width: 4px;\n box-shadow: 0px 4px 12px -6px rgba(0, 0, 0, 0.2);\n display: flex;\n align-items: flex-start;\n padding: 20px;\n box-sizing: border-box;\n"])));
|
|
2151
|
+
var Content$1 = styled.div(templateObject_2$e || (templateObject_2$e = __makeTemplateObject(["\n margin-left: 20px;\n"], ["\n margin-left: 20px;\n"])));
|
|
2131
2152
|
var Alert = function (_a) {
|
|
2132
2153
|
var _b = _a.type, type = _b === void 0 ? 'info' : _b, title = _a.title, description = _a.description, accessibleProps = __rest(_a, ["type", "title", "description"]);
|
|
2133
2154
|
var type_mapping = {
|
|
@@ -2155,14 +2176,14 @@ var Alert = function (_a) {
|
|
|
2155
2176
|
title ? (React.createElement(Heading, { bold: true, margin: '2px 0 0 0', type: 'tertiary' }, title)) : null,
|
|
2156
2177
|
description ? React.createElement(Copy, { margin: '10px 0 0 0' }, description) : null)));
|
|
2157
2178
|
};
|
|
2158
|
-
var templateObject_1$
|
|
2159
|
-
|
|
2160
|
-
var Wrapper$7 = styled.div(templateObject_1$
|
|
2161
|
-
var Left = styled.div(templateObject_2$
|
|
2162
|
-
var Info = styled.div(templateObject_3$
|
|
2163
|
-
var Selected = styled.span(templateObject_4$
|
|
2164
|
-
var Clear = styled.span(templateObject_5$
|
|
2165
|
-
var Actions = styled.div(templateObject_6$
|
|
2179
|
+
var templateObject_1$f, templateObject_2$e;
|
|
2180
|
+
|
|
2181
|
+
var Wrapper$7 = styled.div(templateObject_1$e || (templateObject_1$e = __makeTemplateObject(["\n border: 1px solid ", ";\n border-radius: 8px;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 16px 20px;\n"], ["\n border: 1px solid ", ";\n border-radius: 8px;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 16px 20px;\n"])), Colors.PRIMARY.Hex);
|
|
2182
|
+
var Left = styled.div(templateObject_2$d || (templateObject_2$d = __makeTemplateObject(["\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-shrink: 0;\n"], ["\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-shrink: 0;\n"])));
|
|
2183
|
+
var Info = styled.div(templateObject_3$9 || (templateObject_3$9 = __makeTemplateObject(["\n box-sizing: border-box;\n display: flex;\n align-items: center;\n margin-right: 30px;\n"], ["\n box-sizing: border-box;\n display: flex;\n align-items: center;\n margin-right: 30px;\n"])));
|
|
2184
|
+
var Selected = styled.span(templateObject_4$6 || (templateObject_4$6 = __makeTemplateObject(["\n font-size: 14px;\n font-weight: 400;\n font-family: ", ";\n color: ", ";\n line-height: 1;\n"], ["\n font-size: 14px;\n font-weight: 400;\n font-family: ", ";\n color: ", ";\n line-height: 1;\n"])), FontStyles.DEFAULT, Colors.BLACK.Hex);
|
|
2185
|
+
var Clear = styled.span(templateObject_5$4 || (templateObject_5$4 = __makeTemplateObject(["\n font-size: 14px;\n font-weight: 400;\n font-family: ", ";\n color: ", ";\n line-height: 1;\n cursor: pointer;\n padding-left: 10px;\n margin-left: 10px;\n border-left: 1px solid #ccc;\n"], ["\n font-size: 14px;\n font-weight: 400;\n font-family: ", ";\n color: ", ";\n line-height: 1;\n cursor: pointer;\n padding-left: 10px;\n margin-left: 10px;\n border-left: 1px solid #ccc;\n"])), FontStyles.DEFAULT, Colors.PRIMARY.Hex);
|
|
2186
|
+
var Actions = styled.div(templateObject_6$3 || (templateObject_6$3 = __makeTemplateObject(["\n box-sizing: border-box;\n display: flex;\n align-items: center;\n column-gap: 10px;\n"], ["\n box-sizing: border-box;\n display: flex;\n align-items: center;\n column-gap: 10px;\n"])));
|
|
2166
2187
|
var Error$1 = styled.div(templateObject_7$2 || (templateObject_7$2 = __makeTemplateObject(["\n box-sizing: border-box;\n display: flex;\n align-items: center;\n background: rgba(", ", 0.1);\n border-radius: 4px;\n padding: 6px 8px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n margin-left: 30px;\n"], ["\n box-sizing: border-box;\n display: flex;\n align-items: center;\n background: rgba(", ", 0.1);\n border-radius: 4px;\n padding: 6px 8px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n margin-left: 30px;\n"])), Colors.RED.Rgb);
|
|
2167
2188
|
var ErrorMsg = styled.span(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n font-size: 14px;\n font-weight: 500;\n font-family: ", ";\n line-height: 1em;\n color: ", ";\n margin-left: 8px;\n"], ["\n font-size: 14px;\n font-weight: 500;\n font-family: ", ";\n line-height: 1em;\n color: ", ";\n margin-left: 8px;\n"])), FontStyles.DEFAULT, Colors.RED.Hex);
|
|
2168
2189
|
var BulkActionBar = function (_a) {
|
|
@@ -2179,18 +2200,18 @@ var BulkActionBar = function (_a) {
|
|
|
2179
2200
|
React.createElement(Icon, { color: Colors.RED.Hex, path: mdiInformationOutline, size: '20px' }),
|
|
2180
2201
|
React.createElement(ErrorMsg, null, errorMsg))) : null));
|
|
2181
2202
|
};
|
|
2182
|
-
var templateObject_1$
|
|
2203
|
+
var templateObject_1$e, templateObject_2$d, templateObject_3$9, templateObject_4$6, templateObject_5$4, templateObject_6$3, templateObject_7$2, templateObject_8;
|
|
2183
2204
|
|
|
2184
2205
|
var Checkbox = function (_a) {
|
|
2185
2206
|
var children = _a.children, disabled = _a.disabled, checked = _a.checked, onChange = _a.onChange, accessibleProps = __rest(_a, ["children", "disabled", "checked", "onChange"]);
|
|
2186
|
-
var Wrapper = styled.label(templateObject_1$
|
|
2187
|
-
var Input = styled.input(templateObject_2$
|
|
2188
|
-
var Label = styled.span(templateObject_3$
|
|
2207
|
+
var Wrapper = styled.label(templateObject_1$d || (templateObject_1$d = __makeTemplateObject(["\n padding: 4px 0;\n cursor: ", ";\n display: flex;\n align-items: center;\n font-size: ", ";\n line-height: 1.6em;\n box-sizing: border-box;\n "], ["\n padding: 4px 0;\n cursor: ", ";\n display: flex;\n align-items: center;\n font-size: ", ";\n line-height: 1.6em;\n box-sizing: border-box;\n "])), disabled ? 'default' : 'pointer', FontSizes.DEFAULT);
|
|
2208
|
+
var Input = styled.input(templateObject_2$c || (templateObject_2$c = __makeTemplateObject(["\n font-size: 20px;\n margin: 0px 0px 2px 0px;\n line-height: 1.1em;\n box-sizing: border-box;\n "], ["\n font-size: 20px;\n margin: 0px 0px 2px 0px;\n line-height: 1.1em;\n box-sizing: border-box;\n "])));
|
|
2209
|
+
var Label = styled.span(templateObject_3$8 || (templateObject_3$8 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n line-height: 1.6em;\n color: ", ";\n margin-left: 6px;\n box-sizing: border-box;\n "], ["\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n line-height: 1.6em;\n color: ", ";\n margin-left: 6px;\n box-sizing: border-box;\n "])), FontStyles.DEFAULT, FontSizes.DEFAULT, Colors.BLACK.Hex);
|
|
2189
2210
|
return (React.createElement(Wrapper, __assign({}, accessibleProps, { onClick: disabled ? undefined : onChange }),
|
|
2190
2211
|
React.createElement(Input, { checked: checked, disabled: disabled, name: accessibleProps.name, type: 'checkbox' }),
|
|
2191
2212
|
children ? React.createElement(Label, null, children) : null));
|
|
2192
2213
|
};
|
|
2193
|
-
var templateObject_1$
|
|
2214
|
+
var templateObject_1$d, templateObject_2$c, templateObject_3$8;
|
|
2194
2215
|
|
|
2195
2216
|
var Checklist = function (_a) {
|
|
2196
2217
|
var disabled = _a.disabled, onChange = _a.onChange, options = _a.options, selected = _a.selected, showSelectAll = _a.showSelectAll, accessibleProps = __rest(_a, ["disabled", "onChange", "options", "selected", "showSelectAll"]);
|
|
@@ -2210,8 +2231,8 @@ var Checklist = function (_a) {
|
|
|
2210
2231
|
}
|
|
2211
2232
|
onChange(updated_selected);
|
|
2212
2233
|
};
|
|
2213
|
-
var SelectAll = styled.div(templateObject_1$
|
|
2214
|
-
var Options = styled.div(templateObject_2$
|
|
2234
|
+
var SelectAll = styled.div(templateObject_1$c || (templateObject_1$c = __makeTemplateObject(["\n padding: 8px 12px;\n border-bottom: 1px solid ", ";\n box-sizing: border-box;\n "], ["\n padding: 8px 12px;\n border-bottom: 1px solid ", ";\n box-sizing: border-box;\n "])), Colors.LIGHT_GRAY.Hex);
|
|
2235
|
+
var Options = styled.div(templateObject_2$b || (templateObject_2$b = __makeTemplateObject(["\n padding: 12px;\n box-sizing: border-box;\n "], ["\n padding: 12px;\n box-sizing: border-box;\n "])));
|
|
2215
2236
|
return (React.createElement(React.Fragment, null,
|
|
2216
2237
|
showSelectAll && values.length ? (React.createElement(SelectAll, null,
|
|
2217
2238
|
React.createElement(Checkbox, { checked: selected.length === values.length, disabled: disabled, onChange: handleToggleAll }, "Select All"))) : null,
|
|
@@ -2221,7 +2242,48 @@ var Checklist = function (_a) {
|
|
|
2221
2242
|
return (React.createElement(Checkbox, __assign({}, accessibleProps, { checked: checked, disabled: disabled, onChange: handleChange.bind(null, option) }), label));
|
|
2222
2243
|
}))));
|
|
2223
2244
|
};
|
|
2224
|
-
var templateObject_1$
|
|
2245
|
+
var templateObject_1$c, templateObject_2$b;
|
|
2246
|
+
|
|
2247
|
+
var Scrim$1 = styled.div(templateObject_1$b || (templateObject_1$b = __makeTemplateObject(["\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 9998;\n background: ", ";\n"], ["\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 9998;\n background: ", ";\n"])), function (_a) {
|
|
2248
|
+
var $scrim = _a.$scrim;
|
|
2249
|
+
return ($scrim === 'dark' ? 'rgba(0,0,0,0.8)' : 'transparent');
|
|
2250
|
+
});
|
|
2251
|
+
var Container$1 = styled.div(templateObject_2$a || (templateObject_2$a = __makeTemplateObject(["\n z-index: 9999;\n min-width: 400px;\n width: ", ";\n overflow: hidden;\n box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.2);\n outline: none;\n border: none;\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n padding: 0px;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n background: #fff;\n"], ["\n z-index: 9999;\n min-width: 400px;\n width: ", ";\n overflow: hidden;\n box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.2);\n outline: none;\n border: none;\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n padding: 0px;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n background: #fff;\n"])), function (_a) {
|
|
2252
|
+
var $width = _a.$width;
|
|
2253
|
+
return $width || '400px';
|
|
2254
|
+
});
|
|
2255
|
+
var Header$2 = styled.div(templateObject_3$7 || (templateObject_3$7 = __makeTemplateObject(["\n padding: 30px 20px;\n display: flex;\n align-items: flex-start;\n box-sizing: border-box;\n flex-shrink: 0;\n background: #fff;\n"], ["\n padding: 30px 20px;\n display: flex;\n align-items: flex-start;\n box-sizing: border-box;\n flex-shrink: 0;\n background: #fff;\n"])));
|
|
2256
|
+
var Close$1 = styled.div(templateObject_4$5 || (templateObject_4$5 = __makeTemplateObject(["\n margin-left: auto;\n display: flex;\n align-items: center;\n padding-left: 20px;\n cursor: pointer;\n"], ["\n margin-left: auto;\n display: flex;\n align-items: center;\n padding-left: 20px;\n cursor: pointer;\n"])));
|
|
2257
|
+
var ContentWrapper$1 = styled.div(templateObject_5$3 || (templateObject_5$3 = __makeTemplateObject(["\n overflow-x: hidden;\n overflow-y: auto;\n box-sizing: border-box;\n flex: 1;\n background: #fff;\n"], ["\n overflow-x: hidden;\n overflow-y: auto;\n box-sizing: border-box;\n flex: 1;\n background: #fff;\n"])));
|
|
2258
|
+
var ButtonBar$1 = styled.div(templateObject_6$2 || (templateObject_6$2 = __makeTemplateObject(["\n padding: 20px;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n box-sizing: border-box;\n gap: 10px;\n flex-shrink: 0;\n background: #fff;\n"], ["\n padding: 20px;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n box-sizing: border-box;\n gap: 10px;\n flex-shrink: 0;\n background: #fff;\n"])));
|
|
2259
|
+
var Drawer = function (_a) {
|
|
2260
|
+
var children = _a.children, description = _a.description, title = _a.title, onClose = _a.onClose, primaryButton = _a.primaryButton, secondaryButton = _a.secondaryButton, tertiaryButton = _a.tertiaryButton, scrim = _a.scrim, width = _a.width, accessibleProps = __rest(_a, ["children", "description", "title", "onClose", "primaryButton", "secondaryButton", "tertiaryButton", "scrim", "width"]);
|
|
2261
|
+
useEffect(function () {
|
|
2262
|
+
document.onkeydown = function (e) {
|
|
2263
|
+
if (e.key === 'Escape') {
|
|
2264
|
+
onClose();
|
|
2265
|
+
}
|
|
2266
|
+
};
|
|
2267
|
+
return function cleanup() {
|
|
2268
|
+
document.onkeydown = null;
|
|
2269
|
+
};
|
|
2270
|
+
}, []);
|
|
2271
|
+
return (React.createElement(React.Fragment, null,
|
|
2272
|
+
React.createElement(Container$1, __assign({}, accessibleProps, { "$width": width }),
|
|
2273
|
+
React.createElement(Header$2, null,
|
|
2274
|
+
React.createElement("div", null,
|
|
2275
|
+
title ? React.createElement(Heading, { type: 'secondary' }, title) : null,
|
|
2276
|
+
description ? React.createElement(Copy, { color: 'GRAY' }, description) : null),
|
|
2277
|
+
React.createElement(Close$1, { onClick: onClose },
|
|
2278
|
+
React.createElement(Button, { icon: mdiClose, small: true, type: 'secondary' }))),
|
|
2279
|
+
React.createElement(ContentWrapper$1, null, children),
|
|
2280
|
+
primaryButton || secondaryButton || tertiaryButton ? (React.createElement(ButtonBar$1, null,
|
|
2281
|
+
tertiaryButton ? React.createElement(Button, __assign({}, tertiaryButton, { type: 'secondary' })) : null,
|
|
2282
|
+
secondaryButton ? React.createElement(Button, __assign({}, secondaryButton, { type: 'secondary' })) : null,
|
|
2283
|
+
primaryButton ? React.createElement(Button, __assign({}, primaryButton, { type: 'primary' })) : null)) : null),
|
|
2284
|
+
scrim ? React.createElement(Scrim$1, { "$scrim": scrim, onClick: onClose }) : null));
|
|
2285
|
+
};
|
|
2286
|
+
var templateObject_1$b, templateObject_2$a, templateObject_3$7, templateObject_4$5, templateObject_5$3, templateObject_6$2;
|
|
2225
2287
|
|
|
2226
2288
|
var Wrapper$6 = styled.div(templateObject_1$a || (templateObject_1$a = __makeTemplateObject(["\n margin: ", ";\n"], ["\n margin: ", ";\n"])), function (props) { return props.$margin || '0px 0px 15px 0px'; });
|
|
2227
2289
|
var LabelRow = styled.div(templateObject_2$9 || (templateObject_2$9 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin: 0 0 4px 0;\n box-sizing: border-box;\n"], ["\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin: 0 0 4px 0;\n box-sizing: border-box;\n"])));
|
|
@@ -2322,7 +2384,7 @@ var Container = styled.dialog(templateObject_2$7 || (templateObject_2$7 = __make
|
|
|
2322
2384
|
var Header$1 = styled.div(templateObject_3$5 || (templateObject_3$5 = __makeTemplateObject(["\n position: sticky;\n top: 0;\n padding: 20px;\n border-bottom: 1px solid #e5e5e5;\n display: flex;\n align-items: center;\n background: #ffffff;\n box-sizing: border-box;\n"], ["\n position: sticky;\n top: 0;\n padding: 20px;\n border-bottom: 1px solid #e5e5e5;\n display: flex;\n align-items: center;\n background: #ffffff;\n box-sizing: border-box;\n"])));
|
|
2323
2385
|
var Close = styled.div(templateObject_4$3 || (templateObject_4$3 = __makeTemplateObject(["\n margin-left: auto;\n display: flex;\n align-items: center;\n padding-left: 20px;\n cursor: pointer;\n"], ["\n margin-left: auto;\n display: flex;\n align-items: center;\n padding-left: 20px;\n cursor: pointer;\n"])));
|
|
2324
2386
|
var CloseMsg = styled.span(templateObject_5$1 || (templateObject_5$1 = __makeTemplateObject(["\n font-size: ", ";\n font-weight: 400;\n font-family: ", ";\n line-height: 1em;\n color: ", ";\n"], ["\n font-size: ", ";\n font-weight: 400;\n font-family: ", ";\n line-height: 1em;\n color: ", ";\n"])), FontSizes.SMALL, FontStyles.DEFAULT, Colors.MEDIUM_GRAY.Hex);
|
|
2325
|
-
var ContentWrapper = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n overflow: auto;\n background: #ffffff;\n max-height: calc(100vh - 260px);\n box-sizing: border-box;\n"], ["\n overflow: auto;\n background: #ffffff;\n max-height: calc(100vh - 260px);\n box-sizing: border-box;\n"])));
|
|
2387
|
+
var ContentWrapper = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n overflow-x: hidden;\n overflow-y: auto;\n background: #ffffff;\n max-height: calc(100vh - 260px);\n box-sizing: border-box;\n"], ["\n overflow-x: hidden;\n overflow-y: auto;\n background: #ffffff;\n max-height: calc(100vh - 260px);\n box-sizing: border-box;\n"])));
|
|
2326
2388
|
var ButtonBar = styled.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n position: sticky;\n bottom: 0;\n background: #ffffff;\n padding: 20px;\n border-top: 1px solid #e5e5e5;\n display: flex;\n align-items: center;\n justify-self: flex-end;\n box-sizing: border-box;\n"], ["\n position: sticky;\n bottom: 0;\n background: #ffffff;\n padding: 20px;\n border-top: 1px solid #e5e5e5;\n display: flex;\n align-items: center;\n justify-self: flex-end;\n box-sizing: border-box;\n"])));
|
|
2327
2389
|
var Modal = function (_a) {
|
|
2328
2390
|
var children = _a.children, title = _a.title, onClose = _a.onClose, maxWidth = _a.maxWidth, primaryButton = _a.primaryButton, secondaryButton = _a.secondaryButton, tertiaryButton = _a.tertiaryButton, accessibleProps = __rest(_a, ["children", "title", "onClose", "maxWidth", "primaryButton", "secondaryButton", "tertiaryButton"]);
|
|
@@ -2523,5 +2585,5 @@ var Toggle = function (_a) {
|
|
|
2523
2585
|
Toggle.defaultProps = {};
|
|
2524
2586
|
var templateObject_1, templateObject_2;
|
|
2525
2587
|
|
|
2526
|
-
export { Accordion, ActionDialog, Alert, BulkActionBar, Button, Checkbox, Checklist, Copy, Field, Heading, Input$1 as Input, Modal, MultiSelect, Pagination, Radio, RadioList, Select, Table, Tabs, Tag, Toggle };
|
|
2588
|
+
export { Accordion, ActionDialog, Alert, BulkActionBar, Button, Checkbox, Checklist, Copy, Drawer, Field, Heading, Input$1 as Input, Modal, MultiSelect, Pagination, Radio, RadioList, Select, Table, Tabs, Tag, Toggle };
|
|
2527
2589
|
//# sourceMappingURL=index.js.map
|