@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,6 +1,6 @@
|
|
|
1
1
|
import { __assign, __read } from "tslib";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { useCallback, useEffect, useLayoutEffect, useRef, useState
|
|
3
|
+
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
4
4
|
import { useDebouncedCallback } from "use-debounce";
|
|
5
5
|
import { Stack } from "../../layout";
|
|
6
6
|
import { ObservedDiv } from "./ObservedDiv";
|
|
@@ -48,15 +48,13 @@ function useScrollControl(children, reverse, anchor, scrollSideEffect) {
|
|
|
48
48
|
}
|
|
49
49
|
else if (typeof lastKnownScrollOffset.current === "number" && reverse) {
|
|
50
50
|
ref.current.scrollTo({
|
|
51
|
-
top: Math.abs(lastKnownScrollOffset.current -
|
|
52
|
-
(ref.current.scrollHeight - ref.current.clientHeight)),
|
|
51
|
+
top: Math.abs(lastKnownScrollOffset.current - (ref.current.scrollHeight - ref.current.clientHeight)),
|
|
53
52
|
});
|
|
54
53
|
}
|
|
55
54
|
});
|
|
56
55
|
var debouncedSetIsAttached = useDebouncedCallback(function () {
|
|
57
56
|
if (typeof lastKnownScrollOffset.current === "number" && ref.current) {
|
|
58
|
-
if (shouldAttachScroll.current !== isAttached &&
|
|
59
|
-
lastKnownScrollOffset.current > 300) {
|
|
57
|
+
if (shouldAttachScroll.current !== isAttached && lastKnownScrollOffset.current > 300) {
|
|
60
58
|
setIsAttached(shouldAttachScroll.current);
|
|
61
59
|
}
|
|
62
60
|
else if (shouldAttachScroll.current !== isAttached &&
|
|
@@ -69,15 +67,13 @@ function useScrollControl(children, reverse, anchor, scrollSideEffect) {
|
|
|
69
67
|
var handleScroll = useCallback(function () {
|
|
70
68
|
if (ref.current &&
|
|
71
69
|
!isAttached &&
|
|
72
|
-
ref.current.scrollTop + ref.current.offsetHeight >
|
|
73
|
-
ref.current.scrollHeight - 2) {
|
|
70
|
+
ref.current.scrollTop + ref.current.offsetHeight > ref.current.scrollHeight - 2) {
|
|
74
71
|
setIsAttached(true);
|
|
75
72
|
}
|
|
76
73
|
if (!ref.current)
|
|
77
74
|
return;
|
|
78
75
|
if (reverse) {
|
|
79
|
-
if (ref.current.scrollTop <
|
|
80
|
-
ref.current.scrollHeight - ref.current.clientHeight) {
|
|
76
|
+
if (ref.current.scrollTop < ref.current.scrollHeight - ref.current.clientHeight) {
|
|
81
77
|
shouldAttachScroll.current = false;
|
|
82
78
|
}
|
|
83
79
|
else {
|
|
@@ -93,8 +89,7 @@ function useScrollControl(children, reverse, anchor, scrollSideEffect) {
|
|
|
93
89
|
}
|
|
94
90
|
}
|
|
95
91
|
scrollSideEffect === null || scrollSideEffect === void 0 ? void 0 : scrollSideEffect();
|
|
96
|
-
lastKnownScrollOffset.current = Math.abs(ref.current.scrollTop -
|
|
97
|
-
(ref.current.scrollHeight - ref.current.clientHeight));
|
|
92
|
+
lastKnownScrollOffset.current = Math.abs(ref.current.scrollTop - (ref.current.scrollHeight - ref.current.clientHeight));
|
|
98
93
|
debouncedSetIsAttached();
|
|
99
94
|
}, [debouncedSetIsAttached, reverse, scrollSideEffect, isAttached]);
|
|
100
95
|
var reAttach = useCallback(function () {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __assign, __read } from "tslib";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { useCallback, useEffect, useLayoutEffect, useRef, useState
|
|
3
|
+
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
4
4
|
import { useDebouncedCallback } from "use-debounce";
|
|
5
5
|
import { Stack } from "../../layout";
|
|
6
6
|
import { ObservedDiv } from "./ObservedDiv";
|
|
@@ -48,15 +48,13 @@ function useScrollControl(children, reverse, anchor, scrollSideEffect) {
|
|
|
48
48
|
}
|
|
49
49
|
else if (typeof lastKnownScrollOffset.current === "number" && reverse) {
|
|
50
50
|
ref.current.scrollTo({
|
|
51
|
-
top: Math.abs(lastKnownScrollOffset.current -
|
|
52
|
-
(ref.current.scrollHeight - ref.current.clientHeight)),
|
|
51
|
+
top: Math.abs(lastKnownScrollOffset.current - (ref.current.scrollHeight - ref.current.clientHeight)),
|
|
53
52
|
});
|
|
54
53
|
}
|
|
55
54
|
});
|
|
56
55
|
var debouncedSetIsAttached = useDebouncedCallback(function () {
|
|
57
56
|
if (typeof lastKnownScrollOffset.current === "number" && ref.current) {
|
|
58
|
-
if (shouldAttachScroll.current !== isAttached &&
|
|
59
|
-
lastKnownScrollOffset.current > 300) {
|
|
57
|
+
if (shouldAttachScroll.current !== isAttached && lastKnownScrollOffset.current > 300) {
|
|
60
58
|
setIsAttached(shouldAttachScroll.current);
|
|
61
59
|
}
|
|
62
60
|
}
|
|
@@ -66,8 +64,7 @@ function useScrollControl(children, reverse, anchor, scrollSideEffect) {
|
|
|
66
64
|
if (!ref.current)
|
|
67
65
|
return;
|
|
68
66
|
if (reverse) {
|
|
69
|
-
if (ref.current.scrollTop <
|
|
70
|
-
ref.current.scrollHeight - ref.current.clientHeight) {
|
|
67
|
+
if (ref.current.scrollTop < ref.current.scrollHeight - ref.current.clientHeight) {
|
|
71
68
|
shouldAttachScroll.current = false;
|
|
72
69
|
}
|
|
73
70
|
else {
|
|
@@ -83,8 +80,7 @@ function useScrollControl(children, reverse, anchor, scrollSideEffect) {
|
|
|
83
80
|
}
|
|
84
81
|
}
|
|
85
82
|
scrollSideEffect === null || scrollSideEffect === void 0 ? void 0 : scrollSideEffect();
|
|
86
|
-
lastKnownScrollOffset.current = Math.abs(ref.current.scrollTop -
|
|
87
|
-
(ref.current.scrollHeight - ref.current.clientHeight));
|
|
83
|
+
lastKnownScrollOffset.current = Math.abs(ref.current.scrollTop - (ref.current.scrollHeight - ref.current.clientHeight));
|
|
88
84
|
debouncedSetIsAttached();
|
|
89
85
|
}, [debouncedSetIsAttached, reverse, scrollSideEffect]);
|
|
90
86
|
var reAttach = useCallback(function () {
|
|
@@ -12,7 +12,7 @@ import { Icon } from "../Icon";
|
|
|
12
12
|
import { isISO3166 } from "../FlagImg";
|
|
13
13
|
import { Stack } from "../../layout";
|
|
14
14
|
import styled from "styled-components";
|
|
15
|
-
export { isValidPhoneNumber, getCountryCallingCode, parsePhoneNumber, formatPhoneNumberIntl
|
|
15
|
+
export { isValidPhoneNumber, getCountryCallingCode, parsePhoneNumber, formatPhoneNumberIntl };
|
|
16
16
|
var allOptions = __spreadArray([
|
|
17
17
|
{
|
|
18
18
|
type: "value",
|
|
@@ -45,9 +45,7 @@ var SelectComponent = function (_a) {
|
|
|
45
45
|
var onChange = _a.onChange, value = _a.value, fetchMoreText = _a.fetchMoreText, autoscrollText = _a.autoscrollText, externalLinkIcon = _a.externalLinkIcon, selectedIcon = _a.selectedIcon;
|
|
46
46
|
var _b = __read(useState(""), 2), searchString = _b[0], setSearchString = _b[1];
|
|
47
47
|
var options = useMemo(function () {
|
|
48
|
-
return searchString
|
|
49
|
-
? optionsFuse.search(searchString).map(function (options) { return options.item; })
|
|
50
|
-
: allOptions;
|
|
48
|
+
return searchString ? optionsFuse.search(searchString).map(function (options) { return options.item; }) : allOptions;
|
|
51
49
|
}, [searchString]);
|
|
52
50
|
var handleClose = useCallback(function () { return setSearchString(""); }, []);
|
|
53
51
|
return (React.createElement(Dropdown, { onClose: handleClose, inputValue: searchString, showInternalSearch: true, onInputChange: setSearchString, onSelectOption: function (_a) {
|
|
@@ -72,9 +70,7 @@ var container = function (_a) {
|
|
|
72
70
|
export function IntlPhoneInput(_a) {
|
|
73
71
|
var rightIcon = _a.rightIcon, variant = _a.variant, inputsize = _a.inputsize, error = _a.error, hasLabel = _a.hasLabel, defaultCountryCode = _a.defaultCountryCode, fetchMoreText = _a.fetchMoreText, autoscrollText = _a.autoscrollText, selectedIcon = _a.selectedIcon, externalLinkIcon = _a.externalLinkIcon, rest = __rest(_a, ["rightIcon", "variant", "inputsize", "error", "hasLabel", "defaultCountryCode", "fetchMoreText", "autoscrollText", "selectedIcon", "externalLinkIcon"]);
|
|
74
72
|
var SelectComponentWithText = useCallback(function (props) { return (React.createElement(SelectComponent, __assign({}, props, { fetchMoreText: fetchMoreText, autoscrollText: autoscrollText, selectedIcon: selectedIcon, externalLinkIcon: externalLinkIcon }))); }, [fetchMoreText, autoscrollText, selectedIcon, externalLinkIcon]);
|
|
75
|
-
return (React.createElement(ReactPhoneInput, __assign({ placeholder: rest.placeholder, containerComponent: container, inputComponent: Input, defaultCountry: defaultCountryCode && isISO3166(defaultCountryCode)
|
|
76
|
-
? defaultCountryCode
|
|
77
|
-
: "GB", countrySelectComponent: SelectComponentWithText, international: false, numberInputProps: {
|
|
73
|
+
return (React.createElement(ReactPhoneInput, __assign({ placeholder: rest.placeholder, containerComponent: container, inputComponent: Input, defaultCountry: defaultCountryCode && isISO3166(defaultCountryCode) ? defaultCountryCode : "GB", countrySelectComponent: SelectComponentWithText, international: false, numberInputProps: {
|
|
78
74
|
variant: variant,
|
|
79
75
|
rightIcon: rightIcon,
|
|
80
76
|
inputsize: inputsize,
|
|
@@ -13,7 +13,7 @@ var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplat
|
|
|
13
13
|
return (addMargin ? "2px 4px 2px 0" : "0");
|
|
14
14
|
}, function (props) { return props.backgroundColor; }, function (props) { return props.borderColor; }, function (_a) {
|
|
15
15
|
var theme = _a.theme, textColor = _a.textColor;
|
|
16
|
-
return textColor ? textColor : theme.colors.grey40;
|
|
16
|
+
return (textColor ? textColor : theme.colors.grey40);
|
|
17
17
|
}, function (_a) {
|
|
18
18
|
var maxWidth = _a.maxWidth;
|
|
19
19
|
return maxWidth;
|
|
@@ -23,10 +23,10 @@ var RoundedContainer = styled.div(templateObject_2 || (templateObject_2 = __make
|
|
|
23
23
|
return (addMargin ? "2px 4px 2px 0" : "0");
|
|
24
24
|
}, function (_a) {
|
|
25
25
|
var theme = _a.theme, textColor = _a.textColor;
|
|
26
|
-
return textColor ? textColor : theme.colors.grey40;
|
|
26
|
+
return (textColor ? textColor : theme.colors.grey40);
|
|
27
27
|
}, function (props) { return (props.size === "large" ? "28px" : "16px"); }, function (_a) {
|
|
28
28
|
var backgroundColor = _a.backgroundColor, borderColor = _a.borderColor;
|
|
29
|
-
return borderColor ? borderColor : backgroundColor;
|
|
29
|
+
return (borderColor ? borderColor : backgroundColor);
|
|
30
30
|
}, function (_a) {
|
|
31
31
|
var backgroundColor = _a.backgroundColor;
|
|
32
32
|
return backgroundColor;
|
|
@@ -54,7 +54,7 @@ var Text = styled(TSpan).attrs({ type: "p8" })(templateObject_5 || (templateObje
|
|
|
54
54
|
return (color ? color : theme.colors.grey100);
|
|
55
55
|
}, function (_a) {
|
|
56
56
|
var capitalize = _a.capitalize;
|
|
57
|
-
return capitalize ? "capitalize" : "initial";
|
|
57
|
+
return (capitalize ? "capitalize" : "initial");
|
|
58
58
|
}, function (_a) {
|
|
59
59
|
var size = _a.size;
|
|
60
60
|
return size === "large" && "12px";
|
|
@@ -80,7 +80,7 @@ export var Tag = function (_a) {
|
|
|
80
80
|
icon && (React.createElement(IconWrapper, null,
|
|
81
81
|
React.createElement(Icon, { icon: icon, size: size === "large" ? 12 : undefined }))),
|
|
82
82
|
React.createElement(Text, { size: size, capitalize: capitalize, color: color.textColor, ref: ref }, label),
|
|
83
|
-
withClose &&
|
|
83
|
+
withClose && React.createElement(CloseButton, { minimal: true, icon: closeIcon, onClick: onCloseClick }))); }, [
|
|
84
84
|
addMargin,
|
|
85
85
|
capitalize,
|
|
86
86
|
className,
|
|
@@ -93,8 +93,9 @@ export var Tag = function (_a) {
|
|
|
93
93
|
onCloseClick,
|
|
94
94
|
size,
|
|
95
95
|
withClose,
|
|
96
|
+
closeIcon,
|
|
96
97
|
]);
|
|
97
|
-
return isOverflowActive ?
|
|
98
|
+
return isOverflowActive ? React.createElement(Tooltip, { content: label }, TagComponent) : TagComponent;
|
|
98
99
|
};
|
|
99
100
|
export var RoundedLabelTag = function (_a) {
|
|
100
101
|
var label = _a.label, withClose = _a.withClose, onCloseClick = _a.onCloseClick, closeIcon = _a.closeIcon, capitalize = _a.capitalize, className = _a.className, addMargin = _a.addMargin, icon = _a.icon, size = _a.size, backgroundColor = _a.backgroundColor, borderColor = _a.borderColor, textColor = _a.textColor;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __assign, __rest } from "tslib";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
|
-
import { Icon, isAnyIcon } from "../Icon";
|
|
4
|
+
import { Icon, isAnyIcon, isIconProps } from "../Icon";
|
|
5
5
|
import { TSpan } from "../Typography";
|
|
6
6
|
import { Popover } from "../Popover";
|
|
7
7
|
import { faCaretRight } from "@fortawesome/free-solid-svg-icons";
|
|
@@ -20,9 +20,9 @@ export var MenuItem = forwardRef(function MenuItem(_a, ref) {
|
|
|
20
20
|
var active = _a.active, children = _a.children, disabled = _a.disabled, icon = _a.icon, rightIcon = _a.rightIcon, label = _a.label, htmlTitle = _a.htmlTitle, iconColor = _a.iconColor, anchorProps = __rest(_a, ["active", "children", "disabled", "icon", "rightIcon", "label", "htmlTitle", "iconColor"]);
|
|
21
21
|
var colors = useTheme().colors;
|
|
22
22
|
var target = (React.createElement(S.MenuItem, __assign({}, dpNameProp("MenuItem"), { ref: ref, disabled: disabled }, anchorProps, { title: htmlTitle, role: "menuitem" }),
|
|
23
|
-
icon && (React.createElement(TSpan, { type: "p5", style: { color: iconColor || colors.grey20 } }, isAnyIcon(icon) ? React.createElement(Icon, { icon: icon }) : icon)),
|
|
23
|
+
icon && (React.createElement(TSpan, { type: "p5", style: { color: iconColor || colors.grey20 } }, isAnyIcon(icon) ? React.createElement(Icon, { icon: icon }) : isIconProps(icon) ? React.createElement(Icon, __assign({}, icon)) : icon)),
|
|
24
24
|
React.createElement(TSpan, { "$fill": true, overflow: "ellipsis", type: "p5" }, label),
|
|
25
|
-
rightIcon && (React.createElement(TSpan, { type: "p5" }, isAnyIcon(rightIcon) ? React.createElement(Icon, { icon: rightIcon }) : rightIcon)),
|
|
25
|
+
rightIcon && (React.createElement(TSpan, { type: "p5" }, isAnyIcon(rightIcon) ? (React.createElement(Icon, { icon: rightIcon })) : isIconProps(rightIcon) ? (React.createElement(Icon, __assign({}, rightIcon))) : (rightIcon))),
|
|
26
26
|
children && React.createElement(Icon, { icon: faCaretRight })));
|
|
27
27
|
if (!children) {
|
|
28
28
|
return React.createElement("li", { role: "none" }, target);
|
|
@@ -22,9 +22,7 @@ var ModalPositonContainer = styled.div(templateObject_1 || (templateObject_1 = _
|
|
|
22
22
|
});
|
|
23
23
|
var ModalOverlayContainer = styled(motion.div)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 100%;\n width: 100%;\n pointer-events: none;\n position: relative;\n"], ["\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 100%;\n width: 100%;\n pointer-events: none;\n position: relative;\n"])));
|
|
24
24
|
var ModalContainer = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background-color: ", ";\n border-radius: 8px;\n display: flex;\n flex-direction: column;\n padding-bottom: 10px;\n pointer-events: all;\n width: ", "; // Space for the close btn\n height: ", ";\n overflow: hidden;\n box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.15);\n z-index: 20;\n"], ["\n background-color: ", ";\n border-radius: 8px;\n display: flex;\n flex-direction: column;\n padding-bottom: 10px;\n pointer-events: all;\n width: ", "; // Space for the close btn\n height: ", ";\n overflow: hidden;\n box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.15);\n z-index: 20;\n"])), function (props) { return props.theme.colors.white; }, function (props) {
|
|
25
|
-
return props.width
|
|
26
|
-
? props.width
|
|
27
|
-
: "calc(100vw - 80px)";
|
|
25
|
+
return props.width ? props.width : "calc(100vw - 80px)";
|
|
28
26
|
}, function (props) { return (props.height ? props.height : "90vh"); });
|
|
29
27
|
var ModalCloseContainer = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n padding: 0 38px;\n position: relative;\n"], ["\n padding: 0 38px;\n position: relative;\n"])));
|
|
30
28
|
export var ModalClose = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n position: absolute;\n right: 0;\n background-color: ", ";\n box-shadow: 0px 5px 8px rgba(0, 0, 0, 0.05);\n padding: 10px;\n border-radius: 100%;\n width: 28px;\n height: 28px;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n z-index: 99999;\n\n button {\n color: ", ";\n }\n"], ["\n position: absolute;\n right: 0;\n background-color: ", ";\n box-shadow: 0px 5px 8px rgba(0, 0, 0, 0.05);\n padding: 10px;\n border-radius: 100%;\n width: 28px;\n height: 28px;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n z-index: 99999;\n\n button {\n color: ", ";\n }\n"])), function (_a) {
|
|
@@ -35,12 +33,8 @@ export var ModalClose = styled.div(templateObject_5 || (templateObject_5 = __mak
|
|
|
35
33
|
return theme.colors.brandShade100;
|
|
36
34
|
});
|
|
37
35
|
var ModalHeaderContainer = styled(Stack)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n height: 32px;\n padding: 0 12px;\n flex-shrink: 0;\n"], ["\n background-color: ", ";\n color: ", ";\n height: 32px;\n padding: 0 12px;\n flex-shrink: 0;\n"])), function (props) {
|
|
38
|
-
return props.backgroundColor
|
|
39
|
-
|
|
40
|
-
: props.theme.colors.grey5;
|
|
41
|
-
}, function (props) {
|
|
42
|
-
return props.color ? props.theme.colors[props.color] : props.theme.colors.grey100;
|
|
43
|
-
});
|
|
36
|
+
return props.backgroundColor ? props.theme.colors[props.backgroundColor] : props.theme.colors.grey5;
|
|
37
|
+
}, function (props) { return (props.color ? props.theme.colors[props.color] : props.theme.colors.grey100); });
|
|
44
38
|
export function Modal(_a) {
|
|
45
39
|
var isOpen = _a.isOpen, canClickOutsideClose = _a.canClickOutsideClose, canEscClose = _a.canEscClose, children = _a.children, hasBackdrop = _a.hasBackdrop, onRequestClose = _a.onRequestClose, closeIcon = _a.closeIcon, autofocus = _a.autofocus, height = _a.height, width = _a.width, hideClose = _a.hideClose, top = _a.top, bottom = _a.bottom, left = _a.left, right = _a.right;
|
|
46
40
|
return (React.createElement(Overlay, __assign({}, dpNameProp("Modal"), { hasBackdrop: hasBackdrop, isOpen: isOpen, onRequestClose: onRequestClose, canEscClose: canEscClose, canClickOutsideClose: canClickOutsideClose, autofocus: autofocus }),
|
|
@@ -18,6 +18,6 @@ export var OptionTag = function (_a) {
|
|
|
18
18
|
return (React.createElement(OptionTagContainer, __assign({}, dpNameProp("OptionTag"), rest),
|
|
19
19
|
icon && React.createElement(Icon, { icon: icon }),
|
|
20
20
|
React.createElement(P6, null, displayName),
|
|
21
|
-
withClose &&
|
|
21
|
+
withClose && React.createElement(IconButton, { minimal: true, icon: faTimes, onClick: onClose })));
|
|
22
22
|
};
|
|
23
23
|
var templateObject_1;
|
|
@@ -3,7 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import styled from "styled-components";
|
|
5
5
|
import { times } from "lodash";
|
|
6
|
-
import { faChevronLeft, faChevronRight
|
|
6
|
+
import { faChevronLeft, faChevronRight } from "@fortawesome/free-solid-svg-icons";
|
|
7
7
|
import { Stack, StackItem } from "../../layout/Stack";
|
|
8
8
|
import { Select } from "../Select";
|
|
9
9
|
import { IconButton } from "../Button";
|
|
@@ -48,17 +48,16 @@ export var Pagination = function (_a) {
|
|
|
48
48
|
var ofTotalString = ofTotalText.replace("{total}", displayTotal);
|
|
49
49
|
var uniqueItemsString = uniqueItemsText.replace("{unique}", String(uniqueItems));
|
|
50
50
|
return (React.createElement(Stack, __assign({}, dpNameProp("Pagination"), { align: "center" }),
|
|
51
|
-
displayItems.includes("perPageText") &&
|
|
51
|
+
displayItems.includes("perPageText") && React.createElement(P1Items, null, itemsPerPageText),
|
|
52
52
|
displayItems.includes("perPageSelect") && (React.createElement(PerPageItem, null,
|
|
53
53
|
React.createElement(Select, { options: perPageOptions, value: currentPerPageOption === null || currentPerPageOption === void 0 ? void 0 : currentPerPageOption.value, onChange: function (event) {
|
|
54
|
-
onPerPageChange &&
|
|
55
|
-
onPerPageChange(Number(event.target.value));
|
|
54
|
+
onPerPageChange && onPerPageChange(Number(event.target.value));
|
|
56
55
|
onPageChange(1);
|
|
57
56
|
} }))),
|
|
58
57
|
displayItems.includes("pageSelect") && (React.createElement(PageItem, null,
|
|
59
58
|
React.createElement(Select, { options: pageOptions, value: currentPageOption === null || currentPageOption === void 0 ? void 0 : currentPageOption.value, onChange: function (event) { return onPageChange(Number(event.target.value)); } }))),
|
|
60
59
|
displayItems.includes("total") && React.createElement(P1Total, null, ofTotalString),
|
|
61
|
-
displayItems.includes("uniqueItems") &&
|
|
60
|
+
displayItems.includes("uniqueItems") && React.createElement(P1Items, null, uniqueItemsString),
|
|
62
61
|
displayItems.includes("navArrows") && (React.createElement(React.Fragment, null,
|
|
63
62
|
React.createElement(ButtonLeftItem, null,
|
|
64
63
|
React.createElement(IconButton, { minimal: true, icon: faChevronLeft, onClick: function () { return onPageChange(currentPage - 1); }, disabled: currentPage === 1 })),
|
|
@@ -9,7 +9,7 @@ var StyledIcon = styled(Icon)(templateObject_1 || (templateObject_1 = __makeTemp
|
|
|
9
9
|
var theme = _a.theme;
|
|
10
10
|
return theme.colors.grey40;
|
|
11
11
|
});
|
|
12
|
-
var StyledSelect = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: ", ";\n display: ", ";\n position: relative;\n\n select {\n border-radius: 4px;\n border: 1px solid
|
|
12
|
+
var StyledSelect = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: ", ";\n display: ", ";\n position: relative;\n\n select {\n border-radius: 4px;\n border: 1px solid ", ";\n color: ", ";\n display: inline-flex;\n flex-direction: row;\n align-items: center;\n cursor: pointer;\n font-size: 12px;\n justify-content: center;\n text-align: left;\n vertical-align: middle;\n -moz-appearance: none;\n -webkit-appearance: none;\n height: 30px;\n line-height: 25px;\n padding: 0 25px 0 10px;\n width: ", ";\n\n > * {\n flex-grow: 0;\n flex-shrink: 0;\n }\n\n option {\n color: ", ";\n }\n\n &:hover {\n border-color: ", ";\n color: ", ";\n }\n\n &:focus {\n border-color: ", ";\n color: ", ";\n background-color: ", ";\n outline: none;\n }\n\n &:disabled {\n border-color: ", ";\n color: ", ";\n background-color: ", ";\n }\n\n ", ";\n }\n\n // Control the dropdown icon color\n :hover {\n ", " {\n visibility: visible;\n color: ", ";\n }\n }\n &:focus-within {\n ", " {\n color: ", ";\n }\n }\n"], ["\n width: ", ";\n display: ", ";\n position: relative;\n\n select {\n border-radius: 4px;\n border: 1px solid ", ";\n color: ", ";\n display: inline-flex;\n flex-direction: row;\n align-items: center;\n cursor: pointer;\n font-size: 12px;\n justify-content: center;\n text-align: left;\n vertical-align: middle;\n -moz-appearance: none;\n -webkit-appearance: none;\n height: 30px;\n line-height: 25px;\n padding: 0 25px 0 10px;\n width: ", ";\n\n > * {\n flex-grow: 0;\n flex-shrink: 0;\n }\n\n option {\n color: ", ";\n }\n\n &:hover {\n border-color: ", ";\n color: ", ";\n }\n\n &:focus {\n border-color: ", ";\n color: ", ";\n background-color: ", ";\n outline: none;\n }\n\n &:disabled {\n border-color: ", ";\n color: ", ";\n background-color: ", ";\n }\n\n ", ";\n }\n\n // Control the dropdown icon color\n :hover {\n ", " {\n visibility: visible;\n color: ", ";\n }\n }\n &:focus-within {\n ", " {\n color: ", ";\n }\n }\n"])), function (_a) {
|
|
13
13
|
var fillWidth = _a.fillWidth;
|
|
14
14
|
return (fillWidth ? "100%" : "fit-content");
|
|
15
15
|
}, function (_a) {
|
|
@@ -17,12 +17,10 @@ var StyledSelect = styled.div(templateObject_3 || (templateObject_3 = __makeTemp
|
|
|
17
17
|
return (fillWidth ? "block" : "inline-block");
|
|
18
18
|
}, function (_a) {
|
|
19
19
|
var theme = _a.theme, error = _a.error;
|
|
20
|
-
return error ? theme.colors.red100 : theme.colors.grey20;
|
|
20
|
+
return (error ? theme.colors.red100 : theme.colors.grey20);
|
|
21
21
|
}, function (_a) {
|
|
22
22
|
var theme = _a.theme, hasSelectedValue = _a.hasSelectedValue, hasPlaceholder = _a.hasPlaceholder;
|
|
23
|
-
return !hasPlaceholder || hasSelectedValue
|
|
24
|
-
? theme.colors.grey100
|
|
25
|
-
: theme.colors.grey80;
|
|
23
|
+
return !hasPlaceholder || hasSelectedValue ? theme.colors.grey100 : theme.colors.grey80;
|
|
26
24
|
}, function (_a) {
|
|
27
25
|
var fillWidth = _a.fillWidth;
|
|
28
26
|
return (fillWidth ? "100%" : "auto");
|
|
@@ -31,7 +29,7 @@ var StyledSelect = styled.div(templateObject_3 || (templateObject_3 = __makeTemp
|
|
|
31
29
|
return theme.colors.grey100;
|
|
32
30
|
}, function (_a) {
|
|
33
31
|
var theme = _a.theme, error = _a.error;
|
|
34
|
-
return error ? theme.colors.red100 : theme.colors.grey40;
|
|
32
|
+
return (error ? theme.colors.red100 : theme.colors.grey40);
|
|
35
33
|
}, function (_a) {
|
|
36
34
|
var theme = _a.theme;
|
|
37
35
|
return theme.colors.grey100;
|
|
@@ -55,11 +53,7 @@ var StyledSelect = styled.div(templateObject_3 || (templateObject_3 = __makeTemp
|
|
|
55
53
|
return theme.colors.grey5;
|
|
56
54
|
}, function (_a) {
|
|
57
55
|
var theme = _a.theme, inline = _a.inline, required = _a.required, error = _a.error;
|
|
58
|
-
return inline && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border: none;\n border-radius: 0;\n border-bottom: 1px solid\n ", ";\n\n &:hover {\n border-bottom-color: ", ";\n }\n\n &:focus {\n border-bottom-color: ", ";\n color: ", ";\n background-color: ", ";\n }\n &:disabled {\n background-color: ", ";\n }\n "], ["\n border: none;\n border-radius: 0;\n border-bottom: 1px solid\n ", ";\n\n &:hover {\n border-bottom-color: ", ";\n }\n\n &:focus {\n border-bottom-color: ", ";\n color: ", ";\n background-color: ", ";\n }\n &:disabled {\n background-color: ", ";\n }\n "])), error
|
|
59
|
-
? theme.colors.red100
|
|
60
|
-
: required
|
|
61
|
-
? theme.colors.red20
|
|
62
|
-
: "transparent", required
|
|
56
|
+
return inline && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border: none;\n border-radius: 0;\n border-bottom: 1px solid\n ", ";\n\n &:hover {\n border-bottom-color: ", ";\n }\n\n &:focus {\n border-bottom-color: ", ";\n color: ", ";\n background-color: ", ";\n }\n &:disabled {\n background-color: ", ";\n }\n "], ["\n border: none;\n border-radius: 0;\n border-bottom: 1px solid\n ", ";\n\n &:hover {\n border-bottom-color: ", ";\n }\n\n &:focus {\n border-bottom-color: ", ";\n color: ", ";\n background-color: ", ";\n }\n &:disabled {\n background-color: ", ";\n }\n "])), error ? theme.colors.red100 : required ? theme.colors.red20 : "transparent", required
|
|
63
57
|
? theme.colors.red20
|
|
64
58
|
: error
|
|
65
59
|
? theme.colors.red100
|
|
@@ -6,7 +6,7 @@ import { headingStyles } from "../Typography";
|
|
|
6
6
|
import { dpNameProp } from "../../utils";
|
|
7
7
|
export var TabWrapperCSS = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
|
|
8
8
|
var active = _a.active, isTicketHistory = _a.isTicketHistory;
|
|
9
|
-
return
|
|
9
|
+
return active && isTicketHistory ? headingStyles.h1 : headingStyles.h2;
|
|
10
10
|
});
|
|
11
11
|
var TabWrapper = styled(Stack)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-family: ", ";\n font-style: normal;\n font-weight: ", ";\n font-size: 11px;\n line-height: 110%;\n cursor: default;\n align-items: center;\n justify-content: center;\n pointer-events: ", ";\n color: ", ";\n border-bottom: ", ";\n padding: 0 3px 6px 3px;\n\n :hover {\n color: ", ";\n cursor: pointer;\n }\n\n ", ";\n\n ", ";\n"], ["\n font-family: ", ";\n font-style: normal;\n font-weight: ", ";\n font-size: 11px;\n line-height: 110%;\n cursor: default;\n align-items: center;\n justify-content: center;\n pointer-events: ", ";\n color: ", ";\n border-bottom: ", ";\n padding: 0 3px 6px 3px;\n\n :hover {\n color: ", ";\n cursor: pointer;\n }\n\n ", ";\n\n ", ";\n"])), function (_a) {
|
|
12
12
|
var theme = _a.theme;
|
|
@@ -27,7 +27,7 @@ var TabWrapper = styled(Stack)(templateObject_4 || (templateObject_4 = __makeTem
|
|
|
27
27
|
return props.active ? "solid 2px ".concat(props.theme.colors.brandPrimary) : "none";
|
|
28
28
|
}, function (props) { return props.theme.colors.grey100; }, function (_a) {
|
|
29
29
|
var active = _a.active, tabStyle = _a.tabStyle, theme = _a.theme;
|
|
30
|
-
return tabStyle === "button" && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-grow: 1;\n border: 1px solid ", ";\n border-bottom: solid 1px
|
|
30
|
+
return tabStyle === "button" && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-grow: 1;\n border: 1px solid ", ";\n border-bottom: solid 1px ", ";\n border-right-width: 0;\n\n :first-of-type {\n border-left-width: 0;\n }\n\n padding: 7px;\n\n ", ";\n "], ["\n flex-grow: 1;\n border: 1px solid ", ";\n border-bottom: solid 1px ", ";\n border-right-width: 0;\n\n :first-of-type {\n border-left-width: 0;\n }\n\n padding: 7px;\n\n ", ";\n "])), theme.colors.grey20, active ? theme.colors.brandPrimary : theme.colors.grey20, active && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n "], ["\n background-color: ", ";\n "])), theme.colors.brandShade20));
|
|
31
31
|
}, TabWrapperCSS);
|
|
32
32
|
var StyledTabBar = styled(Stack)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n border-bottom: ", ";\n width: 100%;\n padding: ", ";\n"], ["\n border-bottom: ", ";\n width: 100%;\n padding: ", ";\n"])), function (_a) {
|
|
33
33
|
var tabStyle = _a.tabStyle, theme = _a.theme;
|
|
@@ -7,9 +7,7 @@ import { P5, TSpan } from "../Typography";
|
|
|
7
7
|
import { getSVGURI } from "../../utils/getSVGURI";
|
|
8
8
|
import { dpNameProp } from "../../utils";
|
|
9
9
|
var SliderStyled = styled.span(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n cursor: ", ";\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: ", ";\n\n transition: 0.4s;\n border-radius: 34px;\n &::before {\n position: absolute;\n content: \"\";\n background-image: ", ";\n background-size: ", "px;\n height: ", "px;\n background-repeat: no-repeat;\n background-position: center;\n stroke: ", ";\n height: ", "px;\n width: ", "px;\n left: ", "px;\n bottom: ", "px;\n background-color: white;\n transition: 0.2s;\n border-radius: 50%;\n }\n"], ["\n position: absolute;\n cursor: ", ";\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: ", ";\n\n transition: 0.4s;\n border-radius: 34px;\n &::before {\n position: absolute;\n content: \"\";\n background-image: ", ";\n background-size: ", "px;\n height: ", "px;\n background-repeat: no-repeat;\n background-position: center;\n stroke: ", ";\n height: ", "px;\n width: ", "px;\n left: ", "px;\n bottom: ", "px;\n background-color: white;\n transition: 0.2s;\n border-radius: 50%;\n }\n"])), function (props) { return (props.isLocked ? "not-allowed" : "pointer"); }, function (props) {
|
|
10
|
-
return props.indeterminate
|
|
11
|
-
? props.theme.colors.yellow80
|
|
12
|
-
: props.theme.colors.grey20;
|
|
10
|
+
return props.indeterminate ? props.theme.colors.yellow80 : props.theme.colors.grey20;
|
|
13
11
|
}, function (props) {
|
|
14
12
|
return typeof props.isLocked === "boolean"
|
|
15
13
|
? props.isLocked
|
|
@@ -18,20 +16,10 @@ var SliderStyled = styled.span(templateObject_1 || (templateObject_1 = __makeTem
|
|
|
18
16
|
: "none";
|
|
19
17
|
}, function (props) { return (props.size === "small" ? 5 : 6); }, function (props) { return (props.size === "small" ? 6 : 8); }, function (props) { return props.theme.colors.white; }, function (props) { return (props.size === "small" ? 8 : 12); }, function (props) { return (props.size === "small" ? 8 : 12); }, function (props) { return (props.size === "small" ? 2 : 3); }, function (props) { return (props.size === "small" ? 2 : 3); });
|
|
20
18
|
var InputStyled = styled.input.attrs({ type: "checkbox" })(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n opacity: 0;\n width: 0;\n height: 0;\n display: block;\n"], ["\n opacity: 0;\n width: 0;\n height: 0;\n display: block;\n"])));
|
|
21
|
-
var ToggleContainer = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n position: relative;\n display: inline-block;\n width: ", "px;\n height: ", "px;\n\n input:checked + span {\n background-color: ", ";\n }\n input:focus + span {\n box-shadow: 0 0 1px
|
|
22
|
-
return props.indeterminate ? "" : props.
|
|
23
|
-
}, function (props) { return (props.indeterminate ? "" : props.theme.colors.turquoise100); }, function (props) {
|
|
24
|
-
return props.indeterminate
|
|
25
|
-
? ""
|
|
26
|
-
: props.size === "small"
|
|
27
|
-
? "translateX(6px)"
|
|
28
|
-
: "translateX(9px)";
|
|
19
|
+
var ToggleContainer = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n position: relative;\n display: inline-block;\n width: ", "px;\n height: ", "px;\n\n input:checked + span {\n background-color: ", ";\n }\n input:focus + span {\n box-shadow: 0 0 1px ", ";\n }\n input:checked + span:before {\n transform: ", ";\n }\n input + span:before {\n transform: ", ";\n }\n span:hover {\n ", "\n ", "\n }\n"], ["\n position: relative;\n display: inline-block;\n width: ", "px;\n height: ", "px;\n\n input:checked + span {\n background-color: ", ";\n }\n input:focus + span {\n box-shadow: 0 0 1px ", ";\n }\n input:checked + span:before {\n transform: ", ";\n }\n input + span:before {\n transform: ", ";\n }\n span:hover {\n ", "\n ", "\n }\n"])), function (props) { return (props.size === "small" ? 18 : 27); }, function (props) { return (props.size === "small" ? 12 : 18); }, function (props) { return (props.indeterminate ? "" : props.theme.colors.turquoise100); }, function (props) { return (props.indeterminate ? "" : props.theme.colors.turquoise100); }, function (props) {
|
|
20
|
+
return props.indeterminate ? "" : props.size === "small" ? "translateX(6px)" : "translateX(9px)";
|
|
29
21
|
}, function (props) {
|
|
30
|
-
return props.indeterminate
|
|
31
|
-
? props.size === "small"
|
|
32
|
-
? "translateX(3px)"
|
|
33
|
-
: "translateX(4px)"
|
|
34
|
-
: "";
|
|
22
|
+
return props.indeterminate ? (props.size === "small" ? "translateX(3px)" : "translateX(4px)") : "";
|
|
35
23
|
}, function (_a) {
|
|
36
24
|
var disabled = _a.disabled;
|
|
37
25
|
return disabled && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n cursor: not-allowed;\n "], ["\n cursor: not-allowed;\n "])));
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import { __assign, __makeTemplateObject, __rest } from "tslib";
|
|
1
|
+
import { __assign, __makeTemplateObject, __read, __rest, __spreadArray } from "tslib";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import styled, { css
|
|
3
|
+
import styled, { css } from "styled-components";
|
|
4
4
|
import Tippy from "@tippyjs/react";
|
|
5
5
|
import { Stack } from "../../layout";
|
|
6
6
|
import { faQuestionCircle } from "@fortawesome/free-solid-svg-icons";
|
|
7
7
|
import { Icon } from "../Icon";
|
|
8
8
|
import { dpNameProp } from "../../utils";
|
|
9
|
+
import "tippy.js/dist/border.css";
|
|
9
10
|
var getStyle = function (styleType, theme) {
|
|
10
11
|
var styles = {
|
|
11
12
|
light: {
|
|
12
13
|
backgroundColor: theme.colors.white,
|
|
13
14
|
color: theme.colors.grey100,
|
|
14
15
|
border: "none",
|
|
16
|
+
borderColor: "white",
|
|
15
17
|
boxShadow: "5px 5px 10px rgba(0, 0, 0, 0.1)",
|
|
16
18
|
},
|
|
17
19
|
lightBox: {
|
|
18
20
|
backgroundColor: theme.colors.white,
|
|
19
21
|
color: theme.colors.grey100,
|
|
20
22
|
border: "1px solid ".concat(theme.colors.grey20),
|
|
23
|
+
borderColor: theme.colors.grey20,
|
|
21
24
|
boxShadow: "5px 5px 10px rgba(0, 0, 0, 0.1);",
|
|
22
25
|
},
|
|
23
26
|
// this type is based of the same styling as the modal component
|
|
@@ -25,18 +28,21 @@ var getStyle = function (styleType, theme) {
|
|
|
25
28
|
backgroundColor: theme.colors.white,
|
|
26
29
|
color: theme.colors.grey100,
|
|
27
30
|
border: "1px solid ".concat(theme.colors.grey20),
|
|
31
|
+
borderColor: theme.colors.grey20,
|
|
28
32
|
boxShadow: "0px 4px 16px rgba(0, 0, 0, 0.3)",
|
|
29
33
|
},
|
|
30
34
|
dark: {
|
|
31
35
|
backgroundColor: theme.colors.grey40,
|
|
32
36
|
color: theme.colors.white,
|
|
33
37
|
border: "none",
|
|
38
|
+
borderColor: theme.colors.grey40,
|
|
34
39
|
boxShadow: "5px 5px 10px rgba(0, 0, 0, 0.1)",
|
|
35
40
|
},
|
|
36
41
|
extraDark: {
|
|
37
42
|
backgroundColor: theme.colors.grey100,
|
|
38
43
|
color: theme.colors.white,
|
|
39
44
|
border: "none",
|
|
45
|
+
borderColor: theme.colors.grey100,
|
|
40
46
|
boxShadow: "5px 5px 10px rgba(0, 0, 0, 0.1)",
|
|
41
47
|
},
|
|
42
48
|
};
|
|
@@ -44,11 +50,30 @@ var getStyle = function (styleType, theme) {
|
|
|
44
50
|
return styles[styleType] || styles.dark;
|
|
45
51
|
};
|
|
46
52
|
export var Tooltip = styled(function (_a) {
|
|
47
|
-
var suppressClassNameWarning = _a.suppressClassNameWarning, styleType = _a.styleType, _b = _a.arrow, arrow = _b === void 0 ? false : _b, width = _a.width, offsetTop = _a.offsetTop, styledCss = _a.styledCss, customComponent = _a.customComponent, arrowColor = _a.arrowColor, offsetLeft = _a.offsetLeft, borderRadius = _a.borderRadius, props = __rest(_a, ["suppressClassNameWarning", "styleType", "arrow", "width", "offsetTop", "styledCss", "customComponent", "arrowColor", "offsetLeft", "borderRadius"]);
|
|
48
|
-
|
|
53
|
+
var suppressClassNameWarning = _a.suppressClassNameWarning, styleType = _a.styleType, _b = _a.arrow, arrow = _b === void 0 ? false : _b, width = _a.width, offsetTop = _a.offsetTop, styledCss = _a.styledCss, customComponent = _a.customComponent, arrowColor = _a.arrowColor, offsetLeft = _a.offsetLeft, borderRadius = _a.borderRadius, onPresEsc = _a.onPresEsc, props = __rest(_a, ["suppressClassNameWarning", "styleType", "arrow", "width", "offsetTop", "styledCss", "customComponent", "arrowColor", "offsetLeft", "borderRadius", "onPresEsc"]);
|
|
54
|
+
var escPlugIn = {
|
|
55
|
+
name: "hideOnEsc",
|
|
56
|
+
defaultValue: true,
|
|
57
|
+
fn: function () {
|
|
58
|
+
function onKeyDown(event) {
|
|
59
|
+
if (event.keyCode === 27 && onPresEsc) {
|
|
60
|
+
onPresEsc();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
onShow: function () {
|
|
65
|
+
document.addEventListener("keydown", onKeyDown);
|
|
66
|
+
},
|
|
67
|
+
onHide: function () {
|
|
68
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
return React.createElement(Tippy, __assign({ arrow: arrow }, props, { plugins: __spreadArray([], __read((onPresEsc ? [escPlugIn] : [])), false) }));
|
|
49
74
|
}).attrs({
|
|
50
75
|
suppressClassNameWarning: true,
|
|
51
|
-
})(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n &.tippy-box {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n border: ", ";\n border-radius: ", "px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-family: ", ";\n font-style: normal;\n font-weight: normal;\n font-size: 11px;\n line-height: 150%;\n max-width: ", " !important;\n word-break: break-word;\n width: ", ";\n ", ";\n ", ";\n }\n ", "\n ", "\n ", "\n"], ["\n &.tippy-box {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n border: ", ";\n border-radius: ", "px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-family: ", ";\n font-style: normal;\n font-weight: normal;\n font-size: 11px;\n line-height: 150%;\n max-width: ", " !important;\n word-break: break-word;\n width: ", ";\n ", ";\n ", ";\n }\n ", "\n ", "\n ", "\n"])), function (_a) {
|
|
76
|
+
})(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n &.tippy-box {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n border: ", ";\n border-radius: ", "px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-family: ", ";\n font-style: normal;\n font-weight: normal;\n font-size: 11px;\n line-height: 150%;\n max-width: ", "px !important;\n word-break: break-word;\n width: ", ";\n ", ";\n ", ";\n }\n ", "\n ", "\n ", "\n"], ["\n &.tippy-box {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n border: ", ";\n border-radius: ", "px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-family: ", ";\n font-style: normal;\n font-weight: normal;\n font-size: 11px;\n line-height: 150%;\n max-width: ", "px !important;\n word-break: break-word;\n width: ", ";\n ", ";\n ", ";\n }\n ", "\n ", "\n ", "\n"])), function (_a) {
|
|
52
77
|
var theme = _a.theme, _b = _a.styleType, styleType = _b === void 0 ? "light" : _b;
|
|
53
78
|
return getStyle(styleType, theme).backgroundColor;
|
|
54
79
|
}, function (_a) {
|
|
@@ -82,8 +107,12 @@ export var Tooltip = styled(function (_a) {
|
|
|
82
107
|
var customComponent = _a.customComponent;
|
|
83
108
|
return customComponent && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .tippy-content {\n padding: 0;\n }\n "], ["\n .tippy-content {\n padding: 0;\n }\n "])));
|
|
84
109
|
}, function (_a) {
|
|
85
|
-
var arrowColor = _a.arrowColor, theme = _a.theme;
|
|
86
|
-
return
|
|
110
|
+
var arrowColor = _a.arrowColor, theme = _a.theme, _b = _a.styleType, styleType = _b === void 0 ? "light" : _b;
|
|
111
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n .tippy-arrow {\n color: ", ";\n border-top-color: ", " !important;\n &::before {\n color: ", ";\n }\n }\n "], ["\n .tippy-arrow {\n color: ", ";\n border-top-color: ", " !important;\n &::before {\n color: ", ";\n }\n }\n "])), getStyle(styleType, theme).borderColor, arrowColor
|
|
112
|
+
? theme.colors[arrowColor]
|
|
113
|
+
: getStyle(styleType, theme).backgroundColor, arrowColor
|
|
114
|
+
? theme.colors[arrowColor]
|
|
115
|
+
: getStyle(styleType, theme).backgroundColor);
|
|
87
116
|
});
|
|
88
117
|
export var TooltipCommonIcon = function (_a) {
|
|
89
118
|
var content = _a.content, _b = _a.styleType, styleType = _b === void 0 ? "light" : _b, _c = _a.placement, placement = _c === void 0 ? "top" : _c, _d = _a.iconSize, iconSize = _d === void 0 ? 10 : _d;
|
package/dist/esm/lib.js
CHANGED
package/dist/esm/style/index.js
CHANGED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
import { ThemeContext } from "styled-components";
|
|
4
|
+
export var ThemeProvider = function (props) { return (React.createElement(ThemeContext.Provider, { value: props.theme }, props.children)); };
|
|
5
|
+
export var useTheme = function () { return useContext(ThemeContext); };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { ThemeProvider } from "
|
|
3
|
-
import { lightTheme } from "../style/theme";
|
|
2
|
+
import { lightTheme, ThemeProvider } from "../style";
|
|
4
3
|
export var TestingThemeProvider = function (_a) {
|
|
5
4
|
var children = _a.children;
|
|
6
5
|
return React.createElement(ThemeProvider, { theme: lightTheme }, children);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|