@jetbrains/ring-ui-built 8.0.0-beta.10 → 8.0.0-beta.11

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.
@@ -60,8 +60,13 @@ import '../popup/popup.js';
60
60
  import '../popup/position.js';
61
61
  import '../popup/popup.consts.js';
62
62
  import '../popup/position-css.js';
63
- import '../_helpers/dialog-body-scroll-preventer.js';
63
+ import '../global/get-viewport-size.js';
64
+ import '../dialog/dialog-body-scroll-preventer.js';
64
65
  import 'scrollbar-width';
66
+ import '../_helpers/dialog.js';
67
+ import '../dialog/dialog-controls.js';
68
+ import '@jetbrains/icons/resize-corner-12px';
69
+ import '../dialog/dialog-geometry.js';
65
70
  import '../panel/panel.js';
66
71
  import '../i18n/i18n-context.js';
67
72
  import '../i18n/i18n.js';
@@ -283,6 +288,9 @@ class UserAgreementService {
283
288
  preview,
284
289
  ...restOptions
285
290
  };
291
+ if (!this.container.isConnected) {
292
+ document.body.appendChild(this.container);
293
+ }
286
294
  this.reactRoot.render(/*#__PURE__*/jsx(ControlsHeightContext, {
287
295
  value: getGlobalControlsHeight(),
288
296
  children: /*#__PURE__*/jsx(UserAgreement, {
@@ -1,6 +1,6 @@
1
1
  import { PureComponent } from 'react';
2
- import classNames from 'classnames';
3
2
  import Dialog from '../dialog/dialog.js';
3
+ import 'classnames';
4
4
  import { jsx, jsxs } from 'react/jsx-runtime';
5
5
  import '../_helpers/island.js';
6
6
  import HeaderWrapper from '../island/header.js';
@@ -9,7 +9,6 @@ import Panel from '../panel/panel.js';
9
9
  import { Button } from '../button/button.js';
10
10
  import { I18nContext } from '../i18n/i18n-context.js';
11
11
  import 'react-dom';
12
- import '@jetbrains/icons/close';
13
12
  import '../island/island.js';
14
13
  import '../global/data-tests.js';
15
14
  import '../island/adaptive-island-hoc.js';
@@ -33,21 +32,27 @@ import '../popup/position.js';
33
32
  import '../popup/popup.consts.js';
34
33
  import '../popup/position-css.js';
35
34
  import '../_helpers/theme.js';
36
- import '../_helpers/dialog-body-scroll-preventer.js';
35
+ import '../global/get-viewport-size.js';
36
+ import '../dialog/dialog-body-scroll-preventer.js';
37
37
  import 'scrollbar-width';
38
- import '@jetbrains/icons/chevron-down';
39
- import '@jetbrains/icons/chevron-12px-down';
38
+ import '../_helpers/dialog.js';
39
+ import '../dialog/dialog-controls.js';
40
+ import '@jetbrains/icons/close';
41
+ import '@jetbrains/icons/resize-corner-12px';
40
42
  import '../icon/icon.js';
41
43
  import 'util-deprecate';
42
44
  import '../icon/icon.constants.js';
43
45
  import '../_helpers/icon-svg.js';
44
46
  import '../global/memoize.js';
47
+ import '@jetbrains/icons/chevron-down';
48
+ import '@jetbrains/icons/chevron-12px-down';
45
49
  import '../link/clickable-link.js';
46
50
  import '../global/controls-height.js';
47
51
  import '../_helpers/button.classes.js';
52
+ import '../dialog/dialog-geometry.js';
48
53
  import '../i18n/i18n.js';
49
54
 
50
- var style = {"extra-small-screen-media":"(max-width: 639px)","agreementDialog":"ring-user-agreement-agreementDialog","dialogContent":"ring-user-agreement-dialogContent","suggestion":"ring-user-agreement-suggestion","remindLaterButton":"ring-user-agreement-remindLaterButton"};
55
+ var style = {"extra-small-screen-media":"(max-width: 639px)","dialogContent":"ring-user-agreement-dialogContent","suggestion":"ring-user-agreement-suggestion"};
51
56
 
52
57
  function noop() {}
53
58
  /**
@@ -85,11 +90,11 @@ class UserAgreement extends PureComponent {
85
90
  children: ({
86
91
  translate
87
92
  }) => {
88
- var _translations$userAgr, _translations$userAgr2, _translations$scrollT, _translations$accept, _translations$decline, _translations$scrollT2, _translations$remindL, _translations$close;
93
+ var _translations$userAgr, _translations$userAgr2, _translations$scrollT, _translations$scrollT2, _translations$decline, _translations$remindL, _translations$accept, _translations$close;
89
94
  return /*#__PURE__*/jsxs(Dialog, {
90
95
  label: (_translations$userAgr = translations?.userAgreement) !== null && _translations$userAgr !== void 0 ? _translations$userAgr : translate('userAgreement'),
91
96
  show: show,
92
- className: classNames(style.agreementDialog, className),
97
+ className: className !== null && className !== void 0 ? className : undefined,
93
98
  contentClassName: style.dialogContent,
94
99
  trapFocus: true,
95
100
  autoFocusFirst: false,
@@ -105,25 +110,24 @@ class UserAgreement extends PureComponent {
105
110
  children: [onRemindLater && !scrolledDown && /*#__PURE__*/jsx("div", {
106
111
  className: style.suggestion,
107
112
  children: (_translations$scrollT = translations?.scrollToAccept) !== null && _translations$scrollT !== void 0 ? _translations$scrollT : translate('scrollToAccept')
108
- }), /*#__PURE__*/jsx(Button, {
109
- primary: true,
110
- disabled: !scrolledDown,
111
- onClick: onAccept,
112
- "data-test": "accept",
113
- children: (_translations$accept = translations?.accept) !== null && _translations$accept !== void 0 ? _translations$accept : translate('accept')
113
+ }), !onRemindLater && !scrolledDown && /*#__PURE__*/jsx("span", {
114
+ className: style.suggestion,
115
+ children: (_translations$scrollT2 = translations?.scrollToAccept) !== null && _translations$scrollT2 !== void 0 ? _translations$scrollT2 : translate('scrollToAccept')
114
116
  }), /*#__PURE__*/jsx(Button, {
115
117
  onClick: onDecline,
116
118
  autoFocus: true,
117
119
  "data-test": "decline",
118
120
  children: (_translations$decline = translations?.decline) !== null && _translations$decline !== void 0 ? _translations$decline : translate('decline')
119
- }), !onRemindLater && !scrolledDown && /*#__PURE__*/jsx("span", {
120
- className: style.suggestion,
121
- children: (_translations$scrollT2 = translations?.scrollToAccept) !== null && _translations$scrollT2 !== void 0 ? _translations$scrollT2 : translate('scrollToAccept')
122
121
  }), onRemindLater && /*#__PURE__*/jsx(Button, {
123
- className: style.remindLaterButton,
124
122
  onClick: onRemindLater,
125
123
  "data-test": "later",
126
124
  children: (_translations$remindL = translations?.remindLater) !== null && _translations$remindL !== void 0 ? _translations$remindL : translate('remindLater')
125
+ }), /*#__PURE__*/jsx(Button, {
126
+ primary: true,
127
+ disabled: !scrolledDown,
128
+ onClick: onAccept,
129
+ "data-test": "accept",
130
+ children: (_translations$accept = translations?.accept) !== null && _translations$accept !== void 0 ? _translations$accept : translate('accept')
127
131
  })]
128
132
  }), preview && /*#__PURE__*/jsx(Panel, {
129
133
  children: /*#__PURE__*/jsx(Button, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetbrains/ring-ui-built",
3
- "version": "8.0.0-beta.10",
3
+ "version": "8.0.0-beta.11",
4
4
  "description": "JetBrains UI library",
5
5
  "author": {
6
6
  "name": "JetBrains"
@@ -112,7 +112,7 @@
112
112
  }
113
113
  },
114
114
  "dependencies": {
115
- "@jetbrains/icons": "^5.23.0",
115
+ "@jetbrains/icons": "^5.23.3",
116
116
  "change-case": "^4.1.1",
117
117
  "classnames": "^2.5.1",
118
118
  "combokeys": "^3.0.1",
@@ -133,7 +133,7 @@
133
133
  "util-deprecate": "^1.0.2"
134
134
  },
135
135
  "engines": {
136
- "node": ">=14.0",
136
+ "node": "^22.22.3 || ^24.15 || >=26.0",
137
137
  "npm": ">=6.0.0"
138
138
  },
139
139
  "bugs": {
@@ -1,50 +0,0 @@
1
- import scrollbarWidth from 'scrollbar-width';
2
-
3
- var styles = {"header":"ring-island-header","scrollableWrapper":"ring-island-scrollableWrapper","panel":"ring-panel-panel","container":"ring-dialog-container","nativeDialog":"ring-dialog-nativeDialog","innerContainer":"ring-dialog-innerContainer","content":"ring-dialog-content","contentCloseButtonOutside":"ring-dialog-contentCloseButtonOutside","contentCloseButtonInside":"ring-dialog-contentCloseButtonInside","clickableOverlay":"ring-dialog-clickableOverlay","closeIconOutside":"ring-dialog-closeIconOutside","closeIcon":"ring-dialog-closeIcon","closeButton":"ring-dialog-closeButton","closeButtonOutside":"ring-dialog-closeButtonOutside","closeButtonInside":"ring-dialog-closeButtonInside","documentWithoutScroll":"ring-dialog-documentWithoutScroll","popupTarget":"ring-dialog-popupTarget","dense":"ring-dialog-dense"};
4
-
5
- const isPrevented = new Set();
6
- let previousDocumentWidth = null;
7
- const prevent = key => {
8
- if (isPrevented.has(key)) {
9
- return;
10
- }
11
- isPrevented.add(key);
12
- if (isPrevented.size > 1) {
13
- return;
14
- }
15
- const documentHasScroll = document.documentElement.scrollHeight > window.innerHeight || getComputedStyle(document.documentElement).overflowY === 'scroll';
16
- document.documentElement.classList.add(styles.documentWithoutScroll);
17
- const scrollWidth = scrollbarWidth();
18
- const {
19
- scrollbarGutter
20
- } = getComputedStyle(document.documentElement);
21
- const documentHasScrollbarGutter = scrollbarGutter === 'stable' || scrollbarGutter === 'both-edges';
22
- if (documentHasScroll && scrollWidth !== null && scrollWidth !== undefined && scrollWidth > 0 && !documentHasScrollbarGutter) {
23
- previousDocumentWidth = document.documentElement.style.width;
24
- document.documentElement.style.width = `calc(100% - ${scrollWidth}px)`;
25
- }
26
- };
27
- const reset = key => {
28
- if (isPrevented.size === 0) {
29
- return;
30
- }
31
- isPrevented.delete(key);
32
- if (isPrevented.size > 0) {
33
- return;
34
- }
35
- document.documentElement.classList.remove(styles.documentWithoutScroll);
36
- if (previousDocumentWidth !== null && previousDocumentWidth !== undefined) {
37
- document.documentElement.style.width = previousDocumentWidth;
38
- previousDocumentWidth = null;
39
- }
40
- };
41
- const preventerFactory = key => {
42
- const preventerKey = key || Math.random();
43
- return {
44
- prevent: () => prevent(preventerKey),
45
- reset: () => reset(preventerKey)
46
- };
47
- };
48
- var dialogBodyScrollPreventer = preventerFactory('default-preventer');
49
-
50
- export { dialogBodyScrollPreventer as d, preventerFactory as p, styles as s };