@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
|
@@ -7,55 +7,65 @@ export var ButtonText = styled.span(templateObject_2 || (templateObject_2 = __ma
|
|
|
7
7
|
return props.overflow
|
|
8
8
|
? css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ", ";\n "], ["\n width: 100%;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ", ";\n "])), props.overflow) : undefined;
|
|
9
9
|
});
|
|
10
|
-
export var buttonBaseCss = css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative;\n transition: all 0.1s ease-in-out;\n display: inline-flex;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n padding: 4px 8px;\n vertical-align: middle;\n height: 24px;\n max-height: 24px;\n min-height: 24px;\n min-width: 24px;\n align-items: center;\n\n & > :not(:last-child) {\n margin-right: 7px;\n }\n\n :disabled {\n cursor: not-allowed;\n }\n\n > * {\n flex: 0;\n }\n\n ", " {\n ", ";\n flex: 0 0 auto;\n }\n\n ", " {\n flex: 0 1 auto;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n"], ["\n position: relative;\n transition: all 0.1s ease-in-out;\n display: inline-flex;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n padding: 4px 8px;\n vertical-align: middle;\n height: 24px;\n max-height: 24px;\n min-height: 24px;\n min-width: 24px;\n align-items: center;\n\n & > :not(:last-child) {\n margin-right: 7px;\n }\n\n :disabled {\n cursor: not-allowed;\n }\n\n > * {\n flex: 0;\n }\n\n ", " {\n ", ";\n flex: 0 0 auto;\n }\n\n ", " {\n flex: 0 1 auto;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n"])),
|
|
10
|
+
export var buttonBaseCss = css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative;\n transition: all 0.1s ease-in-out;\n display: inline-flex;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n padding: 4px 8px;\n vertical-align: middle;\n height: 24px;\n max-height: 24px;\n min-height: 24px;\n min-width: 24px;\n align-items: center;\n\n & > :not(:last-child) {\n margin-right: 7px;\n }\n\n :disabled {\n cursor: not-allowed;\n }\n\n :focus {\n outline-visible: 2px solid ", ";\n outline-offset: 1px;\n }\n\n > * {\n flex: 0;\n }\n\n ", " {\n ", ";\n flex: 0 0 auto;\n }\n\n ", " {\n flex: 0 1 auto;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n"], ["\n position: relative;\n transition: all 0.1s ease-in-out;\n display: inline-flex;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n padding: 4px 8px;\n vertical-align: middle;\n height: 24px;\n max-height: 24px;\n min-height: 24px;\n min-width: 24px;\n align-items: center;\n\n & > :not(:last-child) {\n margin-right: 7px;\n }\n\n :disabled {\n cursor: not-allowed;\n }\n\n :focus {\n outline-visible: 2px solid ", ";\n outline-offset: 1px;\n }\n\n > * {\n flex: 0;\n }\n\n ", " {\n ", ";\n flex: 0 0 auto;\n }\n\n ", " {\n flex: 0 1 auto;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n"])), function (_a) {
|
|
11
|
+
var theme = _a.theme;
|
|
12
|
+
return theme.colors.cyan80;
|
|
13
|
+
}, Icon, paragraphStyled.p6, ButtonText);
|
|
11
14
|
export var buttonLarge = css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n min-height: 28px;\n min-width: 28px;\n padding: 6px 10px;\n ", " {\n ", ";\n }\n\n ", " {\n ", "\n }\n"], ["\n min-height: 28px;\n min-width: 28px;\n padding: 6px 10px;\n ", " {\n ", ";\n }\n\n ", " {\n ", "\n }\n"])), ButtonText, paragraphStyled.p2, Icon, paragraphStyled.p2);
|
|
12
15
|
export var buttonSmall = css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n height: 18px;\n min-height: 18px;\n min-width: 18px;\n padding: 3px 8px;\n ", " {\n ", ";\n }\n\n ", " {\n ", "\n }\n"], ["\n height: 18px;\n min-height: 18px;\n min-width: 18px;\n padding: 3px 8px;\n ", " {\n ", ";\n }\n\n ", " {\n ", "\n }\n"])), ButtonText, paragraphStyled.p11, Icon, paragraphStyled.p11);
|
|
13
16
|
export var buttonTiny = css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n height: 16px;\n min-height: 16px;\n max-height: 16px;\n min-width: 28px;\n justify-content: center;\n padding: 1px 2px;\n ", " {\n ", ";\n }\n\n ", " {\n ", ";\n }\n"], ["\n height: 16px;\n min-height: 16px;\n max-height: 16px;\n min-width: 28px;\n justify-content: center;\n padding: 1px 2px;\n ", " {\n ", ";\n }\n\n ", " {\n ", ";\n }\n"])), ButtonText, paragraphStyled.p11, Icon, paragraphStyled.p11);
|
|
14
17
|
export var iconButtonBase = css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n border-radius: 50%;\n justify-content: center;\n ", " {\n ", "\n }\n"], ["\n border-radius: 50%;\n justify-content: center;\n ", " {\n ", "\n }\n"])), Icon, paragraphStyled.p1);
|
|
15
18
|
export var iconButtonSmall = css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n border-radius: 4px;\n padding: 3px;\n height: 20px;\n min-height: 20px;\n max-height: 20px;\n width: 20px;\n ", " {\n ", ";\n }\n\n ", " {\n ", "\n }\n\n &:hover,\n &:active,\n &:focus {\n ", " {\n color: inherit;\n }\n }\n"], ["\n border-radius: 4px;\n padding: 3px;\n height: 20px;\n min-height: 20px;\n max-height: 20px;\n width: 20px;\n ", " {\n ", ";\n }\n\n ", " {\n ", "\n }\n\n &:hover,\n &:active,\n &:focus {\n ", " {\n color: inherit;\n }\n }\n"])), ButtonText, paragraphStyled.p11, Icon, paragraphStyled.p8, Icon);
|
|
16
|
-
export var iconMinimalActive = css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n color: ", ";\n box-shadow: none;\n background-color: transparent;\n border-color: transparent;\n"], ["\n color: ", ";\n box-shadow: none;\n background-color: transparent;\n border-color: transparent;\n"])), function (props) { return props.theme.colors.brandShade100; });
|
|
19
|
+
export var iconMinimalActive = css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n color: ", ";\n box-shadow: none;\n background-color: transparent;\n border-color: transparent;\n outline-visible: none;\n"], ["\n color: ", ";\n box-shadow: none;\n background-color: transparent;\n border-color: transparent;\n outline-visible: none;\n"])), function (props) { return props.theme.colors.brandShade100; });
|
|
17
20
|
export var iconButtonMinimal = css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n padding: 0;\n height: 16px;\n min-height: 16px;\n max-height: 16px;\n width: 16px;\n color: ", ";\n background-color: transparent;\n border-color: transparent;\n box-shadow: none;\n\n :hover {\n color: ", ";\n box-shadow: none;\n background-color: transparent;\n border-color: transparent;\n }\n\n :active,\n :focus {\n ", ";\n }\n\n :disabled {\n box-shadow: none;\n background-color: transparent;\n border-color: transparent;\n color: ", ";\n }\n\n ", " {\n ", "\n }\n"], ["\n padding: 0;\n height: 16px;\n min-height: 16px;\n max-height: 16px;\n width: 16px;\n color: ", ";\n background-color: transparent;\n border-color: transparent;\n box-shadow: none;\n\n :hover {\n color: ", ";\n box-shadow: none;\n background-color: transparent;\n border-color: transparent;\n }\n\n :active,\n :focus {\n ", ";\n }\n\n :disabled {\n box-shadow: none;\n background-color: transparent;\n border-color: transparent;\n color: ", ";\n }\n\n ", " {\n ", "\n }\n"])), function (props) { return props.theme.colors.grey40; }, function (props) { return props.theme.colors.brandShade80; }, iconMinimalActive, function (props) { return props.theme.colors.grey20; }, Icon, headingStyles.h0);
|
|
21
|
+
// ------- BASEs ---------
|
|
22
|
+
// Primary ---------
|
|
18
23
|
export var primaryActive = css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n background-color: ", ";\n border: 1px solid ", ";\n box-shadow: 0px 0px 0px ", ";\n"], ["\n background-color: ", ";\n border: 1px solid ", ";\n box-shadow: 0px 0px 0px ", ";\n"])), function (props) { return props.theme.colors.cyan100; }, function (props) { return props.theme.colors.cyan100; }, function (props) { return props.theme.colors.brandShade40; });
|
|
19
24
|
export var buttonPrimaryBase = css(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n background-color: ", ";\n box-shadow: 0px 2px 2px ", ";\n color: ", ";\n border: 1px solid ", ";\n\n :hover {\n background-color: ", ";\n border: 1px solid ", ";\n }\n\n :focus,\n :active {\n ", "\n }\n\n :disabled {\n border: 1px solid ", ";\n box-shadow: 0px 0px 0px ", ";\n background-color: ", ";\n }\n"], ["\n background-color: ", ";\n box-shadow: 0px 2px 2px ", ";\n color: ", ";\n border: 1px solid ", ";\n\n :hover {\n background-color: ", ";\n border: 1px solid ", ";\n }\n\n :focus,\n :active {\n ", "\n }\n\n :disabled {\n border: 1px solid ", ";\n box-shadow: 0px 0px 0px ", ";\n background-color: ", ";\n }\n"])), function (props) { return props.theme.colors.brandShade100; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.white; }, function (props) { return props.theme.colors.brandShade100; }, function (props) { return props.theme.colors.cyan100; }, function (props) { return props.theme.colors.cyan100; }, primaryActive, function (props) { return props.theme.colors.grey20; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.grey20; });
|
|
25
|
+
// Secondary ---------
|
|
20
26
|
export var secondaryActive = css(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n border-color: ", ";\n background-color: ", ";\n box-shadow: 0px 0px 0px ", ";\n"], ["\n border-color: ", ";\n background-color: ", ";\n box-shadow: 0px 0px 0px ", ";\n"])), function (props) { return props.theme.colors.brandShade100; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.brandShade40; });
|
|
21
27
|
export var buttonSecondaryBase = css(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n background-color: ", ";\n border: 1px solid ", ";\n box-shadow: 0px 2px 2px ", ";\n color: ", ";\n\n :hover {\n background-color: ", ";\n border-color: ", ";\n }\n\n :focus,\n :active {\n ", "\n }\n\n :disabled {\n color: ", ";\n box-shadow: 0px 0px 0px ", ";\n border-color: ", ";\n background-color: ", ";\n }\n"], ["\n background-color: ", ";\n border: 1px solid ", ";\n box-shadow: 0px 2px 2px ", ";\n color: ", ";\n\n :hover {\n background-color: ", ";\n border-color: ", ";\n }\n\n :focus,\n :active {\n ", "\n }\n\n :disabled {\n color: ", ";\n box-shadow: 0px 0px 0px ", ";\n border-color: ", ";\n background-color: ", ";\n }\n"])), function (props) { return props.theme.colors.white; }, function (props) { return props.theme.colors.grey20; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.brandShade100; }, function (props) { return props.theme.colors.brandShade20; }, function (props) { return props.theme.colors.brandShade100; }, secondaryActive, function (props) { return props.theme.colors.grey40; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.grey20; }, function (props) { return props.theme.colors.grey5; });
|
|
28
|
+
// Tertiary ---------
|
|
22
29
|
export var tertiaryActive = css(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n border-color: ", ";\n background-color: ", ";\n color: ", ";\n"], ["\n border-color: ", ";\n background-color: ", ";\n color: ", ";\n"])), function (props) { return props.theme.colors.brandShade100; }, function (props) { return props.theme.colors.systemShade30; }, function (props) { return props.theme.colors.brandShade100; });
|
|
23
30
|
export var buttonTertiaryBase = css(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n background-color: ", ";\n border: 1px solid ", ";\n color: ", ";\n\n :hover {\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n }\n\n :focus,\n :active {\n ", "\n }\n\n :disabled {\n color: ", ";\n border-color: ", ";\n background-color: ", ";\n }\n"], ["\n background-color: ", ";\n border: 1px solid ", ";\n color: ", ";\n\n :hover {\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n }\n\n :focus,\n :active {\n ", "\n }\n\n :disabled {\n color: ", ";\n border-color: ", ";\n background-color: ", ";\n }\n"])), function (props) { return props.theme.colors.systemShade10; }, function (props) { return props.theme.colors.systemShade40; }, function (props) { return props.theme.colors.systemShade80; }, function (props) { return props.theme.colors.brandShade20; }, function (props) { return props.theme.colors.brandShade80; }, function (props) { return props.theme.colors.systemShade80; }, tertiaryActive, function (props) { return props.theme.colors.systemShade40; }, function (props) { return props.theme.colors.systemShade30; }, function (props) { return props.theme.colors.systemShade10; });
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export var dangerSecondaryTeritaryActive = css(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n color: ", ";\n background-color: ", ";\n border: 1px solid ", ";\n box-shadow: 0px 0px 0px ", ";\n"], ["\n color: ", ";\n background-color: ", ";\n border: 1px solid ", ";\n box-shadow: 0px 0px 0px ", ";\n"])), function (props) { return props.theme.colors.red100; }, function (props) { return props.theme.colors.red40; }, function (props) { return props.theme.colors.red100; }, function (props) { return props.theme.colors.brandShade40; });
|
|
27
|
-
export var dangerSecondaryTertiary = css(templateObject_20 || (templateObject_20 = __makeTemplateObject(["\n :focus {\n outline: none;\n background-color: ", ";\n box-shadow: 0px 2px 2px ", ";\n border: 1px solid ", ";\n }\n\n :active {\n ", "\n }\n\n :hover {\n color: ", ";\n background-color: ", ";\n border: 1px solid ", ";\n }\n"], ["\n :focus {\n outline: none;\n background-color: ", ";\n box-shadow: 0px 2px 2px ", ";\n border: 1px solid ", ";\n }\n\n :active {\n ", "\n }\n\n :hover {\n color: ", ";\n background-color: ", ";\n border: 1px solid ", ";\n }\n"])), function (props) { return props.theme.colors.white; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.grey20; }, dangerSecondaryTeritaryActive, function (props) { return props.theme.colors.red100; }, function (props) { return props.theme.colors.red20; }, function (props) { return props.theme.colors.red100; });
|
|
28
|
-
var primaryDisabled = css(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n border: 1px solid ", ";\n box-shadow: 0px 0px 0px ", ";\n background-color: ", ";\n cursor: not-allowed;\n"], ["\n border: 1px solid ", ";\n box-shadow: 0px 0px 0px ", ";\n background-color: ", ";\n cursor: not-allowed;\n"])), function (props) { return props.theme.colors.grey20; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.grey20; });
|
|
29
|
-
var secondaryDisabled = css(templateObject_22 || (templateObject_22 = __makeTemplateObject(["\n color: ", ";\n box-shadow: 0px 0px 0px ", ";\n border-color: ", ";\n background-color: ", ";\n cursor: not-allowed;\n"], ["\n color: ", ";\n box-shadow: 0px 0px 0px ", ";\n border-color: ", ";\n background-color: ", ";\n cursor: not-allowed;\n"])), function (props) { return props.theme.colors.grey40; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.grey20; }, function (props) { return props.theme.colors.grey5; });
|
|
30
|
-
var tertiaryDisabled = css(templateObject_23 || (templateObject_23 = __makeTemplateObject(["\n color: ", ";\n box-shadow: 0px 0px 0px ", ";\n border-color: ", ";\n background-color: ", ";\n cursor: not-allowed;\n"], ["\n color: ", ";\n box-shadow: 0px 0px 0px ", ";\n border-color: ", ";\n background-color: ", ";\n cursor: not-allowed;\n"])), function (props) { return props.theme.colors.grey40; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.grey20; }, function (props) { return props.theme.colors.grey5; });
|
|
31
|
-
var buttonMinimalDisabled = css(templateObject_24 || (templateObject_24 = __makeTemplateObject(["\n background: none;\n color: ", ";\n border: none;\n border-bottom: 1px solid ", ";\n :active,\n :hover,\n :focus {\n background: none;\n color: ", ";\n border: none;\n border-bottom: 1px solid ", ";\n cursor: not-allowed;\n }\n"], ["\n background: none;\n color: ", ";\n border: none;\n border-bottom: 1px solid ", ";\n :active,\n :hover,\n :focus {\n background: none;\n color: ", ";\n border: none;\n border-bottom: 1px solid ", ";\n cursor: not-allowed;\n }\n"])), function (_a) {
|
|
32
|
-
var theme = _a.theme;
|
|
33
|
-
return theme.colors.grey20;
|
|
34
|
-
}, function (_a) {
|
|
31
|
+
// Minimal ---------
|
|
32
|
+
var buttonMinimalDisabled = css(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n background: none;\n color: ", ";\n border: none;\n :active,\n :hover,\n :focus {\n background: none;\n color: ", ";\n border: none;\n cursor: not-allowed;\n }\n"], ["\n background: none;\n color: ", ";\n border: none;\n :active,\n :hover,\n :focus {\n background: none;\n color: ", ";\n border: none;\n cursor: not-allowed;\n }\n"])), function (_a) {
|
|
35
33
|
var theme = _a.theme;
|
|
36
34
|
return theme.colors.grey20;
|
|
37
35
|
}, function (_a) {
|
|
38
36
|
var theme = _a.theme;
|
|
39
37
|
return theme.colors.grey20;
|
|
40
|
-
}
|
|
38
|
+
});
|
|
39
|
+
export var buttonMinimalActive = css(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n background: none;\n color: ", ";\n border: none;\n outline-visible: none;\n"], ["\n background: none;\n color: ", ";\n border: none;\n outline-visible: none;\n"])), function (_a) {
|
|
41
40
|
var theme = _a.theme;
|
|
42
|
-
return theme.colors.
|
|
41
|
+
return theme.colors.brandPrimary;
|
|
43
42
|
});
|
|
44
|
-
export var buttonMinimal = css(
|
|
43
|
+
export var buttonMinimal = css(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n background: none;\n border: none;\n box-shadow: none;\n border-radius: 0;\n color: ", ";\n padding-left: 2px;\n padding-right: 2px;\n ", "\n\n :active, :hover, :focus {\n ", "\n }\n\n :disabled {\n ", "\n }\n"], ["\n background: none;\n border: none;\n box-shadow: none;\n border-radius: 0;\n color: ", ";\n padding-left: 2px;\n padding-right: 2px;\n ", "\n\n :active, :hover, :focus {\n ", "\n }\n\n :disabled {\n ", "\n }\n"])), function (_a) {
|
|
45
44
|
var theme = _a.theme;
|
|
46
45
|
return theme.colors.grey40;
|
|
47
|
-
},
|
|
46
|
+
}, headingStyles.h5, buttonMinimalActive, buttonMinimalDisabled);
|
|
47
|
+
// MinimalUnderline
|
|
48
|
+
export var buttonMinimalUnderline = css(templateObject_20 || (templateObject_20 = __makeTemplateObject(["\n ", "\n\n border-bottom: 1px solid ", ";\n\n :disabled {\n border-bottom: 1px solid ", ";\n }\n\n :hover,\n :active,\n :focus {\n border-bottom: 1px solid ", ";\n }\n"], ["\n ", "\n\n border-bottom: 1px solid ", ";\n\n :disabled {\n border-bottom: 1px solid ", ";\n }\n\n :hover,\n :active,\n :focus {\n border-bottom: 1px solid ", ";\n }\n"])), buttonMinimal, function (_a) {
|
|
48
49
|
var theme = _a.theme;
|
|
49
50
|
return theme.colors.grey40;
|
|
50
|
-
},
|
|
51
|
+
}, function (_a) {
|
|
51
52
|
var theme = _a.theme;
|
|
52
|
-
return theme.colors.
|
|
53
|
+
return theme.colors.grey20;
|
|
53
54
|
}, function (_a) {
|
|
54
55
|
var theme = _a.theme;
|
|
55
56
|
return theme.colors.brandPrimary;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
});
|
|
58
|
+
// minimalBLock
|
|
59
|
+
var minimalBlockActive = css(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n color: ", ";\n background-color: ", ";\n border: none;\n box-shadow: none;\n &:hover {\n color: ", ";\n background-color: ", ";\n border: none;\n box-shadow: none;\n }\n"], ["\n color: ", ";\n background-color: ", ";\n border: none;\n box-shadow: none;\n &:hover {\n color: ", ";\n background-color: ", ";\n border: none;\n box-shadow: none;\n }\n"])), function (props) { return props.theme.colors.white; }, function (props) { return props.theme.colors.cyan100; }, function (props) { return props.theme.colors.white; }, function (props) { return props.theme.colors.cyan80; });
|
|
60
|
+
export var minimalBLock = css(templateObject_22 || (templateObject_22 = __makeTemplateObject(["\n padding: 0;\n height: 22px;\n min-height: 22px;\n max-height: 22px;\n min-width: 22px;\n max-width: 22px;\n width: 22px;\n color: ", ";\n background-color: transparent;\n border: none;\n box-shadow: none;\n border-radius: 4px;\n :hover {\n color: ", ";\n background-color: ", ";\n border: none;\n box-shadow: none;\n }\n :active {\n &:hover {\n color: ", ";\n background-color: ", ";\n border: none;\n box-shadow: none;\n }\n }\n :active,\n :focus {\n ", "\n }\n :disabled {\n background-color: ", ";\n color: ", ";\n border: none;\n box-shadow: none;\n }\n ", " {\n ", "\n }\n"], ["\n padding: 0;\n height: 22px;\n min-height: 22px;\n max-height: 22px;\n min-width: 22px;\n max-width: 22px;\n width: 22px;\n color: ", ";\n background-color: transparent;\n border: none;\n box-shadow: none;\n border-radius: 4px;\n :hover {\n color: ", ";\n background-color: ", ";\n border: none;\n box-shadow: none;\n }\n :active {\n &:hover {\n color: ", ";\n background-color: ", ";\n border: none;\n box-shadow: none;\n }\n }\n :active,\n :focus {\n ", "\n }\n :disabled {\n background-color: ", ";\n color: ", ";\n border: none;\n box-shadow: none;\n }\n ", " {\n ", "\n }\n"])), function (props) { return props.theme.colors.grey80; }, function (props) { return props.theme.colors.brandShade100; }, function (props) { return props.theme.colors.brandShade20; }, function (props) { return props.theme.colors.white; }, function (props) { return props.theme.colors.cyan80; }, minimalBlockActive, function (props) { return props.theme.colors.grey5; }, function (props) { return props.theme.colors.grey80; }, Icon, headingStyles.h0);
|
|
61
|
+
export var dangerPrimaryActive = css(templateObject_23 || (templateObject_23 = __makeTemplateObject(["\n outline-visible: none;\n background-color: ", ";\n border: 1px solid ", ";\n box-shadow: 0px 0px 0px ", ";\n"], ["\n outline-visible: none;\n background-color: ", ";\n border: 1px solid ", ";\n box-shadow: 0px 0px 0px ", ";\n"])), function (props) { return props.theme.colors.red100; }, function (props) { return props.theme.colors.red100; }, function (props) { return props.theme.colors.brandShade40; });
|
|
62
|
+
export var dangerPrimary = css(templateObject_24 || (templateObject_24 = __makeTemplateObject(["\n :hover {\n background-color: ", ";\n border: 1px solid ", ";\n }\n\n :focus,\n :active {\n ", "\n }\n"], ["\n :hover {\n background-color: ", ";\n border: 1px solid ", ";\n }\n\n :focus,\n :active {\n ", "\n }\n"])), function (props) { return props.theme.colors.red100; }, function (props) { return props.theme.colors.red100; }, dangerPrimaryActive);
|
|
63
|
+
export var dangerSecondaryTeritaryActive = css(templateObject_25 || (templateObject_25 = __makeTemplateObject(["\n color: ", ";\n background-color: ", ";\n border: 1px solid ", ";\n box-shadow: 0px 0px 0px ", ";\n"], ["\n color: ", ";\n background-color: ", ";\n border: 1px solid ", ";\n box-shadow: 0px 0px 0px ", ";\n"])), function (props) { return props.theme.colors.red100; }, function (props) { return props.theme.colors.red40; }, function (props) { return props.theme.colors.red100; }, function (props) { return props.theme.colors.brandShade40; });
|
|
64
|
+
export var dangerSecondaryTertiary = css(templateObject_26 || (templateObject_26 = __makeTemplateObject(["\n :focus {\n outline: none;\n background-color: ", ";\n box-shadow: 0px 2px 2px ", ";\n border: 1px solid ", ";\n }\n\n :active {\n ", "\n }\n\n :hover {\n color: ", ";\n background-color: ", ";\n border: 1px solid ", ";\n }\n"], ["\n :focus {\n outline: none;\n background-color: ", ";\n box-shadow: 0px 2px 2px ", ";\n border: 1px solid ", ";\n }\n\n :active {\n ", "\n }\n\n :hover {\n color: ", ";\n background-color: ", ";\n border: 1px solid ", ";\n }\n"])), function (props) { return props.theme.colors.white; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.grey20; }, dangerSecondaryTeritaryActive, function (props) { return props.theme.colors.red100; }, function (props) { return props.theme.colors.red20; }, function (props) { return props.theme.colors.red100; });
|
|
65
|
+
var primaryDisabled = css(templateObject_27 || (templateObject_27 = __makeTemplateObject(["\n border: 1px solid ", ";\n box-shadow: 0px 0px 0px ", ";\n background-color: ", ";\n cursor: not-allowed;\n"], ["\n border: 1px solid ", ";\n box-shadow: 0px 0px 0px ", ";\n background-color: ", ";\n cursor: not-allowed;\n"])), function (props) { return props.theme.colors.grey20; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.grey20; });
|
|
66
|
+
var secondaryDisabled = css(templateObject_28 || (templateObject_28 = __makeTemplateObject(["\n color: ", ";\n box-shadow: 0px 0px 0px ", ";\n border-color: ", ";\n background-color: ", ";\n cursor: not-allowed;\n"], ["\n color: ", ";\n box-shadow: 0px 0px 0px ", ";\n border-color: ", ";\n background-color: ", ";\n cursor: not-allowed;\n"])), function (props) { return props.theme.colors.grey40; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.grey20; }, function (props) { return props.theme.colors.grey5; });
|
|
67
|
+
var tertiaryDisabled = css(templateObject_29 || (templateObject_29 = __makeTemplateObject(["\n color: ", ";\n box-shadow: 0px 0px 0px ", ";\n border-color: ", ";\n background-color: ", ";\n cursor: not-allowed;\n"], ["\n color: ", ";\n box-shadow: 0px 0px 0px ", ";\n border-color: ", ";\n background-color: ", ";\n cursor: not-allowed;\n"])), function (props) { return props.theme.colors.grey40; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.grey20; }, function (props) { return props.theme.colors.grey5; });
|
|
68
|
+
export var buttonFill = css(templateObject_30 || (templateObject_30 = __makeTemplateObject(["\n width: 100%;\n & > * {\n flex: 1;\n }\n\n ", " {\n width: 100%;\n }\n"], ["\n width: 100%;\n & > * {\n flex: 1;\n }\n\n ", " {\n width: 100%;\n }\n"])), ButtonText);
|
|
59
69
|
export function getIntentBase(props) {
|
|
60
70
|
switch (props.intent) {
|
|
61
71
|
case undefined:
|
|
@@ -65,6 +75,12 @@ export function getIntentBase(props) {
|
|
|
65
75
|
return buttonSecondaryBase;
|
|
66
76
|
case "tertiary":
|
|
67
77
|
return buttonTertiaryBase;
|
|
78
|
+
case "minimal":
|
|
79
|
+
return buttonMinimal;
|
|
80
|
+
case "minimalUnderline":
|
|
81
|
+
return buttonMinimalUnderline;
|
|
82
|
+
case "minimalBlock":
|
|
83
|
+
return minimalBLock;
|
|
68
84
|
}
|
|
69
85
|
}
|
|
70
86
|
export function getDangerIntent(props) {
|
|
@@ -96,6 +112,10 @@ export function getActiveIntent(props) {
|
|
|
96
112
|
return secondaryActive;
|
|
97
113
|
case "tertiary":
|
|
98
114
|
return tertiaryActive;
|
|
115
|
+
case "minimal":
|
|
116
|
+
return buttonMinimalActive;
|
|
117
|
+
case "minimalBlock":
|
|
118
|
+
return minimalBlockActive;
|
|
99
119
|
}
|
|
100
120
|
}
|
|
101
121
|
export var getDisabledIntent = function (props) {
|
|
@@ -110,22 +130,25 @@ export var getDisabledIntent = function (props) {
|
|
|
110
130
|
return secondaryDisabled;
|
|
111
131
|
case "tertiary":
|
|
112
132
|
return tertiaryDisabled;
|
|
133
|
+
case "minimal":
|
|
134
|
+
case "minimalUnderline":
|
|
135
|
+
return buttonMinimalDisabled;
|
|
113
136
|
}
|
|
114
137
|
};
|
|
115
|
-
export var ButtonLoaderContainer = styled.div.attrs(dpNameProp("ButtonLoader"))(
|
|
116
|
-
export var buttonLoading = css(
|
|
117
|
-
export var navButtonBase = css(
|
|
118
|
-
export var navButtonSmall = css(
|
|
119
|
-
export var TestOverlayButtonWrapper = styled.div(
|
|
138
|
+
export var ButtonLoaderContainer = styled.div.attrs(dpNameProp("ButtonLoader"))(templateObject_31 || (templateObject_31 = __makeTemplateObject(["\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n color: ", ";\n margin: 0 !important;\n opacity: 0.8;\n"], ["\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n color: ", ";\n margin: 0 !important;\n opacity: 0.8;\n"])), function (props) { return props.theme.colors.brandPrimary; });
|
|
139
|
+
export var buttonLoading = css(templateObject_32 || (templateObject_32 = __makeTemplateObject(["\n &,\n :hover,\n :active,\n :focus {\n background-color: ", " !important;\n color: transparent !important;\n border-color: ", " !important;\n box-shadow: none !important;\n }\n"], ["\n &,\n :hover,\n :active,\n :focus {\n background-color: ", " !important;\n color: transparent !important;\n border-color: ", " !important;\n box-shadow: none !important;\n }\n"])), function (props) { return props.theme.colors.grey10; }, function (props) { return props.theme.colors.grey10; });
|
|
140
|
+
export var navButtonBase = css(templateObject_33 || (templateObject_33 = __makeTemplateObject(["\n position: relative;\n transition: all 0.1s ease-in-out;\n display: inline-flex;\n flex-direction: column;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n padding: 4px 8px;\n vertical-align: middle;\n height: 55px;\n width: 90px;\n overflow: hidden;\n align-items: center;\n justify-content: space-between;\n\n :disabled {\n cursor: not-allowed;\n }\n\n ", " {\n font-size: 20px;\n flex: 1;\n }\n\n ", " {\n ", "\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n"], ["\n position: relative;\n transition: all 0.1s ease-in-out;\n display: inline-flex;\n flex-direction: column;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n padding: 4px 8px;\n vertical-align: middle;\n height: 55px;\n width: 90px;\n overflow: hidden;\n align-items: center;\n justify-content: space-between;\n\n :disabled {\n cursor: not-allowed;\n }\n\n ", " {\n font-size: 20px;\n flex: 1;\n }\n\n ", " {\n ", "\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n"])), Icon, ButtonText, paragraphStyled.p8);
|
|
141
|
+
export var navButtonSmall = css(templateObject_34 || (templateObject_34 = __makeTemplateObject(["\n height: 50px;\n width: 60px;\n min-height: 50px;\n min-width: 60px;\n"], ["\n height: 50px;\n width: 60px;\n min-height: 50px;\n min-width: 60px;\n"])));
|
|
142
|
+
export var TestOverlayButtonWrapper = styled.div(templateObject_35 || (templateObject_35 = __makeTemplateObject(["\n background-color: #eeeeee;\n height: 50px;\n position: ", ";\n width: 100px;\n"], ["\n background-color: #eeeeee;\n height: 50px;\n position: ", ";\n width: 100px;\n"])), function (_a) {
|
|
120
143
|
var position = _a.position;
|
|
121
144
|
return (position ? position : "unset");
|
|
122
145
|
});
|
|
123
|
-
export var overlayButtonStyle = css(
|
|
124
|
-
export var overlayButtonRightTop = css(
|
|
125
|
-
export var overlayButtonRightBottom = css(
|
|
126
|
-
export var overlayButtonLeftTop = css(
|
|
127
|
-
export var overlayButtonLeftBottom = css(
|
|
128
|
-
export var overlayButtonMiddleBottom = css(
|
|
129
|
-
export var overlayButtonMiddleTop = css(
|
|
130
|
-
export var buttonIconSubsection = css(
|
|
131
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32, templateObject_33, templateObject_34, templateObject_35, templateObject_36, templateObject_37, templateObject_38, templateObject_39, templateObject_40;
|
|
146
|
+
export var overlayButtonStyle = css(templateObject_36 || (templateObject_36 = __makeTemplateObject(["\n transition: color 0.2s ease-in-out, border-color 0.2s ease-in-out,\n background-color 0.2s ease-in-out, fill 0.2s ease-in-out;\n align-items: center;\n background-color: ", ";\n\n cursor: pointer;\n display: flex;\n justify-content: center;\n min-width: 25px;\n height: 22px;\n border-color: ", ";\n border-style: solid;\n color: ", ";\n\n &:hover {\n color: ", ";\n background-color: ", ";\n border-color: ", ";\n\n ", " {\n color: ", ";\n }\n }\n\n &:active {\n color: ", ";\n border-color: ", ";\n background-color: ", ";\n box-shadow: 0px 0px 0px ", ";\n\n ", " {\n color: ", ";\n }\n }\n\n & > :not(:last-child) {\n margin-right: 7px;\n }\n"], ["\n transition: color 0.2s ease-in-out, border-color 0.2s ease-in-out,\n background-color 0.2s ease-in-out, fill 0.2s ease-in-out;\n align-items: center;\n background-color: ", ";\n\n cursor: pointer;\n display: flex;\n justify-content: center;\n min-width: 25px;\n height: 22px;\n border-color: ", ";\n border-style: solid;\n color: ", ";\n\n &:hover {\n color: ", ";\n background-color: ", ";\n border-color: ", ";\n\n ", " {\n color: ", ";\n }\n }\n\n &:active {\n color: ", ";\n border-color: ", ";\n background-color: ", ";\n box-shadow: 0px 0px 0px ", ";\n\n ", " {\n color: ", ";\n }\n }\n\n & > :not(:last-child) {\n margin-right: 7px;\n }\n"])), function (props) { return props.theme.colors.white; }, function (props) { return props.theme.colors.grey40; }, function (props) { return props.theme.colors.grey80; }, function (props) { return props.theme.colors.brandShade100; }, function (props) { return props.theme.colors.brandShade10; }, function (props) { return props.theme.colors.brandShade100; }, Icon, function (props) { return props.theme.colors.brandShade100; }, function (props) { return props.theme.colors.brandShade100; }, function (props) { return props.theme.colors.brandShade100; }, function (props) { return props.theme.colors.brandShade40; }, function (props) { return props.theme.colors.brandShade40; }, Icon, function (props) { return props.theme.colors.brandShade100; });
|
|
147
|
+
export var overlayButtonRightTop = css(templateObject_37 || (templateObject_37 = __makeTemplateObject(["\n border-bottom-left-radius: 5px;\n border-bottom-width: 1px;\n border-left-width: 1px;\n\n border-top: 0;\n border-right: 0;\n top: 0;\n right: 0;\n"], ["\n border-bottom-left-radius: 5px;\n border-bottom-width: 1px;\n border-left-width: 1px;\n\n border-top: 0;\n border-right: 0;\n top: 0;\n right: 0;\n"])));
|
|
148
|
+
export var overlayButtonRightBottom = css(templateObject_38 || (templateObject_38 = __makeTemplateObject(["\n border-top-left-radius: 5px;\n border-top-width: 1px;\n border-left-width: 1px;\n border-bottom: 0;\n border-right: 0;\n bottom: 0;\n right: 0;\n"], ["\n border-top-left-radius: 5px;\n border-top-width: 1px;\n border-left-width: 1px;\n border-bottom: 0;\n border-right: 0;\n bottom: 0;\n right: 0;\n"])));
|
|
149
|
+
export var overlayButtonLeftTop = css(templateObject_39 || (templateObject_39 = __makeTemplateObject(["\n border-bottom-right-radius: 5px;\n border-bottom-width: 1px;\n border-right-width: 1px;\n border-left: 0;\n border-top: 0;\n top: 0;\n left: 0;\n"], ["\n border-bottom-right-radius: 5px;\n border-bottom-width: 1px;\n border-right-width: 1px;\n border-left: 0;\n border-top: 0;\n top: 0;\n left: 0;\n"])));
|
|
150
|
+
export var overlayButtonLeftBottom = css(templateObject_40 || (templateObject_40 = __makeTemplateObject(["\n border-top-right-radius: 5px;\n border-top-width: 1px;\n border-right-width: 1px;\n border-left: 0;\n border-bottom: 0;\n top: 0;\n left: 0;\n"], ["\n border-top-right-radius: 5px;\n border-top-width: 1px;\n border-right-width: 1px;\n border-left: 0;\n border-bottom: 0;\n top: 0;\n left: 0;\n"])));
|
|
151
|
+
export var overlayButtonMiddleBottom = css(templateObject_41 || (templateObject_41 = __makeTemplateObject(["\n border-radius: 5px;\n border-width: 1px;\n bottom: 10px;\n left: 50%;\n transform: translateX(-50%);\n white-space: nowrap;\n"], ["\n border-radius: 5px;\n border-width: 1px;\n bottom: 10px;\n left: 50%;\n transform: translateX(-50%);\n white-space: nowrap;\n"])));
|
|
152
|
+
export var overlayButtonMiddleTop = css(templateObject_42 || (templateObject_42 = __makeTemplateObject(["\n border-bottom-left-radius: 5px;\n border-bottom-right-radius: 5px;\n border-bottom-width: 1px;\n border-right-width: 1px;\n border-left-width: 1px;\n border-top: 0;\n top: 0;\n left: 0;\n right: 0;\n margin-left: auto;\n margin-right: auto;\n"], ["\n border-bottom-left-radius: 5px;\n border-bottom-right-radius: 5px;\n border-bottom-width: 1px;\n border-right-width: 1px;\n border-left-width: 1px;\n border-top: 0;\n top: 0;\n left: 0;\n right: 0;\n margin-left: auto;\n margin-right: auto;\n"])));
|
|
153
|
+
export var buttonIconSubsection = css(templateObject_43 || (templateObject_43 = __makeTemplateObject(["\n min-width: 18px;\n width: 18px;\n ", " {\n width: 12px;\n height: 12px;\n }\n"], ["\n min-width: 18px;\n width: 18px;\n ", " {\n width: 12px;\n height: 12px;\n }\n"])), Icon);
|
|
154
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32, templateObject_33, templateObject_34, templateObject_35, templateObject_36, templateObject_37, templateObject_38, templateObject_39, templateObject_40, templateObject_41, templateObject_42, templateObject_43;
|
|
@@ -2,23 +2,21 @@ import { __assign, __makeTemplateObject } from "tslib";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import styled from "styled-components";
|
|
4
4
|
import { Avatar } from "../Avatar";
|
|
5
|
-
import {
|
|
6
|
-
import { P8, TSpan } from "../Typography";
|
|
5
|
+
import { TSpan } from "../Typography";
|
|
7
6
|
import { Stack } from "../../layout";
|
|
8
7
|
import { dpNameProp } from "../../utils";
|
|
9
|
-
|
|
8
|
+
import { IconButton } from "../Button";
|
|
9
|
+
var Container = styled(Stack)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n box-sizing: border-box;\n background-color: ", ";\n border-radius: 10px;\n height: 20px;\n width: fit-content;\n max-width: 100%;\n overflow: hidden;\n padding: 2px 5px 2px 10px;\n font-size: 11px;\n color: #1c3e55;\n"], ["\n box-sizing: border-box;\n background-color: ", ";\n border-radius: 10px;\n height: 20px;\n width: fit-content;\n max-width: 100%;\n overflow: hidden;\n padding: 2px 5px 2px 10px;\n font-size: 11px;\n color: #1c3e55;\n"])), function (_a) {
|
|
10
10
|
var theme = _a.theme;
|
|
11
11
|
return theme.colors.brandShade20;
|
|
12
12
|
});
|
|
13
|
-
var CloseIcon = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n color: ", ";\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n color: ", ";\n"])), function (props) { return props.theme.colors.brandShade100; });
|
|
14
13
|
export var CCUserTag = function (_a) {
|
|
15
14
|
var displayName = _a.displayName, avatar = _a.avatar, email = _a.email, onClose = _a.onClose, closeIcon = _a.closeIcon, avatarBackupIcon = _a.avatarBackupIcon;
|
|
16
|
-
return (React.createElement(Container, __assign({}, dpNameProp("CCUserTag"), {
|
|
17
|
-
|
|
18
|
-
React.createElement(Avatar, __assign({}, avatar, { backupIcon: avatarBackupIcon }))
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
onClose && (React.createElement(
|
|
22
|
-
React.createElement(Icon, { icon: closeIcon })))));
|
|
15
|
+
return (React.createElement(Container, __assign({}, dpNameProp("CCUserTag"), { align: "center", wrap: "nowrap" }),
|
|
16
|
+
React.createElement(Stack, { gap: 6, align: "center", wrap: "nowrap", overflow: "hidden" },
|
|
17
|
+
avatar && React.createElement(Avatar, __assign({ size: 15 }, avatar, { backupIcon: avatarBackupIcon })),
|
|
18
|
+
displayName && (React.createElement(TSpan, { type: "p6", style: { whiteSpace: "nowrap" }, overflow: "ellipsis", flex: 3 }, displayName)),
|
|
19
|
+
email && React.createElement(TSpan, { type: "p8", overflow: "ellipsis", flex: 1 }, "(".concat(email, ")"))),
|
|
20
|
+
onClose && (React.createElement(IconButton, { size: "tiny", intent: "minimal", icon: closeIcon, onClick: function () { return onClose(); } }))));
|
|
23
21
|
};
|
|
24
|
-
var templateObject_1
|
|
22
|
+
var templateObject_1;
|
|
@@ -60,7 +60,7 @@ export var AppCardInfo = styled(TSpan).attrs({
|
|
|
60
60
|
type: "p5",
|
|
61
61
|
overflow: "ellipsis",
|
|
62
62
|
})(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n color: ", ";\n margin-right: 4px;\n"], ["\n color: ", ";\n margin-right: 4px;\n"])), function (props) { return props.theme.colors.grey80; });
|
|
63
|
-
export var IdTitle = styled.span(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n color: ", ";\n font-family: monospace;\n font-size: 9px;\n"], ["\n color: ", ";\n font-family: monospace;\n font-size: 9px;\n"])), function (_a) {
|
|
63
|
+
export var IdTitle = styled.span(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n color: ", ";\n font-family: monospace;\n font-size: 9px;\n word-break: normal;\n"], ["\n color: ", ";\n font-family: monospace;\n font-size: 9px;\n word-break: normal;\n"])), function (_a) {
|
|
64
64
|
var theme = _a.theme;
|
|
65
65
|
return theme.colors.grey80;
|
|
66
66
|
});
|
|
@@ -14,9 +14,7 @@ var StyledCheckbox = styled.span(templateObject_2 || (templateObject_2 = __makeT
|
|
|
14
14
|
: props.checked
|
|
15
15
|
? props.theme.colors.brandPrimary
|
|
16
16
|
: props.theme.colors.white;
|
|
17
|
-
}, function (props) { return (props.disabled ? "not-allowed" : "pointer"); }, function (props) {
|
|
18
|
-
return !props.checked && "solid 1px ".concat(props.theme.colors.grey20);
|
|
19
|
-
}, function (props) { return props.size - 3; }, function (props) { return props.size - 3; }, function (_a) {
|
|
17
|
+
}, function (props) { return (props.disabled ? "not-allowed" : "pointer"); }, function (props) { return !props.checked && "solid 1px ".concat(props.theme.colors.grey20); }, function (props) { return props.size - 3; }, function (props) { return props.size - 3; }, function (_a) {
|
|
20
18
|
var theme = _a.theme;
|
|
21
19
|
return theme.colors.white;
|
|
22
20
|
}, function (props) { return (props.checked ? "visible" : "hidden"); }, function (_a) {
|
|
@@ -30,8 +30,7 @@ export var ColorInput = styled(forwardRef(function Label(_a, ref) {
|
|
|
30
30
|
useLayoutEffect(function () {
|
|
31
31
|
if (leftElementRef.current) {
|
|
32
32
|
var clientWidth = leftElementRef.current.clientWidth;
|
|
33
|
-
if (leftPadding === undefined ||
|
|
34
|
-
Math.abs(clientWidth - leftPadding) > 2) {
|
|
33
|
+
if (leftPadding === undefined || Math.abs(clientWidth - leftPadding) > 2) {
|
|
35
34
|
setLeftPadding(clientWidth);
|
|
36
35
|
}
|
|
37
36
|
}
|
|
@@ -40,8 +39,7 @@ export var ColorInput = styled(forwardRef(function Label(_a, ref) {
|
|
|
40
39
|
}
|
|
41
40
|
if (rightElementRef.current) {
|
|
42
41
|
var clientWidth = rightElementRef.current.clientWidth;
|
|
43
|
-
if (rightPadding === undefined ||
|
|
44
|
-
Math.abs(clientWidth - rightPadding) > 2) {
|
|
42
|
+
if (rightPadding === undefined || Math.abs(clientWidth - rightPadding) > 2) {
|
|
45
43
|
setRightPadding(clientWidth);
|
|
46
44
|
}
|
|
47
45
|
}
|
|
@@ -96,8 +94,7 @@ export var ColorInputWithDisplay = styled(forwardRef(function Label(_a, ref) {
|
|
|
96
94
|
useLayoutEffect(function () {
|
|
97
95
|
if (leftElementRef.current) {
|
|
98
96
|
var clientWidth = leftElementRef.current.clientWidth;
|
|
99
|
-
if (leftPadding === undefined ||
|
|
100
|
-
Math.abs(clientWidth - leftPadding) > 2) {
|
|
97
|
+
if (leftPadding === undefined || Math.abs(clientWidth - leftPadding) > 2) {
|
|
101
98
|
setLeftPadding(clientWidth);
|
|
102
99
|
}
|
|
103
100
|
}
|
|
@@ -106,8 +103,7 @@ export var ColorInputWithDisplay = styled(forwardRef(function Label(_a, ref) {
|
|
|
106
103
|
}
|
|
107
104
|
if (rightElementRef.current) {
|
|
108
105
|
var clientWidth = rightElementRef.current.clientWidth;
|
|
109
|
-
if (rightPadding === undefined ||
|
|
110
|
-
Math.abs(clientWidth - rightPadding) > 2) {
|
|
106
|
+
if (rightPadding === undefined || Math.abs(clientWidth - rightPadding) > 2) {
|
|
111
107
|
setRightPadding(clientWidth);
|
|
112
108
|
}
|
|
113
109
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./DatePicker";
|
|
2
|
-
export { DatePickerInput, LabelAction as DatePickerLabelAction
|
|
2
|
+
export { DatePickerInput, LabelAction as DatePickerLabelAction } from "./styles";
|
|
@@ -11,6 +11,7 @@ import { dpNameProp } from "../../utils";
|
|
|
11
11
|
var DialogOverlayContainer = styled(motion.div)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 100%;\n width: 100%;\n pointer-events: none;\n"], ["\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 100%;\n width: 100%;\n pointer-events: none;\n"])));
|
|
12
12
|
var DialogContainer = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n border-radius: 8px;\n display: flex;\n flex-direction: column;\n padding-bottom: 20px;\n pointer-events: all;\n width: ", ";\n max-height: 80vh;\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: 20px;\n pointer-events: all;\n width: ", ";\n max-height: 80vh;\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) {
|
|
13
13
|
return match(props.size)
|
|
14
|
+
.with("small", function () { return "350px"; })
|
|
14
15
|
.with("medium", function () { return "500px"; })
|
|
15
16
|
.with("large", function () { return "700px"; })
|
|
16
17
|
.with("xLarge", function () { return "840px"; })
|
|
@@ -2,7 +2,7 @@ import { __assign, __makeTemplateObject, __read, __spreadArray } from "tslib";
|
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useRef, useState, } from "react";
|
|
3
3
|
import { usePopper } from "react-popper";
|
|
4
4
|
import * as S from "./styles";
|
|
5
|
-
import { faCaretRight, faSearch, faTimes
|
|
5
|
+
import { faCaretRight, faSearch, faTimes } from "@fortawesome/free-solid-svg-icons";
|
|
6
6
|
import { mergeRefs } from "./utility";
|
|
7
7
|
import { Infinite } from "../Infinite";
|
|
8
8
|
import { Input } from "../Input";
|
|
@@ -20,7 +20,7 @@ export function dropdownRenderOptions(handleSelectOption, activeItem, activeSubI
|
|
|
20
20
|
case "value":
|
|
21
21
|
return (React.createElement(DropdownItem, { active: (activeItem === null || activeItem === void 0 ? void 0 : activeItem.key) === opt.key, onSelect: handleSelectOption, onSelectIcon: opt.onClickIcon, onClickSubItem: opt.onClickSubItem, key: opt.key, value: opt, meta: { active: false, input: "" }, activeSubItem: activeSubItem, setActiveSubItem: setActiveSubItem, hideIcons: hideIcons, iconColumnWidth: iconColumnWidth, fetchMoreText: fetchMoreText, autoscrollText: autoscrollText, selectedIcon: selectedIcon, externalLinkIcon: externalLinkIcon }));
|
|
22
22
|
case "header":
|
|
23
|
-
return
|
|
23
|
+
return React.createElement(S.DropdownHeaderItem, { key: "header".concat(index) }, opt.label);
|
|
24
24
|
case "divider":
|
|
25
25
|
return React.createElement(S.DropdownDividerItem, { key: "divider".concat(index) });
|
|
26
26
|
default:
|
|
@@ -85,9 +85,8 @@ var minimumDropdownWidth = 236;
|
|
|
85
85
|
* }
|
|
86
86
|
* </Dropdown>
|
|
87
87
|
*/
|
|
88
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
89
88
|
export function Dropdown(_a) {
|
|
90
|
-
var children = _a.children, options = _a.options, stickyHeaderOptions = _a.stickyHeaderOptions, stickyFooterOptions = _a.stickyFooterOptions, inputValue = _a.inputValue, searchPlaceholder = _a.searchPlaceholder, _b = _a.placement, placement = _b === void 0 ? "bottom-start" : _b, _c = _a.showInternalSearch, showInternalSearch = _c === void 0 ? false : _c, _d = _a.isLoading, isLoading = _d === void 0 ? false : _d, _e = _a.usePortal, usePortal = _e === void 0 ? true : _e, _f = _a.closeOnSelect, closeOnSelect = _f === void 0 ? true : _f, isOpenProp = _a.isOpen, renderCreateNewOption = _a.renderCreateNewOption, hideIcons = _a.hideIcons, iconColumnWidth = _a.iconColumnWidth, containerWidth = _a.containerWidth, onSelectOption = _a.onSelectOption, onInputChange = _a.onInputChange, onFetchMore = _a.onFetchMore, onClear = _a.onClear, onClose = _a.onClose, onOpen = _a.onOpen, optionsRenderer = _a.optionsRenderer, tabProps = _a.tabProps, disabled = _a.disabled, fetchMoreText = _a.fetchMoreText, autoscrollText = _a.autoscrollText, externalLinkIcon = _a.externalLinkIcon, selectedIcon = _a.selectedIcon;
|
|
89
|
+
var children = _a.children, options = _a.options, stickyHeaderOptions = _a.stickyHeaderOptions, stickyFooterOptions = _a.stickyFooterOptions, inputValue = _a.inputValue, searchPlaceholder = _a.searchPlaceholder, _b = _a.placement, placement = _b === void 0 ? "bottom-start" : _b, _c = _a.showInternalSearch, showInternalSearch = _c === void 0 ? false : _c, _d = _a.isLoading, isLoading = _d === void 0 ? false : _d, _e = _a.usePortal, usePortal = _e === void 0 ? true : _e, _f = _a.closeOnSelect, closeOnSelect = _f === void 0 ? true : _f, isOpenProp = _a.isOpen, renderCreateNewOption = _a.renderCreateNewOption, hideIcons = _a.hideIcons, iconColumnWidth = _a.iconColumnWidth, containerWidth = _a.containerWidth, containerHeight = _a.containerHeight, onSelectOption = _a.onSelectOption, onInputChange = _a.onInputChange, onFetchMore = _a.onFetchMore, onClear = _a.onClear, onClose = _a.onClose, onOpen = _a.onOpen, optionsRenderer = _a.optionsRenderer, tabProps = _a.tabProps, disabled = _a.disabled, fetchMoreText = _a.fetchMoreText, autoscrollText = _a.autoscrollText, externalLinkIcon = _a.externalLinkIcon, selectedIcon = _a.selectedIcon;
|
|
91
90
|
var _g = __read(useState(false), 2), isOpenState = _g[0], setIsOpenState = _g[1];
|
|
92
91
|
var _h = __read(useState(null), 2), activeItem = _h[0], setActiveItem = _h[1];
|
|
93
92
|
var _j = __read(useState(null), 2), activeSubItem = _j[0], setActiveSubItem = _j[1];
|
|
@@ -114,7 +113,7 @@ export function Dropdown(_a) {
|
|
|
114
113
|
close();
|
|
115
114
|
};
|
|
116
115
|
function isHtmlNode(node) {
|
|
117
|
-
return
|
|
116
|
+
return typeof node === "object" && notEmpty(node) && node instanceof HTMLElement;
|
|
118
117
|
}
|
|
119
118
|
// Have to pass a fn to useCallback due to eslint bug in eslint-plugin-react-hooks
|
|
120
119
|
// which is fixed in 4.1.1 but we are tied to 1.6.1 in react-scripts
|
|
@@ -126,8 +125,7 @@ export function Dropdown(_a) {
|
|
|
126
125
|
function handler(event) {
|
|
127
126
|
var _a, _b, _c;
|
|
128
127
|
if (!(((_a = dropdownRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target)) ||
|
|
129
|
-
(isHtmlNode(targetRef.current) &&
|
|
130
|
-
targetRef.current.contains(event.target)) ||
|
|
128
|
+
(isHtmlNode(targetRef.current) && targetRef.current.contains(event.target)) ||
|
|
131
129
|
(isHtmlNode(inputSearchRef.current) &&
|
|
132
130
|
((_b = inputSearchRef.current.parentElement) === null || _b === void 0 ? void 0 : _b.contains(event.target))) ||
|
|
133
131
|
((_c = inputSearchRef.current) === null || _c === void 0 ? void 0 : _c.contains(event.target)))) {
|
|
@@ -223,14 +221,10 @@ export function Dropdown(_a) {
|
|
|
223
221
|
};
|
|
224
222
|
// Have to pass a fn to useCallback due to eslint bug in eslint-plugin-react-hooks
|
|
225
223
|
// which is fixed in 4.1.1 but we are tied to 1.6.1 in react-scripts
|
|
226
|
-
var handleSelectOption = useCallback(handleSelectOptionCb, [
|
|
227
|
-
handleClose,
|
|
228
|
-
onSelectOption,
|
|
229
|
-
]);
|
|
224
|
+
var handleSelectOption = useCallback(handleSelectOptionCb, [handleClose, onSelectOption]);
|
|
230
225
|
// width of input or set minimum width - 236px
|
|
231
226
|
var refWidth = useMemo(function () {
|
|
232
|
-
if ((referenceElement === null || referenceElement === void 0 ? void 0 : referenceElement.scrollWidth) &&
|
|
233
|
-
referenceElement.scrollWidth > minimumDropdownWidth) {
|
|
227
|
+
if ((referenceElement === null || referenceElement === void 0 ? void 0 : referenceElement.scrollWidth) && referenceElement.scrollWidth > minimumDropdownWidth) {
|
|
234
228
|
return referenceElement.scrollWidth;
|
|
235
229
|
}
|
|
236
230
|
else
|
|
@@ -239,9 +233,9 @@ export function Dropdown(_a) {
|
|
|
239
233
|
var innerDropdownContent = (React.createElement(React.Fragment, null,
|
|
240
234
|
optionsRenderer &&
|
|
241
235
|
optionsRenderer(options, handleSelectOption, activeItem, activeSubItem, setActiveSubItem, hideIcons),
|
|
242
|
-
!optionsRenderer && options.length > 0 && (React.createElement(Infinite, { maxHeight: "40vh", onFetchMore: onFetchMore, anchor: false, scrollSideEffect: function () { return setActiveSubItem(null); }, fetchMoreText: fetchMoreText, autoscrollText: autoscrollText }, options.map(dropdownRenderOptions(handleSelectOption, activeItem, activeSubItem, setActiveSubItem, fetchMoreText, autoscrollText, selectedIcon, externalLinkIcon, hideIcons, iconColumnWidth)))),
|
|
236
|
+
!optionsRenderer && options.length > 0 && (React.createElement(Infinite, { maxHeight: containerHeight ? undefined : "40vh", onFetchMore: onFetchMore, anchor: false, scrollSideEffect: function () { return setActiveSubItem(null); }, fetchMoreText: fetchMoreText, autoscrollText: autoscrollText }, options.map(dropdownRenderOptions(handleSelectOption, activeItem, activeSubItem, setActiveSubItem, fetchMoreText, autoscrollText, selectedIcon, externalLinkIcon, hideIcons, iconColumnWidth)))),
|
|
243
237
|
isLoading && React.createElement(Spinner, null)));
|
|
244
|
-
var dropdown = (React.createElement(S.DropdownContainer, __assign({ initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { type: "spring", mass: 0.5 }, onKeyDownCapture: handleKeyDown, "data-testid": "dropdown-container", ref: mergeRefs(setPopperElement, dropdownRef), style: styles.popper, containerWidth: containerWidth || refWidth }, attributes.popper),
|
|
238
|
+
var dropdown = (React.createElement(S.DropdownContainer, __assign({ initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { type: "spring", mass: 0.5 }, onKeyDownCapture: handleKeyDown, "data-testid": "dropdown-container", ref: mergeRefs(setPopperElement, dropdownRef), style: styles.popper, containerWidth: containerWidth || refWidth, containerHeight: containerHeight }, attributes.popper),
|
|
245
239
|
stickyHeaderOptions && (React.createElement(React.Fragment, null,
|
|
246
240
|
stickyHeaderOptions.map(dropdownRenderOptions(handleSelectOption, activeItem, activeSubItem, setActiveSubItem, fetchMoreText, autoscrollText, selectedIcon, externalLinkIcon)),
|
|
247
241
|
React.createElement(S.DropdownDividerItem, null))),
|
|
@@ -2,12 +2,15 @@ import { __makeTemplateObject } from "tslib";
|
|
|
2
2
|
import styled from "styled-components";
|
|
3
3
|
import { motion } from "framer-motion";
|
|
4
4
|
import { dpNameProp } from "../../utils";
|
|
5
|
-
export var DropdownContainer = styled(motion.div).attrs(dpNameProp("Dropdown"))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n overflow: hidden;\n background: ", ";\n box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.25);\n border-radius: 4px;\n z-index: 9999999;\n outline: none;\n padding-top: 5px;\n padding-bottom: 5px;\n // TODO: allow menu contents to define width\n // TODO: set min width based on ref of input trigger\n width: ", "px;\n user-select: none;\n"], ["\n overflow: hidden;\n background: ", ";\n box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.25);\n border-radius: 4px;\n z-index: 9999999;\n outline: none;\n padding-top: 5px;\n padding-bottom: 5px;\n // TODO: allow menu contents to define width\n // TODO: set min width based on ref of input trigger\n width: ", "px;\n user-select: none;\n"])), function (_a) {
|
|
5
|
+
export var DropdownContainer = styled(motion.div).attrs(dpNameProp("Dropdown"))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n overflow: hidden;\n background: ", ";\n box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.25);\n border-radius: 4px;\n z-index: 9999999;\n outline: none;\n padding-top: 5px;\n padding-bottom: 5px;\n // TODO: allow menu contents to define width\n // TODO: set min width based on ref of input trigger\n width: ", "px;\n ", "\n user-select: none;\n"], ["\n overflow: hidden;\n background: ", ";\n box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.25);\n border-radius: 4px;\n z-index: 9999999;\n outline: none;\n padding-top: 5px;\n padding-bottom: 5px;\n // TODO: allow menu contents to define width\n // TODO: set min width based on ref of input trigger\n width: ", "px;\n ", "\n user-select: none;\n"])), function (_a) {
|
|
6
6
|
var theme = _a.theme;
|
|
7
7
|
return theme.colors.white;
|
|
8
8
|
}, function (_a) {
|
|
9
9
|
var containerWidth = _a.containerWidth;
|
|
10
10
|
return containerWidth !== null && containerWidth !== void 0 ? containerWidth : 200;
|
|
11
|
+
}, function (_a) {
|
|
12
|
+
var containerHeight = _a.containerHeight;
|
|
13
|
+
return (containerHeight ? "height: ".concat(containerHeight, "px;") : "");
|
|
11
14
|
});
|
|
12
15
|
export var DropdownDividerItem = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 100%;\n border-top: 1px solid ", ";\n margin-top: 5px;\n margin-bottom: 5px;\n"], ["\n width: 100%;\n border-top: 1px solid ", ";\n margin-top: 5px;\n margin-bottom: 5px;\n"])), function (_a) {
|
|
13
16
|
var theme = _a.theme;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
1
|
+
import { __assign, __rest } from "tslib";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import { DP_CUSTOM_ICONS_CODEPOINTS } from "./customIconsCodegen";
|
|
5
5
|
import { dpNameProp } from "../../utils";
|
|
6
6
|
export var DeskproCustomIcon = function (_a) {
|
|
7
|
-
var icon = _a.icon, className = _a.className;
|
|
8
|
-
return (React.createElement("i", __assign({}, dpNameProp("DeskproCustomIcon"), { className: classNames("dp-custom-icon-".concat(icon), className), style: { lineHeight: 1, height: "auto" } })));
|
|
7
|
+
var icon = _a.icon, className = _a.className, rest = __rest(_a, ["icon", "className"]);
|
|
8
|
+
return (React.createElement("i", __assign({}, rest, dpNameProp("DeskproCustomIcon"), { className: classNames("dp-custom-icon-".concat(icon), className), style: { lineHeight: 1, height: "auto" } })));
|
|
9
9
|
};
|
|
10
10
|
export var isDpCustomIconId = function (icon) {
|
|
11
11
|
return typeof icon === "string" && Object.keys(DP_CUSTOM_ICONS_CODEPOINTS).includes(icon);
|
|
@@ -7,16 +7,10 @@ import { dpNameProp, notEmpty } from "../../utils";
|
|
|
7
7
|
import { DeskproCustomIcon, isDpCustomIconId } from "./DeskproCustomIcon";
|
|
8
8
|
import HeroIcon, { isHeroIcon } from "./HeroIcon";
|
|
9
9
|
export function isFaIcon(icon) {
|
|
10
|
-
return
|
|
11
|
-
notEmpty(icon) &&
|
|
12
|
-
"prefix" in icon &&
|
|
13
|
-
"iconName" in icon);
|
|
10
|
+
return typeof icon === "object" && notEmpty(icon) && "prefix" in icon && "iconName" in icon;
|
|
14
11
|
}
|
|
15
12
|
export function isAnyIcon(icon) {
|
|
16
|
-
return
|
|
17
|
-
isDpCustomIconId(icon) ||
|
|
18
|
-
isFaIcon(icon) ||
|
|
19
|
-
isHeroIcon(icon));
|
|
13
|
+
return isISO3166(icon) || isDpCustomIconId(icon) || isFaIcon(icon) || isHeroIcon(icon);
|
|
20
14
|
}
|
|
21
15
|
export function isIconProps(props) {
|
|
22
16
|
return (typeof props === "object" &&
|
|
@@ -37,23 +31,21 @@ export function isIconProps(props) {
|
|
|
37
31
|
export var Icon = styled(function Icon(_a) {
|
|
38
32
|
var icon = _a.icon, themeColor = _a.themeColor, size = _a.size, rest = __rest(_a, ["icon", "themeColor", "size"]);
|
|
39
33
|
if (isFaIcon(icon)) {
|
|
40
|
-
return React.createElement(FontAwesomeIcon, __assign({}, dpNameProp("FAIcon"), { icon: icon }, rest));
|
|
34
|
+
return (React.createElement(FontAwesomeIcon, __assign({ "data-testid": "fa-icon" }, dpNameProp("FAIcon"), { icon: icon }, rest)));
|
|
41
35
|
}
|
|
42
36
|
if (isISO3166(icon)) {
|
|
43
|
-
return React.createElement(FlagImg, __assign({ isoCode: icon }, rest));
|
|
37
|
+
return React.createElement(FlagImg, __assign({ "data-testid": "flag-icon", isoCode: icon }, rest));
|
|
44
38
|
}
|
|
45
39
|
if (isDpCustomIconId(icon)) {
|
|
46
|
-
return React.createElement(DeskproCustomIcon, __assign({ icon: icon }, rest));
|
|
40
|
+
return React.createElement(DeskproCustomIcon, __assign({ "data-testid": "custom-icon", icon: icon }, rest));
|
|
47
41
|
}
|
|
48
42
|
if (isHeroIcon(icon)) {
|
|
49
|
-
return React.createElement(HeroIcon, __assign({ icon: icon }, rest, { width: size }));
|
|
43
|
+
return React.createElement(HeroIcon, __assign({ "data-testid": "hero-icon", icon: icon }, rest, { width: size }));
|
|
50
44
|
}
|
|
51
|
-
return React.createElement(DeskproCustomIcon, __assign({ icon: "dot" }, rest));
|
|
45
|
+
return React.createElement(DeskproCustomIcon, __assign({ "data-testid": "custom-icon", icon: "dot" }, rest));
|
|
52
46
|
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 1em;\n color: ", ";\n font-size: ", ";\n user-select: none;\n"], ["\n height: 1em;\n color: ", ";\n font-size: ", ";\n user-select: none;\n"])), function (props) {
|
|
53
47
|
var _a;
|
|
54
48
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
55
49
|
return (_a = props.theme.colors[props.themeColor]) !== null && _a !== void 0 ? _a : "inherit";
|
|
56
|
-
}, function (props) {
|
|
57
|
-
return typeof props.size === "number" ? "".concat(props.size, "px") : "inherit";
|
|
58
|
-
});
|
|
50
|
+
}, function (props) { return (typeof props.size === "number" ? "".concat(props.size, "px") : "inherit"); });
|
|
59
51
|
var templateObject_1;
|
|
@@ -22,27 +22,28 @@ export var DP_CUSTOM_ICONS_CODEPOINTS = {
|
|
|
22
22
|
grip: "61717",
|
|
23
23
|
"hang-up": "61718",
|
|
24
24
|
"helping-hand": "61719",
|
|
25
|
-
"im-
|
|
26
|
-
im: "61721",
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"warm-
|
|
47
|
-
|
|
25
|
+
"im-outline": "61720",
|
|
26
|
+
"im-send": "61721",
|
|
27
|
+
im: "61722",
|
|
28
|
+
"inbound-call": "61723",
|
|
29
|
+
"kanban-view": "61724",
|
|
30
|
+
"level-down": "61725",
|
|
31
|
+
"linked-ticket": "61726",
|
|
32
|
+
"location-arrow": "61727",
|
|
33
|
+
merge: "61728",
|
|
34
|
+
merge2: "61729",
|
|
35
|
+
"missed-call": "61730",
|
|
36
|
+
"mobile-rotate": "61731",
|
|
37
|
+
"organization-circle": "61732",
|
|
38
|
+
"outbound-call": "61733",
|
|
39
|
+
read: "61734",
|
|
40
|
+
record: "61735",
|
|
41
|
+
sent: "61736",
|
|
42
|
+
"sip-address": "61737",
|
|
43
|
+
sort: "61738",
|
|
44
|
+
"transfer-queue": "61739",
|
|
45
|
+
triangle: "61740",
|
|
46
|
+
"warm-add": "61741",
|
|
47
|
+
"warm-transfer": "61742",
|
|
48
|
+
webhook: "61743",
|
|
48
49
|
};
|