@codacy/ui-components 0.66.25 → 0.66.26
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/lib/Avatar/Avatar.js +20 -28
- package/lib/Avatar/Avatar.types.js +1 -5
- package/lib/Avatar/gravatar.js +14 -22
- package/lib/Avatar/index.js +1 -16
- package/lib/Banner/Banner.js +33 -50
- package/lib/Banner/Banner.styles.d.ts +1 -1
- package/lib/Banner/Banner.styles.js +11 -20
- package/lib/Banner/Banner.types.js +1 -5
- package/lib/Banner/index.js +2 -27
- package/lib/Bannerol/Bannerol.js +44 -61
- package/lib/Bannerol/Bannerol.styles.js +9 -18
- package/lib/Bannerol/Bannerol.types.js +1 -5
- package/lib/Bannerol/index.js +3 -38
- package/lib/BigTabs/BigTabs.js +39 -54
- package/lib/BigTabs/BigTabs.styles.js +79 -107
- package/lib/BigTabs/BigTabs.types.js +1 -5
- package/lib/BigTabs/index.js +1 -16
- package/lib/Button/Button.js +45 -67
- package/lib/Button/index.js +2 -27
- package/lib/Button/styles.js +101 -130
- package/lib/Button/types.js +1 -5
- package/lib/Checkbox/Checkbox.js +55 -68
- package/lib/Checkbox/CheckboxFilterList.js +33 -66
- package/lib/Checkbox/index.js +3 -38
- package/lib/Checkbox/styles.js +64 -86
- package/lib/Checkbox/types.js +1 -5
- package/lib/CloseButton/index.d.ts +1 -1
- package/lib/CloseButton/index.js +24 -36
- package/lib/Divider/Divider.js +14 -25
- package/lib/Divider/Divider.styles.d.ts +1 -1
- package/lib/Divider/Divider.styles.js +24 -38
- package/lib/Divider/Divider.types.js +1 -5
- package/lib/Divider/index.js +1 -16
- package/lib/Dropdown/Content/DropdownInput.js +10 -20
- package/lib/Dropdown/Content/DropdownItem.js +22 -36
- package/lib/Dropdown/Content/DropdownSeparator.js +8 -19
- package/lib/Dropdown/Content/DropdownTitle.js +8 -22
- package/lib/Dropdown/Content/index.js +4 -49
- package/lib/Dropdown/Dropdown.js +74 -102
- package/lib/Dropdown/Dropdown.styles.d.ts +1 -1
- package/lib/Dropdown/Dropdown.styles.js +60 -82
- package/lib/Dropdown/Dropdown.types.js +1 -5
- package/lib/Dropdown/Triggers/DropdownButtonTrigger.js +19 -32
- package/lib/Dropdown/Triggers/DropdownItemTrigger.js +18 -30
- package/lib/Dropdown/Triggers/FilterTrigger.js +66 -93
- package/lib/Dropdown/Triggers/InputTrigger.js +15 -24
- package/lib/Dropdown/Triggers/SelectTrigger.js +12 -21
- package/lib/Dropdown/Triggers/hooks.js +17 -26
- package/lib/Dropdown/Triggers/index.js +6 -71
- package/lib/Dropdown/Triggers/types.js +1 -5
- package/lib/Dropdown/index.js +4 -49
- package/lib/ExpandableBox/ExpandableBox.js +28 -43
- package/lib/ExpandableBox/ExpandableBox.styles.d.ts +2 -2
- package/lib/ExpandableBox/ExpandableBox.styles.js +27 -40
- package/lib/ExpandableBox/ExpandableBox.types.js +1 -5
- package/lib/ExpandableBox/index.js +1 -16
- package/lib/Flexbox/Flexbox.js +14 -21
- package/lib/Flexbox/index.js +1 -16
- package/lib/Group/Group.js +7 -18
- package/lib/Group/Group.styles.js +8 -16
- package/lib/Group/Group.types.js +1 -5
- package/lib/Group/index.js +1 -16
- package/lib/Icon/Icon.js +15 -26
- package/lib/Icon/Icon.styles.d.ts +1 -1
- package/lib/Icon/Icon.styles.js +57 -50
- package/lib/Icon/Icon.types.js +1 -5
- package/lib/Icon/index.js +1 -16
- package/lib/IconAndText/IconAndText.js +23 -36
- package/lib/IconAndText/IconAndText.styles.js +19 -29
- package/lib/IconAndText/IconAndText.types.js +1 -5
- package/lib/IconAndText/index.js +1 -16
- package/lib/Icons/Chevrons.js +45 -65
- package/lib/Icons/CodacyIcon.js +9 -20
- package/lib/Icons/Ellipsis.js +18 -29
- package/lib/Icons/Messages.js +58 -79
- package/lib/Icons/Search.js +8 -19
- package/lib/Icons/Severities.js +113 -149
- package/lib/Icons/Sorting.js +15 -29
- package/lib/Icons/Spinner.js +11 -22
- package/lib/Icons/Symbols.js +67 -90
- package/lib/Icons/index.js +8 -93
- package/lib/Img/Img.js +26 -45
- package/lib/Img/Img.styles.d.ts +2 -2
- package/lib/Img/Img.styles.js +21 -29
- package/lib/Img/Img.types.js +1 -5
- package/lib/Img/index.js +1 -16
- package/lib/InlineMessage/InlineMessage.js +43 -70
- package/lib/InlineMessage/index.js +1 -16
- package/lib/InlineMessage/types.js +1 -5
- package/lib/Input/Input.js +115 -143
- package/lib/Input/hooks.js +107 -208
- package/lib/Input/index.js +2 -27
- package/lib/Input/styles.d.ts +2 -2
- package/lib/Input/styles.js +116 -151
- package/lib/Input/types.js +1 -5
- package/lib/Labeled/Labeled.js +22 -35
- package/lib/Labeled/index.js +1 -16
- package/lib/Labeled/styles.js +23 -37
- package/lib/Labeled/types.js +1 -5
- package/lib/LeftMenu/LeftMenu.js +10 -21
- package/lib/LeftMenu/LeftMenu.styles.js +25 -43
- package/lib/LeftMenu/LeftMenu.types.js +1 -5
- package/lib/LeftMenu/index.js +1 -16
- package/lib/Link/Link.js +32 -50
- package/lib/Link/Link.styles.js +11 -23
- package/lib/Link/Link.types.js +1 -5
- package/lib/Link/index.js +3 -38
- package/lib/Message/Message.js +31 -42
- package/lib/Message/Message.styles.js +18 -31
- package/lib/Message/Message.types.js +1 -5
- package/lib/Message/index.js +1 -16
- package/lib/Modal/ConfirmationModal.js +40 -67
- package/lib/Modal/Modal.js +107 -137
- package/lib/Modal/index.js +2 -27
- package/lib/Modal/styles.js +44 -62
- package/lib/Modal/types.js +1 -5
- package/lib/MoreInfo/MoreInfo.js +41 -53
- package/lib/MoreInfo/index.js +1 -16
- package/lib/MoreInfo/types.js +1 -5
- package/lib/MultiSlider/MultiSlider.js +17 -31
- package/lib/MultiSlider/index.js +1 -16
- package/lib/MultiSlider/styles.js +18 -34
- package/lib/MultiSlider/types.js +1 -5
- package/lib/Panel/Panel.js +9 -19
- package/lib/Panel/Panel.styles.js +15 -26
- package/lib/Panel/Panel.types.js +1 -5
- package/lib/Panel/index.js +2 -27
- package/lib/PillLabel/PillLabel.js +35 -49
- package/lib/PillLabel/PillLabel.styles.js +33 -44
- package/lib/PillLabel/PillLabel.types.js +1 -5
- package/lib/PillLabel/index.js +1 -16
- package/lib/Popup/Popup.js +43 -61
- package/lib/Popup/index.js +1 -16
- package/lib/Popup/styles.js +22 -37
- package/lib/Popup/types.js +1 -5
- package/lib/ProgressBar/ProgressBar.js +19 -34
- package/lib/ProgressBar/index.js +2 -27
- package/lib/ProgressBar/styles.js +21 -35
- package/lib/ProgressBar/types.js +1 -5
- package/lib/Radio/Radio.js +47 -59
- package/lib/Radio/index.js +1 -16
- package/lib/Radio/styles.js +48 -72
- package/lib/Radio/types.js +1 -5
- package/lib/ScrollableContent/ScrollableContent.js +27 -40
- package/lib/ScrollableContent/ScrollableContent.styles.js +22 -39
- package/lib/ScrollableContent/ScrollableContent.types.js +1 -5
- package/lib/ScrollableContent/index.js +2 -27
- package/lib/ScrollableContent/useScrollContainer.js +35 -50
- package/lib/Skeleton/Skeleton.js +25 -45
- package/lib/Skeleton/Skeleton.styles.js +28 -25
- package/lib/Skeleton/Skeleton.types.js +1 -5
- package/lib/Skeleton/index.js +2 -20
- package/lib/Slider/Slider.js +32 -56
- package/lib/Slider/index.js +1 -16
- package/lib/Slider/styles.js +41 -60
- package/lib/Slider/types.js +1 -5
- package/lib/StepNumber/StepNumber.js +26 -40
- package/lib/StepNumber/index.js +1 -16
- package/lib/StepNumber/styles.js +13 -24
- package/lib/StepNumber/types.js +1 -5
- package/lib/Stepper/Stepper.js +45 -62
- package/lib/Stepper/Stepper.styles.js +27 -44
- package/lib/Stepper/Stepper.types.js +1 -5
- package/lib/Stepper/index.js +1 -16
- package/lib/Switcher/Switcher.js +22 -34
- package/lib/Switcher/Switcher.styles.js +27 -42
- package/lib/Switcher/Switcher.types.js +1 -5
- package/lib/Switcher/index.js +1 -16
- package/lib/Tab/Tab.js +21 -33
- package/lib/Tab/Tab.styles.js +34 -50
- package/lib/Tab/Tab.types.js +1 -5
- package/lib/Tab/index.js +1 -16
- package/lib/Table/NewSelectableTable.js +59 -97
- package/lib/Table/SelectableTable.js +142 -189
- package/lib/Table/Table.js +110 -155
- package/lib/Table/Table.styles.js +67 -90
- package/lib/Table/Table.types.js +1 -5
- package/lib/Table/index.js +2 -27
- package/lib/TagsInput/TagsInput.js +32 -46
- package/lib/TagsInput/index.js +1 -16
- package/lib/TagsInput/style.js +45 -71
- package/lib/TagsInput/types.js +1 -5
- package/lib/Textarea/Textarea.js +52 -71
- package/lib/Textarea/Textarea.styles.js +91 -126
- package/lib/Textarea/Textarea.types.js +1 -5
- package/lib/Textarea/index.js +1 -16
- package/lib/ThemeProvider/ThemeProvider.js +41 -65
- package/lib/ThemeProvider/index.js +1 -16
- package/lib/Toast/Toast.js +53 -68
- package/lib/Toast/index.js +1 -16
- package/lib/Toast/styles.js +29 -49
- package/lib/Toast/types.js +1 -5
- package/lib/Toggle/Toggle.js +48 -65
- package/lib/Toggle/index.js +1 -16
- package/lib/Toggle/styles.d.ts +1 -1
- package/lib/Toggle/styles.js +66 -101
- package/lib/Toggle/types.js +1 -5
- package/lib/Tooltip/Tooltip.js +84 -121
- package/lib/Tooltip/index.js +2 -27
- package/lib/Tooltip/styles.js +61 -91
- package/lib/Tooltip/types.js +1 -5
- package/lib/Typography/Typography.js +78 -116
- package/lib/Typography/Typography.styles.js +61 -78
- package/lib/Typography/Typography.types.js +1 -5
- package/lib/Typography/index.js +3 -38
- package/lib/emotion.d.js +1 -3
- package/lib/hooks/index.js +3 -38
- package/lib/hooks/useForwardedRef.js +5 -11
- package/lib/hooks/useInfiniteScroll.js +13 -25
- package/lib/hooks/useStatefulRef.js +10 -23
- package/lib/index.js +49 -544
- package/lib/system-props/color.js +3 -9
- package/lib/system-props/index.js +2 -27
- package/lib/system-props/types.js +1 -5
- package/lib/theme/ColorSchemes/components/alerts.js +30 -38
- package/lib/theme/ColorSchemes/components/button.js +89 -97
- package/lib/theme/ColorSchemes/components/cards.js +16 -24
- package/lib/theme/ColorSchemes/components/charts.js +93 -101
- package/lib/theme/ColorSchemes/components/checkbox-input.js +13 -21
- package/lib/theme/ColorSchemes/components/divider.js +4 -12
- package/lib/theme/ColorSchemes/components/drawer.js +21 -29
- package/lib/theme/ColorSchemes/components/effects.js +5 -13
- package/lib/theme/ColorSchemes/components/filters.js +12 -20
- package/lib/theme/ColorSchemes/components/index.js +23 -258
- package/lib/theme/ColorSchemes/components/input.js +38 -46
- package/lib/theme/ColorSchemes/components/issues.js +27 -35
- package/lib/theme/ColorSchemes/components/label.js +33 -41
- package/lib/theme/ColorSchemes/components/list-orb.js +8 -16
- package/lib/theme/ColorSchemes/components/loading.js +4 -12
- package/lib/theme/ColorSchemes/components/logo.js +6 -14
- package/lib/theme/ColorSchemes/components/modals.js +6 -14
- package/lib/theme/ColorSchemes/components/navigation.js +17 -25
- package/lib/theme/ColorSchemes/components/progress-bar.js +5 -13
- package/lib/theme/ColorSchemes/components/selector.js +20 -28
- package/lib/theme/ColorSchemes/components/stepper.js +9 -17
- package/lib/theme/ColorSchemes/components/tables.js +12 -20
- package/lib/theme/ColorSchemes/components/tabs.js +13 -21
- package/lib/theme/ColorSchemes/components/tooltip.js +6 -14
- package/lib/theme/ColorSchemes/components/utils.js +1 -11
- package/lib/theme/ColorSchemes/dark/background.d.ts +27 -27
- package/lib/theme/ColorSchemes/dark/background.js +42 -50
- package/lib/theme/ColorSchemes/dark/border.d.ts +27 -27
- package/lib/theme/ColorSchemes/dark/border.js +37 -45
- package/lib/theme/ColorSchemes/dark/data.js +18 -24
- package/lib/theme/ColorSchemes/dark/icon.d.ts +27 -27
- package/lib/theme/ColorSchemes/dark/icon.js +40 -48
- package/lib/theme/ColorSchemes/dark/illustration.js +11 -17
- package/lib/theme/ColorSchemes/dark/index.js +60 -31
- package/lib/theme/ColorSchemes/dark/text.d.ts +27 -27
- package/lib/theme/ColorSchemes/dark/text.js +47 -54
- package/lib/theme/ColorSchemes/index.js +4 -49
- package/lib/theme/ColorSchemes/light/background.d.ts +27 -27
- package/lib/theme/ColorSchemes/light/background.js +42 -50
- package/lib/theme/ColorSchemes/light/border.d.ts +27 -27
- package/lib/theme/ColorSchemes/light/border.js +37 -45
- package/lib/theme/ColorSchemes/light/data.js +18 -24
- package/lib/theme/ColorSchemes/light/icon.d.ts +27 -27
- package/lib/theme/ColorSchemes/light/icon.js +40 -48
- package/lib/theme/ColorSchemes/light/illustration.js +11 -17
- package/lib/theme/ColorSchemes/light/index.d.ts +54 -54
- package/lib/theme/ColorSchemes/light/index.js +43 -19
- package/lib/theme/ColorSchemes/light/text.d.ts +27 -27
- package/lib/theme/ColorSchemes/light/text.js +47 -54
- package/lib/theme/ColorSchemes/primitives/blue.js +1 -7
- package/lib/theme/ColorSchemes/primitives/green.js +1 -7
- package/lib/theme/ColorSchemes/primitives/grey.js +1 -7
- package/lib/theme/ColorSchemes/primitives/index.d.ts +9 -9
- package/lib/theme/ColorSchemes/primitives/index.js +20 -18
- package/lib/theme/ColorSchemes/primitives/magenta.js +1 -7
- package/lib/theme/ColorSchemes/primitives/orange.js +1 -7
- package/lib/theme/ColorSchemes/primitives/purple.js +1 -7
- package/lib/theme/ColorSchemes/primitives/red.js +1 -7
- package/lib/theme/ColorSchemes/primitives/teal.js +1 -7
- package/lib/theme/ColorSchemes/primitives/yellow.js +1 -7
- package/lib/theme/ColorSchemes/semantics.js +7 -13
- package/lib/theme/index.js +2 -27
- package/lib/theme/theme.js +68 -77
- package/lib/types.js +1 -5
- package/lib/utils/hash.js +3 -9
- package/lib/utils/reactNodeToText.js +9 -17
- package/package.json +21 -11
|
@@ -1,103 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var _hooks = require("./hooks");
|
|
14
|
-
var _Icons = require("../../Icons");
|
|
15
|
-
var _Icon = require("../../Icon");
|
|
16
|
-
var _PillLabel = require("../../PillLabel");
|
|
17
|
-
var _lodash = require("lodash");
|
|
18
|
-
var _Typography = require("../../Typography");
|
|
19
|
-
var _Flexbox = require("../../Flexbox");
|
|
20
|
-
var _theme = require("../../theme");
|
|
21
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
-
var _excluded = ["isLoading", "value", "name", "disabled"];
|
|
23
|
-
var StyledFilterButton = /*#__PURE__*/(0, _base["default"])("button", process.env.NODE_ENV === "production" ? {
|
|
1
|
+
import _styled from "@emotion/styled/base";
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
import React, { useMemo } from 'react';
|
|
4
|
+
import { useDropdownTrigger } from './hooks';
|
|
5
|
+
import { ChevronDownIcon, SpinnerIcon } from '../../Icons';
|
|
6
|
+
import { Icon } from '../../Icon';
|
|
7
|
+
import { PillLabel } from '../../PillLabel';
|
|
8
|
+
import { startCase } from 'lodash';
|
|
9
|
+
import { Caption } from '../../Typography';
|
|
10
|
+
import { Flex } from '../../Flexbox';
|
|
11
|
+
import { transition } from '../../theme';
|
|
12
|
+
const StyledFilterButton = /*#__PURE__*/_styled("button", process.env.NODE_ENV === "production" ? {
|
|
24
13
|
target: "e2vnz6f0"
|
|
25
14
|
} : {
|
|
26
15
|
target: "e2vnz6f0",
|
|
27
16
|
label: "codacy"
|
|
28
|
-
})("background-color:",
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}, ";box-shadow:",
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}, ";
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
disabled = _ref11.disabled,
|
|
68
|
-
props = (0, _objectWithoutProperties2["default"])(_ref11, _excluded);
|
|
69
|
-
var dropdownContext = (0, _hooks.useDropdownTrigger)();
|
|
70
|
-
var iconProps = (0, _react.useMemo)(function () {
|
|
71
|
-
return isLoading ? {
|
|
72
|
-
icon: _Icons.SpinnerIcon,
|
|
73
|
-
spin: true
|
|
74
|
-
} : {
|
|
75
|
-
icon: _Icons.ChevronDownIcon,
|
|
76
|
-
flip: dropdownContext.open
|
|
77
|
-
};
|
|
17
|
+
})("background-color:", ({
|
|
18
|
+
theme,
|
|
19
|
+
disabled
|
|
20
|
+
}) => theme.colors[`filter-background-${disabled ? 'disabled' : 'enabled'}`], ";min-height:2rem;display:inline-flex!important;flex-direction:row;align-items:center;cursor:pointer;padding:", ({
|
|
21
|
+
theme
|
|
22
|
+
}) => `${theme.space[1]} ${theme.space[2]}`, ";border:", ({
|
|
23
|
+
theme,
|
|
24
|
+
isActive,
|
|
25
|
+
disabled
|
|
26
|
+
}) => `solid ${theme.borderWidths[0]} ${theme.colors[disabled ? 'filter-border-disabled' : isActive ? 'filter-border-active' : 'filter-border-enabled']}`, ";box-shadow:", ({
|
|
27
|
+
theme,
|
|
28
|
+
isActive
|
|
29
|
+
}) => isActive ? theme.effects.focus[0] : '0 0 0 0 transparent', ";transition:", transition(['box-shadow', 'border-color'], 'fast'), ";border-radius:", ({
|
|
30
|
+
theme
|
|
31
|
+
}) => theme.radii[1], ";height:", ({
|
|
32
|
+
size
|
|
33
|
+
}) => size === 'sm' ? '1.5rem' : '2rem', ";line-height:", ({
|
|
34
|
+
size
|
|
35
|
+
}) => `calc(${size === 'sm' ? '1.5rem' : '2rem'} - 2px)`, ";width:", ({
|
|
36
|
+
size
|
|
37
|
+
}) => size === 'lg' ? '14.75rem' : 'auto', ";justify-content:", ({
|
|
38
|
+
size
|
|
39
|
+
}) => size === 'lg' ? 'space-between' : 'flex-start', ";cursor:", ({
|
|
40
|
+
disabled
|
|
41
|
+
}) => disabled ? 'not-allowed' : 'pointer', ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9Ecm9wZG93bi9UcmlnZ2Vycy9GaWx0ZXJUcmlnZ2VyLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFhdUgiLCJmaWxlIjoiLi4vLi4vLi4vc3JjL0Ryb3Bkb3duL1RyaWdnZXJzL0ZpbHRlclRyaWdnZXIudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0LCB7IHVzZU1lbW8gfSBmcm9tICdyZWFjdCdcbmltcG9ydCB7IEZpbHRlclRyaWdnZXJQcm9wcyB9IGZyb20gJy4vdHlwZXMnXG5pbXBvcnQgeyB1c2VEcm9wZG93blRyaWdnZXIgfSBmcm9tICcuL2hvb2tzJ1xuaW1wb3J0IHsgQ2hldnJvbkRvd25JY29uLCBTcGlubmVySWNvbiB9IGZyb20gJy4uLy4uL0ljb25zJ1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnXG5pbXBvcnQgeyBJY29uUHJvcHMgfSBmcm9tICcuLi8uLi9JY29uL0ljb24udHlwZXMnXG5pbXBvcnQgeyBJY29uIH0gZnJvbSAnLi4vLi4vSWNvbidcbmltcG9ydCB7IFBpbGxMYWJlbCB9IGZyb20gJy4uLy4uL1BpbGxMYWJlbCdcbmltcG9ydCB7IHN0YXJ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bWUpKSA6IG5hbWV9XG4gICAgICAgICAgPC9DYXB0aW9uPlxuICAgICAgICAgIHtzZWxlY3RlZEl0ZW1zICYmIChcbiAgICAgICAgICAgIDxQaWxsTGFiZWwgbWw9ezF9IHN0YXR1cz17ZGlzYWJsZWQgPyAnZGVmYXVsdCcgOiAnaW5mbyd9PlxuICAgICAgICAgICAgICB7c2VsZWN0ZWRJdGVtc31cbiAgICAgICAgICAgIDwvUGlsbExhYmVsPlxuICAgICAgICAgICl9XG4gICAgICAgIDwvRmxleD5cblxuICAgICAgICA8SWNvbiB7Li4uaWNvblByb3BzfSBtbD17M30gY29sb3I9e2Rpc2FibGVkID8gJ2ZpbHRlci1pY29uLWRpc2FibGVkJyA6ICdmaWx0ZXItaWNvbi1lbmFibGVkJ30gLz5cbiAgICAgIDwvU3R5bGVkRmlsdGVyQnV0dG9uPlxuICAgIClcbiAgfVxuKVxuIl19 */"));
|
|
42
|
+
export const FilterTrigger = /*#__PURE__*/React.forwardRef(({
|
|
43
|
+
isLoading,
|
|
44
|
+
value,
|
|
45
|
+
name,
|
|
46
|
+
disabled,
|
|
47
|
+
...props
|
|
48
|
+
}, ref) => {
|
|
49
|
+
const dropdownContext = useDropdownTrigger();
|
|
50
|
+
const iconProps = useMemo(() => isLoading ? {
|
|
51
|
+
icon: SpinnerIcon,
|
|
52
|
+
spin: true
|
|
53
|
+
} : {
|
|
54
|
+
icon: ChevronDownIcon,
|
|
55
|
+
flip: dropdownContext.open
|
|
78
56
|
}, [dropdownContext.open, isLoading]);
|
|
79
|
-
|
|
80
|
-
return /*#__PURE__*/
|
|
57
|
+
const selectedItems = value && typeof value === 'number' && value > 0 ? value : undefined;
|
|
58
|
+
return /*#__PURE__*/React.createElement(StyledFilterButton, _extends({
|
|
81
59
|
isActive: dropdownContext.open,
|
|
82
60
|
disabled: disabled || isLoading,
|
|
83
61
|
onClick: dropdownContext.onClick,
|
|
84
62
|
ref: ref
|
|
85
|
-
}, props),
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, iconProps), {}, {
|
|
99
|
-
ml: 3,
|
|
100
|
-
color: disabled ? 'filter-icon-disabled' : 'filter-icon-enabled'
|
|
101
|
-
}))]
|
|
102
|
-
}));
|
|
63
|
+
}, props), /*#__PURE__*/React.createElement(Flex, {
|
|
64
|
+
alignItems: "center"
|
|
65
|
+
}, /*#__PURE__*/React.createElement(Caption, {
|
|
66
|
+
size: "md",
|
|
67
|
+
as: "div",
|
|
68
|
+
color: disabled || isLoading ? 'filter-text-disabled' : 'filter-text-enabled'
|
|
69
|
+
}, typeof name === 'string' ? name.indexOf(' ') > -1 ? name : startCase(name) : name), selectedItems && /*#__PURE__*/React.createElement(PillLabel, {
|
|
70
|
+
ml: 1,
|
|
71
|
+
status: disabled ? 'default' : 'info'
|
|
72
|
+
}, selectedItems)), /*#__PURE__*/React.createElement(Icon, _extends({}, iconProps, {
|
|
73
|
+
ml: 3,
|
|
74
|
+
color: disabled ? 'filter-icon-disabled' : 'filter-icon-enabled'
|
|
75
|
+
})));
|
|
103
76
|
});
|
|
@@ -1,30 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _hooks = require("./hooks");
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
var _excluded = ["onBeforeOpen", "onChange"];
|
|
15
|
-
var InputTrigger = exports.InputTrigger = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
16
|
-
var onBeforeOpen = _ref.onBeforeOpen,
|
|
17
|
-
_onChange = _ref.onChange,
|
|
18
|
-
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
19
|
-
var dropdownContext = (0, _hooks.useDropdownTrigger)();
|
|
20
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Input.Input, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), {}, {
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Input } from '../../Input';
|
|
4
|
+
import { useDropdownTrigger } from './hooks';
|
|
5
|
+
export const InputTrigger = /*#__PURE__*/React.forwardRef(({
|
|
6
|
+
onBeforeOpen,
|
|
7
|
+
onChange,
|
|
8
|
+
...props
|
|
9
|
+
}, ref) => {
|
|
10
|
+
const dropdownContext = useDropdownTrigger();
|
|
11
|
+
return /*#__PURE__*/React.createElement(Input, _extends({}, props, {
|
|
21
12
|
ref: ref,
|
|
22
13
|
size: dropdownContext.size,
|
|
23
|
-
onChange:
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
onChange: e => {
|
|
15
|
+
const value = e.currentTarget.value;
|
|
16
|
+
const needsToOpen = onBeforeOpen ? onBeforeOpen(value) : !!value;
|
|
26
17
|
if (needsToOpen) dropdownContext.setOpen(true);else dropdownContext.setOpen(false);
|
|
27
|
-
if (
|
|
18
|
+
if (onChange) onChange(e);
|
|
28
19
|
}
|
|
29
20
|
}));
|
|
30
21
|
});
|
|
@@ -1,30 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
var _Input = require("../../Input");
|
|
12
|
-
var _hooks = require("./hooks");
|
|
13
|
-
var _Icons = require("../../Icons");
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
var _excluded = ["caption"];
|
|
16
|
-
var SelectTrigger = exports.SelectTrigger = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Input } from '../../Input';
|
|
4
|
+
import { useDropdownTrigger } from './hooks';
|
|
5
|
+
import { ChevronDownIcon } from '../../Icons';
|
|
6
|
+
export const SelectTrigger = /*#__PURE__*/React.forwardRef(({
|
|
7
|
+
caption,
|
|
8
|
+
...props
|
|
9
|
+
}, ref) => {
|
|
17
10
|
var _dropdownContext$valu;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var dropdownContext = (0, _hooks.useDropdownTrigger)();
|
|
21
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Input.Input, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), {}, {
|
|
11
|
+
const dropdownContext = useDropdownTrigger();
|
|
12
|
+
return /*#__PURE__*/React.createElement(Input, _extends({}, props, {
|
|
22
13
|
ref: ref,
|
|
23
14
|
size: dropdownContext.size,
|
|
24
15
|
readOnly: true,
|
|
25
16
|
onClick: dropdownContext.onClick,
|
|
26
17
|
rightIcon: {
|
|
27
|
-
icon:
|
|
18
|
+
icon: ChevronDownIcon,
|
|
28
19
|
color: dropdownContext.open ? 'icon-enabled' : undefined,
|
|
29
20
|
flip: dropdownContext.open
|
|
30
21
|
},
|
|
@@ -1,42 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.useDropdownTrigger = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
9
|
-
var _react = require("react");
|
|
10
|
-
var _Dropdown = require("../Dropdown");
|
|
11
|
-
var useDropdownTrigger = exports.useDropdownTrigger = function useDropdownTrigger() {
|
|
12
|
-
var dropdownContext = (0, _Dropdown.useDropdownContext)();
|
|
13
|
-
var onClick = (0, _react.useCallback)(function () {
|
|
14
|
-
dropdownContext.setOpen(function (isOpen) {
|
|
15
|
-
return !isOpen;
|
|
16
|
-
});
|
|
1
|
+
import { useCallback, useEffect } from 'react';
|
|
2
|
+
import { useDropdownContext } from '../Dropdown';
|
|
3
|
+
export const useDropdownTrigger = () => {
|
|
4
|
+
const dropdownContext = useDropdownContext();
|
|
5
|
+
const onClick = useCallback(() => {
|
|
6
|
+
dropdownContext.setOpen(isOpen => !isOpen);
|
|
17
7
|
}, [dropdownContext]);
|
|
18
|
-
|
|
8
|
+
const handleSurroundings = useCallback(event => {
|
|
19
9
|
var _dropdownContext$pane, _dropdownContext$trig;
|
|
20
|
-
|
|
10
|
+
const portalDropdown = document.querySelector('#dropdown-panel[data-popper-escaped="true"]');
|
|
21
11
|
|
|
22
12
|
// Check if the click was inside the dropdown or inside nested dropdown that uses portal prop
|
|
23
|
-
|
|
13
|
+
const didClickInsideDropdown = portalDropdown && portalDropdown.contains(event.target) || ((_dropdownContext$pane = dropdownContext.panelRef) === null || _dropdownContext$pane === void 0 ? void 0 : _dropdownContext$pane.contains(event.target));
|
|
24
14
|
if (!((_dropdownContext$trig = dropdownContext.triggerRef) !== null && _dropdownContext$trig !== void 0 && _dropdownContext$trig.contains(event.target)) && !didClickInsideDropdown) {
|
|
25
15
|
dropdownContext.setOpen(false);
|
|
26
16
|
}
|
|
27
17
|
}, [dropdownContext]);
|
|
28
|
-
|
|
18
|
+
const handleEscape = useCallback(event => {
|
|
29
19
|
if (event.key === 'Escape') {
|
|
30
20
|
dropdownContext.setOpen(false);
|
|
31
21
|
}
|
|
32
22
|
}, [dropdownContext]);
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
const subscribe = () => {
|
|
35
25
|
document.addEventListener('focusin', handleSurroundings);
|
|
36
26
|
document.addEventListener('click', handleSurroundings);
|
|
37
27
|
document.addEventListener('keydown', handleEscape);
|
|
38
28
|
};
|
|
39
|
-
|
|
29
|
+
const unsubscribe = () => {
|
|
40
30
|
document.removeEventListener('focusin', handleSurroundings);
|
|
41
31
|
document.removeEventListener('click', handleSurroundings);
|
|
42
32
|
document.removeEventListener('keydown', handleEscape);
|
|
@@ -44,7 +34,8 @@ var useDropdownTrigger = exports.useDropdownTrigger = function useDropdownTrigge
|
|
|
44
34
|
if (dropdownContext.open) subscribe();else unsubscribe();
|
|
45
35
|
return unsubscribe;
|
|
46
36
|
}, [dropdownContext.open, dropdownContext.panelRef, dropdownContext.triggerRef, handleEscape, handleSurroundings]);
|
|
47
|
-
return
|
|
48
|
-
|
|
49
|
-
|
|
37
|
+
return {
|
|
38
|
+
...dropdownContext,
|
|
39
|
+
onClick
|
|
40
|
+
};
|
|
50
41
|
};
|
|
@@ -1,71 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.keys(_SelectTrigger).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _SelectTrigger[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function get() {
|
|
13
|
-
return _SelectTrigger[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _DropdownButtonTrigger = require("./DropdownButtonTrigger");
|
|
18
|
-
Object.keys(_DropdownButtonTrigger).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _DropdownButtonTrigger[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function get() {
|
|
24
|
-
return _DropdownButtonTrigger[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
var _DropdownItemTrigger = require("./DropdownItemTrigger");
|
|
29
|
-
Object.keys(_DropdownItemTrigger).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] === _DropdownItemTrigger[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function get() {
|
|
35
|
-
return _DropdownItemTrigger[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
var _FilterTrigger = require("./FilterTrigger");
|
|
40
|
-
Object.keys(_FilterTrigger).forEach(function (key) {
|
|
41
|
-
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (key in exports && exports[key] === _FilterTrigger[key]) return;
|
|
43
|
-
Object.defineProperty(exports, key, {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function get() {
|
|
46
|
-
return _FilterTrigger[key];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
var _InputTrigger = require("./InputTrigger");
|
|
51
|
-
Object.keys(_InputTrigger).forEach(function (key) {
|
|
52
|
-
if (key === "default" || key === "__esModule") return;
|
|
53
|
-
if (key in exports && exports[key] === _InputTrigger[key]) return;
|
|
54
|
-
Object.defineProperty(exports, key, {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function get() {
|
|
57
|
-
return _InputTrigger[key];
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
var _hooks = require("./hooks");
|
|
62
|
-
Object.keys(_hooks).forEach(function (key) {
|
|
63
|
-
if (key === "default" || key === "__esModule") return;
|
|
64
|
-
if (key in exports && exports[key] === _hooks[key]) return;
|
|
65
|
-
Object.defineProperty(exports, key, {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
get: function get() {
|
|
68
|
-
return _hooks[key];
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
});
|
|
1
|
+
export * from './SelectTrigger';
|
|
2
|
+
export * from './DropdownButtonTrigger';
|
|
3
|
+
export * from './DropdownItemTrigger';
|
|
4
|
+
export * from './FilterTrigger';
|
|
5
|
+
export * from './InputTrigger';
|
|
6
|
+
export * from './hooks';
|
package/lib/Dropdown/index.js
CHANGED
|
@@ -1,49 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
var _Dropdown = require("./Dropdown");
|
|
7
|
-
Object.keys(_Dropdown).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _Dropdown[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function get() {
|
|
13
|
-
return _Dropdown[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _Dropdown2 = require("./Dropdown.styles");
|
|
18
|
-
Object.keys(_Dropdown2).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _Dropdown2[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function get() {
|
|
24
|
-
return _Dropdown2[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
var _Triggers = require("./Triggers");
|
|
29
|
-
Object.keys(_Triggers).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] === _Triggers[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function get() {
|
|
35
|
-
return _Triggers[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
var _Content = require("./Content");
|
|
40
|
-
Object.keys(_Content).forEach(function (key) {
|
|
41
|
-
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (key in exports && exports[key] === _Content[key]) return;
|
|
43
|
-
Object.defineProperty(exports, key, {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function get() {
|
|
46
|
-
return _Content[key];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
1
|
+
export * from './Dropdown';
|
|
2
|
+
export * from './Dropdown.styles';
|
|
3
|
+
export * from './Triggers';
|
|
4
|
+
export * from './Content';
|
|
@@ -1,49 +1,34 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyledExpandableBox, StyledAnimateHeight, StyledBox } from './ExpandableBox.styles';
|
|
3
|
+
import { Box } from '../Flexbox';
|
|
2
4
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.ExpandableBox = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
9
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
var _ExpandableBox = require("./ExpandableBox.styles");
|
|
12
|
-
var _Flexbox = require("../Flexbox");
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
var _excluded = ["children", "expanded", "primaryColor", "secondaryColor", "animating", "setAnimating", "expandableContentChildren"];
|
|
15
5
|
/**
|
|
16
6
|
* Description for ExpandableBox
|
|
17
7
|
*/
|
|
18
|
-
var ANIMATION_DURATION = 300; // in milliseconds
|
|
19
8
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
children: expandableContentChildren
|
|
46
|
-
})
|
|
47
|
-
})]
|
|
48
|
-
}));
|
|
9
|
+
const ANIMATION_DURATION = 300; // in milliseconds
|
|
10
|
+
|
|
11
|
+
export const ExpandableBox = ({
|
|
12
|
+
children,
|
|
13
|
+
expanded,
|
|
14
|
+
primaryColor,
|
|
15
|
+
secondaryColor,
|
|
16
|
+
animating,
|
|
17
|
+
setAnimating,
|
|
18
|
+
expandableContentChildren,
|
|
19
|
+
...props
|
|
20
|
+
}) => {
|
|
21
|
+
return /*#__PURE__*/React.createElement(Box, props, /*#__PURE__*/React.createElement(StyledExpandableBox, {
|
|
22
|
+
primaryColor: primaryColor,
|
|
23
|
+
expanded: expanded,
|
|
24
|
+
padding: 4
|
|
25
|
+
}, children), /*#__PURE__*/React.createElement(StyledAnimateHeight, {
|
|
26
|
+
secondaryColor: secondaryColor,
|
|
27
|
+
duration: ANIMATION_DURATION,
|
|
28
|
+
height: expanded ? 'auto' : 0,
|
|
29
|
+
easing: "ease-in-out",
|
|
30
|
+
onAnimationEnd: () => setAnimating === null || setAnimating === void 0 ? void 0 : setAnimating(false)
|
|
31
|
+
}, (expanded || animating) && /*#__PURE__*/React.createElement(StyledBox, {
|
|
32
|
+
p: 4
|
|
33
|
+
}, expandableContentChildren)));
|
|
49
34
|
};
|