@jetbrains/ring-ui 5.0.0-beta.3 → 5.0.0-beta.7
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/CHANGELOG.md +49 -1
- package/babel.config.js +1 -12
- package/components/alert/alert.css +3 -14
- package/components/alert/alert.d.ts +3 -0
- package/components/alert/alert.js +8 -7
- package/components/alert/container.css +0 -2
- package/components/alert-service/alert-service.examples.css +5 -3
- package/components/auth/auth__core.d.ts +3 -1
- package/components/auth/auth__core.js +42 -15
- package/components/auth/down-notification.css +1 -1
- package/components/auth-dialog/auth-dialog.d.ts +11 -0
- package/components/auth-dialog/auth-dialog.js +33 -2
- package/components/autofocus-ng/autofocus-ng.js +1 -1
- package/components/autofocus-ng/autofocus-ng.test.js +1 -1
- package/components/button/button.css +93 -204
- package/components/button/button.d.ts +7 -8
- package/components/button/button.js +6 -8
- package/components/button/button__classes.d.ts +1 -1
- package/components/button/button__classes.js +4 -7
- package/components/button-group/button-group.css +136 -19
- package/components/button-group/button-group.d.ts +4 -1
- package/components/button-group/button-group.js +3 -3
- package/components/button-group-ng/button-group-ng.css +1 -0
- package/components/button-group-ng/button-group-ng.examples.js +1 -1
- package/components/button-ng/button-ng.examples.js +6 -7
- package/components/button-ng/button-ng.js +6 -25
- package/components/button-set/button-set.css +1 -0
- package/components/button-toolbar/button-toolbar.css +2 -0
- package/components/checkbox/checkbox.css +10 -4
- package/components/date-picker/date-input.js +2 -1
- package/components/date-picker/date-picker.css +2 -1
- package/components/dialog/dialog.css +10 -3
- package/components/dialog-ng/dialog-ng__template.js +1 -0
- package/components/error-bubble/error-bubble-legacy.css +1 -1
- package/components/error-bubble/error-bubble.css +1 -1
- package/components/global/controls-height.d.ts +7 -0
- package/components/global/controls-height.js +8 -0
- package/components/global/theme.d.ts +7 -20
- package/components/global/theme.js +26 -32
- package/components/global/variables.css +30 -25
- package/components/global/variables.d.ts +10 -8
- package/components/global/variables_dark.css +68 -0
- package/components/header/header.css +19 -10
- package/components/header/header.d.ts +7 -69
- package/components/header/header.js +10 -9
- package/components/header/services.css +3 -3
- package/components/header/services.d.ts +5 -0
- package/components/header/services.js +8 -2
- package/components/header/tray-icon.d.ts +18 -575
- package/components/heading/heading.css +4 -1
- package/components/icon/icon.css +1 -1
- package/components/input/input.css +81 -151
- package/components/input/input.d.ts +13 -17
- package/components/input/input.js +28 -32
- package/components/input-ng/input-ng.examples.js +1 -1
- package/components/input-ng/input-ng.js +45 -49
- package/components/island/adaptive-island-hoc.d.ts +2 -2
- package/components/island/adaptive-island-hoc.js +2 -2
- package/components/island/content.js +2 -7
- package/components/island/header.js +7 -4
- package/components/island/island.css +8 -5
- package/components/island/island.d.ts +2 -2
- package/components/island-legacy/island-legacy.css +1 -1
- package/components/list/list.d.ts +1 -1
- package/components/loader-inline/loader-inline.css +14 -0
- package/components/loader-inline/loader-inline.d.ts +4 -41
- package/components/loader-inline/loader-inline.js +3 -11
- package/components/loader-inline-ng/loader-inline-ng.js +1 -17
- package/components/loader-inline-ng/loader-inline-ng.test.js +0 -11
- package/components/markdown/code.d.ts +6 -13
- package/components/markdown/code.js +2 -2
- package/components/markdown/heading.d.ts +5 -9
- package/components/markdown/heading.js +2 -2
- package/components/markdown/link.d.ts +4 -8
- package/components/markdown/link.js +1 -1
- package/components/markdown/markdown.d.ts +2 -3
- package/components/markdown/markdown.js +14 -11
- package/components/message/message.css +7 -3
- package/components/message/message.d.ts +3 -0
- package/components/message/message.js +16 -9
- package/components/pager/pager.js +2 -8
- package/components/popup/popup.css +1 -1
- package/components/popup/popup.target.d.ts +1 -0
- package/components/progress-bar/progress-bar.css +8 -12
- package/components/progress-bar/progress-bar.d.ts +0 -4
- package/components/progress-bar/progress-bar.js +1 -6
- package/components/progress-bar-ng/progress-bar-ng.examples.js +3 -2
- package/components/query-assist/query-assist.css +48 -64
- package/components/query-assist/query-assist.d.ts +0 -5
- package/components/query-assist/query-assist.js +4 -10
- package/components/radio/radio.css +10 -4
- package/components/select/select.css +19 -37
- package/components/select/select.d.ts +4 -6
- package/components/select/select.js +17 -30
- package/components/select/select__filter.js +2 -1
- package/components/select/select__popup.js +1 -2
- package/components/select-ng/select-ng.examples.js +1 -0
- package/components/select-ng/select-ng.js +3 -1
- package/components/select-ng/select-ng.test.js +1 -1
- package/components/select-ng/select-ng__lazy.js +1 -2
- package/components/shortcuts-hint-ng/shortcuts-hint-ng.css +1 -1
- package/components/shortcuts-hint-ng/shortcuts-hint-ng.examples.js +1 -1
- package/components/tabs/collapsible-tab.js +2 -2
- package/components/tabs/dumb-tabs.d.ts +4 -107
- package/components/tabs/dumb-tabs.js +5 -9
- package/components/tabs/tab.d.ts +2 -0
- package/components/tabs/tabs.css +8 -28
- package/components/tabs-ng/tabs-ng.examples.js +11 -3
- package/components/tabs-ng/tabs-ng.js +1 -4
- package/components/tabs-ng/tabs-ng__template.js +1 -1
- package/components/tag/tag.css +31 -8
- package/components/tag/tag.d.ts +1 -0
- package/components/tag/tag.js +1 -0
- package/components/tags-input/tags-input.css +10 -4
- package/components/toggle/toggle.css +61 -35
- package/components/toggle/toggle.d.ts +9 -89
- package/components/toggle/toggle.js +7 -7
- package/components/tooltip/tooltip.css +7 -0
- package/components/tooltip/tooltip.d.ts +1 -0
- package/components/tooltip/tooltip.js +3 -2
- package/components/user-agreement/service.d.ts +2 -2
- package/components/user-agreement/user-agreement.js +1 -1
- package/dist/_helpers/anchor.js +3 -3
- package/dist/_helpers/badge.js +1 -1
- package/dist/_helpers/button-group.js +1 -1
- package/dist/_helpers/button-set.js +1 -1
- package/dist/_helpers/button-toolbar.js +1 -1
- package/dist/_helpers/button__classes.js +5 -8
- package/dist/_helpers/card.js +1 -1
- package/dist/_helpers/checkbox.js +1 -1
- package/dist/_helpers/date-picker.js +1 -1
- package/dist/_helpers/dialog__body-scroll-preventer.js +1 -1
- package/dist/_helpers/error-message.js +1 -1
- package/dist/_helpers/footer.js +1 -1
- package/dist/_helpers/grid.js +1 -1
- package/dist/_helpers/group.js +1 -1
- package/dist/_helpers/header.js +1 -1
- package/dist/_helpers/icon.js +1 -1
- package/dist/_helpers/input.js +1 -1
- package/dist/_helpers/island.js +1 -1
- package/dist/_helpers/link.js +1 -1
- package/dist/_helpers/list.js +1 -1
- package/dist/_helpers/loader-inline.js +3 -0
- package/dist/_helpers/loader-screen.js +1 -1
- package/dist/_helpers/panel.js +1 -1
- package/dist/_helpers/query-assist__suggestions.js +1 -1
- package/dist/_helpers/radio.js +1 -1
- package/dist/_helpers/select__filter.js +5 -3
- package/dist/_helpers/services-link.js +1 -1
- package/dist/_helpers/sidebar.js +1 -1
- package/dist/_helpers/table.js +1 -1
- package/dist/_helpers/tabs.js +1 -1
- package/dist/_helpers/theme.js +50 -0
- package/dist/_helpers/title.js +1 -1
- package/dist/alert/alert.d.ts +3 -0
- package/dist/alert/alert.js +21 -19
- package/dist/alert/container.js +1 -1
- package/dist/alert-service/alert-service.js +9 -7
- package/dist/auth/auth.js +9 -9
- package/dist/auth/auth__core.d.ts +3 -1
- package/dist/auth/auth__core.js +58 -26
- package/dist/auth/down-notification.js +8 -8
- package/dist/auth/iframe-flow.js +1 -1
- package/dist/auth/landing.js +9 -9
- package/dist/auth/storage.js +9 -7
- package/dist/auth-dialog/auth-dialog.d.ts +11 -0
- package/dist/auth-dialog/auth-dialog.js +52 -7
- package/dist/auth-dialog-service/auth-dialog-service.js +1 -1
- package/dist/auth-ng/auth-ng.js +9 -9
- package/dist/autofocus-ng/autofocus-ng.js +1 -1
- package/dist/avatar/avatar.js +1 -1
- package/dist/avatar-editor-ng/avatar-editor-ng.js +9 -7
- package/dist/breadcrumb-ng/breadcrumb-ng.js +1 -1
- package/dist/button/button.d.ts +7 -8
- package/dist/button/button.js +6 -8
- package/dist/button/button__classes.d.ts +1 -1
- package/dist/button/button__classes.js +0 -3
- package/dist/button-group/button-group.d.ts +4 -1
- package/dist/button-group/button-group.js +5 -3
- package/dist/button-group-ng/button-group-ng.js +1 -1
- package/dist/button-ng/button-ng.js +6 -31
- package/dist/code/code.js +1 -1
- package/dist/confirm/confirm.js +5 -5
- package/dist/confirm-ng/confirm-ng.js +1 -1
- package/dist/confirm-service/confirm-service.js +1 -1
- package/dist/data-list/data-list.js +2 -7
- package/dist/data-list/item.js +8 -13
- package/dist/data-list-ng/data-list-ng.js +2 -7
- package/dist/date-picker/date-input.js +4 -3
- package/dist/date-picker/date-picker.js +1 -1
- package/dist/date-picker/date-popup.js +1 -1
- package/dist/dialog/dialog.js +3 -3
- package/dist/dialog-ng/dialog-ng.js +3 -3
- package/dist/dialog-ng/dialog-ng__template.js +1 -0
- package/dist/docked-panel-ng/docked-panel-ng.js +1 -1
- package/dist/dropdown/anchor.js +1 -1
- package/dist/dropdown/dropdown.js +1 -1
- package/dist/dropdown-menu/dropdown-menu.js +1 -1
- package/dist/error-bubble/error-bubble.js +1 -1
- package/dist/global/controls-height.d.ts +7 -0
- package/dist/global/controls-height.js +13 -0
- package/dist/global/theme.d.ts +7 -20
- package/dist/global/theme.js +7 -62
- package/dist/global/variables.d.ts +10 -8
- package/dist/header/header.d.ts +7 -69
- package/dist/header/header.js +13 -17
- package/dist/header/profile.js +3 -3
- package/dist/header/services.d.ts +5 -0
- package/dist/header/services.js +11 -3
- package/dist/header/smart-profile.js +10 -14
- package/dist/header/smart-services.js +9 -13
- package/dist/header/tray-icon.d.ts +18 -575
- package/dist/header/tray-icon.js +4 -4
- package/dist/heading/heading.js +1 -1
- package/dist/input/input.d.ts +13 -17
- package/dist/input/input.js +32 -41
- package/dist/input-ng/input-ng.js +46 -49
- package/dist/island/adaptive-island-hoc.d.ts +2 -2
- package/dist/island/adaptive-island-hoc.js +4 -2
- package/dist/island/content.js +2 -9
- package/dist/island/header.js +7 -4
- package/dist/island/island.d.ts +2 -2
- package/dist/list/list.d.ts +1 -1
- package/dist/loader/loader__core.js +1 -1
- package/dist/loader-inline/loader-inline.d.ts +4 -41
- package/dist/loader-inline/loader-inline.js +3 -21
- package/dist/loader-inline-ng/loader-inline-ng.js +2 -30
- package/dist/login-dialog/login-dialog.js +2 -2
- package/dist/login-dialog/service.js +1 -1
- package/dist/markdown/code.d.ts +6 -13
- package/dist/markdown/code.js +3 -3
- package/dist/markdown/heading.d.ts +5 -9
- package/dist/markdown/heading.js +2 -2
- package/dist/markdown/link.d.ts +4 -8
- package/dist/markdown/link.js +1 -1
- package/dist/markdown/markdown.d.ts +2 -3
- package/dist/markdown/markdown.js +16 -16
- package/dist/message/message.d.ts +3 -0
- package/dist/message/message.js +18 -10
- package/dist/pager/pager.js +8 -12
- package/dist/pager-ng/pager-ng.js +3 -7
- package/dist/permissions-ng/permissions-ng.js +9 -9
- package/dist/popup/popup.js +1 -1
- package/dist/popup/popup.target.d.ts +1 -0
- package/dist/progress-bar/progress-bar.d.ts +0 -4
- package/dist/progress-bar/progress-bar.js +1 -7
- package/dist/progress-bar-ng/progress-bar-ng.js +0 -1
- package/dist/promised-click-ng/promised-click-ng.js +2 -2
- package/dist/query-assist/query-assist.d.ts +0 -5
- package/dist/query-assist/query-assist.js +10 -26
- package/dist/query-assist-ng/query-assist-ng.js +2 -7
- package/dist/save-field-ng/save-field-ng.js +2 -9
- package/dist/select/select.d.ts +4 -6
- package/dist/select/select.js +35 -58
- package/dist/select/select__filter.js +1 -1
- package/dist/select/select__popup.js +7 -13
- package/dist/select-ng/select-ng.js +5 -9
- package/dist/select-ng/select-ng__lazy.js +7 -11
- package/dist/shortcuts-hint-ng/shortcuts-hint-ng.js +2 -2
- package/dist/sidebar-ng/sidebar-ng.js +2 -2
- package/dist/storage/storage.js +9 -7
- package/dist/storage/storage__local.js +9 -7
- package/dist/style.css +1 -1
- package/dist/tab-trap/tab-trap.js +1 -1
- package/dist/table/row-with-focus-sensor.js +1 -1
- package/dist/table/row.js +5 -5
- package/dist/table/smart-table.js +1 -1
- package/dist/table/table.js +1 -1
- package/dist/table-legacy-ng/table-legacy-ng.js +3 -7
- package/dist/table-legacy-ng/table-legacy-ng__pager.js +3 -7
- package/dist/table-ng/smart-table-ng.js +1 -1
- package/dist/table-ng/table-ng.js +1 -1
- package/dist/tabs/collapsible-more.js +1 -1
- package/dist/tabs/collapsible-tab.js +3 -2
- package/dist/tabs/collapsible-tabs.js +1 -1
- package/dist/tabs/dumb-tabs.d.ts +4 -107
- package/dist/tabs/dumb-tabs.js +6 -12
- package/dist/tabs/smart-tabs.js +3 -3
- package/dist/tabs/tab.d.ts +2 -0
- package/dist/tabs/tabs.js +1 -1
- package/dist/tabs-ng/tabs-ng.js +1 -6
- package/dist/tabs-ng/tabs-ng__template.js +1 -1
- package/dist/tag/tag.d.ts +1 -0
- package/dist/tag/tag.js +5 -4
- package/dist/tags-input/tags-input.js +5 -9
- package/dist/tags-input-ng/tags-input-ng.js +4 -8
- package/dist/tags-list/tags-list.js +1 -1
- package/dist/text/text.js +1 -1
- package/dist/toggle/toggle.d.ts +9 -89
- package/dist/toggle/toggle.js +7 -8
- package/dist/toggle-ng/toggle-ng.js +2 -3
- package/dist/tooltip/tooltip.d.ts +1 -0
- package/dist/tooltip/tooltip.js +6 -3
- package/dist/user-agreement/service.d.ts +2 -2
- package/dist/user-agreement/service.js +9 -13
- package/dist/user-agreement/user-agreement.js +8 -10
- package/dist/user-card/smart-user-card-tooltip.js +6 -11
- package/dist/user-card/tooltip.js +1 -1
- package/dist/user-card/user-card.js +2 -7
- package/dist/user-card-ng/user-card-ng.js +4 -9
- package/package.json +5 -5
- package/webpack.config.js +0 -11
- package/components/global/conic-gradient.d.ts +0 -796
- package/components/global/conic-gradient.js +0 -21
- package/components/global/radial-gradient-mask.d.ts +0 -9
- package/components/global/radial-gradient-mask.js +0 -39
- package/components/global/supports-css.d.ts +0 -2
- package/components/global/supports-css.js +0 -14
- package/components/global/variables_dark.d.ts +0 -3
- package/components/global/variables_dark.js +0 -53
- package/components/loader-inline/inject-styles.d.ts +0 -2
- package/components/loader-inline/inject-styles.js +0 -17
- package/dist/_helpers/inject-styles.js +0 -22
- package/dist/global/conic-gradient.d.ts +0 -796
- package/dist/global/conic-gradient.js +0 -35
- package/dist/global/radial-gradient-mask.d.ts +0 -9
- package/dist/global/radial-gradient-mask.js +0 -49
- package/dist/global/supports-css.d.ts +0 -2
- package/dist/global/supports-css.js +0 -20
- package/dist/global/variables_dark.d.ts +0 -3
- package/dist/global/variables_dark.js +0 -57
- package/dist/loader-inline/inject-styles.d.ts +0 -2
- package/dist/loader-inline/inject-styles.js +0 -11
|
@@ -2,174 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
@value unit from "../global/global.css";
|
|
4
4
|
@value button-shadow: inset 0 0 0 1px;
|
|
5
|
-
@value height:
|
|
5
|
+
@value height: var(--ring-button-height);
|
|
6
6
|
@value loaderWidth: calc(unit * 8);
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
--ring-button-primary-background-color: #1a98ff;
|
|
12
|
-
--ring-button-primary-border-color: #0062b2;
|
|
13
|
-
--ring-button-danger-active-color: #ffe7e8;
|
|
14
|
-
--ring-button-danger-hover-color: var(--ring-icon-error-color);
|
|
15
|
-
--ring-button-loader-background: #33a3ff;
|
|
16
|
-
--ring-button-dark-icon-color: #80929d;
|
|
17
|
-
--ring-button-dark-border-disabled-color: #333;
|
|
18
|
-
--ring-button-dark-icon-disabled-color: var(--ring-dark-disabled-color);
|
|
19
|
-
--ring-button-dark-danger-active-color: #26080a;
|
|
20
|
-
--ring-button-dark-danger-hover-color: var(--ring-error-color);
|
|
21
|
-
--ring-button-dark-active-color: #062640;
|
|
22
|
-
--ring-button-dark-loader-background: #002039;
|
|
23
|
-
/* stylelint-enable color-no-hex */
|
|
8
|
+
.heightS {
|
|
9
|
+
--ring-button-height: calc(unit * 3);
|
|
10
|
+
--ring-button-font-size: var(--ring-font-size-smaller);
|
|
24
11
|
}
|
|
25
12
|
|
|
26
|
-
.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
box-shadow: button-shadow var(--ring-borders-color);
|
|
30
|
-
|
|
31
|
-
&:hover {
|
|
32
|
-
box-shadow: button-shadow var(--ring-border-hover-color);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
&:active,
|
|
36
|
-
&.active {
|
|
37
|
-
background-color: var(--ring-selected-background-color);
|
|
38
|
-
box-shadow: button-shadow var(--ring-border-hover-color);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
&:global(.focus-visible) {
|
|
42
|
-
box-shadow: button-shadow var(--ring-border-hover-color), 0 0 0 1px var(--ring-border-hover-color);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
&[disabled] {
|
|
46
|
-
box-shadow: button-shadow var(--ring-border-disabled-color);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
&[disabled],
|
|
50
|
-
&[disabled].withIcon {
|
|
51
|
-
color: var(--ring-disabled-color);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
&[disabled] .icon {
|
|
55
|
-
color: var(--ring-icon-disabled-color);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
&.primary:active,
|
|
59
|
-
&.primary.active {
|
|
60
|
-
background-color: var(--ring-button-primary-background-color);
|
|
61
|
-
box-shadow: button-shadow var(--ring-button-primary-border-color);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
&.danger:active,
|
|
65
|
-
&.danger.active {
|
|
66
|
-
background-color: var(--ring-button-danger-active-color);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
&.danger:active,
|
|
70
|
-
&.danger.active,
|
|
71
|
-
&.danger:global(.focus-visible) {
|
|
72
|
-
box-shadow: button-shadow var(--ring-button-danger-hover-color);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
&.withIcon {
|
|
76
|
-
color: var(--ring-secondary-color);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
& .loaderBackground::before {
|
|
80
|
-
background-image:
|
|
81
|
-
linear-gradient(
|
|
82
|
-
to right,
|
|
83
|
-
var(--ring-content-background-color),
|
|
84
|
-
var(--ring-selected-background-color) 40%,
|
|
85
|
-
var(--ring-content-background-color) 80%
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.light.danger:hover {
|
|
91
|
-
box-shadow: button-shadow var(--ring-button-danger-hover-color);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.dark {
|
|
95
|
-
color: var(--ring-dark-secondary-color);
|
|
96
|
-
background-color: var(--ring-navigation-background-color);
|
|
97
|
-
box-shadow: button-shadow var(--ring-dark-borders-color);
|
|
98
|
-
|
|
99
|
-
&:hover {
|
|
100
|
-
box-shadow: button-shadow var(--ring-dark-border-hover-color);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
&:active,
|
|
104
|
-
&.active {
|
|
105
|
-
color: var(--ring-dark-text-color);
|
|
106
|
-
background-color: var(--ring-button-dark-active-color);
|
|
107
|
-
box-shadow: button-shadow var(--ring-dark-border-hover-color);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
&:global(.focus-visible) {
|
|
111
|
-
box-shadow: button-shadow var(--ring-dark-border-hover-color), 0 0 0 1px var(--ring-dark-border-hover-color);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
&[disabled] {
|
|
115
|
-
box-shadow: button-shadow var(--ring-button-dark-border-disabled-color);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
&[disabled],
|
|
119
|
-
&[disabled].withIcon {
|
|
120
|
-
color: var(--ring-dark-disabled-color);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
&[disabled] .icon {
|
|
124
|
-
color: var(--ring-button-dark-icon-disabled-color);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
&.primary:active,
|
|
128
|
-
&.primary.active {
|
|
129
|
-
background-color: var(--ring-main-hover-color);
|
|
130
|
-
box-shadow: button-shadow var(--ring-border-hover-color);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
&.danger:active,
|
|
134
|
-
&.danger.active {
|
|
135
|
-
color: var(--ring-icon-error-color);
|
|
136
|
-
background-color: var(--ring-button-dark-danger-active-color);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
&.danger:active,
|
|
140
|
-
&.danger.active,
|
|
141
|
-
&.danger:global(.focus-visible) {
|
|
142
|
-
box-shadow: button-shadow var(--ring-button-dark-danger-hover-color);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
&.withIcon {
|
|
146
|
-
color: var(--ring-dark-secondary-color);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
& .loaderBackground::before {
|
|
150
|
-
background-image:
|
|
151
|
-
linear-gradient(
|
|
152
|
-
to right,
|
|
153
|
-
var(--ring-navigation-background-color),
|
|
154
|
-
var(--ring-button-dark-loader-background) 40%,
|
|
155
|
-
var(--ring-navigation-background-color) 80%
|
|
156
|
-
);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
& .dropdownIcon {
|
|
160
|
-
color: var(--ring-dark-secondary-color);
|
|
161
|
-
}
|
|
13
|
+
.heightM {
|
|
14
|
+
--ring-button-height: calc(unit * 3.5);
|
|
15
|
+
--ring-button-font-size: var(--ring-font-size);
|
|
162
16
|
}
|
|
163
17
|
|
|
164
|
-
.
|
|
165
|
-
|
|
18
|
+
.heightL {
|
|
19
|
+
--ring-button-height: calc(unit * 4);
|
|
20
|
+
--ring-button-font-size: var(--ring-font-size);
|
|
166
21
|
}
|
|
167
22
|
|
|
168
23
|
.button {
|
|
169
|
-
composes: button from "../button-group/button-group.css";
|
|
170
|
-
composes: button from "../button-set/button-set.css";
|
|
171
|
-
composes: button from "../button-toolbar/button-toolbar.css";
|
|
172
|
-
|
|
173
24
|
position: relative;
|
|
174
25
|
|
|
175
26
|
display: inline-block;
|
|
@@ -183,25 +34,62 @@
|
|
|
183
34
|
transition: color var(--ring-ease), background-color var(--ring-ease), box-shadow var(--ring-ease);
|
|
184
35
|
text-decoration: none;
|
|
185
36
|
|
|
37
|
+
color: var(--ring-text-color);
|
|
38
|
+
|
|
186
39
|
border: 0;
|
|
187
40
|
border-radius: var(--ring-border-radius);
|
|
188
41
|
outline: 0;
|
|
42
|
+
background-color: var(--ring-content-background-color);
|
|
43
|
+
box-shadow: button-shadow var(--ring-borders-color);
|
|
189
44
|
|
|
190
45
|
font-family: var(--ring-font-family);
|
|
191
|
-
font-size: var(--ring-font-size
|
|
46
|
+
font-size: var(--ring-button-font-size);
|
|
192
47
|
|
|
193
48
|
line-height: height;
|
|
194
49
|
|
|
195
50
|
&:hover {
|
|
196
51
|
transition: none;
|
|
52
|
+
|
|
53
|
+
box-shadow: button-shadow var(--ring-border-hover-color);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&:active {
|
|
57
|
+
transition: none;
|
|
58
|
+
|
|
59
|
+
background-color: var(--ring-selected-background-color);
|
|
60
|
+
box-shadow: button-shadow var(--ring-border-hover-color);
|
|
197
61
|
}
|
|
198
62
|
|
|
199
63
|
&:global(.focus-visible) {
|
|
200
64
|
transition: none;
|
|
65
|
+
|
|
66
|
+
box-shadow: button-shadow var(--ring-border-hover-color), 0 0 0 1px var(--ring-border-hover-color);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&.active {
|
|
70
|
+
transition: none;
|
|
71
|
+
|
|
72
|
+
box-shadow: button-shadow var(--ring-main-color);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&:global(.focus-visible).active {
|
|
76
|
+
box-shadow: button-shadow var(--ring-main-color), 0 0 0 1px var(--ring-border-hover-color);
|
|
201
77
|
}
|
|
202
78
|
|
|
203
79
|
&[disabled] {
|
|
204
80
|
pointer-events: none;
|
|
81
|
+
|
|
82
|
+
background-color: var(--ring-disabled-background-color);
|
|
83
|
+
box-shadow: button-shadow var(--ring-border-disabled-color);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&[disabled],
|
|
87
|
+
&[disabled].withIcon {
|
|
88
|
+
color: var(--ring-disabled-color);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&[disabled] .icon {
|
|
92
|
+
color: var(--ring-icon-disabled-color);
|
|
205
93
|
}
|
|
206
94
|
|
|
207
95
|
&::-moz-focus-inner {
|
|
@@ -212,26 +100,37 @@
|
|
|
212
100
|
}
|
|
213
101
|
}
|
|
214
102
|
|
|
215
|
-
.
|
|
216
|
-
|
|
103
|
+
.withIcon {
|
|
104
|
+
color: var(--ring-secondary-color);
|
|
217
105
|
}
|
|
218
106
|
|
|
219
107
|
.primary {
|
|
220
|
-
color: var(--ring-
|
|
108
|
+
color: var(--ring-white-text-color);
|
|
221
109
|
background-color: var(--ring-main-color);
|
|
222
110
|
box-shadow: none;
|
|
223
111
|
|
|
112
|
+
&:hover {
|
|
113
|
+
transition: none;
|
|
114
|
+
|
|
115
|
+
background-color: var(--ring-main-hover-color);
|
|
116
|
+
box-shadow: none;
|
|
117
|
+
}
|
|
118
|
+
|
|
224
119
|
&.withIcon,
|
|
225
120
|
&.withIcon:active,
|
|
226
121
|
&.withIcon.active {
|
|
227
122
|
color: var(--ring-main-color);
|
|
228
123
|
}
|
|
229
124
|
|
|
230
|
-
&:global(.focus-visible)
|
|
231
|
-
|
|
125
|
+
&:global(.focus-visible),
|
|
126
|
+
&:active,
|
|
127
|
+
&.active {
|
|
128
|
+
background-color: var(--ring-button-primary-background-color);
|
|
129
|
+
}
|
|
232
130
|
|
|
233
|
-
|
|
234
|
-
|
|
131
|
+
&:active,
|
|
132
|
+
&.active {
|
|
133
|
+
box-shadow: button-shadow var(--ring-button-primary-border-color);
|
|
235
134
|
}
|
|
236
135
|
|
|
237
136
|
&[disabled] {
|
|
@@ -240,7 +139,7 @@
|
|
|
240
139
|
}
|
|
241
140
|
|
|
242
141
|
&[disabled].loader {
|
|
243
|
-
color: var(--ring-
|
|
142
|
+
color: var(--ring-white-text-color);
|
|
244
143
|
}
|
|
245
144
|
|
|
246
145
|
& .loaderBackground {
|
|
@@ -263,13 +162,6 @@
|
|
|
263
162
|
}
|
|
264
163
|
}
|
|
265
164
|
|
|
266
|
-
.primary:hover {
|
|
267
|
-
transition: none;
|
|
268
|
-
|
|
269
|
-
background-color: var(--ring-main-hover-color);
|
|
270
|
-
box-shadow: none;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
165
|
.danger {
|
|
274
166
|
&,
|
|
275
167
|
&.withIcon,
|
|
@@ -281,17 +173,21 @@
|
|
|
281
173
|
color: var(--ring-error-color);
|
|
282
174
|
}
|
|
283
175
|
|
|
176
|
+
&:active,
|
|
177
|
+
&.active {
|
|
178
|
+
background-color: var(--ring-button-danger-active-color);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&:active,
|
|
182
|
+
&.active,
|
|
284
183
|
&:global(.focus-visible),
|
|
285
184
|
&:hover {
|
|
286
|
-
|
|
185
|
+
box-shadow: button-shadow var(--ring-button-danger-hover-color);
|
|
287
186
|
}
|
|
288
|
-
}
|
|
289
187
|
|
|
290
|
-
.
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
&.active {
|
|
294
|
-
color: var(--ring-icon-error-color);
|
|
188
|
+
&:global(.focus-visible),
|
|
189
|
+
&:hover {
|
|
190
|
+
transition: none;
|
|
295
191
|
}
|
|
296
192
|
}
|
|
297
193
|
|
|
@@ -380,22 +276,14 @@
|
|
|
380
276
|
}
|
|
381
277
|
}
|
|
382
278
|
|
|
383
|
-
.
|
|
279
|
+
.withNormalIcon .icon {
|
|
384
280
|
transition: color var(--ring-ease);
|
|
385
281
|
|
|
386
282
|
color: var(--ring-icon-color);
|
|
387
283
|
}
|
|
388
284
|
|
|
389
|
-
.
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
color: var(--ring-button-dark-icon-color);
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
.withNormalIconLight:active,
|
|
396
|
-
.withNormalIconLight.active,
|
|
397
|
-
.withNormalIconDark:active,
|
|
398
|
-
.withNormalIconDark.active {
|
|
285
|
+
.withNormalIcon:active,
|
|
286
|
+
.withNormalIcon.active {
|
|
399
287
|
color: var(--ring-main-color);
|
|
400
288
|
|
|
401
289
|
& .icon {
|
|
@@ -405,25 +293,18 @@
|
|
|
405
293
|
}
|
|
406
294
|
}
|
|
407
295
|
|
|
408
|
-
.
|
|
409
|
-
.
|
|
410
|
-
.withDangerIconLight:hover .icon,
|
|
411
|
-
.withDangerIconDark:hover .icon {
|
|
296
|
+
.withNormalIcon:hover .icon,
|
|
297
|
+
.withDangerIcon:hover .icon {
|
|
412
298
|
transition: none;
|
|
413
299
|
|
|
414
300
|
color: inherit;
|
|
415
301
|
}
|
|
416
302
|
|
|
417
|
-
.
|
|
418
|
-
.
|
|
303
|
+
.withDangerIcon .icon,
|
|
304
|
+
.withDangerIcon:active .icon {
|
|
419
305
|
color: var(--ring-icon-error-color);
|
|
420
306
|
}
|
|
421
307
|
|
|
422
|
-
.withDangerIconDark .icon,
|
|
423
|
-
.withDangerIconDark:active .icon {
|
|
424
|
-
color: var(--ring-error-color);
|
|
425
|
-
}
|
|
426
|
-
|
|
427
308
|
.loader {
|
|
428
309
|
position: relative;
|
|
429
310
|
z-index: 0;
|
|
@@ -454,6 +335,14 @@
|
|
|
454
335
|
content: "";
|
|
455
336
|
animation: progress 1s linear infinite;
|
|
456
337
|
|
|
338
|
+
background-image:
|
|
339
|
+
linear-gradient(
|
|
340
|
+
to right,
|
|
341
|
+
var(--ring-content-background-color),
|
|
342
|
+
var(--ring-selected-background-color) 40%,
|
|
343
|
+
var(--ring-content-background-color) 80%
|
|
344
|
+
);
|
|
345
|
+
|
|
457
346
|
background-repeat: repeat;
|
|
458
347
|
background-size: loaderWidth;
|
|
459
348
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import 'focus-visible';
|
|
2
|
-
import React, { PureComponent, ButtonHTMLAttributes
|
|
2
|
+
import React, { PureComponent, ButtonHTMLAttributes } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { IconType, Size } from '../icon/icon';
|
|
5
|
-
import Theme, { ThemeOuterProps, ThemeProps } from '../global/theme';
|
|
6
5
|
import { ClickableLinkProps } from '../link/clickableLink';
|
|
7
|
-
|
|
6
|
+
import { ControlsHeight } from '../global/controls-height';
|
|
7
|
+
export interface ButtonBaseProps {
|
|
8
|
+
height?: ControlsHeight | undefined;
|
|
8
9
|
active?: boolean | null | undefined;
|
|
9
10
|
danger?: boolean | null | undefined;
|
|
10
11
|
delayed?: boolean | null | undefined;
|
|
@@ -36,7 +37,6 @@ export declare type ButtonProps = ButtonButtonProps | ButtonLinkProps;
|
|
|
36
37
|
*/
|
|
37
38
|
export declare class Button extends PureComponent<ButtonProps> {
|
|
38
39
|
static propTypes: {
|
|
39
|
-
theme: PropTypes.Requireable<string>;
|
|
40
40
|
active: PropTypes.Requireable<boolean>;
|
|
41
41
|
danger: PropTypes.Requireable<boolean>;
|
|
42
42
|
delayed: PropTypes.Requireable<boolean>;
|
|
@@ -57,12 +57,11 @@ export declare class Button extends PureComponent<ButtonProps> {
|
|
|
57
57
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
58
58
|
};
|
|
59
59
|
static IconSize: typeof Size;
|
|
60
|
-
static
|
|
60
|
+
static contextType: React.Context<ControlsHeight>;
|
|
61
61
|
buttonRef: React.RefObject<HTMLButtonElement>;
|
|
62
62
|
render(): JSX.Element;
|
|
63
63
|
}
|
|
64
64
|
export { Size as IconSize };
|
|
65
|
-
export declare type ContainerProps<T> =
|
|
65
|
+
export declare type ContainerProps<T extends ButtonProps> = JSX.LibraryManagedAttributes<typeof Button, T>;
|
|
66
66
|
export declare type ButtonAttrs = ContainerProps<ButtonButtonProps> | ContainerProps<ButtonLinkProps>;
|
|
67
|
-
|
|
68
|
-
export default _default;
|
|
67
|
+
export default Button;
|
|
@@ -4,8 +4,8 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import chevronDown from '@jetbrains/icons/chevron-10px';
|
|
6
6
|
import Icon, { Size } from '../icon/icon';
|
|
7
|
-
import Theme, { withTheme } from '../global/theme';
|
|
8
7
|
import ClickableLink from '../link/clickableLink';
|
|
8
|
+
import { ControlsHeightContext } from '../global/controls-height';
|
|
9
9
|
import styles from './button.css';
|
|
10
10
|
import { getButtonClasses } from './button__classes';
|
|
11
11
|
/**
|
|
@@ -16,7 +16,6 @@ import { getButtonClasses } from './button__classes';
|
|
|
16
16
|
*/
|
|
17
17
|
export class Button extends PureComponent {
|
|
18
18
|
static propTypes = {
|
|
19
|
-
theme: PropTypes.oneOf(['light', 'dark']),
|
|
20
19
|
active: PropTypes.bool,
|
|
21
20
|
danger: PropTypes.bool,
|
|
22
21
|
delayed: PropTypes.bool,
|
|
@@ -37,16 +36,16 @@ export class Button extends PureComponent {
|
|
|
37
36
|
onClick: PropTypes.func
|
|
38
37
|
};
|
|
39
38
|
static IconSize = Size;
|
|
40
|
-
static
|
|
39
|
+
static contextType = ControlsHeightContext;
|
|
41
40
|
buttonRef = createRef();
|
|
42
41
|
render() {
|
|
43
42
|
const {
|
|
44
43
|
// Modifiers
|
|
45
|
-
|
|
44
|
+
active, danger, delayed, loader, primary, short, text, inline, dropdown, height = this.context,
|
|
46
45
|
// Props
|
|
47
46
|
icon, iconSize, iconClassName, iconSuppressSizeWarning, className, children, ...props } = this.props;
|
|
48
|
-
const classes = getButtonClasses({ className, active, danger, delayed, icon,
|
|
49
|
-
primary, short, text, inline });
|
|
47
|
+
const classes = getButtonClasses({ className, active, danger, delayed, icon, loader,
|
|
48
|
+
primary, short, text, inline, height });
|
|
50
49
|
const content = (<span className={styles.content}>
|
|
51
50
|
{icon && (<span className={classNames(styles.icon, iconClassName)}>
|
|
52
51
|
<Icon glyph={icon} size={iconSize} loading={loader} suppressSizeWarning={iconSuppressSizeWarning}/>
|
|
@@ -69,5 +68,4 @@ export class Button extends PureComponent {
|
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
70
|
export { Size as IconSize };
|
|
72
|
-
|
|
73
|
-
export default ThemedButton;
|
|
71
|
+
export default Button;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ButtonProps } from './button';
|
|
2
|
-
export declare function getButtonClasses({ className, active, disabled, loader, primary, short, text, inline, danger, delayed, icon,
|
|
2
|
+
export declare function getButtonClasses({ className, active, disabled, loader, primary, short, text, inline, danger, delayed, icon, height }: ButtonProps): string;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
|
-
import Theme from '../global/theme';
|
|
3
2
|
import styles from './button.css';
|
|
4
|
-
export function getButtonClasses({ className, active, disabled, loader, primary, short, text, inline, danger, delayed, icon,
|
|
3
|
+
export function getButtonClasses({ className, active, disabled, loader, primary, short, text, inline, danger, delayed, icon, height }) {
|
|
5
4
|
const withNormalIcon = icon && !active && !danger && !primary && !disabled;
|
|
6
|
-
return classNames(styles.button, className, styles[
|
|
5
|
+
return classNames(styles.button, className, styles[`height${height}`], {
|
|
7
6
|
[styles.active]: active,
|
|
8
7
|
[styles.danger]: danger,
|
|
9
8
|
[styles.delayed]: delayed,
|
|
10
9
|
[styles.withIcon]: icon,
|
|
11
|
-
[styles.
|
|
12
|
-
[styles.
|
|
13
|
-
[styles.withDangerIconLight]: (icon && danger && theme === Theme.LIGHT),
|
|
14
|
-
[styles.withDangerIconDark]: (icon && danger && theme === Theme.DARK),
|
|
10
|
+
[styles.withNormalIcon]: withNormalIcon,
|
|
11
|
+
[styles.withDangerIcon]: icon && danger,
|
|
15
12
|
[styles.loader]: loader && !icon,
|
|
16
13
|
[styles.primary]: primary,
|
|
17
14
|
[styles.short]: short,
|