@deskpro/deskpro-ui 0.1.15 → 1.1.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 +88 -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 +60 -37
- 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/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/AppCard.js +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 +1 -2
- package/dist/cjs/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/cjs/components/Dropdown/Dropdown.js +8 -14
- 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 +1 -2
- package/dist/cjs/components/Dropdown/styles.d.ts.map +1 -1
- package/dist/cjs/components/Dropdown/styles.js +4 -1
- package/dist/cjs/components/Dropdown/types.d.ts +3 -2
- 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/Icon/customIconsCodegen.d.ts +1 -1
- package/dist/cjs/components/Icon/customIconsCodegen.d.ts.map +1 -1
- package/dist/cjs/components/Icon/customIconsCodegen.js +24 -23
- 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 -2
- package/dist/cjs/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.js +34 -5
- 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/lib.d.ts +0 -1
- package/dist/cjs/lib.d.ts.map +1 -1
- package/dist/cjs/lib.js +0 -1
- 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/deskpro-custom-icons.css +29 -26
- 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 +87 -27
- package/dist/esm/components/Button/styles.js +59 -36
- package/dist/esm/components/CCUserTag/CCUserTag.js +10 -12
- package/dist/esm/components/Card/AppCard.js +1 -1
- 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 +9 -15
- package/dist/esm/components/Dropdown/styles.js +4 -1
- package/dist/esm/components/Icon/DeskproCustomIcon.js +3 -3
- package/dist/esm/components/Icon/Icon.js +8 -16
- package/dist/esm/components/Icon/customIconsCodegen.js +24 -23
- 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 +36 -7
- package/dist/esm/lib.js +0 -1
- 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/dist/fonts/DpCustomIcons/DpCustomIcons.eot +0 -0
- package/dist/fonts/DpCustomIcons/DpCustomIcons.woff +0 -0
- package/dist/fonts/DpCustomIcons/DpCustomIcons.woff2 +0 -0
- package/package.json +78 -58
- package/.idea/.gitignore +0 -8
- package/.idea/deskpro-ui.iml +0 -8
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/prettier.xml +0 -6
- package/.idea/vcs.xml +0 -6
- package/dist/cjs/nav/NavSidebar/NavSidebar.d.ts +0 -28
- package/dist/cjs/nav/NavSidebar/NavSidebar.d.ts.map +0 -1
- package/dist/cjs/nav/NavSidebar/NavSidebar.js +0 -55
- package/dist/cjs/nav/NavSidebar/index.d.ts +0 -3
- package/dist/cjs/nav/NavSidebar/index.d.ts.map +0 -1
- package/dist/cjs/nav/NavSidebar/index.js +0 -6
- package/dist/esm/nav/NavSidebar/NavSidebar.js +0 -49
- package/dist/esm/nav/NavSidebar/index.js +0 -2
|
@@ -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"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
@font-face {
|
|
2
2
|
font-family: "DpCustomIcons";
|
|
3
|
-
src: url("./fonts/DpCustomIcons/DpCustomIcons.eot?
|
|
4
|
-
url("./fonts/DpCustomIcons/DpCustomIcons.woff2?
|
|
5
|
-
url("./fonts/DpCustomIcons/DpCustomIcons.woff?
|
|
3
|
+
src: url("./fonts/DpCustomIcons/DpCustomIcons.eot?90f42c3555fdeaefe1013f8c50600c5e#iefix") format("embedded-opentype"),
|
|
4
|
+
url("./fonts/DpCustomIcons/DpCustomIcons.woff2?90f42c3555fdeaefe1013f8c50600c5e") format("woff2"),
|
|
5
|
+
url("./fonts/DpCustomIcons/DpCustomIcons.woff?90f42c3555fdeaefe1013f8c50600c5e") format("woff");
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
i[class^="dp-custom-icon-"]:before, i[class*=" dp-custom-icon-"]:before {
|
|
@@ -85,72 +85,75 @@ i[class^="dp-custom-icon-"]:before, i[class*=" dp-custom-icon-"]:before {
|
|
|
85
85
|
.dp-custom-icon-helping-hand:before {
|
|
86
86
|
content: "\f117";
|
|
87
87
|
}
|
|
88
|
-
.dp-custom-icon-im-
|
|
88
|
+
.dp-custom-icon-im-outline:before {
|
|
89
89
|
content: "\f118";
|
|
90
90
|
}
|
|
91
|
-
.dp-custom-icon-im:before {
|
|
91
|
+
.dp-custom-icon-im-send:before {
|
|
92
92
|
content: "\f119";
|
|
93
93
|
}
|
|
94
|
-
.dp-custom-icon-
|
|
94
|
+
.dp-custom-icon-im:before {
|
|
95
95
|
content: "\f11a";
|
|
96
96
|
}
|
|
97
|
-
.dp-custom-icon-
|
|
97
|
+
.dp-custom-icon-inbound-call:before {
|
|
98
98
|
content: "\f11b";
|
|
99
99
|
}
|
|
100
|
-
.dp-custom-icon-
|
|
100
|
+
.dp-custom-icon-kanban-view:before {
|
|
101
101
|
content: "\f11c";
|
|
102
102
|
}
|
|
103
|
-
.dp-custom-icon-
|
|
103
|
+
.dp-custom-icon-level-down:before {
|
|
104
104
|
content: "\f11d";
|
|
105
105
|
}
|
|
106
|
-
.dp-custom-icon-
|
|
106
|
+
.dp-custom-icon-linked-ticket:before {
|
|
107
107
|
content: "\f11e";
|
|
108
108
|
}
|
|
109
|
-
.dp-custom-icon-
|
|
109
|
+
.dp-custom-icon-location-arrow:before {
|
|
110
110
|
content: "\f11f";
|
|
111
111
|
}
|
|
112
|
-
.dp-custom-icon-
|
|
112
|
+
.dp-custom-icon-merge:before {
|
|
113
113
|
content: "\f120";
|
|
114
114
|
}
|
|
115
|
-
.dp-custom-icon-
|
|
115
|
+
.dp-custom-icon-merge2:before {
|
|
116
116
|
content: "\f121";
|
|
117
117
|
}
|
|
118
|
-
.dp-custom-icon-
|
|
118
|
+
.dp-custom-icon-missed-call:before {
|
|
119
119
|
content: "\f122";
|
|
120
120
|
}
|
|
121
|
-
.dp-custom-icon-
|
|
121
|
+
.dp-custom-icon-mobile-rotate:before {
|
|
122
122
|
content: "\f123";
|
|
123
123
|
}
|
|
124
|
-
.dp-custom-icon-
|
|
124
|
+
.dp-custom-icon-organization-circle:before {
|
|
125
125
|
content: "\f124";
|
|
126
126
|
}
|
|
127
|
-
.dp-custom-icon-
|
|
127
|
+
.dp-custom-icon-outbound-call:before {
|
|
128
128
|
content: "\f125";
|
|
129
129
|
}
|
|
130
|
-
.dp-custom-icon-
|
|
130
|
+
.dp-custom-icon-read:before {
|
|
131
131
|
content: "\f126";
|
|
132
132
|
}
|
|
133
|
-
.dp-custom-icon-
|
|
133
|
+
.dp-custom-icon-record:before {
|
|
134
134
|
content: "\f127";
|
|
135
135
|
}
|
|
136
|
-
.dp-custom-icon-
|
|
136
|
+
.dp-custom-icon-sent:before {
|
|
137
137
|
content: "\f128";
|
|
138
138
|
}
|
|
139
|
-
.dp-custom-icon-
|
|
139
|
+
.dp-custom-icon-sip-address:before {
|
|
140
140
|
content: "\f129";
|
|
141
141
|
}
|
|
142
|
-
.dp-custom-icon-
|
|
142
|
+
.dp-custom-icon-sort:before {
|
|
143
143
|
content: "\f12a";
|
|
144
144
|
}
|
|
145
|
-
.dp-custom-icon-
|
|
145
|
+
.dp-custom-icon-transfer-queue:before {
|
|
146
146
|
content: "\f12b";
|
|
147
147
|
}
|
|
148
|
-
.dp-custom-icon-
|
|
148
|
+
.dp-custom-icon-triangle:before {
|
|
149
149
|
content: "\f12c";
|
|
150
150
|
}
|
|
151
|
-
.dp-custom-icon-warm-
|
|
151
|
+
.dp-custom-icon-warm-add:before {
|
|
152
152
|
content: "\f12d";
|
|
153
153
|
}
|
|
154
|
-
.dp-custom-icon-
|
|
154
|
+
.dp-custom-icon-warm-transfer:before {
|
|
155
155
|
content: "\f12e";
|
|
156
156
|
}
|
|
157
|
+
.dp-custom-icon-webhook:before {
|
|
158
|
+
content: "\f12f";
|
|
159
|
+
}
|
|
@@ -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",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __assign, __makeTemplateObject, __rest } from "tslib";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
|
-
import styled from "styled-components";
|
|
4
|
+
import styled, { css } 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
|
/**
|
|
@@ -18,41 +18,71 @@ export var Button = styled(forwardRef(function Button(_a, ref) {
|
|
|
18
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 && getActiveIntent({ intent: calculatedIntent, danger: props.danger });
|
|
30
|
+
}, function (props) { return props.loading && buttonLoading; }, function (props) { return props.fill && buttonFill; });
|
|
22
31
|
/**
|
|
23
32
|
* Icon Button
|
|
24
33
|
*/
|
|
25
34
|
export var IconButton = styled(forwardRef(function IconButton(_a, ref) {
|
|
26
35
|
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) {
|
|
36
|
+
return (React.createElement("button", __assign({}, dpNameProp("IconButton"), { ref: ref, type: type }, rest, { disabled: disabled || loading }), loading ? (React.createElement(ButtonLoaderContainer, null,
|
|
37
|
+
React.createElement(Spinner, { size: "small" }))) : isAnyIcon(icon) ? (React.createElement(Icon, { themeColor: themeColor, icon: icon })) : isIconProps(icon) ? (React.createElement(Icon, __assign({ themeColor: themeColor }, icon))) : (icon)));
|
|
38
|
+
}))(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) {
|
|
39
|
+
var calculatedIntent = calculateIntent(props);
|
|
40
|
+
return getIntentBase({
|
|
41
|
+
intent: calculatedIntent === "minimalUnderline" ? "minimal" : calculatedIntent,
|
|
42
|
+
});
|
|
43
|
+
}, function (props) {
|
|
44
|
+
var calculatedIntent = calculateIntent(props);
|
|
45
|
+
return props.danger && getDangerIntent({ intent: calculatedIntent });
|
|
46
|
+
}, function (props) {
|
|
47
|
+
var calculatedIntent = calculateIntent(props);
|
|
48
|
+
return props.active && getActiveIntent({ intent: calculatedIntent });
|
|
49
|
+
}, function (props) { return props.loading && buttonLoading; }, function (props) { return props.iconSubsection && buttonIconSubsection; });
|
|
35
50
|
export var AvatarButton = styled(forwardRef(function AvatarButton(_a, ref) {
|
|
36
51
|
var avatarSize = _a.avatarSize, _b = _a.type, type = _b === void 0 ? "button" : _b, rest = __rest(_a, ["avatarSize", "type"]);
|
|
37
52
|
return React.createElement(IconButton, __assign({ ref: ref, type: type }, rest));
|
|
38
|
-
}))(
|
|
53
|
+
}))(templateObject_4 || (templateObject_4 = __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\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\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
54
|
var avatarSize = _a.avatarSize;
|
|
40
|
-
return avatarSize;
|
|
55
|
+
return avatarSize + 4;
|
|
41
56
|
}, function (_a) {
|
|
42
57
|
var avatarSize = _a.avatarSize;
|
|
43
|
-
return avatarSize;
|
|
58
|
+
return avatarSize + 4;
|
|
44
59
|
}, function (_a) {
|
|
45
60
|
var avatarSize = _a.avatarSize;
|
|
46
|
-
return avatarSize;
|
|
61
|
+
return avatarSize + 4;
|
|
47
62
|
}, function (_a) {
|
|
48
63
|
var avatarSize = _a.avatarSize;
|
|
49
|
-
return avatarSize;
|
|
64
|
+
return avatarSize + 4;
|
|
50
65
|
}, function (_a) {
|
|
51
66
|
var avatarSize = _a.avatarSize;
|
|
52
|
-
return avatarSize;
|
|
67
|
+
return avatarSize + 4;
|
|
53
68
|
}, function (_a) {
|
|
54
69
|
var avatarSize = _a.avatarSize;
|
|
55
|
-
return avatarSize;
|
|
70
|
+
return avatarSize + 4;
|
|
71
|
+
}, function (_a) {
|
|
72
|
+
var theme = _a.theme;
|
|
73
|
+
return theme.colors.white;
|
|
74
|
+
}, function (_a) {
|
|
75
|
+
var theme = _a.theme;
|
|
76
|
+
return theme.colors.brandShade60;
|
|
77
|
+
}, function (_a) {
|
|
78
|
+
var active = _a.active, theme = _a.theme;
|
|
79
|
+
return active && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border: 2px solid ", ";\n "], ["\n border: 2px solid ", ";\n "])), theme.colors.cyan100);
|
|
80
|
+
}, function (_a) {
|
|
81
|
+
var theme = _a.theme;
|
|
82
|
+
return theme.colors.cyan100;
|
|
83
|
+
}, function (_a) {
|
|
84
|
+
var disabled = _a.disabled;
|
|
85
|
+
return (disabled ? "cursor: not-allowed;" : "");
|
|
56
86
|
}, function (_a) {
|
|
57
87
|
var avatarSize = _a.avatarSize;
|
|
58
88
|
return avatarSize;
|
|
@@ -66,7 +96,7 @@ export var AvatarButton = styled(forwardRef(function AvatarButton(_a, ref) {
|
|
|
66
96
|
var avatarSize = _a.avatarSize;
|
|
67
97
|
return avatarSize;
|
|
68
98
|
});
|
|
69
|
-
export var AvatarGroupButton = styled(IconButton)(
|
|
99
|
+
export var AvatarGroupButton = styled(IconButton)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n max-height: initial;\n min-height: initial;\n max-width: initial;\n min-width: initial;\n width: auto;\n height: auto;\n"], ["\n max-height: initial;\n min-height: initial;\n max-width: initial;\n min-width: initial;\n width: auto;\n height: auto;\n"])));
|
|
70
100
|
/**
|
|
71
101
|
* Anchor component styled like a button
|
|
72
102
|
*/
|
|
@@ -80,7 +110,16 @@ export var AnchorButton = styled(forwardRef(function AnchorButton(_a, ref) {
|
|
|
80
110
|
isAnyIcon(icon) ? React.createElement(Icon, { icon: icon }) : isIconProps(icon) ? React.createElement(Icon, __assign({}, icon)) : icon,
|
|
81
111
|
text && React.createElement(ButtonText, null, text),
|
|
82
112
|
isAnyIcon(rightIcon) ? (React.createElement(Icon, { icon: rightIcon })) : isIconProps(rightIcon) ? (React.createElement(Icon, __assign({}, rightIcon))) : (rightIcon)));
|
|
83
|
-
}))(
|
|
113
|
+
}))(templateObject_6 || (templateObject_6 = __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) {
|
|
114
|
+
var calculatedIntent = calculateIntent(props);
|
|
115
|
+
return getIntentBase({ intent: calculatedIntent });
|
|
116
|
+
}, function (props) {
|
|
117
|
+
var calculatedIntent = calculateIntent(props);
|
|
118
|
+
return props.danger && getDangerIntent({ intent: calculatedIntent });
|
|
119
|
+
}, function (props) {
|
|
120
|
+
var calculatedIntent = calculateIntent(props);
|
|
121
|
+
return props.active && getActiveIntent({ intent: calculatedIntent });
|
|
122
|
+
}, 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
123
|
/**
|
|
85
124
|
* Label component styled like a button - useful for wrapping around file input for example
|
|
86
125
|
*/
|
|
@@ -95,10 +134,20 @@ export var LabelButton = styled(forwardRef(function LabelButton(_a, ref) {
|
|
|
95
134
|
isAnyIcon(icon) ? React.createElement(Icon, { icon: icon }) : isIconProps(icon) ? React.createElement(Icon, __assign({}, icon)) : icon,
|
|
96
135
|
text && React.createElement(ButtonText, null, text),
|
|
97
136
|
isAnyIcon(rightIcon) ? (React.createElement(Icon, { icon: rightIcon })) : isIconProps(rightIcon) ? (React.createElement(Icon, __assign({}, rightIcon))) : (rightIcon)));
|
|
98
|
-
}))(
|
|
137
|
+
}))(templateObject_7 || (templateObject_7 = __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) {
|
|
138
|
+
var calculatedIntent = calculateIntent(props);
|
|
139
|
+
return getIntentBase({ intent: calculatedIntent });
|
|
140
|
+
}, function (props) {
|
|
141
|
+
var calculatedIntent = calculateIntent(props);
|
|
142
|
+
return props.danger && getDangerIntent({ intent: calculatedIntent });
|
|
143
|
+
}, function (props) {
|
|
144
|
+
var calculatedIntent = calculateIntent(props);
|
|
145
|
+
return props.active && getActiveIntent({ intent: calculatedIntent });
|
|
146
|
+
}, 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; });
|
|
147
|
+
// ${(props) => props.noMinimalUnderline && buttonNoMinimalUnderline} ^^^^
|
|
99
148
|
export var LabelButtonFileInput = styled.input.attrs({
|
|
100
149
|
type: "file",
|
|
101
|
-
})(
|
|
150
|
+
})(templateObject_8 || (templateObject_8 = __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"])));
|
|
102
151
|
export var NavButton = styled(forwardRef(function NavButton(_a, ref) {
|
|
103
152
|
var text = _a.text, _b = _a.type, type = _b === void 0 ? "button" : _b, icon = _a.icon, active = _a.active, alignText = _a.alignText, _c = _a.reverse, reverse = _c === void 0 ? false : _c, rest = __rest(_a, ["text", "type", "icon", "active", "alignText", "reverse"]);
|
|
104
153
|
return (React.createElement("button", __assign({ type: type, ref: ref }, dpNameProp("NavButton"), rest),
|
|
@@ -108,19 +157,25 @@ export var NavButton = styled(forwardRef(function NavButton(_a, ref) {
|
|
|
108
157
|
!reverse && (React.createElement(React.Fragment, null,
|
|
109
158
|
isAnyIcon(icon) ? React.createElement(Icon, { icon: icon }) : isIconProps(icon) ? React.createElement(Icon, __assign({}, icon)) : icon,
|
|
110
159
|
text && React.createElement(ButtonText, { overflow: "ellipsis" }, text)))));
|
|
111
|
-
}))(
|
|
160
|
+
}))(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n ", "\n"], ["\n ", "\n ", "\n ", "\n ", "\n"])), navButtonBase, function (props) {
|
|
161
|
+
var calculatedIntent = calculateIntent(props);
|
|
162
|
+
return getIntentBase({ intent: calculatedIntent });
|
|
163
|
+
}, function (props) { return props.size === "small" && navButtonSmall; }, function (props) {
|
|
164
|
+
var calculatedIntent = calculateIntent(props);
|
|
165
|
+
return props.active && getActiveIntent({ intent: calculatedIntent });
|
|
166
|
+
});
|
|
112
167
|
/**
|
|
113
168
|
* OverlayButton requires `position: relative` wrapper to overlay unless position set to relative
|
|
114
169
|
*/
|
|
115
170
|
export var OverlayButton = styled(forwardRef(function OverlayButton(_a, ref) {
|
|
116
|
-
var icon = _a.icon,
|
|
171
|
+
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
172
|
return (React.createElement("button", __assign({ type: type }, dpNameProp("OverlayButton"), { ref: ref }, rest),
|
|
118
173
|
loading && (React.createElement(ButtonLoaderContainer, null,
|
|
119
|
-
React.createElement(Spinner,
|
|
174
|
+
React.createElement(Spinner, { size: "small" }))),
|
|
120
175
|
isAnyIcon(icon) ? (React.createElement(Icon, { icon: icon, size: 10 })) : isIconProps(icon) ? (React.createElement(Icon, __assign({ size: 10 }, icon))) : (icon),
|
|
121
176
|
text && React.createElement(ButtonText, null, text),
|
|
122
177
|
isAnyIcon(rightIcon) ? (React.createElement(Icon, { icon: rightIcon, size: 10 })) : isIconProps(rightIcon) ? (React.createElement(Icon, __assign({ size: 10 }, rightIcon))) : (rightIcon)));
|
|
123
|
-
}))(
|
|
178
|
+
}))(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n text-align: ", ";\n ", "\n ", "\n\n position: ", ";\n"], ["\n text-align: ", ";\n ", "\n ", "\n\n position: ", ";\n"])), function (props) { var _a; return (_a = props.alignText) !== null && _a !== void 0 ? _a : "left"; }, overlayButtonStyle, function (props) {
|
|
124
179
|
var _a;
|
|
125
180
|
return match((_a = props.placement) !== null && _a !== void 0 ? _a : "right-top")
|
|
126
181
|
.with("right-top", function () { return overlayButtonRightTop; })
|
|
@@ -134,4 +189,9 @@ export var OverlayButton = styled(forwardRef(function OverlayButton(_a, ref) {
|
|
|
134
189
|
var position = _a.position;
|
|
135
190
|
return (position ? position : "absolute");
|
|
136
191
|
});
|
|
137
|
-
var
|
|
192
|
+
export var calculateIntent = function (_a) {
|
|
193
|
+
var minimal = _a.minimal, noMinimalUnderline = _a.noMinimalUnderline, intent = _a.intent;
|
|
194
|
+
var newIntent = minimal ? (noMinimalUnderline ? "minimal" : "minimalUnderline") : intent;
|
|
195
|
+
return newIntent !== null && newIntent !== void 0 ? newIntent : "primary";
|
|
196
|
+
};
|
|
197
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
|