@deskpro/deskpro-ui 0.1.14 → 1.0.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 +11 -8
- package/dist/cjs/components/AttachmentTag/AttachmentTag.d.ts +0 -1
- package/dist/cjs/components/AttachmentTag/AttachmentTag.d.ts.map +1 -1
- package/dist/cjs/components/AttachmentTag/AttachmentTag.js +1 -3
- package/dist/cjs/components/AttachmentTag/LoadingAttachment.d.ts +0 -1
- package/dist/cjs/components/AttachmentTag/LoadingAttachment.d.ts.map +1 -1
- package/dist/cjs/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/cjs/components/Avatar/Avatar.js +5 -11
- package/dist/cjs/components/Avatar/AvatarGroup.d.ts +1 -2
- package/dist/cjs/components/Avatar/AvatarGroup.d.ts.map +1 -1
- package/dist/cjs/components/Button/Button.d.ts +18 -11
- package/dist/cjs/components/Button/Button.d.ts.map +1 -1
- package/dist/cjs/components/Button/Button.js +93 -27
- package/dist/cjs/components/Button/styles.d.ts +7 -5
- package/dist/cjs/components/Button/styles.d.ts.map +1 -1
- package/dist/cjs/components/Button/styles.js +62 -39
- package/dist/cjs/components/Button/types.d.ts +19 -10
- package/dist/cjs/components/Button/types.d.ts.map +1 -1
- package/dist/cjs/components/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/cjs/components/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/cjs/components/CCUserTag/CCUserTag.d.ts +0 -1
- package/dist/cjs/components/CCUserTag/CCUserTag.d.ts.map +1 -1
- package/dist/cjs/components/CCUserTag/CCUserTag.js +9 -11
- package/dist/cjs/components/Card/AppCard.d.ts +0 -1
- package/dist/cjs/components/Card/AppCard.d.ts.map +1 -1
- package/dist/cjs/components/Card/CardKanban.d.ts +0 -1
- package/dist/cjs/components/Card/CardKanban.d.ts.map +1 -1
- package/dist/cjs/components/Card/CardList.d.ts +0 -1
- package/dist/cjs/components/Card/CardList.d.ts.map +1 -1
- package/dist/cjs/components/Card/RowCard.d.ts +0 -1
- package/dist/cjs/components/Card/RowCard.d.ts.map +1 -1
- package/dist/cjs/components/Checkbox/Checkbox.d.ts +0 -1
- package/dist/cjs/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/cjs/components/Checkbox/Checkbox.js +1 -3
- package/dist/cjs/components/ColorInput/ColorInput.d.ts +0 -1
- package/dist/cjs/components/ColorInput/ColorInput.d.ts.map +1 -1
- package/dist/cjs/components/ColorInput/ColorInput.js +4 -8
- package/dist/cjs/components/DatePicker/DatePicker.d.ts +0 -1
- package/dist/cjs/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/cjs/components/DatePicker/index.d.ts +1 -1
- package/dist/cjs/components/DatePicker/index.d.ts.map +1 -1
- package/dist/cjs/components/DatePicker/styles.d.ts +0 -1
- package/dist/cjs/components/DatePicker/styles.d.ts.map +1 -1
- package/dist/cjs/components/Dialog/Dialog.d.ts +1 -1
- package/dist/cjs/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/cjs/components/Dialog/Dialog.js +1 -0
- package/dist/cjs/components/Dropdown/Dropdown.d.ts +0 -1
- package/dist/cjs/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/cjs/components/Dropdown/Dropdown.js +5 -11
- package/dist/cjs/components/Dropdown/DropdownResetButton.d.ts +0 -2
- package/dist/cjs/components/Dropdown/DropdownResetButton.d.ts.map +1 -1
- package/dist/cjs/components/Dropdown/styles.d.ts +0 -2
- package/dist/cjs/components/Dropdown/styles.d.ts.map +1 -1
- package/dist/cjs/components/Dropdown/types.d.ts +0 -1
- package/dist/cjs/components/Dropdown/types.d.ts.map +1 -1
- package/dist/cjs/components/FlagImg/FlagImg.d.ts +0 -1
- package/dist/cjs/components/FlagImg/FlagImg.d.ts.map +1 -1
- package/dist/cjs/components/Formik/FormikFastField.d.ts +0 -1
- package/dist/cjs/components/Formik/FormikFastField.d.ts.map +1 -1
- package/dist/cjs/components/Icon/DeskproCustomIcon.d.ts +4 -4
- package/dist/cjs/components/Icon/DeskproCustomIcon.d.ts.map +1 -1
- package/dist/cjs/components/Icon/DeskproCustomIcon.js +2 -2
- package/dist/cjs/components/Icon/HeroIcon.d.ts +2 -3
- package/dist/cjs/components/Icon/HeroIcon.d.ts.map +1 -1
- package/dist/cjs/components/Icon/Icon.d.ts +0 -2
- package/dist/cjs/components/Icon/Icon.d.ts.map +1 -1
- package/dist/cjs/components/Icon/Icon.js +8 -16
- package/dist/cjs/components/Infinite/Infinite.d.ts.map +1 -1
- package/dist/cjs/components/Infinite/Infinite.js +5 -10
- package/dist/cjs/components/Infinite/InfiniteTopBottom.d.ts.map +1 -1
- package/dist/cjs/components/Infinite/InfiniteTopBottom.js +4 -8
- package/dist/cjs/components/Infinite/ObservedDiv.d.ts +0 -1
- package/dist/cjs/components/Infinite/ObservedDiv.d.ts.map +1 -1
- package/dist/cjs/components/Input/Input.d.ts +0 -1
- package/dist/cjs/components/Input/Input.d.ts.map +1 -1
- package/dist/cjs/components/IntlPhoneInput/IntlPhoneInput.d.ts +1 -1
- package/dist/cjs/components/IntlPhoneInput/IntlPhoneInput.d.ts.map +1 -1
- package/dist/cjs/components/IntlPhoneInput/IntlPhoneInput.js +2 -6
- package/dist/cjs/components/Label/Label.d.ts +0 -1
- package/dist/cjs/components/Label/Label.d.ts.map +1 -1
- package/dist/cjs/components/LabelTag/Tag.d.ts +1 -2
- package/dist/cjs/components/LabelTag/Tag.d.ts.map +1 -1
- package/dist/cjs/components/LabelTag/Tag.js +7 -6
- package/dist/cjs/components/LabelTag/TagCircle.d.ts +0 -1
- package/dist/cjs/components/LabelTag/TagCircle.d.ts.map +1 -1
- package/dist/cjs/components/Menu/Menu.d.ts +8 -17
- package/dist/cjs/components/Menu/Menu.d.ts.map +1 -1
- package/dist/cjs/components/Menu/Menu.js +2 -2
- package/dist/cjs/components/Modal/Modal.d.ts +1 -1
- package/dist/cjs/components/Modal/Modal.d.ts.map +1 -1
- package/dist/cjs/components/Modal/Modal.js +3 -9
- package/dist/cjs/components/NonIdealState/styles.d.ts +0 -1
- package/dist/cjs/components/NonIdealState/styles.d.ts.map +1 -1
- package/dist/cjs/components/OptionTag/OptionTag.d.ts +0 -1
- package/dist/cjs/components/OptionTag/OptionTag.d.ts.map +1 -1
- package/dist/cjs/components/OptionTag/OptionTag.js +1 -1
- package/dist/cjs/components/Pagination/Pagination.d.ts +0 -2
- package/dist/cjs/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/cjs/components/Pagination/Pagination.js +3 -4
- package/dist/cjs/components/Pill/UrgencyCircle.d.ts +0 -1
- package/dist/cjs/components/Pill/UrgencyCircle.d.ts.map +1 -1
- package/dist/cjs/components/Radio/Radio.d.ts +0 -1
- package/dist/cjs/components/Radio/Radio.d.ts.map +1 -1
- package/dist/cjs/components/SandboxHtml/SandboxHtml.d.ts +0 -1
- package/dist/cjs/components/SandboxHtml/SandboxHtml.d.ts.map +1 -1
- package/dist/cjs/components/Scrollbar/Scrollbar.d.ts +2 -0
- package/dist/cjs/components/Scrollbar/Scrollbar.d.ts.map +1 -1
- package/dist/cjs/components/Select/Select.d.ts +0 -1
- package/dist/cjs/components/Select/Select.d.ts.map +1 -1
- package/dist/cjs/components/Select/Select.js +5 -11
- package/dist/cjs/components/Spinner/Spinner.d.ts +0 -1
- package/dist/cjs/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/cjs/components/TabBar/TabBar.d.ts +0 -1
- package/dist/cjs/components/TabBar/TabBar.d.ts.map +1 -1
- package/dist/cjs/components/TabbedSection/Tabs.d.ts +0 -1
- package/dist/cjs/components/TabbedSection/Tabs.d.ts.map +1 -1
- package/dist/cjs/components/TabbedSection/Tabs.js +2 -2
- package/dist/cjs/components/Tabs/Tabs.d.ts +0 -1
- package/dist/cjs/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/cjs/components/TextArea/TextArea.d.ts +0 -1
- package/dist/cjs/components/TextArea/TextArea.d.ts.map +1 -1
- package/dist/cjs/components/Toggle/Toggle.d.ts +0 -1
- package/dist/cjs/components/Toggle/Toggle.d.ts.map +1 -1
- package/dist/cjs/components/Toggle/Toggle.js +4 -16
- package/dist/cjs/components/Tooltip/Tooltip.d.ts +4 -3
- package/dist/cjs/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.js +21 -8
- package/dist/cjs/layout/Stack/Spacer.d.ts +0 -1
- package/dist/cjs/layout/Stack/Spacer.d.ts.map +1 -1
- package/dist/cjs/layout/Stack/ToolbarStack.d.ts +11 -1054
- package/dist/cjs/layout/Stack/ToolbarStack.d.ts.map +1 -1
- package/dist/cjs/nav/NavSidebar/NavSidebar.d.ts +1 -1
- package/dist/cjs/nav/NavSidebar/NavSidebar.d.ts.map +1 -1
- package/dist/cjs/nav/NavSidebar/NavSidebar.js +2 -6
- package/dist/cjs/structure/AppSidebar/AppSidebar.d.ts +0 -1
- package/dist/cjs/structure/AppSidebar/AppSidebar.d.ts.map +1 -1
- package/dist/cjs/structure/AppSidebar/index.d.ts +0 -1
- package/dist/cjs/structure/AppSidebar/index.d.ts.map +1 -1
- package/dist/cjs/style/index.d.ts +1 -0
- package/dist/cjs/style/index.d.ts.map +1 -1
- package/dist/cjs/style/index.js +4 -1
- package/dist/cjs/style/theme/ThemeProvider.d.ts +10 -0
- package/dist/cjs/style/theme/ThemeProvider.d.ts.map +1 -0
- package/dist/cjs/style/theme/ThemeProvider.js +11 -0
- package/dist/cjs/testing/providers.d.ts.map +1 -1
- package/dist/cjs/testing/providers.js +2 -3
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/cjs/utils/events/isRightClick.d.ts +0 -1
- package/dist/cjs/utils/events/isRightClick.d.ts.map +1 -1
- package/dist/esm/components/AttachmentTag/AttachmentTag.js +1 -3
- package/dist/esm/components/Avatar/Avatar.js +5 -11
- package/dist/esm/components/Button/Button.js +92 -27
- package/dist/esm/components/Button/styles.js +61 -38
- package/dist/esm/components/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/esm/components/CCUserTag/CCUserTag.js +10 -12
- package/dist/esm/components/Checkbox/Checkbox.js +1 -3
- package/dist/esm/components/ColorInput/ColorInput.js +4 -8
- package/dist/esm/components/DatePicker/index.js +1 -1
- package/dist/esm/components/Dialog/Dialog.js +1 -0
- package/dist/esm/components/Dropdown/Dropdown.js +6 -12
- package/dist/esm/components/Icon/DeskproCustomIcon.js +3 -3
- package/dist/esm/components/Icon/Icon.js +8 -16
- package/dist/esm/components/Infinite/Infinite.js +6 -11
- package/dist/esm/components/Infinite/InfiniteTopBottom.js +5 -9
- package/dist/esm/components/IntlPhoneInput/IntlPhoneInput.js +3 -7
- package/dist/esm/components/LabelTag/Tag.js +7 -6
- package/dist/esm/components/Menu/Menu.js +3 -3
- package/dist/esm/components/Modal/Modal.js +3 -9
- package/dist/esm/components/OptionTag/OptionTag.js +1 -1
- package/dist/esm/components/Pagination/Pagination.js +4 -5
- package/dist/esm/components/Select/Select.js +5 -11
- package/dist/esm/components/TabbedSection/Tabs.js +2 -2
- package/dist/esm/components/Toggle/Toggle.js +4 -16
- package/dist/esm/components/Tooltip/Tooltip.js +23 -10
- package/dist/esm/nav/NavSidebar/NavSidebar.js +2 -6
- package/dist/esm/style/index.js +1 -0
- package/dist/esm/style/theme/ThemeProvider.js +5 -0
- package/dist/esm/testing/providers.js +1 -2
- package/package.json +77 -58
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isRightClick.d.ts","sourceRoot":"","sources":["../../../../src/utils/events/isRightClick.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"isRightClick.d.ts","sourceRoot":"","sources":["../../../../src/utils/events/isRightClick.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,eAAO,MAAM,YAAY,MAAO,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC,YASpE,CAAC"}
|
|
@@ -26,9 +26,7 @@ export var Name = styled(P6)(templateObject_3 || (templateObject_3 = __makeTempl
|
|
|
26
26
|
var Size = styled(P8)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n white-space: nowrap;\n"], ["\n white-space: nowrap;\n"])));
|
|
27
27
|
export var AttachmentTag = forwardRef(function AttachmentTag(_a, ref) {
|
|
28
28
|
var filename = _a.filename, fileSize = _a.fileSize, icon = _a.icon, onClose = _a.onClose, withClose = _a.withClose, _b = _a.variant, variant = _b === void 0 ? "default" : _b, maxWidth = _a.maxWidth, isLoading = _a.isLoading, rest = __rest(_a, ["filename", "fileSize", "icon", "onClose", "withClose", "variant", "maxWidth", "isLoading"]);
|
|
29
|
-
var displayFileSize = fileSize
|
|
30
|
-
? prettyBytes(fileSize, { locale: true })
|
|
31
|
-
: undefined;
|
|
29
|
+
var displayFileSize = fileSize ? prettyBytes(fileSize, { locale: true }) : undefined;
|
|
32
30
|
return (React.createElement(StyledContainer, __assign({}, dpNameProp("AttachmentTag"), { gap: 6, variant: variant, style: { maxWidth: maxWidth } }),
|
|
33
31
|
React.createElement(AttachmentLink, __assign({ ref: ref }, rest, { title: filename, target: "_blank", rel: "noopener nofollow noreferrer" }),
|
|
34
32
|
React.createElement(Icon, { icon: icon }),
|
|
@@ -107,7 +107,7 @@ export var Avatar = React.memo(function (_a) {
|
|
|
107
107
|
}, [imageStyles, props, randomColors.backgroundColor]);
|
|
108
108
|
var AvatarComponent = useMemo(function () {
|
|
109
109
|
if (isEmojiAvatarProps(props)) {
|
|
110
|
-
return
|
|
110
|
+
return React.createElement(Emoji, { title: name, size: size, style: props.emojiStyles, rounded: rounded });
|
|
111
111
|
}
|
|
112
112
|
if (isFaIconAvatarProps(props)) {
|
|
113
113
|
var Component = (React.createElement(FaIcon, { title: name, size: size, className: props.faIconClassName, style: props.iconStyles, rounded: rounded }));
|
|
@@ -127,7 +127,7 @@ export var Avatar = React.memo(function (_a) {
|
|
|
127
127
|
if (name && initials) {
|
|
128
128
|
return React.createElement(TagCircleLetter, { name: name, size: size });
|
|
129
129
|
}
|
|
130
|
-
return
|
|
130
|
+
return React.createElement(TagCircleIcon, { icon: backupIcon, color: themeColor !== null && themeColor !== void 0 ? themeColor : "brandShade", size: size });
|
|
131
131
|
}
|
|
132
132
|
else {
|
|
133
133
|
return React.createElement(Icon, { icon: backupIcon, size: size });
|
|
@@ -148,15 +148,9 @@ export var Avatar = React.memo(function (_a) {
|
|
|
148
148
|
AvatarComponent,
|
|
149
149
|
statusColor && showOnlineBadge && (React.createElement(StatusCircle, { themeColor: statusColor, rounded: rounded })))));
|
|
150
150
|
});
|
|
151
|
-
var isEmojiAvatarProps = function (avatarProps) {
|
|
152
|
-
|
|
153
|
-
};
|
|
154
|
-
export var isFaIconAvatarProps = function (avatarProps) {
|
|
155
|
-
return "faIconClassName" in avatarProps;
|
|
156
|
-
};
|
|
157
|
-
export var isImageAvatarProps = function (avatarProps) {
|
|
158
|
-
return "imageUrl" in avatarProps;
|
|
159
|
-
};
|
|
151
|
+
var isEmojiAvatarProps = function (avatarProps) { return "emojiStyles" in avatarProps; };
|
|
152
|
+
export var isFaIconAvatarProps = function (avatarProps) { return "faIconClassName" in avatarProps; };
|
|
153
|
+
export var isImageAvatarProps = function (avatarProps) { return "imageUrl" in avatarProps; };
|
|
160
154
|
export var AvatarContainer = styled(Stack).attrs({
|
|
161
155
|
inline: true,
|
|
162
156
|
align: "center",
|
|
@@ -4,7 +4,7 @@ import { forwardRef } from "react";
|
|
|
4
4
|
import styled from "styled-components";
|
|
5
5
|
import { match } from "ts-pattern";
|
|
6
6
|
import { Icon, isAnyIcon, isIconProps } from "../Icon";
|
|
7
|
-
import { buttonBaseCss, buttonFill, buttonLarge, buttonLoading,
|
|
7
|
+
import { buttonBaseCss, buttonFill, buttonLarge, buttonLoading, buttonSmall, ButtonText, buttonTiny, getActiveIntent, getDangerIntent, getDisabledIntent, getIntentBase, iconButtonBase, iconButtonSmall, navButtonBase, navButtonSmall, overlayButtonStyle, overlayButtonRightTop, overlayButtonRightBottom, overlayButtonLeftBottom, overlayButtonLeftTop, overlayButtonMiddleBottom, overlayButtonMiddleTop, buttonIconSubsection, ButtonLoaderContainer, } from "./styles";
|
|
8
8
|
import { dpNameProp } from "../../utils";
|
|
9
9
|
import { Spinner } from "../Spinner";
|
|
10
10
|
/**
|
|
@@ -15,44 +15,75 @@ export var Button = styled(forwardRef(function Button(_a, ref) {
|
|
|
15
15
|
return (React.createElement("button", __assign({ type: type }, dpNameProp("Button"), { ref: ref, disabled: disabled || loading }, rest),
|
|
16
16
|
loading && (React.createElement(ButtonLoaderContainer, null,
|
|
17
17
|
React.createElement(Spinner, { size: "small" }))),
|
|
18
|
-
isAnyIcon(icon) ? React.createElement(Icon, { icon: icon }) : isIconProps(icon) ? React.createElement(Icon, __assign({}, icon)) : icon,
|
|
18
|
+
isAnyIcon(icon) ? (React.createElement(Icon, { icon: icon })) : isIconProps(icon) ? (React.createElement(Icon, __assign({}, icon))) : (icon),
|
|
19
19
|
text && React.createElement(ButtonText, null, text),
|
|
20
20
|
isAnyIcon(rightIcon) ? (React.createElement(Icon, { icon: rightIcon })) : isIconProps(rightIcon) ? (React.createElement(Icon, __assign({}, rightIcon))) : (rightIcon)));
|
|
21
|
-
}))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n text-align: ", ";\n ", "\n ", "\n ", "\n ", "\n
|
|
21
|
+
}))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n text-align: ", ";\n ", "\n ", "\n ", "\n ", "\n\n ", "\n ", "\n ", "\n ", ";\n ", "\n"], ["\n text-align: ", ";\n ", "\n ", "\n ", "\n ", "\n\n ", "\n ", "\n ", "\n ", ";\n ", "\n"])), function (props) { var _a; return (_a = props.alignText) !== null && _a !== void 0 ? _a : "left"; }, buttonBaseCss, function (props) { return props.size === "large" && buttonLarge; }, function (props) { return props.size === "small" && buttonSmall; }, function (props) { return props.size === "tiny" && buttonTiny; }, function (props) {
|
|
22
|
+
var calculatedIntent = calculateIntent(props);
|
|
23
|
+
return getIntentBase({ intent: calculatedIntent });
|
|
24
|
+
}, function (props) {
|
|
25
|
+
var calculatedIntent = calculateIntent(props);
|
|
26
|
+
return props.danger && getDangerIntent({ intent: calculatedIntent });
|
|
27
|
+
}, function (props) {
|
|
28
|
+
var calculatedIntent = calculateIntent(props);
|
|
29
|
+
return (props.active &&
|
|
30
|
+
getActiveIntent({ intent: calculatedIntent, danger: props.danger }));
|
|
31
|
+
}, function (props) { return props.loading && buttonLoading; }, function (props) { return props.fill && buttonFill; });
|
|
22
32
|
/**
|
|
23
33
|
* Icon Button
|
|
24
34
|
*/
|
|
25
35
|
export var IconButton = styled(forwardRef(function IconButton(_a, ref) {
|
|
26
36
|
var icon = _a.icon, rightIcon = _a.rightIcon, minimal = _a.minimal, active = _a.active, danger = _a.danger, loading = _a.loading, themeColor = _a.themeColor, noMinimalUnderline = _a.noMinimalUnderline, iconSubsection = _a.iconSubsection, _b = _a.type, type = _b === void 0 ? "button" : _b, disabled = _a.disabled, rest = __rest(_a, ["icon", "rightIcon", "minimal", "active", "danger", "loading", "themeColor", "noMinimalUnderline", "iconSubsection", "type", "disabled"]);
|
|
27
|
-
return (React.createElement("button", __assign({}, dpNameProp("IconButton"), { ref: ref, type: type }, rest, { disabled: disabled || loading }),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}, function (props) {
|
|
37
|
+
return (React.createElement("button", __assign({}, dpNameProp("IconButton"), { ref: ref, type: type }, rest, { disabled: disabled || loading }), loading ? (React.createElement(ButtonLoaderContainer, null,
|
|
38
|
+
React.createElement(Spinner, { size: "small" }))) : isAnyIcon(icon) ? (React.createElement(Icon, { themeColor: themeColor, icon: icon })) : isIconProps(icon) ? (React.createElement(Icon, __assign({ themeColor: themeColor }, icon))) : (icon)));
|
|
39
|
+
}))(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 28px;\n max-height: 28px;\n width: 28px;\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", ";\n"], ["\n height: 28px;\n max-height: 28px;\n width: 28px;\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", ";\n"])), buttonBaseCss, iconButtonBase, function (props) { return props.size === "small" && iconButtonSmall; }, function (props) { return props.size === "tiny" && buttonTiny; }, function (props) { return props.size === "large" && buttonLarge; }, function (props) {
|
|
40
|
+
var calculatedIntent = calculateIntent(props);
|
|
41
|
+
return getIntentBase({
|
|
42
|
+
intent: calculatedIntent === "minimalUnderline" ? "minimal" : calculatedIntent,
|
|
43
|
+
});
|
|
44
|
+
}, function (props) {
|
|
45
|
+
var calculatedIntent = calculateIntent(props);
|
|
46
|
+
return props.danger && getDangerIntent({ intent: calculatedIntent });
|
|
47
|
+
}, function (props) {
|
|
48
|
+
var calculatedIntent = calculateIntent(props);
|
|
49
|
+
return props.active && getActiveIntent({ intent: calculatedIntent });
|
|
50
|
+
}, function (props) { return props.loading && buttonLoading; }, function (props) { return props.iconSubsection && buttonIconSubsection; });
|
|
35
51
|
export var AvatarButton = styled(forwardRef(function AvatarButton(_a, ref) {
|
|
36
52
|
var avatarSize = _a.avatarSize, _b = _a.type, type = _b === void 0 ? "button" : _b, rest = __rest(_a, ["avatarSize", "type"]);
|
|
37
53
|
return React.createElement(IconButton, __assign({ ref: ref, type: type }, rest));
|
|
38
|
-
}))(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: ", "px;\n height: ", "px;\n max-height: ", "px;\n min-height: ", "px;\n max-width: ", "px;\n min-width: ", "px;\n > div {\n flex: 1;\n max-height: ", "px;\n min-height: ", "px;\n max-width: ", "px;\n min-width: ", "px;\n }\n & > :not(:last-child) {\n margin-right: 0;\n }\n"], ["\n width: ", "px;\n height: ", "px;\n max-height: ", "px;\n min-height: ", "px;\n max-width: ", "px;\n min-width: ", "px;\n > div {\n flex: 1;\n max-height: ", "px;\n min-height: ", "px;\n max-width: ", "px;\n min-width: ", "px;\n }\n & > :not(:last-child) {\n margin-right: 0;\n }\n"])), function (_a) {
|
|
54
|
+
}))(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: ", "px;\n height: ", "px;\n max-height: ", "px;\n min-height: ", "px;\n max-width: ", "px;\n min-width: ", "px;\n border: 2px solid ", ";\n border-radius: 50%;\n position: relative;\n :hover {\n border: 2px solid ", ";\n }\n\n ", "\n :active,\n :focus {\n border: 2px solid ", ";\n }\n\n ", "\n :disabled {\n cursor: not-allowed;\n }\n\n > div {\n flex: 1;\n max-height: ", "px;\n min-height: ", "px;\n max-width: ", "px;\n min-width: ", "px;\n }\n & > :not(:last-child) {\n margin-right: 0;\n }\n"], ["\n width: ", "px;\n height: ", "px;\n max-height: ", "px;\n min-height: ", "px;\n max-width: ", "px;\n min-width: ", "px;\n border: 2px solid ", ";\n border-radius: 50%;\n position: relative;\n :hover {\n border: 2px solid ", ";\n }\n\n ", "\n :active,\n :focus {\n border: 2px solid ", ";\n }\n\n ", "\n :disabled {\n cursor: not-allowed;\n }\n\n > div {\n flex: 1;\n max-height: ", "px;\n min-height: ", "px;\n max-width: ", "px;\n min-width: ", "px;\n }\n & > :not(:last-child) {\n margin-right: 0;\n }\n"])), function (_a) {
|
|
39
55
|
var avatarSize = _a.avatarSize;
|
|
40
|
-
return avatarSize;
|
|
56
|
+
return avatarSize + 4;
|
|
41
57
|
}, function (_a) {
|
|
42
58
|
var avatarSize = _a.avatarSize;
|
|
43
|
-
return avatarSize;
|
|
59
|
+
return avatarSize + 4;
|
|
44
60
|
}, function (_a) {
|
|
45
61
|
var avatarSize = _a.avatarSize;
|
|
46
|
-
return avatarSize;
|
|
62
|
+
return avatarSize + 4;
|
|
47
63
|
}, function (_a) {
|
|
48
64
|
var avatarSize = _a.avatarSize;
|
|
49
|
-
return avatarSize;
|
|
65
|
+
return avatarSize + 4;
|
|
50
66
|
}, function (_a) {
|
|
51
67
|
var avatarSize = _a.avatarSize;
|
|
52
|
-
return avatarSize;
|
|
68
|
+
return avatarSize + 4;
|
|
53
69
|
}, function (_a) {
|
|
54
70
|
var avatarSize = _a.avatarSize;
|
|
55
|
-
return avatarSize;
|
|
71
|
+
return avatarSize + 4;
|
|
72
|
+
}, function (_a) {
|
|
73
|
+
var theme = _a.theme;
|
|
74
|
+
return theme.colors.white;
|
|
75
|
+
}, function (_a) {
|
|
76
|
+
var theme = _a.theme;
|
|
77
|
+
return theme.colors.brandShade60;
|
|
78
|
+
}, function (_a) {
|
|
79
|
+
var active = _a.active, theme = _a.theme;
|
|
80
|
+
return active ? "border: 2px solid ".concat(theme.colors.cyan100, ";") : "";
|
|
81
|
+
}, function (_a) {
|
|
82
|
+
var theme = _a.theme;
|
|
83
|
+
return theme.colors.cyan100;
|
|
84
|
+
}, function (_a) {
|
|
85
|
+
var disabled = _a.disabled;
|
|
86
|
+
return (disabled ? "cursor: not-allowed;" : "");
|
|
56
87
|
}, function (_a) {
|
|
57
88
|
var avatarSize = _a.avatarSize;
|
|
58
89
|
return avatarSize;
|
|
@@ -77,10 +108,19 @@ export var AnchorButton = styled(forwardRef(function AnchorButton(_a, ref) {
|
|
|
77
108
|
} }, rest),
|
|
78
109
|
loading && (React.createElement(ButtonLoaderContainer, null,
|
|
79
110
|
React.createElement(Spinner, { size: "small" }))),
|
|
80
|
-
isAnyIcon(icon) ? React.createElement(Icon, { icon: icon }) : isIconProps(icon) ? React.createElement(Icon, __assign({}, icon)) : icon,
|
|
111
|
+
isAnyIcon(icon) ? (React.createElement(Icon, { icon: icon })) : isIconProps(icon) ? (React.createElement(Icon, __assign({}, icon))) : (icon),
|
|
81
112
|
text && React.createElement(ButtonText, null, text),
|
|
82
113
|
isAnyIcon(rightIcon) ? (React.createElement(Icon, { icon: rightIcon })) : isIconProps(rightIcon) ? (React.createElement(Icon, __assign({}, rightIcon))) : (rightIcon)));
|
|
83
|
-
}))(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n text-align: ", ";\n text-decoration: none;\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "
|
|
114
|
+
}))(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n text-align: ", ";\n text-decoration: none;\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n :active,\n :focus,\n :hover {\n ", ";\n }\n ", "\n ", ";\n"], ["\n text-align: ", ";\n text-decoration: none;\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n :active,\n :focus,\n :hover {\n ", ";\n }\n ", "\n ", ";\n"])), function (props) { var _a; return (_a = props.alignText) !== null && _a !== void 0 ? _a : "left"; }, buttonBaseCss, function (props) { return props.size === "large" && buttonLarge; }, function (props) { return props.size === "small" && buttonSmall; }, function (props) { return props.size === "tiny" && buttonTiny; }, function (props) {
|
|
115
|
+
var calculatedIntent = calculateIntent(props);
|
|
116
|
+
return getIntentBase({ intent: calculatedIntent });
|
|
117
|
+
}, function (props) {
|
|
118
|
+
var calculatedIntent = calculateIntent(props);
|
|
119
|
+
return props.danger && getDangerIntent({ intent: calculatedIntent });
|
|
120
|
+
}, function (props) {
|
|
121
|
+
var calculatedIntent = calculateIntent(props);
|
|
122
|
+
return props.active && getActiveIntent({ intent: calculatedIntent });
|
|
123
|
+
}, function (props) { return props.disabled && getDisabledIntent(props); }, function (props) { return props.disabled && getDisabledIntent(props); }, function (props) { return props.fill && buttonFill; }, function (props) { return props.loading && buttonLoading; });
|
|
84
124
|
/**
|
|
85
125
|
* Label component styled like a button - useful for wrapping around file input for example
|
|
86
126
|
*/
|
|
@@ -92,10 +132,20 @@ export var LabelButton = styled(forwardRef(function LabelButton(_a, ref) {
|
|
|
92
132
|
loading && (React.createElement(ButtonLoaderContainer, null,
|
|
93
133
|
React.createElement(Spinner, { size: "small" }))),
|
|
94
134
|
children,
|
|
95
|
-
isAnyIcon(icon) ? React.createElement(Icon, { icon: icon }) : isIconProps(icon) ? React.createElement(Icon, __assign({}, icon)) : icon,
|
|
135
|
+
isAnyIcon(icon) ? (React.createElement(Icon, { icon: icon })) : isIconProps(icon) ? (React.createElement(Icon, __assign({}, icon))) : (icon),
|
|
96
136
|
text && React.createElement(ButtonText, null, text),
|
|
97
137
|
isAnyIcon(rightIcon) ? (React.createElement(Icon, { icon: rightIcon })) : isIconProps(rightIcon) ? (React.createElement(Icon, __assign({}, rightIcon))) : (rightIcon)));
|
|
98
|
-
}))(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n text-align: ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "
|
|
138
|
+
}))(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n text-align: ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n :active,\n :focus,\n :hover {\n ", ";\n }\n ", "\n ", ";\n"], ["\n text-align: ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n :active,\n :focus,\n :hover {\n ", ";\n }\n ", "\n ", ";\n"])), function (props) { var _a; return (_a = props.alignText) !== null && _a !== void 0 ? _a : "left"; }, buttonBaseCss, function (props) { return props.size === "large" && buttonLarge; }, function (props) { return props.size === "small" && buttonSmall; }, function (props) { return props.size === "tiny" && buttonTiny; }, function (props) {
|
|
139
|
+
var calculatedIntent = calculateIntent(props);
|
|
140
|
+
return getIntentBase({ intent: calculatedIntent });
|
|
141
|
+
}, function (props) {
|
|
142
|
+
var calculatedIntent = calculateIntent(props);
|
|
143
|
+
return props.danger && getDangerIntent({ intent: calculatedIntent });
|
|
144
|
+
}, function (props) {
|
|
145
|
+
var calculatedIntent = calculateIntent(props);
|
|
146
|
+
return props.active && getActiveIntent({ intent: calculatedIntent });
|
|
147
|
+
}, function (props) { return props.disabled && getDisabledIntent(props); }, function (props) { return props.disabled && getDisabledIntent(props); }, function (props) { return props.fill && buttonFill; }, function (props) { return props.loading && buttonLoading; });
|
|
148
|
+
// ${(props) => props.noMinimalUnderline && buttonNoMinimalUnderline} ^^^^
|
|
99
149
|
export var LabelButtonFileInput = styled.input.attrs({
|
|
100
150
|
type: "file",
|
|
101
151
|
})(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n width: 0;\n height: 0;\n opacity: 0;\n overflow: hidden;\n position: absolute;\n z-index: -1;\n"], ["\n width: 0;\n height: 0;\n opacity: 0;\n overflow: hidden;\n position: absolute;\n z-index: -1;\n"])));
|
|
@@ -104,19 +154,25 @@ export var NavButton = styled(forwardRef(function NavButton(_a, ref) {
|
|
|
104
154
|
return (React.createElement("button", __assign({ type: type, ref: ref }, dpNameProp("NavButton"), rest),
|
|
105
155
|
reverse && (React.createElement(React.Fragment, null,
|
|
106
156
|
text && React.createElement(ButtonText, { overflow: "ellipsis" }, text),
|
|
107
|
-
isAnyIcon(icon) ? React.createElement(Icon, { icon: icon }) : isIconProps(icon) ? React.createElement(Icon, __assign({}, icon)) : icon)),
|
|
157
|
+
isAnyIcon(icon) ? (React.createElement(Icon, { icon: icon })) : isIconProps(icon) ? (React.createElement(Icon, __assign({}, icon))) : (icon))),
|
|
108
158
|
!reverse && (React.createElement(React.Fragment, null,
|
|
109
|
-
isAnyIcon(icon) ? React.createElement(Icon, { icon: icon }) : isIconProps(icon) ? React.createElement(Icon, __assign({}, icon)) : icon,
|
|
159
|
+
isAnyIcon(icon) ? (React.createElement(Icon, { icon: icon })) : isIconProps(icon) ? (React.createElement(Icon, __assign({}, icon))) : (icon),
|
|
110
160
|
text && React.createElement(ButtonText, { overflow: "ellipsis" }, text)))));
|
|
111
|
-
}))(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n ", "\n"], ["\n ", "\n ", "\n ", "\n ", "\n"])), navButtonBase, function (props) {
|
|
161
|
+
}))(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n ", "\n"], ["\n ", "\n ", "\n ", "\n ", "\n"])), navButtonBase, function (props) {
|
|
162
|
+
var calculatedIntent = calculateIntent(props);
|
|
163
|
+
return getIntentBase({ intent: calculatedIntent });
|
|
164
|
+
}, function (props) { return props.size === "small" && navButtonSmall; }, function (props) {
|
|
165
|
+
var calculatedIntent = calculateIntent(props);
|
|
166
|
+
return props.active && getActiveIntent({ intent: calculatedIntent });
|
|
167
|
+
});
|
|
112
168
|
/**
|
|
113
169
|
* OverlayButton requires `position: relative` wrapper to overlay unless position set to relative
|
|
114
170
|
*/
|
|
115
171
|
export var OverlayButton = styled(forwardRef(function OverlayButton(_a, ref) {
|
|
116
|
-
var icon = _a.icon,
|
|
172
|
+
var icon = _a.icon, active = _a.active, danger = _a.danger, loading = _a.loading, text = _a.text, _b = _a.type, type = _b === void 0 ? "button" : _b, alignText = _a.alignText, placement = _a.placement, rightIcon = _a.rightIcon, rest = __rest(_a, ["icon", "active", "danger", "loading", "text", "type", "alignText", "placement", "rightIcon"]);
|
|
117
173
|
return (React.createElement("button", __assign({ type: type }, dpNameProp("OverlayButton"), { ref: ref }, rest),
|
|
118
174
|
loading && (React.createElement(ButtonLoaderContainer, null,
|
|
119
|
-
React.createElement(Spinner,
|
|
175
|
+
React.createElement(Spinner, { size: "small" }))),
|
|
120
176
|
isAnyIcon(icon) ? (React.createElement(Icon, { icon: icon, size: 10 })) : isIconProps(icon) ? (React.createElement(Icon, __assign({ size: 10 }, icon))) : (icon),
|
|
121
177
|
text && React.createElement(ButtonText, null, text),
|
|
122
178
|
isAnyIcon(rightIcon) ? (React.createElement(Icon, { icon: rightIcon, size: 10 })) : isIconProps(rightIcon) ? (React.createElement(Icon, __assign({ size: 10 }, rightIcon))) : (rightIcon)));
|
|
@@ -134,4 +190,13 @@ export var OverlayButton = styled(forwardRef(function OverlayButton(_a, ref) {
|
|
|
134
190
|
var position = _a.position;
|
|
135
191
|
return (position ? position : "absolute");
|
|
136
192
|
});
|
|
193
|
+
export var calculateIntent = function (_a) {
|
|
194
|
+
var minimal = _a.minimal, noMinimalUnderline = _a.noMinimalUnderline, intent = _a.intent;
|
|
195
|
+
var newIntent = minimal
|
|
196
|
+
? noMinimalUnderline
|
|
197
|
+
? "minimal"
|
|
198
|
+
: "minimalUnderline"
|
|
199
|
+
: intent;
|
|
200
|
+
return newIntent !== null && newIntent !== void 0 ? newIntent : "primary";
|
|
201
|
+
};
|
|
137
202
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
|
|
@@ -7,55 +7,65 @@ export var ButtonText = styled.span(templateObject_2 || (templateObject_2 = __ma
|
|
|
7
7
|
return props.overflow
|
|
8
8
|
? css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ", ";\n "], ["\n width: 100%;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ", ";\n "])), props.overflow) : undefined;
|
|
9
9
|
});
|
|
10
|
-
export var buttonBaseCss = css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative;\n transition: all 0.1s ease-in-out;\n display: inline-flex;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n padding: 4px 8px;\n vertical-align: middle;\n height: 24px;\n max-height: 24px;\n min-height: 24px;\n min-width: 24px;\n align-items: center;\n\n & > :not(:last-child) {\n margin-right: 7px;\n }\n\n :disabled {\n cursor: not-allowed;\n }\n\n > * {\n flex: 0;\n }\n\n ", " {\n ", ";\n flex: 0 0 auto;\n }\n\n ", " {\n flex: 0 1 auto;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n"], ["\n position: relative;\n transition: all 0.1s ease-in-out;\n display: inline-flex;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n padding: 4px 8px;\n vertical-align: middle;\n height: 24px;\n max-height: 24px;\n min-height: 24px;\n min-width: 24px;\n align-items: center;\n\n & > :not(:last-child) {\n margin-right: 7px;\n }\n\n :disabled {\n cursor: not-allowed;\n }\n\n > * {\n flex: 0;\n }\n\n ", " {\n ", ";\n flex: 0 0 auto;\n }\n\n ", " {\n flex: 0 1 auto;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n"])),
|
|
10
|
+
export var buttonBaseCss = css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative;\n transition: all 0.1s ease-in-out;\n display: inline-flex;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n padding: 4px 8px;\n vertical-align: middle;\n height: 24px;\n max-height: 24px;\n min-height: 24px;\n min-width: 24px;\n align-items: center;\n\n & > :not(:last-child) {\n margin-right: 7px;\n }\n\n :disabled {\n cursor: not-allowed;\n }\n\n :focus {\n outline: 2px solid ", ";\n outline-offset: 1px;\n }\n\n > * {\n flex: 0;\n }\n\n ", " {\n ", ";\n flex: 0 0 auto;\n }\n\n ", " {\n flex: 0 1 auto;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n"], ["\n position: relative;\n transition: all 0.1s ease-in-out;\n display: inline-flex;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n padding: 4px 8px;\n vertical-align: middle;\n height: 24px;\n max-height: 24px;\n min-height: 24px;\n min-width: 24px;\n align-items: center;\n\n & > :not(:last-child) {\n margin-right: 7px;\n }\n\n :disabled {\n cursor: not-allowed;\n }\n\n :focus {\n outline: 2px solid ", ";\n outline-offset: 1px;\n }\n\n > * {\n flex: 0;\n }\n\n ", " {\n ", ";\n flex: 0 0 auto;\n }\n\n ", " {\n flex: 0 1 auto;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n"])), function (_a) {
|
|
11
|
+
var theme = _a.theme;
|
|
12
|
+
return theme.colors.cyan80;
|
|
13
|
+
}, Icon, paragraphStyled.p6, ButtonText);
|
|
11
14
|
export var buttonLarge = css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n min-height: 28px;\n min-width: 28px;\n padding: 6px 10px;\n ", " {\n ", ";\n }\n\n ", " {\n ", "\n }\n"], ["\n min-height: 28px;\n min-width: 28px;\n padding: 6px 10px;\n ", " {\n ", ";\n }\n\n ", " {\n ", "\n }\n"])), ButtonText, paragraphStyled.p2, Icon, paragraphStyled.p2);
|
|
12
15
|
export var buttonSmall = css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n height: 18px;\n min-height: 18px;\n min-width: 18px;\n padding: 3px 8px;\n ", " {\n ", ";\n }\n\n ", " {\n ", "\n }\n"], ["\n height: 18px;\n min-height: 18px;\n min-width: 18px;\n padding: 3px 8px;\n ", " {\n ", ";\n }\n\n ", " {\n ", "\n }\n"])), ButtonText, paragraphStyled.p11, Icon, paragraphStyled.p11);
|
|
13
16
|
export var buttonTiny = css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n height: 16px;\n min-height: 16px;\n max-height: 16px;\n min-width: 28px;\n justify-content: center;\n padding: 1px 2px;\n ", " {\n ", ";\n }\n\n ", " {\n ", ";\n }\n"], ["\n height: 16px;\n min-height: 16px;\n max-height: 16px;\n min-width: 28px;\n justify-content: center;\n padding: 1px 2px;\n ", " {\n ", ";\n }\n\n ", " {\n ", ";\n }\n"])), ButtonText, paragraphStyled.p11, Icon, paragraphStyled.p11);
|
|
14
17
|
export var iconButtonBase = css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n border-radius: 50%;\n justify-content: center;\n ", " {\n ", "\n }\n"], ["\n border-radius: 50%;\n justify-content: center;\n ", " {\n ", "\n }\n"])), Icon, paragraphStyled.p1);
|
|
15
18
|
export var iconButtonSmall = css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n border-radius: 4px;\n padding: 3px;\n height: 20px;\n min-height: 20px;\n max-height: 20px;\n width: 20px;\n ", " {\n ", ";\n }\n\n ", " {\n ", "\n }\n\n &:hover,\n &:active,\n &:focus {\n ", " {\n color: inherit;\n }\n }\n"], ["\n border-radius: 4px;\n padding: 3px;\n height: 20px;\n min-height: 20px;\n max-height: 20px;\n width: 20px;\n ", " {\n ", ";\n }\n\n ", " {\n ", "\n }\n\n &:hover,\n &:active,\n &:focus {\n ", " {\n color: inherit;\n }\n }\n"])), ButtonText, paragraphStyled.p11, Icon, paragraphStyled.p8, Icon);
|
|
16
|
-
export var iconMinimalActive = css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n color: ", ";\n box-shadow: none;\n background-color: transparent;\n border-color: transparent;\n"], ["\n color: ", ";\n box-shadow: none;\n background-color: transparent;\n border-color: transparent;\n"])), function (props) { return props.theme.colors.brandShade100; });
|
|
19
|
+
export var iconMinimalActive = css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n color: ", ";\n box-shadow: none;\n background-color: transparent;\n border-color: transparent;\n outline: none;\n"], ["\n color: ", ";\n box-shadow: none;\n background-color: transparent;\n border-color: transparent;\n outline: none;\n"])), function (props) { return props.theme.colors.brandShade100; });
|
|
17
20
|
export var iconButtonMinimal = css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n padding: 0;\n height: 16px;\n min-height: 16px;\n max-height: 16px;\n width: 16px;\n color: ", ";\n background-color: transparent;\n border-color: transparent;\n box-shadow: none;\n\n :hover {\n color: ", ";\n box-shadow: none;\n background-color: transparent;\n border-color: transparent;\n }\n\n :active,\n :focus {\n ", ";\n }\n\n :disabled {\n box-shadow: none;\n background-color: transparent;\n border-color: transparent;\n color: ", ";\n }\n\n ", " {\n ", "\n }\n"], ["\n padding: 0;\n height: 16px;\n min-height: 16px;\n max-height: 16px;\n width: 16px;\n color: ", ";\n background-color: transparent;\n border-color: transparent;\n box-shadow: none;\n\n :hover {\n color: ", ";\n box-shadow: none;\n background-color: transparent;\n border-color: transparent;\n }\n\n :active,\n :focus {\n ", ";\n }\n\n :disabled {\n box-shadow: none;\n background-color: transparent;\n border-color: transparent;\n color: ", ";\n }\n\n ", " {\n ", "\n }\n"])), function (props) { return props.theme.colors.grey40; }, function (props) { return props.theme.colors.brandShade80; }, iconMinimalActive, function (props) { return props.theme.colors.grey20; }, Icon, headingStyles.h0);
|
|
21
|
+
// ------- BASEs ---------
|
|
22
|
+
// Primary ---------
|
|
18
23
|
export var primaryActive = css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n background-color: ", ";\n border: 1px solid ", ";\n box-shadow: 0px 0px 0px ", ";\n"], ["\n background-color: ", ";\n border: 1px solid ", ";\n box-shadow: 0px 0px 0px ", ";\n"])), function (props) { return props.theme.colors.cyan100; }, function (props) { return props.theme.colors.cyan100; }, function (props) { return props.theme.colors.brandShade40; });
|
|
19
24
|
export var buttonPrimaryBase = css(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n background-color: ", ";\n box-shadow: 0px 2px 2px ", ";\n color: ", ";\n border: 1px solid ", ";\n\n :hover {\n background-color: ", ";\n border: 1px solid ", ";\n }\n\n :focus,\n :active {\n ", "\n }\n\n :disabled {\n border: 1px solid ", ";\n box-shadow: 0px 0px 0px ", ";\n background-color: ", ";\n }\n"], ["\n background-color: ", ";\n box-shadow: 0px 2px 2px ", ";\n color: ", ";\n border: 1px solid ", ";\n\n :hover {\n background-color: ", ";\n border: 1px solid ", ";\n }\n\n :focus,\n :active {\n ", "\n }\n\n :disabled {\n border: 1px solid ", ";\n box-shadow: 0px 0px 0px ", ";\n background-color: ", ";\n }\n"])), function (props) { return props.theme.colors.brandShade100; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.white; }, function (props) { return props.theme.colors.brandShade100; }, function (props) { return props.theme.colors.cyan100; }, function (props) { return props.theme.colors.cyan100; }, primaryActive, function (props) { return props.theme.colors.grey20; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.grey20; });
|
|
25
|
+
// Secondary ---------
|
|
20
26
|
export var secondaryActive = css(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n border-color: ", ";\n background-color: ", ";\n box-shadow: 0px 0px 0px ", ";\n"], ["\n border-color: ", ";\n background-color: ", ";\n box-shadow: 0px 0px 0px ", ";\n"])), function (props) { return props.theme.colors.brandShade100; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.brandShade40; });
|
|
21
27
|
export var buttonSecondaryBase = css(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n background-color: ", ";\n border: 1px solid ", ";\n box-shadow: 0px 2px 2px ", ";\n color: ", ";\n\n :hover {\n background-color: ", ";\n border-color: ", ";\n }\n\n :focus,\n :active {\n ", "\n }\n\n :disabled {\n color: ", ";\n box-shadow: 0px 0px 0px ", ";\n border-color: ", ";\n background-color: ", ";\n }\n"], ["\n background-color: ", ";\n border: 1px solid ", ";\n box-shadow: 0px 2px 2px ", ";\n color: ", ";\n\n :hover {\n background-color: ", ";\n border-color: ", ";\n }\n\n :focus,\n :active {\n ", "\n }\n\n :disabled {\n color: ", ";\n box-shadow: 0px 0px 0px ", ";\n border-color: ", ";\n background-color: ", ";\n }\n"])), function (props) { return props.theme.colors.white; }, function (props) { return props.theme.colors.grey20; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.brandShade100; }, function (props) { return props.theme.colors.brandShade20; }, function (props) { return props.theme.colors.brandShade100; }, secondaryActive, function (props) { return props.theme.colors.grey40; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.grey20; }, function (props) { return props.theme.colors.grey5; });
|
|
22
|
-
|
|
23
|
-
export var
|
|
24
|
-
export var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
export var dangerSecondaryTertiary = css(templateObject_20 || (templateObject_20 = __makeTemplateObject(["\n :focus {\n outline: none;\n background-color: ", ";\n box-shadow: 0px 2px 2px ", ";\n border: 1px solid ", ";\n }\n\n :active {\n ", "\n }\n\n :hover {\n color: ", ";\n background-color: ", ";\n border: 1px solid ", ";\n }\n"], ["\n :focus {\n outline: none;\n background-color: ", ";\n box-shadow: 0px 2px 2px ", ";\n border: 1px solid ", ";\n }\n\n :active {\n ", "\n }\n\n :hover {\n color: ", ";\n background-color: ", ";\n border: 1px solid ", ";\n }\n"])), function (props) { return props.theme.colors.white; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.grey20; }, dangerSecondaryTeritaryActive, function (props) { return props.theme.colors.red100; }, function (props) { return props.theme.colors.red20; }, function (props) { return props.theme.colors.red100; });
|
|
28
|
-
var primaryDisabled = css(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n border: 1px solid ", ";\n box-shadow: 0px 0px 0px ", ";\n background-color: ", ";\n cursor: not-allowed;\n"], ["\n border: 1px solid ", ";\n box-shadow: 0px 0px 0px ", ";\n background-color: ", ";\n cursor: not-allowed;\n"])), function (props) { return props.theme.colors.grey20; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.grey20; });
|
|
29
|
-
var secondaryDisabled = css(templateObject_22 || (templateObject_22 = __makeTemplateObject(["\n color: ", ";\n box-shadow: 0px 0px 0px ", ";\n border-color: ", ";\n background-color: ", ";\n cursor: not-allowed;\n"], ["\n color: ", ";\n box-shadow: 0px 0px 0px ", ";\n border-color: ", ";\n background-color: ", ";\n cursor: not-allowed;\n"])), function (props) { return props.theme.colors.grey40; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.grey20; }, function (props) { return props.theme.colors.grey5; });
|
|
30
|
-
var tertiaryDisabled = css(templateObject_23 || (templateObject_23 = __makeTemplateObject(["\n color: ", ";\n box-shadow: 0px 0px 0px ", ";\n border-color: ", ";\n background-color: ", ";\n cursor: not-allowed;\n"], ["\n color: ", ";\n box-shadow: 0px 0px 0px ", ";\n border-color: ", ";\n background-color: ", ";\n cursor: not-allowed;\n"])), function (props) { return props.theme.colors.grey40; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.grey20; }, function (props) { return props.theme.colors.grey5; });
|
|
31
|
-
var buttonMinimalDisabled = css(templateObject_24 || (templateObject_24 = __makeTemplateObject(["\n background: none;\n color: ", ";\n border: none;\n border-bottom: 1px solid ", ";\n :active,\n :hover,\n :focus {\n background: none;\n color: ", ";\n border: none;\n border-bottom: 1px solid ", ";\n cursor: not-allowed;\n }\n"], ["\n background: none;\n color: ", ";\n border: none;\n border-bottom: 1px solid ", ";\n :active,\n :hover,\n :focus {\n background: none;\n color: ", ";\n border: none;\n border-bottom: 1px solid ", ";\n cursor: not-allowed;\n }\n"])), function (_a) {
|
|
32
|
-
var theme = _a.theme;
|
|
33
|
-
return theme.colors.grey20;
|
|
34
|
-
}, function (_a) {
|
|
28
|
+
// Tertiary ---------
|
|
29
|
+
export var tertiaryActive = css(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n border-color: ", ";\n background-color: ", ";\n color: ", ";\n"], ["\n border-color: ", ";\n background-color: ", ";\n color: ", ";\n"])), function (props) { return props.theme.colors.brandShade100; }, function (props) { return props.theme.colors.systemShade30; }, function (props) { return props.theme.colors.brandShade100; });
|
|
30
|
+
export var buttonTertiaryBase = css(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n background-color: ", ";\n border: 1px solid ", ";\n color: ", ";\n\n :hover {\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n }\n\n :focus,\n :active {\n ", "\n }\n\n :disabled {\n color: ", ";\n border-color: ", ";\n background-color: ", ";\n }\n"], ["\n background-color: ", ";\n border: 1px solid ", ";\n color: ", ";\n\n :hover {\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n }\n\n :focus,\n :active {\n ", "\n }\n\n :disabled {\n color: ", ";\n border-color: ", ";\n background-color: ", ";\n }\n"])), function (props) { return props.theme.colors.systemShade10; }, function (props) { return props.theme.colors.systemShade40; }, function (props) { return props.theme.colors.systemShade80; }, function (props) { return props.theme.colors.brandShade20; }, function (props) { return props.theme.colors.brandShade80; }, function (props) { return props.theme.colors.systemShade80; }, tertiaryActive, function (props) { return props.theme.colors.systemShade40; }, function (props) { return props.theme.colors.systemShade30; }, function (props) { return props.theme.colors.systemShade10; });
|
|
31
|
+
// Minimal ---------
|
|
32
|
+
var buttonMinimalDisabled = css(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n background: none;\n color: ", ";\n border: none;\n :active,\n :hover,\n :focus {\n background: none;\n color: ", ";\n border: none;\n cursor: not-allowed;\n }\n"], ["\n background: none;\n color: ", ";\n border: none;\n :active,\n :hover,\n :focus {\n background: none;\n color: ", ";\n border: none;\n cursor: not-allowed;\n }\n"])), function (_a) {
|
|
35
33
|
var theme = _a.theme;
|
|
36
34
|
return theme.colors.grey20;
|
|
37
35
|
}, function (_a) {
|
|
38
36
|
var theme = _a.theme;
|
|
39
37
|
return theme.colors.grey20;
|
|
40
|
-
}
|
|
38
|
+
});
|
|
39
|
+
export var buttonMinimalActive = css(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n background: none;\n color: ", ";\n border: none;\n outline: none;\n"], ["\n background: none;\n color: ", ";\n border: none;\n outline: none;\n"])), function (_a) {
|
|
41
40
|
var theme = _a.theme;
|
|
42
|
-
return theme.colors.
|
|
41
|
+
return theme.colors.brandPrimary;
|
|
43
42
|
});
|
|
44
|
-
export var buttonMinimal = css(
|
|
43
|
+
export var buttonMinimal = css(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n background: none;\n border: none;\n box-shadow: none;\n border-radius: 0;\n color: ", ";\n padding-left: 2px;\n padding-right: 2px;\n ", "\n\n :active, :hover, :focus {\n ", "\n }\n\n :disabled {\n ", "\n }\n"], ["\n background: none;\n border: none;\n box-shadow: none;\n border-radius: 0;\n color: ", ";\n padding-left: 2px;\n padding-right: 2px;\n ", "\n\n :active, :hover, :focus {\n ", "\n }\n\n :disabled {\n ", "\n }\n"])), function (_a) {
|
|
45
44
|
var theme = _a.theme;
|
|
46
45
|
return theme.colors.grey40;
|
|
47
|
-
},
|
|
46
|
+
}, headingStyles.h5, buttonMinimalActive, buttonMinimalDisabled);
|
|
47
|
+
// MinimalUnderline
|
|
48
|
+
export var buttonMinimalUnderline = css(templateObject_20 || (templateObject_20 = __makeTemplateObject(["\n ", "\n\n border-bottom: 1px solid ", ";\n\n :disabled {\n border-bottom: 1px solid ", ";\n }\n\n :hover,\n :active,\n :focus {\n border-bottom: 1px solid ", ";\n }\n"], ["\n ", "\n\n border-bottom: 1px solid ", ";\n\n :disabled {\n border-bottom: 1px solid ", ";\n }\n\n :hover,\n :active,\n :focus {\n border-bottom: 1px solid ", ";\n }\n"])), buttonMinimal, function (_a) {
|
|
48
49
|
var theme = _a.theme;
|
|
49
50
|
return theme.colors.grey40;
|
|
50
|
-
},
|
|
51
|
+
}, function (_a) {
|
|
51
52
|
var theme = _a.theme;
|
|
52
|
-
return theme.colors.
|
|
53
|
+
return theme.colors.grey20;
|
|
53
54
|
}, function (_a) {
|
|
54
55
|
var theme = _a.theme;
|
|
55
56
|
return theme.colors.brandPrimary;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
});
|
|
58
|
+
// minimalBLock
|
|
59
|
+
var minimalBlockActive = css(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n color: ", ";\n background-color: ", ";\n border: none;\n box-shadow: none;\n &:hover {\n color: ", ";\n background-color: ", ";\n border: none;\n box-shadow: none;\n }\n"], ["\n color: ", ";\n background-color: ", ";\n border: none;\n box-shadow: none;\n &:hover {\n color: ", ";\n background-color: ", ";\n border: none;\n box-shadow: none;\n }\n"])), function (props) { return props.theme.colors.white; }, function (props) { return props.theme.colors.cyan100; }, function (props) { return props.theme.colors.white; }, function (props) { return props.theme.colors.cyan80; });
|
|
60
|
+
export var minimalBLock = css(templateObject_22 || (templateObject_22 = __makeTemplateObject(["\n padding: 0;\n height: 22px;\n min-height: 22px;\n max-height: 22px;\n min-width: 22px;\n max-width: 22px;\n width: 22px;\n color: ", ";\n background-color: transparent;\n border: none;\n box-shadow: none;\n border-radius: 4px;\n :hover {\n color: ", ";\n background-color: ", ";\n border: none;\n box-shadow: none;\n }\n :active {\n &:hover {\n color: ", ";\n background-color: ", ";\n border: none;\n box-shadow: none;\n }\n }\n :active,\n :focus {\n ", "\n }\n :disabled {\n background-color: ", ";\n color: ", ";\n border: none;\n box-shadow: none;\n }\n ", " {\n ", "\n }\n"], ["\n padding: 0;\n height: 22px;\n min-height: 22px;\n max-height: 22px;\n min-width: 22px;\n max-width: 22px;\n width: 22px;\n color: ", ";\n background-color: transparent;\n border: none;\n box-shadow: none;\n border-radius: 4px;\n :hover {\n color: ", ";\n background-color: ", ";\n border: none;\n box-shadow: none;\n }\n :active {\n &:hover {\n color: ", ";\n background-color: ", ";\n border: none;\n box-shadow: none;\n }\n }\n :active,\n :focus {\n ", "\n }\n :disabled {\n background-color: ", ";\n color: ", ";\n border: none;\n box-shadow: none;\n }\n ", " {\n ", "\n }\n"])), function (props) { return props.theme.colors.grey80; }, function (props) { return props.theme.colors.brandShade100; }, function (props) { return props.theme.colors.brandShade20; }, function (props) { return props.theme.colors.white; }, function (props) { return props.theme.colors.cyan80; }, minimalBlockActive, function (props) { return props.theme.colors.grey5; }, function (props) { return props.theme.colors.grey80; }, Icon, headingStyles.h0);
|
|
61
|
+
export var dangerPrimaryActive = css(templateObject_23 || (templateObject_23 = __makeTemplateObject(["\n outline: none;\n background-color: ", ";\n border: 1px solid ", ";\n box-shadow: 0px 0px 0px ", ";\n"], ["\n outline: none;\n background-color: ", ";\n border: 1px solid ", ";\n box-shadow: 0px 0px 0px ", ";\n"])), function (props) { return props.theme.colors.red100; }, function (props) { return props.theme.colors.red100; }, function (props) { return props.theme.colors.brandShade40; });
|
|
62
|
+
export var dangerPrimary = css(templateObject_24 || (templateObject_24 = __makeTemplateObject(["\n :hover {\n background-color: ", ";\n border: 1px solid ", ";\n }\n\n :focus,\n :active {\n ", "\n }\n"], ["\n :hover {\n background-color: ", ";\n border: 1px solid ", ";\n }\n\n :focus,\n :active {\n ", "\n }\n"])), function (props) { return props.theme.colors.red100; }, function (props) { return props.theme.colors.red100; }, dangerPrimaryActive);
|
|
63
|
+
export var dangerSecondaryTeritaryActive = css(templateObject_25 || (templateObject_25 = __makeTemplateObject(["\n color: ", ";\n background-color: ", ";\n border: 1px solid ", ";\n box-shadow: 0px 0px 0px ", ";\n"], ["\n color: ", ";\n background-color: ", ";\n border: 1px solid ", ";\n box-shadow: 0px 0px 0px ", ";\n"])), function (props) { return props.theme.colors.red100; }, function (props) { return props.theme.colors.red40; }, function (props) { return props.theme.colors.red100; }, function (props) { return props.theme.colors.brandShade40; });
|
|
64
|
+
export var dangerSecondaryTertiary = css(templateObject_26 || (templateObject_26 = __makeTemplateObject(["\n :focus {\n outline: none;\n background-color: ", ";\n box-shadow: 0px 2px 2px ", ";\n border: 1px solid ", ";\n }\n\n :active {\n ", "\n }\n\n :hover {\n color: ", ";\n background-color: ", ";\n border: 1px solid ", ";\n }\n"], ["\n :focus {\n outline: none;\n background-color: ", ";\n box-shadow: 0px 2px 2px ", ";\n border: 1px solid ", ";\n }\n\n :active {\n ", "\n }\n\n :hover {\n color: ", ";\n background-color: ", ";\n border: 1px solid ", ";\n }\n"])), function (props) { return props.theme.colors.white; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.grey20; }, dangerSecondaryTeritaryActive, function (props) { return props.theme.colors.red100; }, function (props) { return props.theme.colors.red20; }, function (props) { return props.theme.colors.red100; });
|
|
65
|
+
var primaryDisabled = css(templateObject_27 || (templateObject_27 = __makeTemplateObject(["\n border: 1px solid ", ";\n box-shadow: 0px 0px 0px ", ";\n background-color: ", ";\n cursor: not-allowed;\n"], ["\n border: 1px solid ", ";\n box-shadow: 0px 0px 0px ", ";\n background-color: ", ";\n cursor: not-allowed;\n"])), function (props) { return props.theme.colors.grey20; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.grey20; });
|
|
66
|
+
var secondaryDisabled = css(templateObject_28 || (templateObject_28 = __makeTemplateObject(["\n color: ", ";\n box-shadow: 0px 0px 0px ", ";\n border-color: ", ";\n background-color: ", ";\n cursor: not-allowed;\n"], ["\n color: ", ";\n box-shadow: 0px 0px 0px ", ";\n border-color: ", ";\n background-color: ", ";\n cursor: not-allowed;\n"])), function (props) { return props.theme.colors.grey40; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.grey20; }, function (props) { return props.theme.colors.grey5; });
|
|
67
|
+
var tertiaryDisabled = css(templateObject_29 || (templateObject_29 = __makeTemplateObject(["\n color: ", ";\n box-shadow: 0px 0px 0px ", ";\n border-color: ", ";\n background-color: ", ";\n cursor: not-allowed;\n"], ["\n color: ", ";\n box-shadow: 0px 0px 0px ", ";\n border-color: ", ";\n background-color: ", ";\n cursor: not-allowed;\n"])), function (props) { return props.theme.colors.grey40; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.grey20; }, function (props) { return props.theme.colors.grey5; });
|
|
68
|
+
export var buttonFill = css(templateObject_30 || (templateObject_30 = __makeTemplateObject(["\n width: 100%;\n & > * {\n flex: 1;\n }\n\n ", " {\n width: 100%;\n }\n"], ["\n width: 100%;\n & > * {\n flex: 1;\n }\n\n ", " {\n width: 100%;\n }\n"])), ButtonText);
|
|
59
69
|
export function getIntentBase(props) {
|
|
60
70
|
switch (props.intent) {
|
|
61
71
|
case undefined:
|
|
@@ -65,6 +75,12 @@ export function getIntentBase(props) {
|
|
|
65
75
|
return buttonSecondaryBase;
|
|
66
76
|
case "tertiary":
|
|
67
77
|
return buttonTertiaryBase;
|
|
78
|
+
case "minimal":
|
|
79
|
+
return buttonMinimal;
|
|
80
|
+
case "minimalUnderline":
|
|
81
|
+
return buttonMinimalUnderline;
|
|
82
|
+
case "minimalBlock":
|
|
83
|
+
return minimalBLock;
|
|
68
84
|
}
|
|
69
85
|
}
|
|
70
86
|
export function getDangerIntent(props) {
|
|
@@ -96,6 +112,10 @@ export function getActiveIntent(props) {
|
|
|
96
112
|
return secondaryActive;
|
|
97
113
|
case "tertiary":
|
|
98
114
|
return tertiaryActive;
|
|
115
|
+
case "minimal":
|
|
116
|
+
return buttonMinimalActive;
|
|
117
|
+
case "minimalBlock":
|
|
118
|
+
return minimalBlockActive;
|
|
99
119
|
}
|
|
100
120
|
}
|
|
101
121
|
export var getDisabledIntent = function (props) {
|
|
@@ -110,22 +130,25 @@ export var getDisabledIntent = function (props) {
|
|
|
110
130
|
return secondaryDisabled;
|
|
111
131
|
case "tertiary":
|
|
112
132
|
return tertiaryDisabled;
|
|
133
|
+
case "minimal":
|
|
134
|
+
case "minimalUnderline":
|
|
135
|
+
return buttonMinimalDisabled;
|
|
113
136
|
}
|
|
114
137
|
};
|
|
115
|
-
export var ButtonLoaderContainer = styled.div.attrs(dpNameProp("ButtonLoader"))(
|
|
116
|
-
export var buttonLoading = css(
|
|
117
|
-
export var navButtonBase = css(
|
|
118
|
-
export var navButtonSmall = css(
|
|
119
|
-
export var TestOverlayButtonWrapper = styled.div(
|
|
138
|
+
export var ButtonLoaderContainer = styled.div.attrs(dpNameProp("ButtonLoader"))(templateObject_31 || (templateObject_31 = __makeTemplateObject(["\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n color: ", ";\n margin: 0 !important;\n opacity: 0.8;\n"], ["\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n color: ", ";\n margin: 0 !important;\n opacity: 0.8;\n"])), function (props) { return props.theme.colors.brandPrimary; });
|
|
139
|
+
export var buttonLoading = css(templateObject_32 || (templateObject_32 = __makeTemplateObject(["\n &,\n :hover,\n :active,\n :focus {\n background-color: ", " !important;\n color: transparent !important;\n border-color: ", " !important;\n box-shadow: none !important;\n }\n"], ["\n &,\n :hover,\n :active,\n :focus {\n background-color: ", " !important;\n color: transparent !important;\n border-color: ", " !important;\n box-shadow: none !important;\n }\n"])), function (props) { return props.theme.colors.grey10; }, function (props) { return props.theme.colors.grey10; });
|
|
140
|
+
export var navButtonBase = css(templateObject_33 || (templateObject_33 = __makeTemplateObject(["\n position: relative;\n transition: all 0.1s ease-in-out;\n display: inline-flex;\n flex-direction: column;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n padding: 4px 8px;\n vertical-align: middle;\n height: 55px;\n width: 90px;\n overflow: hidden;\n align-items: center;\n justify-content: center;\n\n & > :not(:last-child) {\n margin-bottom: 4px;\n }\n\n :disabled {\n cursor: not-allowed;\n }\n\n > * {\n flex: 0;\n }\n\n ", " {\n font-size: 20px;\n flex: 0 0 auto;\n }\n\n ", " {\n ", "\n flex: 0 1 auto;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n"], ["\n position: relative;\n transition: all 0.1s ease-in-out;\n display: inline-flex;\n flex-direction: column;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n padding: 4px 8px;\n vertical-align: middle;\n height: 55px;\n width: 90px;\n overflow: hidden;\n align-items: center;\n justify-content: center;\n\n & > :not(:last-child) {\n margin-bottom: 4px;\n }\n\n :disabled {\n cursor: not-allowed;\n }\n\n > * {\n flex: 0;\n }\n\n ", " {\n font-size: 20px;\n flex: 0 0 auto;\n }\n\n ", " {\n ", "\n flex: 0 1 auto;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n"])), Icon, ButtonText, paragraphStyled.p8);
|
|
141
|
+
export var navButtonSmall = css(templateObject_34 || (templateObject_34 = __makeTemplateObject(["\n height: 50px;\n width: 60px;\n min-height: 50px;\n min-width: 60px;\n"], ["\n height: 50px;\n width: 60px;\n min-height: 50px;\n min-width: 60px;\n"])));
|
|
142
|
+
export var TestOverlayButtonWrapper = styled.div(templateObject_35 || (templateObject_35 = __makeTemplateObject(["\n background-color: #eeeeee;\n height: 50px;\n position: ", ";\n width: 100px;\n"], ["\n background-color: #eeeeee;\n height: 50px;\n position: ", ";\n width: 100px;\n"])), function (_a) {
|
|
120
143
|
var position = _a.position;
|
|
121
144
|
return (position ? position : "unset");
|
|
122
145
|
});
|
|
123
|
-
export var overlayButtonStyle = css(
|
|
124
|
-
export var overlayButtonRightTop = css(
|
|
125
|
-
export var overlayButtonRightBottom = css(
|
|
126
|
-
export var overlayButtonLeftTop = css(
|
|
127
|
-
export var overlayButtonLeftBottom = css(
|
|
128
|
-
export var overlayButtonMiddleBottom = css(
|
|
129
|
-
export var overlayButtonMiddleTop = css(
|
|
130
|
-
export var buttonIconSubsection = css(
|
|
131
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32, templateObject_33, templateObject_34, templateObject_35, templateObject_36, templateObject_37, templateObject_38, templateObject_39, templateObject_40;
|
|
146
|
+
export var overlayButtonStyle = css(templateObject_36 || (templateObject_36 = __makeTemplateObject(["\n transition: color 0.2s ease-in-out, border-color 0.2s ease-in-out,\n background-color 0.2s ease-in-out, fill 0.2s ease-in-out;\n align-items: center;\n background-color: ", ";\n\n cursor: pointer;\n display: flex;\n justify-content: center;\n min-width: 25px;\n height: 22px;\n border-color: ", ";\n border-style: solid;\n color: ", ";\n\n &:hover {\n color: ", ";\n background-color: ", ";\n border-color: ", ";\n\n ", " {\n color: ", ";\n }\n }\n\n &:active {\n color: ", ";\n border-color: ", ";\n background-color: ", ";\n box-shadow: 0px 0px 0px ", ";\n\n ", " {\n color: ", ";\n }\n }\n\n & > :not(:last-child) {\n margin-right: 7px;\n }\n"], ["\n transition: color 0.2s ease-in-out, border-color 0.2s ease-in-out,\n background-color 0.2s ease-in-out, fill 0.2s ease-in-out;\n align-items: center;\n background-color: ", ";\n\n cursor: pointer;\n display: flex;\n justify-content: center;\n min-width: 25px;\n height: 22px;\n border-color: ", ";\n border-style: solid;\n color: ", ";\n\n &:hover {\n color: ", ";\n background-color: ", ";\n border-color: ", ";\n\n ", " {\n color: ", ";\n }\n }\n\n &:active {\n color: ", ";\n border-color: ", ";\n background-color: ", ";\n box-shadow: 0px 0px 0px ", ";\n\n ", " {\n color: ", ";\n }\n }\n\n & > :not(:last-child) {\n margin-right: 7px;\n }\n"])), function (props) { return props.theme.colors.white; }, function (props) { return props.theme.colors.grey40; }, function (props) { return props.theme.colors.grey80; }, function (props) { return props.theme.colors.brandShade100; }, function (props) { return props.theme.colors.brandShade10; }, function (props) { return props.theme.colors.brandShade100; }, Icon, function (props) { return props.theme.colors.brandShade100; }, function (props) { return props.theme.colors.brandShade100; }, function (props) { return props.theme.colors.brandShade100; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.brandShade40; }, Icon, function (props) { return props.theme.colors.brandShade100; });
|
|
147
|
+
export var overlayButtonRightTop = css(templateObject_37 || (templateObject_37 = __makeTemplateObject(["\n border-bottom-left-radius: 5px;\n border-bottom-width: 1px;\n border-left-width: 1px;\n\n border-top: 0;\n border-right: 0;\n top: 0;\n right: 0;\n"], ["\n border-bottom-left-radius: 5px;\n border-bottom-width: 1px;\n border-left-width: 1px;\n\n border-top: 0;\n border-right: 0;\n top: 0;\n right: 0;\n"])));
|
|
148
|
+
export var overlayButtonRightBottom = css(templateObject_38 || (templateObject_38 = __makeTemplateObject(["\n border-top-left-radius: 5px;\n border-top-width: 1px;\n border-left-width: 1px;\n border-bottom: 0;\n border-right: 0;\n bottom: 0;\n right: 0;\n"], ["\n border-top-left-radius: 5px;\n border-top-width: 1px;\n border-left-width: 1px;\n border-bottom: 0;\n border-right: 0;\n bottom: 0;\n right: 0;\n"])));
|
|
149
|
+
export var overlayButtonLeftTop = css(templateObject_39 || (templateObject_39 = __makeTemplateObject(["\n border-bottom-right-radius: 5px;\n border-bottom-width: 1px;\n border-right-width: 1px;\n border-left: 0;\n border-top: 0;\n top: 0;\n left: 0;\n"], ["\n border-bottom-right-radius: 5px;\n border-bottom-width: 1px;\n border-right-width: 1px;\n border-left: 0;\n border-top: 0;\n top: 0;\n left: 0;\n"])));
|
|
150
|
+
export var overlayButtonLeftBottom = css(templateObject_40 || (templateObject_40 = __makeTemplateObject(["\n border-top-right-radius: 5px;\n border-top-width: 1px;\n border-right-width: 1px;\n border-left: 0;\n border-bottom: 0;\n top: 0;\n left: 0;\n"], ["\n border-top-right-radius: 5px;\n border-top-width: 1px;\n border-right-width: 1px;\n border-left: 0;\n border-bottom: 0;\n top: 0;\n left: 0;\n"])));
|
|
151
|
+
export var overlayButtonMiddleBottom = css(templateObject_41 || (templateObject_41 = __makeTemplateObject(["\n border-radius: 5px;\n border-width: 1px;\n bottom: 10px;\n left: 50%;\n transform: translateX(-50%);\n white-space: nowrap;\n"], ["\n border-radius: 5px;\n border-width: 1px;\n bottom: 10px;\n left: 50%;\n transform: translateX(-50%);\n white-space: nowrap;\n"])));
|
|
152
|
+
export var overlayButtonMiddleTop = css(templateObject_42 || (templateObject_42 = __makeTemplateObject(["\n border-bottom-left-radius: 5px;\n border-bottom-right-radius: 5px;\n border-bottom-width: 1px;\n border-right-width: 1px;\n border-left-width: 1px;\n border-top: 0;\n top: 0;\n left: 0;\n right: 0;\n margin-left: auto;\n margin-right: auto;\n"], ["\n border-bottom-left-radius: 5px;\n border-bottom-right-radius: 5px;\n border-bottom-width: 1px;\n border-right-width: 1px;\n border-left-width: 1px;\n border-top: 0;\n top: 0;\n left: 0;\n right: 0;\n margin-left: auto;\n margin-right: auto;\n"])));
|
|
153
|
+
export var buttonIconSubsection = css(templateObject_43 || (templateObject_43 = __makeTemplateObject(["\n min-width: 18px;\n width: 18px;\n ", " {\n width: 12px;\n height: 12px;\n }\n"], ["\n min-width: 18px;\n width: 18px;\n ", " {\n width: 12px;\n height: 12px;\n }\n"])), Icon);
|
|
154
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32, templateObject_33, templateObject_34, templateObject_35, templateObject_36, templateObject_37, templateObject_38, templateObject_39, templateObject_40, templateObject_41, templateObject_42, templateObject_43;
|
|
@@ -2,5 +2,5 @@ import { __makeTemplateObject } from "tslib";
|
|
|
2
2
|
import { Button, AnchorButton } from "../Button";
|
|
3
3
|
import styled from "styled-components";
|
|
4
4
|
import { dpNameProp } from "../../utils";
|
|
5
|
-
export var ButtonGroup = styled.div.attrs(dpNameProp("ButtonGroup"))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n\n ", ", ", " {\n flex: 0 1 auto;\n position: relative;\n\n &:not(:last-child) {\n border-bottom-right-radius: 0%;\n border-top-right-radius: 0%;\n }\n\n &:not(:first-child) {\n border-bottom-left-radius: 0%;\n border-top-left-radius: 0%;\n }\n }\n"], ["\n display: inline-flex;\n\n ", ", ", " {\n flex: 0 1 auto;\n position: relative;\n\n &:not(:last-child) {\n border-bottom-right-radius: 0%;\n border-top-right-radius: 0%;\n }\n\n &:not(:first-child) {\n border-bottom-left-radius: 0%;\n border-top-left-radius: 0%;\n }\n }\n"])), Button, AnchorButton);
|
|
5
|
+
export var ButtonGroup = styled.div.attrs(dpNameProp("ButtonGroup"))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n\n ", ", ", " {\n flex: 0 1 auto;\n position: relative;\n\n &:not(:last-child) {\n border-bottom-right-radius: 0%;\n border-top-right-radius: 0%;\n }\n\n &:not(:first-child) {\n border-bottom-left-radius: 0%;\n border-top-left-radius: 0%;\n border-left: none;\n }\n }\n"], ["\n display: inline-flex;\n\n ", ", ", " {\n flex: 0 1 auto;\n position: relative;\n\n &:not(:last-child) {\n border-bottom-right-radius: 0%;\n border-top-right-radius: 0%;\n }\n\n &:not(:first-child) {\n border-bottom-left-radius: 0%;\n border-top-left-radius: 0%;\n border-left: none;\n }\n }\n"])), Button, AnchorButton);
|
|
6
6
|
var templateObject_1;
|
|
@@ -2,23 +2,21 @@ import { __assign, __makeTemplateObject } from "tslib";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import styled from "styled-components";
|
|
4
4
|
import { Avatar } from "../Avatar";
|
|
5
|
-
import {
|
|
6
|
-
import { P8, TSpan } from "../Typography";
|
|
5
|
+
import { TSpan } from "../Typography";
|
|
7
6
|
import { Stack } from "../../layout";
|
|
8
7
|
import { dpNameProp } from "../../utils";
|
|
9
|
-
|
|
8
|
+
import { IconButton } from "../Button";
|
|
9
|
+
var Container = styled(Stack)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n box-sizing: border-box;\n background-color: ", ";\n border-radius: 10px;\n height: 20px;\n width: fit-content;\n max-width: 100%;\n overflow: hidden;\n padding: 2px 5px 2px 10px;\n font-size: 11px;\n color: #1c3e55;\n"], ["\n box-sizing: border-box;\n background-color: ", ";\n border-radius: 10px;\n height: 20px;\n width: fit-content;\n max-width: 100%;\n overflow: hidden;\n padding: 2px 5px 2px 10px;\n font-size: 11px;\n color: #1c3e55;\n"])), function (_a) {
|
|
10
10
|
var theme = _a.theme;
|
|
11
11
|
return theme.colors.brandShade20;
|
|
12
12
|
});
|
|
13
|
-
var CloseIcon = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n color: ", ";\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n color: ", ";\n"])), function (props) { return props.theme.colors.brandShade100; });
|
|
14
13
|
export var CCUserTag = function (_a) {
|
|
15
14
|
var displayName = _a.displayName, avatar = _a.avatar, email = _a.email, onClose = _a.onClose, closeIcon = _a.closeIcon, avatarBackupIcon = _a.avatarBackupIcon;
|
|
16
|
-
return (React.createElement(Container, __assign({}, dpNameProp("CCUserTag"), {
|
|
17
|
-
|
|
18
|
-
React.createElement(Avatar, __assign({}, avatar, { backupIcon: avatarBackupIcon }))
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
onClose && (React.createElement(
|
|
22
|
-
React.createElement(Icon, { icon: closeIcon })))));
|
|
15
|
+
return (React.createElement(Container, __assign({}, dpNameProp("CCUserTag"), { align: "center", wrap: "nowrap" }),
|
|
16
|
+
React.createElement(Stack, { gap: 6, align: "center", wrap: "nowrap", overflow: "hidden" },
|
|
17
|
+
avatar && React.createElement(Avatar, __assign({ size: 15 }, avatar, { backupIcon: avatarBackupIcon })),
|
|
18
|
+
displayName && (React.createElement(TSpan, { type: "p6", style: { whiteSpace: "nowrap" }, overflow: "ellipsis", flex: 3 }, displayName)),
|
|
19
|
+
email && React.createElement(TSpan, { type: "p8", overflow: "ellipsis", flex: 1 }, "(".concat(email, ")"))),
|
|
20
|
+
onClose && (React.createElement(IconButton, { size: "tiny", intent: "minimal", icon: closeIcon, onClick: function () { return onClose(); } }))));
|
|
23
21
|
};
|
|
24
|
-
var templateObject_1
|
|
22
|
+
var templateObject_1;
|