@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.
Files changed (323) hide show
  1. package/CHANGELOG.md +49 -1
  2. package/babel.config.js +1 -12
  3. package/components/alert/alert.css +3 -14
  4. package/components/alert/alert.d.ts +3 -0
  5. package/components/alert/alert.js +8 -7
  6. package/components/alert/container.css +0 -2
  7. package/components/alert-service/alert-service.examples.css +5 -3
  8. package/components/auth/auth__core.d.ts +3 -1
  9. package/components/auth/auth__core.js +42 -15
  10. package/components/auth/down-notification.css +1 -1
  11. package/components/auth-dialog/auth-dialog.d.ts +11 -0
  12. package/components/auth-dialog/auth-dialog.js +33 -2
  13. package/components/autofocus-ng/autofocus-ng.js +1 -1
  14. package/components/autofocus-ng/autofocus-ng.test.js +1 -1
  15. package/components/button/button.css +93 -204
  16. package/components/button/button.d.ts +7 -8
  17. package/components/button/button.js +6 -8
  18. package/components/button/button__classes.d.ts +1 -1
  19. package/components/button/button__classes.js +4 -7
  20. package/components/button-group/button-group.css +136 -19
  21. package/components/button-group/button-group.d.ts +4 -1
  22. package/components/button-group/button-group.js +3 -3
  23. package/components/button-group-ng/button-group-ng.css +1 -0
  24. package/components/button-group-ng/button-group-ng.examples.js +1 -1
  25. package/components/button-ng/button-ng.examples.js +6 -7
  26. package/components/button-ng/button-ng.js +6 -25
  27. package/components/button-set/button-set.css +1 -0
  28. package/components/button-toolbar/button-toolbar.css +2 -0
  29. package/components/checkbox/checkbox.css +10 -4
  30. package/components/date-picker/date-input.js +2 -1
  31. package/components/date-picker/date-picker.css +2 -1
  32. package/components/dialog/dialog.css +10 -3
  33. package/components/dialog-ng/dialog-ng__template.js +1 -0
  34. package/components/error-bubble/error-bubble-legacy.css +1 -1
  35. package/components/error-bubble/error-bubble.css +1 -1
  36. package/components/global/controls-height.d.ts +7 -0
  37. package/components/global/controls-height.js +8 -0
  38. package/components/global/theme.d.ts +7 -20
  39. package/components/global/theme.js +26 -32
  40. package/components/global/variables.css +30 -25
  41. package/components/global/variables.d.ts +10 -8
  42. package/components/global/variables_dark.css +68 -0
  43. package/components/header/header.css +19 -10
  44. package/components/header/header.d.ts +7 -69
  45. package/components/header/header.js +10 -9
  46. package/components/header/services.css +3 -3
  47. package/components/header/services.d.ts +5 -0
  48. package/components/header/services.js +8 -2
  49. package/components/header/tray-icon.d.ts +18 -575
  50. package/components/heading/heading.css +4 -1
  51. package/components/icon/icon.css +1 -1
  52. package/components/input/input.css +81 -151
  53. package/components/input/input.d.ts +13 -17
  54. package/components/input/input.js +28 -32
  55. package/components/input-ng/input-ng.examples.js +1 -1
  56. package/components/input-ng/input-ng.js +45 -49
  57. package/components/island/adaptive-island-hoc.d.ts +2 -2
  58. package/components/island/adaptive-island-hoc.js +2 -2
  59. package/components/island/content.js +2 -7
  60. package/components/island/header.js +7 -4
  61. package/components/island/island.css +8 -5
  62. package/components/island/island.d.ts +2 -2
  63. package/components/island-legacy/island-legacy.css +1 -1
  64. package/components/list/list.d.ts +1 -1
  65. package/components/loader-inline/loader-inline.css +14 -0
  66. package/components/loader-inline/loader-inline.d.ts +4 -41
  67. package/components/loader-inline/loader-inline.js +3 -11
  68. package/components/loader-inline-ng/loader-inline-ng.js +1 -17
  69. package/components/loader-inline-ng/loader-inline-ng.test.js +0 -11
  70. package/components/markdown/code.d.ts +6 -13
  71. package/components/markdown/code.js +2 -2
  72. package/components/markdown/heading.d.ts +5 -9
  73. package/components/markdown/heading.js +2 -2
  74. package/components/markdown/link.d.ts +4 -8
  75. package/components/markdown/link.js +1 -1
  76. package/components/markdown/markdown.d.ts +2 -3
  77. package/components/markdown/markdown.js +14 -11
  78. package/components/message/message.css +7 -3
  79. package/components/message/message.d.ts +3 -0
  80. package/components/message/message.js +16 -9
  81. package/components/pager/pager.js +2 -8
  82. package/components/popup/popup.css +1 -1
  83. package/components/popup/popup.target.d.ts +1 -0
  84. package/components/progress-bar/progress-bar.css +8 -12
  85. package/components/progress-bar/progress-bar.d.ts +0 -4
  86. package/components/progress-bar/progress-bar.js +1 -6
  87. package/components/progress-bar-ng/progress-bar-ng.examples.js +3 -2
  88. package/components/query-assist/query-assist.css +48 -64
  89. package/components/query-assist/query-assist.d.ts +0 -5
  90. package/components/query-assist/query-assist.js +4 -10
  91. package/components/radio/radio.css +10 -4
  92. package/components/select/select.css +19 -37
  93. package/components/select/select.d.ts +4 -6
  94. package/components/select/select.js +17 -30
  95. package/components/select/select__filter.js +2 -1
  96. package/components/select/select__popup.js +1 -2
  97. package/components/select-ng/select-ng.examples.js +1 -0
  98. package/components/select-ng/select-ng.js +3 -1
  99. package/components/select-ng/select-ng.test.js +1 -1
  100. package/components/select-ng/select-ng__lazy.js +1 -2
  101. package/components/shortcuts-hint-ng/shortcuts-hint-ng.css +1 -1
  102. package/components/shortcuts-hint-ng/shortcuts-hint-ng.examples.js +1 -1
  103. package/components/tabs/collapsible-tab.js +2 -2
  104. package/components/tabs/dumb-tabs.d.ts +4 -107
  105. package/components/tabs/dumb-tabs.js +5 -9
  106. package/components/tabs/tab.d.ts +2 -0
  107. package/components/tabs/tabs.css +8 -28
  108. package/components/tabs-ng/tabs-ng.examples.js +11 -3
  109. package/components/tabs-ng/tabs-ng.js +1 -4
  110. package/components/tabs-ng/tabs-ng__template.js +1 -1
  111. package/components/tag/tag.css +31 -8
  112. package/components/tag/tag.d.ts +1 -0
  113. package/components/tag/tag.js +1 -0
  114. package/components/tags-input/tags-input.css +10 -4
  115. package/components/toggle/toggle.css +61 -35
  116. package/components/toggle/toggle.d.ts +9 -89
  117. package/components/toggle/toggle.js +7 -7
  118. package/components/tooltip/tooltip.css +7 -0
  119. package/components/tooltip/tooltip.d.ts +1 -0
  120. package/components/tooltip/tooltip.js +3 -2
  121. package/components/user-agreement/service.d.ts +2 -2
  122. package/components/user-agreement/user-agreement.js +1 -1
  123. package/dist/_helpers/anchor.js +3 -3
  124. package/dist/_helpers/badge.js +1 -1
  125. package/dist/_helpers/button-group.js +1 -1
  126. package/dist/_helpers/button-set.js +1 -1
  127. package/dist/_helpers/button-toolbar.js +1 -1
  128. package/dist/_helpers/button__classes.js +5 -8
  129. package/dist/_helpers/card.js +1 -1
  130. package/dist/_helpers/checkbox.js +1 -1
  131. package/dist/_helpers/date-picker.js +1 -1
  132. package/dist/_helpers/dialog__body-scroll-preventer.js +1 -1
  133. package/dist/_helpers/error-message.js +1 -1
  134. package/dist/_helpers/footer.js +1 -1
  135. package/dist/_helpers/grid.js +1 -1
  136. package/dist/_helpers/group.js +1 -1
  137. package/dist/_helpers/header.js +1 -1
  138. package/dist/_helpers/icon.js +1 -1
  139. package/dist/_helpers/input.js +1 -1
  140. package/dist/_helpers/island.js +1 -1
  141. package/dist/_helpers/link.js +1 -1
  142. package/dist/_helpers/list.js +1 -1
  143. package/dist/_helpers/loader-inline.js +3 -0
  144. package/dist/_helpers/loader-screen.js +1 -1
  145. package/dist/_helpers/panel.js +1 -1
  146. package/dist/_helpers/query-assist__suggestions.js +1 -1
  147. package/dist/_helpers/radio.js +1 -1
  148. package/dist/_helpers/select__filter.js +5 -3
  149. package/dist/_helpers/services-link.js +1 -1
  150. package/dist/_helpers/sidebar.js +1 -1
  151. package/dist/_helpers/table.js +1 -1
  152. package/dist/_helpers/tabs.js +1 -1
  153. package/dist/_helpers/theme.js +50 -0
  154. package/dist/_helpers/title.js +1 -1
  155. package/dist/alert/alert.d.ts +3 -0
  156. package/dist/alert/alert.js +21 -19
  157. package/dist/alert/container.js +1 -1
  158. package/dist/alert-service/alert-service.js +9 -7
  159. package/dist/auth/auth.js +9 -9
  160. package/dist/auth/auth__core.d.ts +3 -1
  161. package/dist/auth/auth__core.js +58 -26
  162. package/dist/auth/down-notification.js +8 -8
  163. package/dist/auth/iframe-flow.js +1 -1
  164. package/dist/auth/landing.js +9 -9
  165. package/dist/auth/storage.js +9 -7
  166. package/dist/auth-dialog/auth-dialog.d.ts +11 -0
  167. package/dist/auth-dialog/auth-dialog.js +52 -7
  168. package/dist/auth-dialog-service/auth-dialog-service.js +1 -1
  169. package/dist/auth-ng/auth-ng.js +9 -9
  170. package/dist/autofocus-ng/autofocus-ng.js +1 -1
  171. package/dist/avatar/avatar.js +1 -1
  172. package/dist/avatar-editor-ng/avatar-editor-ng.js +9 -7
  173. package/dist/breadcrumb-ng/breadcrumb-ng.js +1 -1
  174. package/dist/button/button.d.ts +7 -8
  175. package/dist/button/button.js +6 -8
  176. package/dist/button/button__classes.d.ts +1 -1
  177. package/dist/button/button__classes.js +0 -3
  178. package/dist/button-group/button-group.d.ts +4 -1
  179. package/dist/button-group/button-group.js +5 -3
  180. package/dist/button-group-ng/button-group-ng.js +1 -1
  181. package/dist/button-ng/button-ng.js +6 -31
  182. package/dist/code/code.js +1 -1
  183. package/dist/confirm/confirm.js +5 -5
  184. package/dist/confirm-ng/confirm-ng.js +1 -1
  185. package/dist/confirm-service/confirm-service.js +1 -1
  186. package/dist/data-list/data-list.js +2 -7
  187. package/dist/data-list/item.js +8 -13
  188. package/dist/data-list-ng/data-list-ng.js +2 -7
  189. package/dist/date-picker/date-input.js +4 -3
  190. package/dist/date-picker/date-picker.js +1 -1
  191. package/dist/date-picker/date-popup.js +1 -1
  192. package/dist/dialog/dialog.js +3 -3
  193. package/dist/dialog-ng/dialog-ng.js +3 -3
  194. package/dist/dialog-ng/dialog-ng__template.js +1 -0
  195. package/dist/docked-panel-ng/docked-panel-ng.js +1 -1
  196. package/dist/dropdown/anchor.js +1 -1
  197. package/dist/dropdown/dropdown.js +1 -1
  198. package/dist/dropdown-menu/dropdown-menu.js +1 -1
  199. package/dist/error-bubble/error-bubble.js +1 -1
  200. package/dist/global/controls-height.d.ts +7 -0
  201. package/dist/global/controls-height.js +13 -0
  202. package/dist/global/theme.d.ts +7 -20
  203. package/dist/global/theme.js +7 -62
  204. package/dist/global/variables.d.ts +10 -8
  205. package/dist/header/header.d.ts +7 -69
  206. package/dist/header/header.js +13 -17
  207. package/dist/header/profile.js +3 -3
  208. package/dist/header/services.d.ts +5 -0
  209. package/dist/header/services.js +11 -3
  210. package/dist/header/smart-profile.js +10 -14
  211. package/dist/header/smart-services.js +9 -13
  212. package/dist/header/tray-icon.d.ts +18 -575
  213. package/dist/header/tray-icon.js +4 -4
  214. package/dist/heading/heading.js +1 -1
  215. package/dist/input/input.d.ts +13 -17
  216. package/dist/input/input.js +32 -41
  217. package/dist/input-ng/input-ng.js +46 -49
  218. package/dist/island/adaptive-island-hoc.d.ts +2 -2
  219. package/dist/island/adaptive-island-hoc.js +4 -2
  220. package/dist/island/content.js +2 -9
  221. package/dist/island/header.js +7 -4
  222. package/dist/island/island.d.ts +2 -2
  223. package/dist/list/list.d.ts +1 -1
  224. package/dist/loader/loader__core.js +1 -1
  225. package/dist/loader-inline/loader-inline.d.ts +4 -41
  226. package/dist/loader-inline/loader-inline.js +3 -21
  227. package/dist/loader-inline-ng/loader-inline-ng.js +2 -30
  228. package/dist/login-dialog/login-dialog.js +2 -2
  229. package/dist/login-dialog/service.js +1 -1
  230. package/dist/markdown/code.d.ts +6 -13
  231. package/dist/markdown/code.js +3 -3
  232. package/dist/markdown/heading.d.ts +5 -9
  233. package/dist/markdown/heading.js +2 -2
  234. package/dist/markdown/link.d.ts +4 -8
  235. package/dist/markdown/link.js +1 -1
  236. package/dist/markdown/markdown.d.ts +2 -3
  237. package/dist/markdown/markdown.js +16 -16
  238. package/dist/message/message.d.ts +3 -0
  239. package/dist/message/message.js +18 -10
  240. package/dist/pager/pager.js +8 -12
  241. package/dist/pager-ng/pager-ng.js +3 -7
  242. package/dist/permissions-ng/permissions-ng.js +9 -9
  243. package/dist/popup/popup.js +1 -1
  244. package/dist/popup/popup.target.d.ts +1 -0
  245. package/dist/progress-bar/progress-bar.d.ts +0 -4
  246. package/dist/progress-bar/progress-bar.js +1 -7
  247. package/dist/progress-bar-ng/progress-bar-ng.js +0 -1
  248. package/dist/promised-click-ng/promised-click-ng.js +2 -2
  249. package/dist/query-assist/query-assist.d.ts +0 -5
  250. package/dist/query-assist/query-assist.js +10 -26
  251. package/dist/query-assist-ng/query-assist-ng.js +2 -7
  252. package/dist/save-field-ng/save-field-ng.js +2 -9
  253. package/dist/select/select.d.ts +4 -6
  254. package/dist/select/select.js +35 -58
  255. package/dist/select/select__filter.js +1 -1
  256. package/dist/select/select__popup.js +7 -13
  257. package/dist/select-ng/select-ng.js +5 -9
  258. package/dist/select-ng/select-ng__lazy.js +7 -11
  259. package/dist/shortcuts-hint-ng/shortcuts-hint-ng.js +2 -2
  260. package/dist/sidebar-ng/sidebar-ng.js +2 -2
  261. package/dist/storage/storage.js +9 -7
  262. package/dist/storage/storage__local.js +9 -7
  263. package/dist/style.css +1 -1
  264. package/dist/tab-trap/tab-trap.js +1 -1
  265. package/dist/table/row-with-focus-sensor.js +1 -1
  266. package/dist/table/row.js +5 -5
  267. package/dist/table/smart-table.js +1 -1
  268. package/dist/table/table.js +1 -1
  269. package/dist/table-legacy-ng/table-legacy-ng.js +3 -7
  270. package/dist/table-legacy-ng/table-legacy-ng__pager.js +3 -7
  271. package/dist/table-ng/smart-table-ng.js +1 -1
  272. package/dist/table-ng/table-ng.js +1 -1
  273. package/dist/tabs/collapsible-more.js +1 -1
  274. package/dist/tabs/collapsible-tab.js +3 -2
  275. package/dist/tabs/collapsible-tabs.js +1 -1
  276. package/dist/tabs/dumb-tabs.d.ts +4 -107
  277. package/dist/tabs/dumb-tabs.js +6 -12
  278. package/dist/tabs/smart-tabs.js +3 -3
  279. package/dist/tabs/tab.d.ts +2 -0
  280. package/dist/tabs/tabs.js +1 -1
  281. package/dist/tabs-ng/tabs-ng.js +1 -6
  282. package/dist/tabs-ng/tabs-ng__template.js +1 -1
  283. package/dist/tag/tag.d.ts +1 -0
  284. package/dist/tag/tag.js +5 -4
  285. package/dist/tags-input/tags-input.js +5 -9
  286. package/dist/tags-input-ng/tags-input-ng.js +4 -8
  287. package/dist/tags-list/tags-list.js +1 -1
  288. package/dist/text/text.js +1 -1
  289. package/dist/toggle/toggle.d.ts +9 -89
  290. package/dist/toggle/toggle.js +7 -8
  291. package/dist/toggle-ng/toggle-ng.js +2 -3
  292. package/dist/tooltip/tooltip.d.ts +1 -0
  293. package/dist/tooltip/tooltip.js +6 -3
  294. package/dist/user-agreement/service.d.ts +2 -2
  295. package/dist/user-agreement/service.js +9 -13
  296. package/dist/user-agreement/user-agreement.js +8 -10
  297. package/dist/user-card/smart-user-card-tooltip.js +6 -11
  298. package/dist/user-card/tooltip.js +1 -1
  299. package/dist/user-card/user-card.js +2 -7
  300. package/dist/user-card-ng/user-card-ng.js +4 -9
  301. package/package.json +5 -5
  302. package/webpack.config.js +0 -11
  303. package/components/global/conic-gradient.d.ts +0 -796
  304. package/components/global/conic-gradient.js +0 -21
  305. package/components/global/radial-gradient-mask.d.ts +0 -9
  306. package/components/global/radial-gradient-mask.js +0 -39
  307. package/components/global/supports-css.d.ts +0 -2
  308. package/components/global/supports-css.js +0 -14
  309. package/components/global/variables_dark.d.ts +0 -3
  310. package/components/global/variables_dark.js +0 -53
  311. package/components/loader-inline/inject-styles.d.ts +0 -2
  312. package/components/loader-inline/inject-styles.js +0 -17
  313. package/dist/_helpers/inject-styles.js +0 -22
  314. package/dist/global/conic-gradient.d.ts +0 -796
  315. package/dist/global/conic-gradient.js +0 -35
  316. package/dist/global/radial-gradient-mask.d.ts +0 -9
  317. package/dist/global/radial-gradient-mask.js +0 -49
  318. package/dist/global/supports-css.d.ts +0 -2
  319. package/dist/global/supports-css.js +0 -20
  320. package/dist/global/variables_dark.d.ts +0 -3
  321. package/dist/global/variables_dark.js +0 -57
  322. package/dist/loader-inline/inject-styles.d.ts +0 -2
  323. package/dist/loader-inline/inject-styles.js +0 -11
