@codacy/ui-components 0.66.25 → 0.66.27
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.d.ts +1 -0
- package/lib/hooks/index.js +4 -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,7 +1,7 @@
|
|
|
1
1
|
export declare const primitiveColors: {
|
|
2
|
+
"yellow-00": string;
|
|
2
3
|
"yellow-10": string;
|
|
3
4
|
"yellow-20": string;
|
|
4
|
-
"yellow-00": string;
|
|
5
5
|
"yellow-30": string;
|
|
6
6
|
"yellow-40": string;
|
|
7
7
|
"yellow-50": string;
|
|
@@ -11,9 +11,9 @@ export declare const primitiveColors: {
|
|
|
11
11
|
"yellow-90": string;
|
|
12
12
|
"yellow-95": string;
|
|
13
13
|
"yellow-98": string;
|
|
14
|
+
"teal-00": string;
|
|
14
15
|
"teal-10": string;
|
|
15
16
|
"teal-20": string;
|
|
16
|
-
"teal-00": string;
|
|
17
17
|
"teal-30": string;
|
|
18
18
|
"teal-40": string;
|
|
19
19
|
"teal-50": string;
|
|
@@ -23,9 +23,9 @@ export declare const primitiveColors: {
|
|
|
23
23
|
"teal-90": string;
|
|
24
24
|
"teal-95": string;
|
|
25
25
|
"teal-98": string;
|
|
26
|
+
"red-00": string;
|
|
26
27
|
"red-10": string;
|
|
27
28
|
"red-20": string;
|
|
28
|
-
"red-00": string;
|
|
29
29
|
"red-30": string;
|
|
30
30
|
"red-40": string;
|
|
31
31
|
"red-50": string;
|
|
@@ -47,9 +47,9 @@ export declare const primitiveColors: {
|
|
|
47
47
|
"purple-95": string;
|
|
48
48
|
"purple-98": string;
|
|
49
49
|
"purple-08": string;
|
|
50
|
+
"orange-00": string;
|
|
50
51
|
"orange-10": string;
|
|
51
52
|
"orange-20": string;
|
|
52
|
-
"orange-00": string;
|
|
53
53
|
"orange-30": string;
|
|
54
54
|
"orange-40": string;
|
|
55
55
|
"orange-50": string;
|
|
@@ -59,9 +59,9 @@ export declare const primitiveColors: {
|
|
|
59
59
|
"orange-90": string;
|
|
60
60
|
"orange-95": string;
|
|
61
61
|
"orange-98": string;
|
|
62
|
+
"magenta-00": string;
|
|
62
63
|
"magenta-10": string;
|
|
63
64
|
"magenta-20": string;
|
|
64
|
-
"magenta-00": string;
|
|
65
65
|
"magenta-30": string;
|
|
66
66
|
"magenta-40": string;
|
|
67
67
|
"magenta-50": string;
|
|
@@ -71,10 +71,9 @@ export declare const primitiveColors: {
|
|
|
71
71
|
"magenta-90": string;
|
|
72
72
|
"magenta-95": string;
|
|
73
73
|
"magenta-98": string;
|
|
74
|
+
"grey-00": string;
|
|
74
75
|
"grey-10": string;
|
|
75
|
-
"grey-15": string;
|
|
76
76
|
"grey-20": string;
|
|
77
|
-
"grey-00": string;
|
|
78
77
|
"grey-30": string;
|
|
79
78
|
"grey-40": string;
|
|
80
79
|
"grey-50": string;
|
|
@@ -85,10 +84,11 @@ export declare const primitiveColors: {
|
|
|
85
84
|
"grey-95": string;
|
|
86
85
|
"grey-98": string;
|
|
87
86
|
"grey-05": string;
|
|
87
|
+
"grey-15": string;
|
|
88
88
|
"grey-100": string;
|
|
89
|
+
"green-00": string;
|
|
89
90
|
"green-10": string;
|
|
90
91
|
"green-20": string;
|
|
91
|
-
"green-00": string;
|
|
92
92
|
"green-30": string;
|
|
93
93
|
"green-40": string;
|
|
94
94
|
"green-50": string;
|
|
@@ -98,9 +98,9 @@ export declare const primitiveColors: {
|
|
|
98
98
|
"green-90": string;
|
|
99
99
|
"green-95": string;
|
|
100
100
|
"green-98": string;
|
|
101
|
+
"blue-00": string;
|
|
101
102
|
"blue-10": string;
|
|
102
103
|
"blue-20": string;
|
|
103
|
-
"blue-00": string;
|
|
104
104
|
"blue-30": string;
|
|
105
105
|
"blue-40": string;
|
|
106
106
|
"blue-50": string;
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { blue } from './blue';
|
|
2
|
+
import { green } from './green';
|
|
3
|
+
import { grey } from './grey';
|
|
4
|
+
import { magenta } from './magenta';
|
|
5
|
+
import { orange } from './orange';
|
|
6
|
+
import { purple } from './purple';
|
|
7
|
+
import { red } from './red';
|
|
8
|
+
import { teal } from './teal';
|
|
9
|
+
import { yellow } from './yellow';
|
|
10
|
+
export const primitiveColors = {
|
|
11
|
+
...blue,
|
|
12
|
+
...green,
|
|
13
|
+
...grey,
|
|
14
|
+
...magenta,
|
|
15
|
+
...orange,
|
|
16
|
+
...purple,
|
|
17
|
+
...red,
|
|
18
|
+
...teal,
|
|
19
|
+
...yellow
|
|
20
|
+
};
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.semanticFunctionalColorsFx = void 0;
|
|
7
|
-
var _primitives = require("./primitives");
|
|
8
|
-
var semantics = ['danger', 'success', 'warning', 'info', 'attention', 'critical', 'high', 'medium', 'minor'];
|
|
9
|
-
var semanticFunctionalColorsFx = exports.semanticFunctionalColorsFx = function semanticFunctionalColorsFx(prefix, number) {
|
|
10
|
-
var colors = {};
|
|
11
|
-
var semanticMapToColor = {
|
|
1
|
+
import { primitiveColors } from './primitives';
|
|
2
|
+
const semantics = ['danger', 'success', 'warning', 'info', 'attention', 'critical', 'high', 'medium', 'minor'];
|
|
3
|
+
export const semanticFunctionalColorsFx = (prefix, number) => {
|
|
4
|
+
const colors = {};
|
|
5
|
+
const semanticMapToColor = {
|
|
12
6
|
danger: 'red',
|
|
13
7
|
success: 'green',
|
|
14
8
|
warning: 'yellow',
|
|
@@ -19,8 +13,8 @@ var semanticFunctionalColorsFx = exports.semanticFunctionalColorsFx = function s
|
|
|
19
13
|
medium: 'yellow',
|
|
20
14
|
minor: 'blue'
|
|
21
15
|
};
|
|
22
|
-
semantics.map(
|
|
23
|
-
return colors[
|
|
16
|
+
semantics.map(semantic => {
|
|
17
|
+
return colors[`${prefix}-${semantic}`] = primitiveColors[`${semanticMapToColor[semantic]}-${number}`];
|
|
24
18
|
});
|
|
25
19
|
return colors;
|
|
26
20
|
};
|
package/lib/theme/index.js
CHANGED
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _ColorSchemes = require("./ColorSchemes");
|
|
7
|
-
Object.keys(_ColorSchemes).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _ColorSchemes[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function get() {
|
|
13
|
-
return _ColorSchemes[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _theme = require("./theme");
|
|
18
|
-
Object.keys(_theme).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _theme[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function get() {
|
|
24
|
-
return _theme[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
1
|
+
export * from './ColorSchemes';
|
|
2
|
+
export * from './theme';
|
package/lib/theme/theme.js
CHANGED
|
@@ -1,30 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
import { codacyThemeColors, darkCodacyThemeColors } from './';
|
|
2
|
+
import { rgba } from 'polished';
|
|
2
3
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.transition = exports.generateTheme = exports.darkCodacyTheme = exports.codacyTheme = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
9
|
-
var _ = require("./");
|
|
10
|
-
var _polished = require("polished");
|
|
11
4
|
// Types
|
|
12
5
|
|
|
13
6
|
// *** Theme Standard Values ***********************
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var remScale = 16;
|
|
20
|
-
var gridSize = 0.5; /* rem */
|
|
21
|
-
var borderWidths = ['1px', '0.125rem', '0.25rem'];
|
|
22
|
-
var fonts = {
|
|
7
|
+
const fontStack = fonts => fonts.map(font => font.includes(' ') ? `"${font}"` : font).join(', ');
|
|
8
|
+
const remScale = 16;
|
|
9
|
+
const gridSize = 0.5; /* rem */
|
|
10
|
+
const borderWidths = ['1px', '0.125rem', '0.25rem'];
|
|
11
|
+
const fonts = {
|
|
23
12
|
normal: fontStack(['Inter', 'arial', 'system-ui', 'sans-serif']),
|
|
24
13
|
display: fontStack(['Inter', 'arial', 'system-ui', 'sans-serif']),
|
|
25
14
|
monospace: fontStack(['Menlo', 'Consolas', 'ui-monospace', 'monospace'])
|
|
26
15
|
};
|
|
27
|
-
|
|
16
|
+
const fontSizes = [/** fontSize-00 */'0.5rem',
|
|
28
17
|
// 8px: xxs
|
|
29
18
|
/** fontSize-01 */
|
|
30
19
|
'0.625rem',
|
|
@@ -50,41 +39,51 @@ var fontSizes = [/** fontSize-00 */'0.5rem',
|
|
|
50
39
|
/** fontSize-08 */
|
|
51
40
|
'2.25rem' // 36px: xh
|
|
52
41
|
];
|
|
53
|
-
|
|
42
|
+
const space = [/** space-00 */'0', /** space-01 */`${gridSize * 0.5}rem`,
|
|
43
|
+
// 4px
|
|
54
44
|
/** space-02 */
|
|
55
|
-
|
|
45
|
+
`${gridSize}rem`,
|
|
46
|
+
// 8px
|
|
56
47
|
/** space-03 */
|
|
57
|
-
|
|
48
|
+
`${gridSize * 1.5}rem`,
|
|
49
|
+
// 12px
|
|
58
50
|
/** space-04 */
|
|
59
|
-
|
|
51
|
+
`${gridSize * 2}rem`,
|
|
52
|
+
// 16px
|
|
60
53
|
/** space-05 */
|
|
61
|
-
|
|
54
|
+
`${gridSize * 3}rem`,
|
|
55
|
+
// 24px
|
|
62
56
|
/** space-06 */
|
|
63
|
-
|
|
57
|
+
`${gridSize * 4}rem`,
|
|
58
|
+
// 32px
|
|
64
59
|
/** space-07 */
|
|
65
|
-
|
|
60
|
+
`${gridSize * 5}rem`,
|
|
61
|
+
// 40px
|
|
66
62
|
/** space-08 */
|
|
67
|
-
|
|
63
|
+
`${gridSize * 6}rem`,
|
|
64
|
+
// 48px
|
|
68
65
|
/** space-09 */
|
|
69
|
-
|
|
66
|
+
`${gridSize * 8}rem` // 64px
|
|
70
67
|
];
|
|
71
|
-
|
|
68
|
+
const sizes = [/** size-00 */`${gridSize * 9}rem`,
|
|
69
|
+
// 72px
|
|
72
70
|
/** size-01 */
|
|
73
|
-
|
|
71
|
+
`${gridSize * 19}rem`,
|
|
72
|
+
// 152px
|
|
74
73
|
/** size-02 */
|
|
75
|
-
|
|
74
|
+
`${gridSize * 31}rem`,
|
|
75
|
+
// 248px
|
|
76
76
|
/** size-03 */
|
|
77
|
-
|
|
77
|
+
`${gridSize * 44.5}rem`,
|
|
78
|
+
// 356px
|
|
78
79
|
/** size-04 */
|
|
79
|
-
|
|
80
|
+
`${gridSize * 56.5}rem` // 452px
|
|
80
81
|
];
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
var breakpoints = ['85.1rem' /* > 1360px */, '90.1rem' /* > 1440px */, '105.1rem' /* > 1680px */];
|
|
87
|
-
var zIndices = {
|
|
82
|
+
const radii = ['0.125rem' /* 2px */, '0.25rem' /* 4px */, '0.5rem' /* 8px */];
|
|
83
|
+
const shadowsFx = scheme => [`0 0.0625rem 0.125rem ${rgba(scheme['border-subtle-hover'], 0.2)}`, `0 0.125rem 0.375rem ${rgba(scheme['border-subtle-hover'], 0.3)}`, `0 0.125rem 0.375rem ${rgba(scheme['border-subtle-hover'], 0.2)}, 0 0.125rem 0.5rem ${rgba(scheme['border-subtle-hover'], 0.1)}`, `0 0.25rem 0.5rem ${rgba(scheme['border-subtle-hover'], 0.2)}, 0 0.25rem 0.75rem ${rgba(scheme['border-subtle-hover'], 0.1)}`, `0 0.75rem 1rem ${rgba(scheme['border-subtle-hover'], 0.2)}, 0 0.75rem 1.5rem ${rgba(scheme['border-subtle-hover'], 0.1)}`];
|
|
84
|
+
const transitions = ['0.2s ease-in-out', '0.35s ease-in-out', '0.75s ease-in-out'];
|
|
85
|
+
const breakpoints = ['85.1rem' /* > 1360px */, '90.1rem' /* > 1440px */, '105.1rem' /* > 1680px */];
|
|
86
|
+
const zIndices = {
|
|
88
87
|
inactive: -1,
|
|
89
88
|
body: 1000,
|
|
90
89
|
modal: 1010,
|
|
@@ -96,14 +95,14 @@ var zIndices = {
|
|
|
96
95
|
navbar: 1060,
|
|
97
96
|
tooltip: 1070
|
|
98
97
|
};
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
gridSize
|
|
104
|
-
remScale
|
|
105
|
-
borderWidths
|
|
106
|
-
fonts
|
|
98
|
+
const lineHeights = ['1.1875rem', '1.9375rem', '2.75rem'];
|
|
99
|
+
const fontWeights = ['200', '400', '500', '600'];
|
|
100
|
+
const letterSpacings = ['normal'];
|
|
101
|
+
const baseTheme = {
|
|
102
|
+
gridSize,
|
|
103
|
+
remScale,
|
|
104
|
+
borderWidths,
|
|
105
|
+
fonts,
|
|
107
106
|
fontSizes: {
|
|
108
107
|
xxs: fontSizes[0],
|
|
109
108
|
xs: fontSizes[1],
|
|
@@ -121,18 +120,18 @@ var baseTheme = {
|
|
|
121
120
|
medium: fontWeights[2],
|
|
122
121
|
'semi-bold': fontWeights[3]
|
|
123
122
|
}),
|
|
124
|
-
lineHeights
|
|
125
|
-
space
|
|
126
|
-
sizes
|
|
127
|
-
radii
|
|
123
|
+
lineHeights,
|
|
124
|
+
space,
|
|
125
|
+
sizes,
|
|
126
|
+
radii,
|
|
128
127
|
transitions: Object.assign(transitions, {
|
|
129
128
|
fast: transitions[0],
|
|
130
129
|
normal: transitions[1],
|
|
131
130
|
slow: transitions[2]
|
|
132
131
|
}),
|
|
133
|
-
breakpoints
|
|
134
|
-
zIndices
|
|
135
|
-
letterSpacings
|
|
132
|
+
breakpoints,
|
|
133
|
+
zIndices,
|
|
134
|
+
letterSpacings,
|
|
136
135
|
controlSize: {
|
|
137
136
|
xs: sizes[0],
|
|
138
137
|
sm: sizes[1],
|
|
@@ -147,27 +146,19 @@ var baseTheme = {
|
|
|
147
146
|
};
|
|
148
147
|
|
|
149
148
|
// Helper functions
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
shadows: shadowsFx(scheme),
|
|
163
|
-
effects: {
|
|
164
|
-
elevation: ["0 0.1875rem 0.375rem 0 ".concat(scheme['effect-elevation-1']), "0 0.75rem 1.5rem 0 ".concat(scheme['effect-elevation-2'])],
|
|
165
|
-
focus: ["0 0 0 0.25rem ".concat(scheme['background-brand-subtle']), "0 0 0 0.25rem ".concat(scheme['background-brand-enabled'], "33")],
|
|
166
|
-
error: ["0 0 0 0.25rem ".concat(scheme['background-danger']), "0 0 0 0.25rem ".concat(scheme['background-danger-disabled'])]
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
};
|
|
149
|
+
export const transition = (properties, speed, refTheme = baseTheme) => properties.map(p => `${p} ${refTheme.transitions[speed || 'normal']}`).join(', ');
|
|
150
|
+
export const generateTheme = scheme => ({
|
|
151
|
+
...baseTheme,
|
|
152
|
+
colors: scheme,
|
|
153
|
+
borders: borderWidths.map(w => `solid ${w} ${scheme['border-primary']}`),
|
|
154
|
+
shadows: shadowsFx(scheme),
|
|
155
|
+
effects: {
|
|
156
|
+
elevation: [`0 0.1875rem 0.375rem 0 ${scheme['effect-elevation-1']}`, `0 0.75rem 1.5rem 0 ${scheme['effect-elevation-2']}`],
|
|
157
|
+
focus: [`0 0 0 0.25rem ${scheme['background-brand-subtle']}`, `0 0 0 0.25rem ${scheme['background-brand-enabled']}33`],
|
|
158
|
+
error: [`0 0 0 0.25rem ${scheme['background-danger']}`, `0 0 0 0.25rem ${scheme['background-danger-disabled']}`]
|
|
159
|
+
}
|
|
160
|
+
});
|
|
170
161
|
|
|
171
162
|
// Themes
|
|
172
|
-
|
|
173
|
-
|
|
163
|
+
export const codacyTheme = generateTheme(codacyThemeColors);
|
|
164
|
+
export const darkCodacyTheme = generateTheme(darkCodacyThemeColors);
|
package/lib/types.js
CHANGED
package/lib/utils/hash.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.hash = void 0;
|
|
7
|
-
var hash = exports.hash = function hash(s) {
|
|
8
|
-
var h = 9;
|
|
9
|
-
for (var i = 0; i < s.length;) h = Math.imul(h ^ s.charCodeAt(i++), Math.pow(9, 9));
|
|
1
|
+
export const hash = s => {
|
|
2
|
+
let h = 9;
|
|
3
|
+
for (let i = 0; i < s.length;) h = Math.imul(h ^ s.charCodeAt(i++), 9 ** 9);
|
|
10
4
|
return h ^ h >>> 9;
|
|
11
5
|
};
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.reactNodeToText = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
1
|
// From https://github.com/fernandopasik/react-children-utilities
|
|
9
2
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var childToString = function childToString(child) {
|
|
3
|
+
import { Children, isValidElement } from 'react';
|
|
4
|
+
const hasChildren = element => /*#__PURE__*/isValidElement(element) && Boolean(element.props.children);
|
|
5
|
+
const childToString = child => {
|
|
14
6
|
if (typeof child === 'undefined' || child === null || typeof child === 'boolean') {
|
|
15
7
|
return '';
|
|
16
8
|
}
|
|
@@ -19,15 +11,15 @@ var childToString = function childToString(child) {
|
|
|
19
11
|
}
|
|
20
12
|
return child.toString();
|
|
21
13
|
};
|
|
22
|
-
|
|
23
|
-
if (!(children instanceof Array) && ! /*#__PURE__*/
|
|
14
|
+
export const reactNodeToText = children => {
|
|
15
|
+
if (!(children instanceof Array) && ! /*#__PURE__*/isValidElement(children)) {
|
|
24
16
|
return childToString(children);
|
|
25
17
|
}
|
|
26
|
-
return
|
|
27
|
-
|
|
28
|
-
if ( /*#__PURE__*/
|
|
18
|
+
return Children.toArray(children).reduce((text, child) => {
|
|
19
|
+
let newText = '';
|
|
20
|
+
if ( /*#__PURE__*/isValidElement(child) && hasChildren(child)) {
|
|
29
21
|
newText = reactNodeToText(child.props.children);
|
|
30
|
-
} else if ( /*#__PURE__*/
|
|
22
|
+
} else if ( /*#__PURE__*/isValidElement(child) && !hasChildren(child)) {
|
|
31
23
|
newText = '';
|
|
32
24
|
} else {
|
|
33
25
|
newText = childToString(child);
|
package/package.json
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codacy/ui-components",
|
|
3
|
-
"version": "0.66.
|
|
3
|
+
"version": "0.66.27",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "",
|
|
7
|
+
"type": "module",
|
|
7
8
|
"main": "lib/index.js",
|
|
9
|
+
"module": "lib/index.js",
|
|
10
|
+
"types": "lib/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./lib/index.d.ts",
|
|
14
|
+
"import": "./lib/index.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
8
17
|
"files": [
|
|
9
18
|
"lib/"
|
|
10
19
|
],
|
|
@@ -12,7 +21,7 @@
|
|
|
12
21
|
"scripts": {
|
|
13
22
|
"build": "rimraf lib && npm run build:types && npm run build:js",
|
|
14
23
|
"build-storybook": "storybook build",
|
|
15
|
-
"build:js": "NODE_ENV=production babel src -d lib --extensions \".ts,.tsx,.jsx\" --ignore src/
|
|
24
|
+
"build:js": "NODE_ENV=production babel src -d lib --extensions \".ts,.tsx,.jsx\" --ignore src/vitestSetup.ts,src/test-utils,\"src/**/*.spec.ts\",\"src/**/*.test.tsx\"",
|
|
16
25
|
"build:types": "tsc -p tsconfig.prod.json --emitDeclarationOnly",
|
|
17
26
|
"check-types": "tsc --noEmit",
|
|
18
27
|
"check-types:watch": "npm run check-types -- --watch",
|
|
@@ -22,9 +31,8 @@
|
|
|
22
31
|
"lint-cmd": "eslint --ignore-path .eslintignore --ext .js,.jsx,.ts,.tsx",
|
|
23
32
|
"lint-staged": "lint-staged",
|
|
24
33
|
"storybook": "storybook dev -p 6006",
|
|
25
|
-
"test": "
|
|
26
|
-
"test:
|
|
27
|
-
"test:coverage": "jest --coverage --maxWorkers=4"
|
|
34
|
+
"test": "vitest",
|
|
35
|
+
"test:coverage": "vitest run --coverage"
|
|
28
36
|
},
|
|
29
37
|
"dependencies": {
|
|
30
38
|
"@babel/runtime": "^7.23.6",
|
|
@@ -56,11 +64,11 @@
|
|
|
56
64
|
"@testing-library/dom": "^8.16.0",
|
|
57
65
|
"@testing-library/jest-dom": "^5.11.6",
|
|
58
66
|
"@testing-library/react": "^13.3.0",
|
|
59
|
-
"@testing-library/react-hooks": "^3.4.2",
|
|
60
67
|
"@types/autosize": "^3.0.7",
|
|
61
|
-
"@types/
|
|
68
|
+
"@types/jsdom": "^21.1.7",
|
|
62
69
|
"@types/lodash": "^4.14.165",
|
|
63
70
|
"@types/md5": "^2.2.1",
|
|
71
|
+
"@types/node": "^20.0.0",
|
|
64
72
|
"@types/numeral": "^2.0.2",
|
|
65
73
|
"@types/react": "^18.0.15",
|
|
66
74
|
"@types/react-dom": "^18.0.6",
|
|
@@ -69,6 +77,8 @@
|
|
|
69
77
|
"@types/styled-system__should-forward-prop": "^5.1.4",
|
|
70
78
|
"@typescript-eslint/eslint-plugin": "^6.13.2",
|
|
71
79
|
"@typescript-eslint/parser": "^6.13.2",
|
|
80
|
+
"@vitejs/plugin-react": "^4.7.0",
|
|
81
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
72
82
|
"babel-loader": "^9.1.3",
|
|
73
83
|
"babel-preset-react-app": "^10.0.1",
|
|
74
84
|
"copy-to-clipboard": "^3.3.1",
|
|
@@ -85,9 +95,7 @@
|
|
|
85
95
|
"eslint-plugin-react-hooks": "^1.7.0",
|
|
86
96
|
"fontsource-inter": "^4.0.0",
|
|
87
97
|
"husky": "^4.3.0",
|
|
88
|
-
"
|
|
89
|
-
"jest-environment-jsdom": "^29.7.0",
|
|
90
|
-
"jest-watch-typeahead": "^1.0.0",
|
|
98
|
+
"jsdom": "^26.1.0",
|
|
91
99
|
"lint-staged": "^12.5.0",
|
|
92
100
|
"lodash": "^4.17.20",
|
|
93
101
|
"numeral": "^2.0.6",
|
|
@@ -102,7 +110,9 @@
|
|
|
102
110
|
"rimraf": "^3.0.2",
|
|
103
111
|
"storybook": "^8.1.9",
|
|
104
112
|
"styled-system": "^5.1.5",
|
|
105
|
-
"typescript": "^4.5.4"
|
|
113
|
+
"typescript": "^4.5.4",
|
|
114
|
+
"vite": "^7.0.6",
|
|
115
|
+
"vitest": "^3.2.4"
|
|
106
116
|
},
|
|
107
117
|
"peerDependencies": {
|
|
108
118
|
"@emotion/react": "^11.11.1",
|