@@ -1,33 +1,139 @@
1
1
  @import "../global/variables.css";
2
2
 
3
3
  @value unit from "../global/global.css";
4
+ @value button, active, primary, button-shadow from "../button/button.css";
4
5
 
5
6
  :root {
6
- --ring-button-group-default-z-index: 0;
7
- --ring-button-group-disabled-z-index: -1;
8
- --ring-button-group-active-z-index: 1;
9
- --ring-button-group-hover-z-index: 2;
10
- --ring-button-group-focus-z-index: 3;
7
+ --ring-button-group-default-z-index: 1;
8
+ --ring-button-group-disabled-z-index: 0;
9
+ --ring-button-group-active-z-index: 2;
10
+ --ring-button-group-hover-z-index: 3;
11
+ --ring-button-group-focus-z-index: 4;
12
+ }
13
+
14
+ .common {
15
+ display: inline-block;
16
+
17
+ white-space: nowrap;
11
18
  }
12
19
 
13
20
  .buttonGroup {
21
+ composes: common;
14
22
  composes: buttonGroup from "../button-toolbar/button-toolbar.css";
15
23
 
24
+ border-radius: var(--ring-border-radius);
25
+
26
+ box-shadow: button-shadow var(--ring-borders-color);
27
+ }
28
+
29
+ .buttonGroup .button {
30
+ --ring-button-group-button-border-color: var(--ring-borders-color);
31
+
16
32
  position: relative;
17
- z-index: 0;
18
33
 
19
- display: inline-block;
34
+ transition: none;
20
35
 
21
- white-space: nowrap;
36
+ box-shadow: 0 1px var(--ring-button-group-button-border-color) inset, 0 -1px var(--ring-button-group-button-border-color) inset;
22
37
  }
23
38
 
24
- .buttonGroup button,
25
- .buttonGroup .button {
26
- margin: 0 0 0 -1px;
39
+ .buttonGroup .button[disabled] {
40
+ --ring-button-group-button-border-color: var(--ring-border-unselected-disabled-color);
41
+
42
+ /* stylelint-disable-next-line selector-max-specificity */
43
+ &::before,
44
+ &::after {
45
+ position: absolute;
46
+ z-index: 0;
47
+ top: 0;
48
+ bottom: 0;
49
+
50
+ width: var(--ring-border-radius);
51
+
52
+ content: "";
53
+
54
+ background-color: var(--ring-disabled-background-color);
55
+
56
+ box-shadow: 0 1px var(--ring-border-unselected-disabled-color) inset, 0 -1px var(--ring-border-unselected-disabled-color) inset;
57
+ }
58
+
59
+ /* stylelint-disable-next-line selector-max-specificity */
60
+ &::before {
61
+ left: calc(var(--ring-border-radius) * -1);
62
+ }
63
+
64
+ /* stylelint-disable-next-line selector-max-specificity */
65
+ &::after {
66
+ right: calc(var(--ring-border-radius) * -1);
67
+ }
68
+ }
69
+
70
+ .buttonGroup > .button:first-child,
71
+ .buttonGroup > :first-child .button {
72
+ box-shadow: 0 1px var(--ring-button-group-button-border-color) inset, 0 -1px var(--ring-button-group-button-border-color) inset, 1px 0 var(--ring-button-group-button-border-color) inset;
73
+
74
+ /* stylelint-disable-next-line selector-max-specificity */
75
+ &::before {
76
+ display: none;
77
+ }
78
+ }
79
+
80
+ .buttonGroup > .button:last-child,
81
+ .buttonGroup > :last-child .button {
82
+ box-shadow: 0 1px var(--ring-button-group-button-border-color) inset, 0 -1px var(--ring-button-group-button-border-color) inset, -1px 0 var(--ring-button-group-button-border-color) inset;
83
+
84
+ /* stylelint-disable-next-line selector-max-specificity */
85
+ &::after {
86
+ display: none;
87
+ }
88
+ }
89
+
90
+ /* stylelint-disable-next-line selector-max-specificity */
91
+ .buttonGroup .button.button:hover,
92
+ .buttonGroup .button.button:active {
93
+ border-radius: var(--ring-border-radius);
94
+ box-shadow: button-shadow var(--ring-border-hover-color);
95
+ }
96
+
97
+ /* stylelint-disable-next-line selector-max-specificity */
98
+ .buttonGroup .button.button:global(.focus-visible) {
99
+ border-radius: var(--ring-border-radius);
100
+ box-shadow: button-shadow var(--ring-border-hover-color), 0 0 0 1px var(--ring-border-hover-color);
101
+ }
102
+
103
+ /* stylelint-disable-next-line selector-max-specificity */
104
+ .buttonGroup .button.button.active {
105
+ border-radius: var(--ring-border-radius);
106
+ box-shadow: button-shadow var(--ring-main-color);
107
+ }
108
+
109
+ /* stylelint-disable-next-line selector-max-specificity */
110
+ .buttonGroup .button:global(.focus-visible).active {
111
+ border-radius: var(--ring-border-radius);
112
+ box-shadow: button-shadow var(--ring-main-color), 0 0 0 1px var(--ring-border-hover-color);
113
+ }
114
+
115
+ /* stylelint-disable-next-line selector-max-specificity */
116
+ .buttonGroup .button.active[disabled] {
117
+ box-shadow: button-shadow var(--ring-border-disabled-color);
118
+ }
119
+
120
+ .split {
121
+ composes: common;
122
+
123
+ position: relative;
124
+ z-index: 0;
125
+ }
27
126
 
127
+ .common button,
128
+ .common .button {
28
129
  border-radius: 0;
29
130
  }
30
131
 
132
+ .split button,
133
+ .split .button {
134
+ margin: 0 0 0 -1px;
135
+ }
136
+
31
137
  .caption {
32
138
  composes: font from "../global/global.css";
33
139
 
@@ -40,24 +146,31 @@
40
146
  }
41
147
  }
42
148
 
43
- .buttonGroup > .caption + .button,
44
- .buttonGroup > button:first-child,
45
- .buttonGroup > .button:first-child,
46
- .buttonGroup > :first-child .button {
149
+ .common > button:first-child,
150
+ .common > .button:first-child,
151
+ .common > :first-child .button {
47
152
  margin: 0;
48
153
 
49
154
  border-top-left-radius: var(--ring-border-radius);
50
155
  border-bottom-left-radius: var(--ring-border-radius);
51
156
  }
52
157
 
53
- .buttonGroup > .button:last-child,
54
- .buttonGroup > button:last-child,
55
- .buttonGroup > :last-child .button {
158
+ .common > .button:last-child,
159
+ .common > button:last-child,
160
+ .common > :last-child .button {
56
161
  border-top-right-radius: var(--ring-border-radius);
57
162
  border-bottom-right-radius: var(--ring-border-radius);
58
163
  }
59
164
 
60
- .buttonGroup {
165
+ .split .primary:not(:last-child) {
166
+ margin-right: 1px;
167
+ }
168
+
169
+ .split .primary:not(:first-child) {
170
+ margin-left: 1px;
171
+ }
172
+
173
+ .common {
61
174
  & .button {
62
175
  position: relative;
63
176
  z-index: var(--ring-button-group-default-z-index);
@@ -81,5 +194,9 @@
81
194
 
82
195
  & .active {
83
196
  z-index: var(--ring-button-group-active-z-index);
197
+
198
+ &[disabled] {
199
+ z-index: var(--ring-button-group-default-z-index);
200
+ }
84
201
  }
85
202
  }
@@ -1,10 +1,13 @@
1
1
  import { PureComponent, HTMLAttributes } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import Caption from './caption';
4
+ export interface ButtonGroupProps extends HTMLAttributes<HTMLElement> {
5
+ split?: boolean | null | undefined;
6
+ }
4
7
  /**
5
8
  * @name Button Group
6
9
  */
7
- export default class ButtonGroup extends PureComponent<HTMLAttributes<HTMLElement>> {
10
+ export default class ButtonGroup extends PureComponent<ButtonGroupProps> {
8
11
  static propTypes: {
9
12
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
10
13
  className: PropTypes.Requireable<string>;
@@ -12,9 +12,9 @@ export default class ButtonGroup extends PureComponent {
12
12
  className: PropTypes.string
13
13
  };
14
14
  render() {
15
- const { className } = this.props;
16
- const classes = classNames(styles.buttonGroup, className);
17
- return (<div {...this.props} className={classes}/>);
15
+ const { className, split, ...restProps } = this.props;
16
+ const classes = classNames(split ? styles.split : styles.buttonGroup, className);
17
+ return (<div {...restProps} className={classes}/>);
18
18
  }
19
19
  }
20
20
  export { Caption };
@@ -1,3 +1,4 @@
1
1
  .buttonGroup {
2
2
  font-size: 0;
3
+ line-height: 0;
3
4
  }
@@ -19,8 +19,8 @@ export const basic = () => {
19
19
  angular.module(APP_NAME, [ButtonNG, ButtonGroupNG]);
20
20
 
21
21
  return `
22
+ <span rg-button-group-caption>Side</span>
22
23
  <div rg-button-group>
23
- <span rg-button-group-caption>Side</span>
24
24
  <rg-button>Left</rg-button>
25
25
  <rg-button>Right</rg-button>
26
26
  </div>
@@ -9,6 +9,7 @@ import IconNG from '../icon-ng/icon-ng';
9
9
  import ThemeNG from '../theme-ng/theme-ng';
10
10
  import CheckboxNG from '../checkbox-ng/checkbox-ng';
11
11
  import Theme from '../global/theme';
12
+ import styles from '../global/variables_dark.css';
12
13
 
13
14
  import ButtonNG from './button-ng';
14
15
 
@@ -88,9 +89,7 @@ export const basic = () => {
88
89
  <div ng-controller="testCtrl">
89
90
  <div class="buttons">${renderAllButtons()}</div>
90
91
 
91
- <rg-theme theme="Theme.DARK">
92
- <div class="buttons dark">${renderAllButtons()}</div>
93
- </rg-theme>
92
+ <div class="buttons ${styles.dark}">${renderAllButtons()}</div>
94
93
  </div>
95
94
  `;
96
95
 
@@ -108,12 +107,12 @@ basic.parameters = {
108
107
  },
109
108
  storyStyles: `
110
109
  <style>
111
- .buttons > button {
112
- margin: 8px;
110
+ .buttons {
111
+ background-color: var(--ring-content-background-color);
113
112
  }
114
113
 
115
- .dark {
116
- background: #000;
114
+ .buttons > button {
115
+ margin: 8px;
117
116
  }
118
117
  </style>`
119
118
  };
@@ -5,10 +5,11 @@ import classNames from 'classnames';
5
5
  import RingAngularComponent from '../global/ring-angular-component';
6
6
  import {addClasses, applyMethodToClasses, removeClasses} from '../global/dom';
7
7
  import IconNG from '../icon-ng/icon-ng';
8
- import Theme, {applyTheme} from '../global/theme';
9
8
  import styles from '../button/button.css';
10
9
  import {getButtonClasses} from '../button/button__classes';
11
10
 
11
+ import {ControlsHeight} from '../global/controls-height';
12
+
12
13
  import overrides from './button-ng.css';
13
14
 
14
15
  const {ringIconDefaultColor, iconMarginFix, transcludeSpacer} = overrides;
@@ -92,7 +93,6 @@ class ButtonController extends RingAngularComponent {
92
93
  this.updateClasses();
93
94
  this.updateIcon();
94
95
  });
95
- $attrs.$observe('theme', this.updateClasses);
96
96
  }
97
97
 
98
98
  getAttrValue(attribute) {
@@ -103,13 +103,12 @@ class ButtonController extends RingAngularComponent {
103
103
  updateClasses = () => {
104
104
  const {$attrs} = this.$inject;
105
105
 
106
- const theme = this.element.classList.contains(styles.light) ? Theme.LIGHT : Theme.DARK;
107
-
108
106
  const foreignClasses = [...this.element.classList].filter(name => !buttonClassesMap[name]);
109
107
 
110
108
  this.element.className = classNames(
111
109
  foreignClasses,
112
110
  getButtonClasses({
111
+ height: ControlsHeight.S,
113
112
  className: styles.button,
114
113
  active: this.getAttrValue($attrs.active),
115
114
  disabled: this.getAttrValue($attrs.disabled),
@@ -120,8 +119,7 @@ class ButtonController extends RingAngularComponent {
120
119
  inline: this.getAttrValue($attrs.inline),
121
120
  danger: this.getAttrValue($attrs.danger),
122
121
  delayed: this.getAttrValue($attrs.delayed),
123
- icon: $attrs.icon,
124
- theme
122
+ icon: $attrs.icon
125
123
  }),
126
124
  {
127
125
  // Some overrides for angular buttons
@@ -169,24 +167,13 @@ class ButtonController extends RingAngularComponent {
169
167
  };
170
168
  }
171
169
 
172
- function changeTheme(element, data) {
173
- return applyTheme({
174
- element,
175
- prevTheme: data.prevTheme && styles[data.prevTheme] || styles.light,
176
- currentTheme: styles[data.currentTheme]
177
- });
178
- }
179
-
180
170
  function createButtonDirective(tagName) {
181
171
  return () => ({
182
172
  restrict: 'E',
183
173
  transclude: true,
184
174
  replace: true,
185
- require: {
186
- rgThemeCtrl: '?^^rgTheme'
187
- },
188
175
  template: `
189
- <${tagName} class="${styles.button} ${styles.light}">
176
+ <${tagName} class="${styles.button}">
190
177
  <span class="${styles.content}"
191
178
  ><rg-icon class="${classNames(styles.icon, overrides.iconNg, iconMarginFix)}"></rg-icon
192
179
  ><ng-transclude></ng-transclude
@@ -194,13 +181,7 @@ function createButtonDirective(tagName) {
194
181
  ><div class="js-button-loader"></div>
195
182
  </${tagName}>
196
183
  `,
197
- controller: ButtonController,
198
- link: (scope, element, attrs, {rgThemeCtrl}) => {
199
- if (rgThemeCtrl) {
200
- changeTheme(element[0], {currentTheme: rgThemeCtrl.theme});
201
- rgThemeCtrl.on('change', (event, data) => changeTheme(element[0], data));
202
- }
203
- }
184
+ controller: ButtonController
204
185
  });
205
186
  }
206
187
 
@@ -1,6 +1,7 @@
1
1
  @import "../global/variables.css";
2
2
 
3
3
  @value unit from "../global/global.css";
4
+ @value button from "../button/button.css";
4
5
 
5
6
  .buttonSet {
6
7
  position: relative;
@@ -1,6 +1,7 @@
1
1
  @import "../global/variables.css";
2
2
 
3
3
  @value unit from "../global/global.css";
4
+ @value button from "../button/button.css";
4
5
 
5
6
  .buttonToolbar {
6
7
  display: inline-block;
@@ -8,6 +9,7 @@
8
9
  white-space: nowrap;
9
10
 
10
11
  font-size: 0;
12
+ line-height: 0;
11
13
  }
12
14
 
13
15
  .buttonToolbar > button,
@@ -36,7 +36,7 @@
36
36
  pointer-events: none;
37
37
 
38
38
  border: 1px solid var(--ring-borders-color);
39
- border-radius: 3px;
39
+ border-radius: var(--ring-border-radius);
40
40
  background-color: var(--ring-content-background-color);
41
41
  }
42
42
 
@@ -120,14 +120,20 @@
120
120
 
121
121
  /* stylelint-disable-next-line selector-max-specificity */
122
122
  &[disabled][disabled] + .cell {
123
- border-color: var(--ring-line-color);
124
- background-color: var(--ring-content-background-color);
123
+ border-color: var(--ring-border-unselected-disabled-color);
124
+ background-color: var(--ring-disabled-background-color);
125
+ }
126
+
127
+ /* stylelint-disable-next-line selector-max-specificity */
128
+ &[disabled]:checked + .cell,
129
+ &[disabled]:indeterminate + .cell {
130
+ border-color: var(--ring-border-disabled-color);
125
131
  }
126
132
 
127
133
  /* stylelint-disable-next-line selector-max-specificity */
128
134
  &[disabled]:checked + .cell .check,
129
135
  &[disabled]:indeterminate + .cell .minus {
130
- opacity: 0.5;
136
+ color: var(--ring-border-disabled-color);
131
137
  }
132
138
 
133
139
  /* stylelint-disable-next-line selector-max-specificity */
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import classNames from 'classnames';
3
3
  import PropTypes from 'prop-types';
4
4
  import Input from '../input/input';
5
+ import { ControlsHeight } from '../global/controls-height';
5
6
  import { dateType } from './consts';
6
7
  import styles from './date-picker.css';
7
8
  export default class DateInput extends React.PureComponent {
@@ -92,6 +93,6 @@ export default class DateInput extends React.PureComponent {
92
93
  }
93
94
  })();
94
95
  const classes = classNames(styles.filter, styles[`${name}Input`], divider && styles[`${name}InputWithDivider`], 'ring-js-shortcuts');
95
- return (<Input autoComplete="off" borderless data-name={name} inputRef={this.inputRef} className={classes} value={displayText} onChange={this.handleChange} onFocus={onActivate} onKeyDown={this.handleKeyDown} onClear={onClear} placeholder={placeholder}/>);
96
+ return (<Input autoComplete="off" borderless height={ControlsHeight.L} data-name={name} inputRef={this.inputRef} className={classes} value={displayText} onChange={this.handleChange} onFocus={onActivate} onKeyDown={this.handleKeyDown} onClear={onClear} placeholder={placeholder}/>);
96
97
  }
97
98
  }
@@ -94,6 +94,7 @@
94
94
  .fromInputWithDivider {
95
95
  &::after {
96
96
  position: absolute;
97
+ top: 0;
97
98
  right: unit;
98
99
 
99
100
  content: "—";
@@ -243,7 +244,7 @@
243
244
  }
244
245
 
245
246
  .current.current {
246
- color: var(--ring-dark-text-color);
247
+ color: var(--ring-white-text-color);
247
248
  border-radius: var(--ring-border-radius);
248
249
  background-color: var(--ring-main-color);
249
250
  }
@@ -1,6 +1,7 @@
1
1
  @import "../global/variables.css";
2
2
 
3
3
  @value unit from "../global/global.css";
4
+ @value header from "../island/island.css";
4
5
 
5
6
  .container {
6
7
  position: fixed;
@@ -39,8 +40,7 @@
39
40
 
40
41
  & .panel {
41
42
  margin-top: 0;
42
- padding-right: calc(unit * 4);
43
- padding-left: calc(unit * 4);
43
+ padding: calc(unit * 2) calc(unit * 4) calc(unit * 4);
44
44
 
45
45
  border-top: none;
46
46
 
@@ -54,7 +54,7 @@
54
54
  }
55
55
 
56
56
  .content.content {
57
- box-shadow: 0 2px 16px var(--ring-popup-shadow-color);
57
+ box-shadow: var(--ring-dialog-shadow);
58
58
  }
59
59
 
60
60
  .clickableOverlay {
@@ -117,3 +117,10 @@
117
117
  pointer-events: initial;
118
118
  }
119
119
  }
120
+
121
+ .container .header {
122
+ padding-top: calc(unit * 4);
123
+
124
+ font-size: 24px;
125
+ line-height: 28px;
126
+ }
@@ -3,6 +3,7 @@ export default `<div
3
3
  ng-class="[!dialog.inSidebar && dialog.dialogStyles.container]"
4
4
  ng-click="dialog.handleClick($event)"
5
5
  ng-attr-data-portaltarget="{{!dialog.inSidebar ? 'dialog-ng-popup-container' : null}}"
6
+ ng-attr-data-test="ring-dialog-container"
6
7
  >
7
8
  <div ng-class="[dialog.dialogStyles.innerContainer]">
8
9
  <div data-anchor="dialog-container"
@@ -20,7 +20,7 @@
20
20
 
21
21
  border-radius: var(--ring-border-radius);
22
22
  background: var(--ring-popup-background-color);
23
- box-shadow: 0 2px 16px 0 var(--ring-popup-shadow-color);
23
+ box-shadow: var(--ring-popup-shadow);
24
24
 
25
25
  font-family: var(--ring-font-family);
26
26
 
@@ -30,7 +30,7 @@
30
30
  border-radius: var(--ring-border-radius);
31
31
 
32
32
  background: var(--ring-popup-background-color);
33
- box-shadow: 0 2px 16px 0 var(--ring-popup-shadow-color);
33
+ box-shadow: var(--ring-popup-shadow);
34
34
 
35
35
  font-size: 12px;
36
36
  line-height: 22px;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ export declare enum ControlsHeight {
3
+ S = "S",
4
+ M = "M",
5
+ L = "L"
6
+ }
7
+ export declare const ControlsHeightContext: import("react").Context<ControlsHeight>;
@@ -0,0 +1,8 @@
1
+ import { createContext } from 'react';
2
+ export var ControlsHeight;
3
+ (function (ControlsHeight) {
4
+ ControlsHeight["S"] = "S";
5
+ ControlsHeight["M"] = "M";
6
+ ControlsHeight["L"] = "L";
7
+ })(ControlsHeight || (ControlsHeight = {}));
8
+ export const ControlsHeightContext = createContext(ControlsHeight.M);
@@ -1,26 +1,13 @@
1
- import React, { RefAttributes, ExoticComponent, PropsWithoutRef, FunctionComponent } from 'react';
1
+ import React, { HTMLAttributes } from 'react';
2
2
  declare enum Theme {
3
+ AUTO = "auto",
3
4
  LIGHT = "light",
4
5
  DARK = "dark"
5
6
  }
6
- export declare const ThemeContext: React.Context<Theme | null>;
7
- export interface ThemeOuterProps {
8
- theme?: Theme | null | undefined;
7
+ export declare function useTheme(): Theme.LIGHT | Theme.DARK;
8
+ export interface ThemeProviderProps extends HTMLAttributes<HTMLDivElement> {
9
+ theme?: Theme;
10
+ passToPopups?: boolean;
9
11
  }
10
- export interface ThemeProps {
11
- theme: Theme;
12
- }
13
- declare type ClassComponentType<T, P> = T extends React.Component<P> ? new (props: P) => T : never;
14
- declare type ExoticComponentType<T, P> = ExoticComponent<PropsWithoutRef<P> & RefAttributes<T>>;
15
- declare type AnyComponentType<T, P> = ClassComponentType<T, P> | FunctionComponent<P> | ExoticComponentType<T, P>;
16
- export declare const withTheme: (defaultTheme?: Theme) => <T, P extends ThemeProps, S>(ComposedComponent: AnyComponentType<T, P> & S) => React.NamedExoticComponent<React.PropsWithRef<React.PropsWithoutRef<Omit<JSX.LibraryManagedAttributes<ClassComponentType<T, P> & S, P> | JSX.LibraryManagedAttributes<React.FunctionComponent<P> & S, P> | JSX.LibraryManagedAttributes<ExoticComponentType<T, P> & S, P>, "theme"> & ThemeOuterProps> & React.RefAttributes<T>>> & {
17
- readonly type: React.ForwardRefExoticComponent<React.PropsWithoutRef<Omit<JSX.LibraryManagedAttributes<ClassComponentType<T, P> & S, P> | JSX.LibraryManagedAttributes<React.FunctionComponent<P> & S, P> | JSX.LibraryManagedAttributes<ExoticComponentType<T, P> & S, P>, "theme"> & ThemeOuterProps> & React.RefAttributes<T>>;
18
- } & { [K in keyof S]: S[K]; };
19
- export interface ApplyThemeParams {
20
- element?: Element | null | undefined;
21
- prevTheme?: string | null | undefined;
22
- currentTheme?: string | null | undefined;
23
- }
24
- declare function applyTheme(params: ApplyThemeParams): void;
25
- export { applyTheme };
12
+ export declare const ThemeProvider: React.ForwardRefExoticComponent<ThemeProviderProps & React.RefAttributes<HTMLDivElement>>;
26
13
  export default Theme;
@@ -1,39 +1,33 @@
1
- import React, { createContext, forwardRef, memo } from 'react';
1
+ import React, { useMemo, useState, useEffect, forwardRef } from 'react';
2
+ import classNames from 'classnames';
3
+ import { PopupTarget } from '../popup/popup.target';
4
+ import styles from './variables_dark.css';
5
+ import getUID from './get-uid';
2
6
  var Theme;
3
7
  (function (Theme) {
8
+ Theme["AUTO"] = "auto";
4
9
  Theme["LIGHT"] = "light";
5
10
  Theme["DARK"] = "dark";
6
11
  })(Theme || (Theme = {}));
7
- export const ThemeContext = createContext(null);
8
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
- const getDisplayName = (Component) => Component.name ?? Component.displayName ?? 'Component';
10
- export const withTheme = (defaultTheme = Theme.LIGHT) => (ComposedComponent) => {
11
- // eslint-disable-next-line react/display-name
12
- const WithTheme = memo(forwardRef(({ theme, ...restProps }, ref) => (<ThemeContext.Consumer>
13
- {contextTheme => {
14
- const usedTheme = theme || contextTheme || defaultTheme;
15
- const Component = ComposedComponent;
16
- return (<ThemeContext.Provider value={usedTheme}>
17
- <Component ref={ref}
18
- // https://github.com/Microsoft/TypeScript/issues/28938#issuecomment-450636046
19
- {...restProps} theme={usedTheme}/>
20
- </ThemeContext.Provider>);
21
- }}
22
- </ThemeContext.Consumer>)));
23
- const WithThemeAndStatics = Object.assign(WithTheme, ComposedComponent, {
24
- displayName: `withTheme(${getDisplayName(ComposedComponent)})`,
25
- propTypes: null
26
- });
27
- return WithThemeAndStatics;
28
- };
29
- function applyTheme(params) {
30
- if (!params || !params.element || !params.currentTheme) {
31
- return;
32
- }
33
- if (params.prevTheme) {
34
- params.element.classList.remove(params.prevTheme);
35
- }
36
- params.element.classList.add(params.currentTheme);
12
+ const darkMatcher = window.matchMedia('(prefers-color-scheme: dark)');
13
+ export function useTheme() {
14
+ const [dark, setDark] = useState(darkMatcher.matches);
15
+ useEffect(() => {
16
+ const onChange = (e) => setDark(e.matches);
17
+ darkMatcher.addEventListener('change', onChange);
18
+ return () => darkMatcher.removeEventListener('change', onChange);
19
+ }, []);
20
+ return dark ? Theme.DARK : Theme.LIGHT;
37
21
  }
38
- export { applyTheme };
22
+ export const ThemeProvider = forwardRef(function ThemeProvider({ theme = Theme.AUTO, className, passToPopups, children, ...restProps }, ref) {
23
+ const systemTheme = useTheme();
24
+ const resolvedTheme = theme === Theme.AUTO ? systemTheme : theme;
25
+ const id = useMemo(() => getUID('popups-with-theme-'), []);
26
+ return (<div ref={ref} className={classNames(className, { [styles.dark]: resolvedTheme === Theme.DARK })} {...restProps}>{passToPopups
27
+ ? (<PopupTarget id={id}>
28
+ {target => <>{children}{target}</>}
29
+ </PopupTarget>)
30
+ : children}
31
+ </div>);
32
+ });
39
33
  export default Theme;