@jetbrains/ring-ui 5.0.16 → 5.0.19

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 DELETED
@@ -1,995 +0,0 @@
1
- ## [5.0.0]
2
-
3
- ### BREAKING CHANGES
4
- - Design of some components is changed, see [RG-2156](https://youtrack.jetbrains.com/issue/RG-2156). By default, controls (buttons, inputs etc.) have 28px height. To bring back the old compact 24px height, wrap your app into `ControlsHeightContext.Provider`:
5
- ```js
6
- import {ControlsHeight, ControlsHeightContext} from '@jetbrains/ring-ui/components/global/controls-height';
7
-
8
- <ControlsHeightContext.Provider value={ControlsHeight.S}>
9
- <App />
10
- </ControlsHeightContext.Provider>
11
- ```
12
- - Input: removed `compact` and `renderUnderline` props
13
- - Select: removed `Type.MATERIAL`
14
- - Toggle: added `Size.Size14` which is the new default
15
- - Button Group: caption should be pllaced outside of the group
16
- ```
17
- // Before
18
- <ButtonGroup>
19
- <Caption>Side:</Caption>
20
- <Button>Left</Button>
21
- <Button>Right</Button>
22
- </ButtonGroup>
23
-
24
- // After
25
- <>
26
- <Caption>Side:</Caption>
27
- <ButtonGroup>
28
- <Button>Left</Button>
29
- <Button>Right</Button>
30
- </ButtonGroup>
31
- </>
32
- ```
33
- - Components no longer accept `theme` prop, themes are managed using CSS Custom Properties instead. To apply a theme to your app or some part of it, wrap it into `ThemeProvider`:
34
- ```js
35
- import Theme, {ThemeProvider} from '@jetbrains/ring-ui/components/global/theme';
36
-
37
- <ThemeProvider theme={Theme.DARK}>{children}</ThemeProvider>
38
- ```
39
-
40
- If you still need to apply theme to the global scope, here is a solution:
41
- ```js
42
- import Theme, {applyTheme} from '@jetbrains/ring-ui/components/global/theme';
43
-
44
- applyTheme(Theme.DARK, document.body);
45
- ```
46
- You can also pass `Theme.AUTO` to use the user-defined system theme.
47
- The only exceptions are the components that provide dark context by default: Alert, Header, Message. Those still accept a `theme` prop.
48
- - `--ring-dark-*` CSS custom properties are removed, `--ring-dark-text-color` is renamed to `--ring-white-text-color`
49
- - `--ring-message-background-color` is removed in favor of `--ring-popup-background-color`
50
- - The codebase has migrated to TypeScript
51
- - `react-markdown` has been updated to v7, which affects the props of `Markdown` component. The most notable change is replacing `source` with `children`:
52
- ```js
53
- // before
54
- <Markdown source="some markdown" />
55
-
56
- // after
57
- <Markdown>some markdown</Markdown>
58
- ```
59
- See `react-markdown`'s [changelog](https://github.com/remarkjs/react-markdown/blob/main/changelog.md#600---2021-04-15) for other changes
60
- - Removed `core-js@2` support
61
- - Removed `webpack@4` support
62
-
63
- ## [4.2.0]
64
-
65
- ### React 18 support
66
-
67
- To enable the new root API, add the following code before any rendering:
68
- ```js
69
- import * as client from 'react-dom/client'
70
- import {setClient} from '@jetbrains/ring-ui/components/global/react-render-adapter'
71
-
72
- setClient(client)
73
- ```
74
-
75
- ## [4.1.0]
76
-
77
- ### Pre-built version
78
-
79
- Ring UI now comes with pre-built version in `@jetbrains/ring-ui/dist` directory.
80
- This addresses the following issues:
81
-
82
- * does not require using specific bundler (WebPack) anymore
83
- * does not require dealing with Ring UI building configuration
84
- * decreases your project build time
85
-
86
- See "README.md" for quick start with pre-built version
87
-
88
- ## [4.0.0]
89
-
90
- ### BREAKING CHANGES
91
- - `WebPack 4` is no longer supported. Please upgrade your project to use `WebPack@>=5`.
92
- - `Code` no longer preloads any language highlighting. It's loaded lazily using dynamic imports instead. You can still preload the languages you need with `highlight.registerLanguage`, see https://jetbrains.github.io/ring-ui/master/index.html?path=/docs/components-code--basic. If you used the following line in your webpack config to reduce the bundle size, please remove it:
93
- ```js
94
- new webpack.NormalModuleReplacementPlugin(/@jetbrains\\/ring-ui\\/components\\/code\\/highlight.js$/, './highlight-lazy.js')
95
- ```
96
- - `date-picker` has migrated from `moment` to `date-fns`. All the props deprecated in 3.1.0 are now removed. `onDateChange` is renamed back to `onChange` and will be removed in 5.0.
97
- - `svg-inline-loader` is not used by Ring UI anymore. Consider installing and using own instance if needed:
98
- 1. `npm install svg-inline-loader -D`
99
- 2. Configure loader like this:
100
- ```js
101
- {
102
- test: /\.svg$/,
103
- loader: require.resolve('svg-inline-loader'),
104
- options: {removeSVGTagAttrs: false},
105
- include: [require('@jetbrains/icons')]
106
- }
107
- ```
108
- Also, Ring UI now imports ["js" versions of](https://github.com/JetBrains/icons/blob/master/CHANGELOG.md#3130-2021-01-27) `@jetbrains/icons`, so you may also want to.
109
- - `rerenderHOC` has no `captureNode` option anymore and is not in charge of capturing reference for wrapped component node.
110
- Component must capture and store own node in `this.node` property.
111
- See [commit](https://github.com/JetBrains/ring-ui/commit/885c49d90bc00241921da121602817eca43022d2) for more details.
112
- - `@jetbrains/generator-ring-ui` requires `yo` v4 (currently in beta)
113
-
114
- #### Moving away from SASS
115
- - `SASS` files are rewritten to `CSS`. If your project imports Ring UI's SCSS files, check same folder for new CSS options.
116
- - `global.scss` is not more available. If you use variables or mixins from this file, please consider having own copy.
117
- Old version can be found [here](https://github.com/JetBrains/ring-ui/blob/4ec18fa1bb/components/global/global.scss).
118
-
119
- ## [3.1.0]
120
- Some of the props of `date-picker` are changed or deprecared to allow removing the dependency on `moment` package in v4:
121
- - passing `moment` instance as `date`, `from`, `to`, `minDate`, and `maxDate` props is deprecated. They still accept js `Date` objects, strings, and numeric timestamps
122
- - in `withTime` mode, the time should be passed as a part of `date` prop:
123
- ```js
124
- // before
125
- <DatePicker date="8 January 2020" time="9:45"/>
126
-
127
- // after
128
- <DatePicker date="8 January 2020, 9:45"/>
129
- ```
130
- - `displayFormat`, `displayMonthFormat`, and `displayDateFormat` now accept a function of type `Date => string` instead of string
131
- - `inputFormat` is replaced with `parseDateInput` which accepts a function of type `string => Date`
132
- - `onChange` is replaced with `onDateChange` which has a different signature: all `moment` objects are replaced with js `Date` objects. In `withTime` mode, `onDateChange` is called with a single js `Date` object containing both date and time info instead of an object with separate `date` and `time` fields
133
-
134
- ## [3.0.0]
135
-
136
- Minimum required React version is now 16.8.0 (was 16.4.0 before). This allows Ring UI to use hooks and utilities such as `React.memo`.
137
- This release also stopped indirectly using deprecated `React.createFactory` API, which warns since React@16.13.
138
- If your project uses React@16.8.0+, there **are no action required** to be compatible with this release.
139
-
140
- ## [2.1.20]
141
-
142
- The JS part of Ring UI package is now marked as "sideEffect free". This means that webpack will [tree-shake](https://webpack.js.org/guides/tree-shaking/) unused imports of Ring UI files.
143
- Theoretically this may be breaking change, but we don't know any real case yet. We consider advantages of this change are more important
144
- than potential disadvantages.
145
-
146
- ## [2.0.2]
147
-
148
- - Due to deprecation, `postcss-cssnext` has been replaced with `postcss-preset-env`.
149
-
150
- - `extract-css-vars.js` script has been deprecated in favor of ['importFrom'](https://github.com/csstools/postcss-preset-env#importfrom) option of postcss-preset-env. Please consider using the same approach in your project.
151
-
152
- ## [2.0.0]
153
-
154
- - Versions of dependencies are now prepended with a caret (`^`) rather than fixed
155
- - \[Breaking\] `@jetbrains/icons` was updated to `3.0.0` which includes a major rework of icons' shapes and dimensions.
156
-
157
- `size`, `width` and `height` props are deprecated in the `Icon` component. The intrinsic size of the icon (`width` and `height` SVG attributes) is used instead.
158
-
159
- We strongly recommend to use icons handcrafted for particular sizes. If an icon doesn't exist in the desired size, please ask your designer to draw one. "Responsive" checkmark should be unchecked when exporting an icon.
160
-
161
- If you're using your own instance of `svg-inline-loader` make sure to pass `options: {removeSVGTagAttrs: false}` to avoid removing `width` and `height` attributes.
162
-
163
- - \[Breaking\] Icons are now aligned to the text baseline out of the box (only when using the following icon sizes: 10px, 14px, 16px, 20px). Previously, `vertical-align: middle;` was used by default which was not great as it required fine-tuning almost every time to achieve perfect alignment. If you have such compensations in your code, please inspect and remove them.
164
-
165
- - \[Breaking\] SVG icons are not inlined anymore – Icon and IconNg components don't support sprite IDs. If you are patching svgSpriteLoader, replace `"svgSpriteLoader.include.push(...)"` with `"svgInlineLoader.include.push(...)"`. See [this issue](https://youtrack.jetbrains.com/issue/RG-1646) for details.
166
-
167
- - \[Breaking\] Some deprecated SASS files were [removed](https://github.com/JetBrains/ring-ui/commit/b174d82d5c683ebd8716524c8affc880adc7460e): `button.scss`, `icon.scss`, `loader-inline__legacy.scss`.
168
-
169
- - \[Breaking\] Some deprecated SASS constants (like `$ring-text-color`) were [removed](https://github.com/JetBrains/ring-ui/commit/4ec18fa1bbd5e069e1e357246893a8511501237a).
170
-
171
- ## [1.0.0]
172
-
173
- - \[Breaking\] New visual language. Most UI components have received significant updates which may require you to update the rest of your application's UI.
174
-
175
- - Many components now have a `theme` property that toggles the component's appearance to better fit dark and light backgrounds.
176
-
177
- - \[Breaking\] The styles of many components were rewritten from SASS to CSS modules. If you were importing the SASS files directly, you will have to remove those imports and use the corresponding components instead. The complete list of removed SASS files:
178
-
179
- ```
180
- badge.scss, button-group.scss, button-toolbar.scss, checkbox.scss, link.scss, list.scss,
181
- loader.scss, old-browsers-message.scss, popup.scss, query-assist.scss, radio.scss,
182
- select-popup.scss, select.scss, tabs.css, tag.scss, tags-input.scss, tooltip.scss
183
- ```
184
-
185
- - \[Breaking\] SASS and `postcss-modules-values-replace` variables were deprecated, CSS custom properties must be used instead. In order to use CSS custom properties in your app, you will need to configure PostCSS as follows:
186
- ```
187
- plugins: [
188
- ...
189
- require('postcss-custom-properties')({
190
- preserve: true,
191
- variables: require('@jetbrains/ring-ui/extract-css-vars')
192
- })
193
- ]
194
- ```
195
-
196
- - Babel 7 was introduced.
197
-
198
- - The default font-family declaration was changed. Notably, it may now fall back to Segoe UI instead of Helvetica Neue on Windows.
199
-
200
- ## [0.4.6] — 28-12-2017
201
-
202
- - `ErrorBubble` component was reimplemented using `Popup`. While the API did not change, the implementation has changed drastically. If you were relying on the internals (to customize CSS, for example) please review your implementation.
203
-
204
- ## [0.4.0] — 18-12-2017
205
-
206
- - `react-markdown` package was updated to version 3.0 which contains breaking changes. Since the `Markdown` component passes props to `react-markdown`, this constitutes a breaking change for Ring UI itself. See the [details](https://github.com/rexxars/react-markdown/blob/master/CHANGELOG.md#300---2017-11-20).
207
-
208
- - [dependencies.io](https://www.dependencies.io/) was set up to help us keep dependencies up-to-date. Most dependencies were updated to latest versions.
209
-
210
- ## [0.3.8] — 29-11-2017
211
-
212
- ### Auth improvements
213
- - Embedded login flow is now supported: instead of redirecting to and from Hub to perform authentication, a login form can now be opened in a separate window. Upon successful authentication the service may choose to either reload the page or to partially update the UI without reloading, which results in a more pleasant login experience for the users. To enable the new mode, pass `embeddedLogin: true` to Auth configuration. There's also a new `enableBackendStatusCheck` option that checks if Hub is up and running before opening the login window or making the redirect. This option is enabled by default.
214
-
215
- ## [0.3.0] — 20-11-2017
216
- ### Breaking
217
- - Release 0.3.0 is designed to work with React 16. Moreover, `react` and `react-dom` are no longer `dependencies` but `peerDependencies` — make sure to include them in your project's `dependencies`, if you don't have them already. If your project's `webpack.config.js` includes a `resolve` section for making sure only one copy of React is loaded, it can now be removed.
218
-
219
- - `RingComponent`, a base class for all Ring UI components is now gone. The components are now inherited directly from `PureComponent`. If you have your own components using `RingComponent` as the base class, please refactor them:
220
-
221
- // Before
222
- import React from 'react';
223
- import RingComponent from '../ring-component/ring-component';
224
-
225
- export default class MyComponent extends RingComponent {
226
- ...
227
- // RingComponent had its own lifecycle methods, matching the original ones
228
- didUpdate(prevProps, prevState) {
229
-
230
- }
231
- }
232
-
233
- // After
234
- import React, {PureComponent} from 'react';
235
-
236
- export default class MyComponent extends PureComponent {
237
- ...
238
- componentDidUpdate(prevProps, prevState) {
239
-
240
- }
241
- }
242
-
243
- - If you were relying on the `rerender` method of `RingComponent` (for example, to trigger re-rendering of `date-picker` or `query-assist`), special wrapped versions of those components should be used instead. Those wrapped versions include the `rerender` method for backward compatibility:
244
-
245
- // Before
246
- import DatePicker from "@jetbrains/ring-ui/components/date-picker/date-picker";
247
-
248
- // After
249
- import {RerenderableDatePicker as DatePicker} from "@jetbrains/ring-ui/components/date-picker/date-picker";
250
-
251
- ### Added
252
-
253
- - [Hover mode](http://www.jetbrains.org/ring-ui/dropdown.html#Dropdown%20with%20hover%20mode) was added to `Dropdown`. [Review][RING-UI-CR-2998]
254
- - `user-card` [component](http://www.jetbrains.org/ring-ui/user-card.html) was added. [Review][RING-UI-CR-3016]
255
- - Support for fuzzy search was added to `Select`, pass `props.filter = { fuzzy: true }` to activate. [Review][RING-UI-CR-3037]
256
- - `data-list` component [received a major rewrite](http://www.jetbrains.org/ring-ui/data-list.html). [Review][RING-UI-CR-3042]
257
-
258
- ### Removed
259
-
260
- - `React Ng`, a legacy Angular directive for proxying React components was removed.
261
- - An ability to import SVG icons as components (`import PencilIcon from '@jetbrains/icons/pencil.svg'`) deprecated earlier was removed.
262
-
263
- ### Internals
264
- - Updated lots of dependencies
265
- - `mout` is no longer a dependency
266
-
267
- [0.4.6]: https://upsource.jetbrains.com/ring-ui/compare/%40jetbrains/ring-ui%400.4.5...%40jetbrains/ring-ui%400.4.6
268
- [0.4.0]: https://upsource.jetbrains.com/ring-ui/compare/%40jetbrains/ring-ui%400.3.8...9a4e78c2d33ec82fec05f8b5afc14d081d553798
269
- [0.3.8]: https://upsource.jetbrains.com/ring-ui/compare/%40jetbrains/ring-ui%400.3.1...%40jetbrains/ring-ui%400.3.8
270
- [0.3.0]: https://upsource.jetbrains.com/ring-ui/compare/%40jetbrains/ring-ui%400.2.50...%40jetbrains/ring-ui%400.3.1
271
- [RING-UI-CR-2998]: https://upsource.jetbrains.com/ring-ui/review/RING-UI-CR-2998
272
- [RING-UI-CR-3016]: https://upsource.jetbrains.com/ring-ui/review/RING-UI-CR-3016
273
- [RING-UI-CR-3037]: https://upsource.jetbrains.com/ring-ui/review/RING-UI-CR-3037
274
- [RING-UI-CR-3042]: https://upsource.jetbrains.com/ring-ui/review/RING-UI-CR-3042
275
-
276
- ## [0.2.10] — 22-08-2017
277
- ### Added
278
- - `Icon` component now exports icons (`@jetbrains/icons` package) and logos (`@jetbrains/logos`) as React components. A previously introduced feature of importing them directly from packages is deprecated:
279
-
280
- // deprecated, will be removed in 0.3
281
- import PencilIcon from '@jetbrains/icons/pencil.svg'
282
- import SearchIcon from '@jetbrains/icons/search.svg'
283
- import HubLogo from '@jetbrains/logos/hub/hub.svg'
284
-
285
- <PencilIcon/>
286
- <SearchIcon/>
287
- <HubLogo/>
288
-
289
- // Worked before, works now, and will work later
290
- import pencilIcon from '@jetbrains/icons/pencil.svg'
291
- import searchIcon from '@jetbrains/icons/search.svg'
292
- import hubLogo from '@jetbrains/logos/hub/hub.svg'
293
- import Icon from '@jetbrains/components/icon/icon'
294
-
295
- <Icon glyph={pencilIcon}/>
296
- <Icon glyph={searchIcon}/>
297
- <Icon glyph={hubLogo}/>
298
-
299
- // Works since 0.2.7. This allows to stop patching ring-ui's `svg-sprite-loader` rule in your webpack config.
300
- import {PencilIcon, SearchIcon} from '@jetbrains/components/icon'
301
- import {HubLogo} from '@jetbrains/components/icon/logos' // This can dramatically increase your bundle size, so you may want to keep using the above traditional method for logos
302
-
303
- <PencilIcon/>
304
- <SearchIcon/>
305
- <HubLogo/>
306
-
307
- // Also works
308
- import Icon, {PencilIcon, SearchIcon} from '@jetbrains/components/icon'
309
- import {HubLogo} from '@jetbrains/components/icon/logos'
310
-
311
- <Icon glyph={PencilIcon}/>
312
- <Icon glyph={SearchIcon}/>
313
- <Icon glyph={HubLogo}/>
314
- [Review][RING-UI-CR-2945]
315
- - `Tag`: `disabled` prop was added. [Review][RING-UI-CR-2951]
316
- - `Popup`: a custom container can be passed as a prop. [Review][RING-UI-CR-2941]
317
- - `Dialog`: focus is trapped inside dialog. Tabbing outside of the dialog is blocked.
318
- You can opt out of this behavior by passing `trapFocus={false}`. [Review][RING-UI-CR-2935]
319
-
320
- ### Changed
321
- - `Select`: after selecting a tag, the input is cleared. [Review][RING-UI-CR-2944]
322
-
323
- ### Fixed
324
- - "Clear" icon on `Select`'s button was not clickable in Firefox. [Review][RING-UI-CR-2952]
325
- - `svg-sprite-loader` was updated to fix rendering of logos in Firefox. [Review][RING-UI-CR-2942]
326
-
327
- [0.2.10]: https://upsource.jetbrains.com/ring-ui/compare/%40jetbrains/ring-ui%400.2.1...%40jetbrains/ring-ui%400.2.10
328
- [RING-UI-CR-2952]: https://upsource.jetbrains.com/ring-ui/review/RING-UI-CR-2952
329
- [RING-UI-CR-2951]: https://upsource.jetbrains.com/ring-ui/review/RING-UI-CR-2951
330
- [RING-UI-CR-2945]: https://upsource.jetbrains.com/ring-ui/review/RING-UI-CR-2945
331
- [RING-UI-CR-2944]: https://upsource.jetbrains.com/ring-ui/review/RING-UI-CR-2944
332
- [RING-UI-CR-2941]: https://upsource.jetbrains.com/ring-ui/review/RING-UI-CR-2941
333
- [RING-UI-CR-2942]: https://upsource.jetbrains.com/ring-ui/review/RING-UI-CR-2942
334
- [RING-UI-CR-2935]: https://upsource.jetbrains.com/ring-ui/review/RING-UI-CR-2935
335
-
336
- ## [0.2.1] — 11-08-2017
337
- ### Fixed
338
- - Include icon-runtime-generator.js into package
339
-
340
- [0.2.1]: https://upsource.jetbrains.com/ring-ui/compare/%40jetbrains/ring-ui%400.2.0...%40jetbrains/ring-ui%400.2.1
341
-
342
- ## [0.2.0] — 11-08-2017
343
- ### Added
344
- - SVG icons can be imported directly as React components. They pass props to the `Icon` component.
345
-
346
- // Before (and still fully supported)
347
- import pencilIcon from '@jetbrains/icons/pencil.svg'
348
- import Icon from '@jetbrains/components/icon/icon'
349
-
350
- <Icon
351
- glyph={pencilIcon}
352
- size={Icon.Size.Size12}
353
- title="edit"
354
- />
355
-
356
- // After
357
- import PencilIcon from '@jetbrains/icons/pencil.svg'
358
-
359
- <PencilIcon
360
- size={PencilIcon.Size.Size12}
361
- title="edit"
362
- />
363
- [Review][RING-UI-CR-2921]
364
- - `baseline` option for `Grid` component. [Review][RING-UI-CR-2913]
365
-
366
- ### Changed
367
- - `Code` component now comes with a list of highlighed languages. Other languages supported by `highlight.js` can be enabled manually:
368
-
369
- import {highlight} from '@jetbrains/ring-ui/components/code/code'
370
- import lang1c from 'highlight.js/lib/languages/1c';
371
- highlight.registerLanguage('1c', lang1c);
372
- [Review][RING-UI-CR-2914]
373
- - `DataList` component: "show more / less" functionality was fully rewritten. [Review][RING-UI-CR-2908]
374
-
375
- ### Fixed
376
- - `DataList`: fixed the issue with selection and focus being cleared when toggling a tree element. [Review][RING-UI-CR-2903]
377
- - Various optimizations were applied to reduce app bundle size. [Review][RING-UI-CR-2923]
378
-
379
- [0.2.0]: https://upsource.jetbrains.com/ring-ui/compare/%40jetbrains/ring-ui%400.1.2...%40jetbrains/ring-ui%400.2.0
380
- [RING-UI-CR-2903]: https://upsource.jetbrains.com/ring-ui/review/RING-UI-CR-2903
381
- [RING-UI-CR-2908]: https://upsource.jetbrains.com/ring-ui/review/RING-UI-CR-2908
382
- [RING-UI-CR-2913]: https://upsource.jetbrains.com/ring-ui/review/RING-UI-CR-2913
383
- [RING-UI-CR-2914]: https://upsource.jetbrains.com/ring-ui/review/RING-UI-CR-2914
384
- [RING-UI-CR-2921]: https://upsource.jetbrains.com/ring-ui/review/RING-UI-CR-2921
385
- [RING-UI-CR-2923]: https://upsource.jetbrains.com/ring-ui/review/RING-UI-CR-2923
386
-
387
- ## 0.1.0 — 01-08-2017: Ring UI goes Open Source!
388
-
389
- ### What changes for the end users
390
- - `@jetbrains/ring-ui` package should be used instead of `ring-ui`.
391
- - Version was reset to `0.1.1`. To install the latest version, run `npm install --save-exact @jetbrains/ring-ui`.
392
- - You may remove the internal registry line from `.npmrc`.
393
- - Named imports can be used for importing components:
394
- ```js
395
- import {Button, Input} from '@jetbrains/ring-ui';
396
-
397
- // You can still import components one by one to reduce bundle size
398
- import Button from '@jetbrains/ring-ui/components/button/button';
399
- import Input from '@jetbrains/ring-ui/components/input/input';
400
- ```
401
- - Change the webpack configuration import (if using one) from `require('ring-ui')` to `require('@jetbrains/ring-ui')`.
402
-
403
- ### What changes for the contributors
404
- - The commit history has been rewritten. Please clone the repository anew from `ssh://github.com/JetBrains/ring-ui.git`.
405
- - Prepend your commit messages with `[Publish]` to trigger publishing of npm packages.
406
-
407
- ## Earlier changes
408
-
409
- ### 27-07-2017: @jetbrains/icons
410
-
411
- Private `jetbrains-icons` package was replaced with a public one that is hosted on GitHub and available as `@jetbrains/icons` in npm. Please update your projects accordingly.
412
-
413
- ### 23-07-2017: borders are used for link underline instead of text-decoration
414
-
415
- This allows to put the underline right below the descenders, so that it doesn't cross them, and make it 1 physical pixel wide on retina displays.
416
-
417
- If you use some non-textual content along with text inside `Link` component, you may need to pass a function as a child to `Link`, which would take one argument, `WrapText`, and use it to wrap the text parts (see [example with logo](http://ring-ui.github.io/branch/ring-ui-language/link.html#Link)).
418
-
419
- Note that `WrapText` relies on the fact that it's an inline element, so if, for example, you use flexbox layout inside `Link`, you may need an additional div around `WrapText`.
420
-
421
- ### 23-07-2017: react-virtualized
422
-
423
- The render optimisation logic in List component is delegated to [react-virtualized]() library. Now it works even if the List doesn't have a `maxHeight` prop. You may still opt out of the optimization by passing `renderOptimization={false}`.
424
-
425
- ### 06-07-2017: `expect(smth).to` usage is discouraged in favour of `smth.should`
426
-
427
- It's not possible to define `should` property on `null` and `undefined` values, so here's a possible workaround:
428
- ```js
429
- // Before
430
- expect(foo).to.not.exist;
431
- expect(foo).to.be.null;
432
- expect(foo).to.not.undefined;
433
-
434
-
435
- // After
436
- should.not.exist(foo);
437
-
438
- // Or, if you want to be more specific
439
- (foo === null).should.be.true;
440
- (foo === undefined).should.be.true;
441
- ```
442
-
443
- ### 04-07-2017: Ring UI is a monorepo
444
-
445
- Run `npm run bootstrap` to install all the packages' dependencies and link them between each other where needed.
446
-
447
- ### 03-07-2017: `header-legacy` component has been removed
448
-
449
- Use `header` component instead
450
-
451
- ### 24-06-2017: major tests refactoring
452
-
453
- #### Enzyme
454
- Airbnb's [enzyme](http://airbnb.io/enzyme) was introduced as a tool for testing React output. Please refer to its [API docs](http://airbnb.io/enzyme/docs/api/) and to the list of `chai-enzyme` [assertions](https://github.com/producthunt/chai-enzyme#table-of-contents).
455
-
456
- ##### Which helper should I use?
457
- When using enzyme, a tough question is which of the `shallow/mount/render` helpers to use. Here's a simple checklist for that.
458
-
459
- * Use `shallow` by default. Basically, it just tests the output of your `render` function and often this can be enough
460
- * Use `mount` when
461
- 1. some DOM APIs are involved
462
- 2. testcase relies on `componentDidMount` or refs being called
463
- 3. testcase uses type and/or props of the component being tested ([example](https://upsource.jetbrains.com/ring-ui/file/87e1889c8d1e1300cf2695c3958e4c5bdb27d1a9/components/progress-bar/progress-bar.test.js?nav=531:579:focused&line=0))
464
- * Use `render` when
465
- 1. the full html output tree is needed
466
- 2. testing the text content of a node
467
- 3. using some complex CSS selector, beyond the [subset](http://airbnb.io/enzyme/docs/api/selector.html) supported by other wrappers
468
-
469
- One possible workflow is to start with `shallow`, and if something doesn't work as expected, replace with `mount` or `render` based on the checklist.
470
-
471
- #### Local variables instead of context
472
- Using context(`this`) in testcases is discouraged in favour of local variables. This allows using arrow functions for all the testcases, which in turn helps to maintain uniformity.
473
-
474
- * before:
475
- ```js
476
- /* eslint-disable func-names */
477
-
478
- describe('Something', () => {
479
- beforeEach(function() {
480
- this.foo = makeFoo();
481
- });
482
-
483
- it('testcase using foo', function() {
484
- this.foo.should.equal(this.foo);
485
- });
486
-
487
- it('testcase not using foo', () => {
488
- true.should.equal(true);
489
- });
490
- })
491
- ```
492
- * after:
493
- ```js
494
- describe('Something', () => {
495
- let foo;
496
- beforeEach(() => {
497
- foo = makeFoo();
498
- });
499
-
500
- it('testcase using foo', () => {
501
- foo.should.equal(foo);
502
- });
503
-
504
- it('testcase not using foo', () => {
505
- true.should.equal(true);
506
- });
507
- })
508
- ```
509
-
510
- Sinon sandbox previously available as `this.sinon` became a global variable `sandbox`.
511
-
512
-
513
- ### 25-05-2017: auth parameters have been uniformly named in camelCase. Support for snake_case parameters has been dropped.
514
-
515
- Attempting to pass `client_id`, `redirect_uri`, `request_credentials` will throw an exception. Use `clientId`, `redirectUri`, `requestCredentials` instead.
516
-
517
- ### 27-04-2017: Unused HeaderAuth component has been removed
518
- Use brand new Header component instead
519
-
520
- ### 26-04-2017: `stage-0/1` transforms are dropped
521
- The most widely used of them was [`transform-function-bind`](http://babeljs.io/docs/plugins/transform-function-bind/).
522
-
523
- * Before: `::this.handleClick`
524
- * After: `this.handleClick.bind(this)`
525
-
526
- Often it's better to declare an arrow property function instead of binding a method on each render.
527
-
528
- * Before:
529
- ```js
530
- class MyComponent extends Component() {
531
- handleClick(e) {
532
- ...
533
- }
534
-
535
- render() {
536
- return <div onClick={::this.handleClick}/>;
537
- }
538
- }
539
- ```
540
- * After:
541
- ```js
542
- class MyComponent extends Component() {
543
- handleClick = e => {
544
- ...
545
- }
546
-
547
- render() {
548
- return <div onClick={this.handleClick}/>;
549
- }
550
- }
551
- ```
552
-
553
- ### 20-04-2017: Usage with webpack 1.* is deprecated
554
- This was necessary in order to enable tree-shaking.
555
-
556
- ### 18-04-2017: Default export hack is dropped
557
- This affects only CommonJS usages.
558
-
559
- * Before: `const Button = require('ring-ui/components/button/button');`
560
- * After: `const Button = require('ring-ui/components/button/button').default;`
561
- * Even better: `import Button from 'ring-ui/components/button/button';`
562
-
563
- ### 13-04-2017: Auth component no longer provides getSecure and getApi methods
564
-
565
- Use the brand new `HTTP` component instead.
566
-
567
- Before:
568
- ```js
569
- import Auth from 'ring-ui/components/auth/auth';
570
-
571
- const auth = new Auth(authConfig);
572
-
573
- const services = auth.requestToken().
574
- then(token => auth.getApi('services/header', token));
575
- ```
576
-
577
- After:
578
- ```js
579
- import Auth from 'ring-ui/components/auth/auth';
580
- import HTTP from 'ring-ui/components/http/http';
581
-
582
- const auth = new Auth(authConfig);
583
- const http = new HTTP(auth, auth.getAPIPath());
584
-
585
- const services = http.get('services/header');
586
- ```
587
-
588
- ### 13-02-2017: Checkbox + ReactNg connection does not support ngModel anymore. Use checkbox-ng instead.
589
-
590
- ### 13-02-2017: Badge component has no margins anymore and is aligned by baseline
591
-
592
- ### 20-01-2016: Webpack configuration structure change
593
-
594
- In order to migrate to webpack 2, we have to keep webpack.config clean of properties that don't match [the schema](https://github.com/webpack/webpack/blob/028c51301733836abbedc88be7483af2623f5943/schemas/webpackOptionsSchema.json).
595
- Since this change config moved to internal property `config`, and loaders moved to `loaders` properties:
596
-
597
- Before:
598
- ```js
599
- require('webpack-config-merger')(require('ring-ui'), {
600
- ...
601
- });
602
- ```
603
-
604
- After:
605
- ```js
606
- require('webpack-config-merger')(require('ring-ui').config, {
607
- ...
608
- });
609
- ```
610
-
611
- ### 18-01-2016: Existing Header moved to legacy folder
612
-
613
- Before:
614
-
615
- ```js
616
- import Header from 'ring-ui/components/header/header';
617
- import HeaderHelper from 'ring-ui/components/header/header__helper';
618
- ```
619
-
620
- After:
621
-
622
- ```js
623
- import Header from 'ring-ui/components/header-legacy/header-legacy';
624
- import HeaderHelper from 'ring-ui/components/header-legacy/header-legacy__helper';
625
- ```
626
-
627
- ### 04-01-2016 (2.5.5847): Popup reimplemented
628
- * `Popup` should now be rendered directly, as any other react child
629
- * `anchorElement` becomes optional, the parent DOM element is used as default anchor
630
- * `container` prop isn't used anymore. Instead, for correct positioning inside scrollable containers, scroll events on anchor ancestors are listened to.
631
- * Imperative API is replaced with declarative
632
-
633
- Before:
634
- ```js
635
- class TogglePopup extends Component {
636
- renderPopup() {
637
- this.popup = Popup.renderPopup(
638
- <Popup
639
- hidden={false}
640
- anchorElement={this.refs.button}
641
- onClose={::this.forceUpdate} // to keep button state in sync with popup
642
- dontCloseOnAnchorClick={true}
643
- autoRemove={false}
644
- >
645
- <div ref="popupContent" />
646
- </Popup>
647
- )
648
- }
649
-
650
- toggle() {
651
- if (!this.popup) {
652
- this.renderPopup()
653
- } else if (this.popup.isVisible()) {
654
- this.popup.hide()
655
- } else {
656
- this.popup.show()
657
- }
658
- }
659
-
660
- render() {
661
- return (
662
- <Button
663
- ref="button"
664
- active={this.popup && this.popup.isVisible()}
665
- onClick={::this.toggle}
666
- >
667
- Toggle
668
- </Button>
669
- )
670
- }
671
- }
672
- ```
673
-
674
- After:
675
- ```js
676
- class TogglePopup extends Component {
677
- state = {hidden: false};
678
-
679
- toggle() {
680
- this.setState(state => ({hidden: !state.hidden}));
681
- }
682
-
683
- render() {
684
- return (
685
- <Button
686
- active={!this.state.hidden}
687
- onClick={::this.toggle}
688
- >
689
- Toggle
690
-
691
- // Button becomes anchor here
692
- <Popup
693
- hidden={this.state.hidden}
694
- // This is called on Esc press or outside click. There are also separate handlers for those two events
695
- onCloseAttempt={() => this.setState({hidden: true})}
696
- dontCloseOnAnchorClick={true}
697
- >
698
- // String refs don't work inside Popup. Use functional refs instead:
699
- <div
700
- ref={el => { this.popupContent = el; }}
701
- />
702
- </Popup>
703
- </Button>
704
- )
705
- }
706
- }
707
- ```
708
-
709
- ### 05-12-2016: Alert API reimplemented
710
-
711
- * There are now two ways to use alerts in React: 1) as a pure component with custom management of alerts' stack (see Alert Container example), and 2) a simple `alert-service`, which should cover most usages.
712
- * Alert now receives the message as its child, not as `caption` prop.
713
- * Alert is now closeable by default.
714
- * Alert now has a `timeout` property to define timeout for `onCloseRequest` call.
715
- * Alert doesn't remove itself anymore. It now calls the `onCloseRequest` callback if it should be removed with an animation. The host component should then set the `isClosing={true}` prop which performs the closing animation and calls the `onClose` callback after it finishes.
716
- * To remove an alert use `{remove, removeWithoutAnimation}` functions from alert-service.
717
- * [Angular] `alert-ng` component was removed – `alert-service` should be used instead.
718
-
719
- ### 29-11-2016: Several changes to Dialog and Island
720
-
721
- * dialog.scss was moved to dialog-ng component because dialog itself has been reimplemented.
722
- * island header and island content now have 32px spacing to suit the most common use case.
723
-
724
- ### 18-11-2016: All buttons have type="button" by default. To set another type (e.g. "submit") you have to pass it explicitly
725
-
726
- ### 15-11-2016: Footer no longer supports the "ring-footer_floating" modifier, use "floating" prop instead
727
-
728
- Before:
729
- ```
730
- <Footer className="ring-footer_floating"/>
731
- ```
732
-
733
- After:
734
- ```
735
- <Footer floating={true}/>
736
- ```
737
-
738
- ### 31-10-2016: ListItem and ListCustom no longer pass all props to DOM elements
739
-
740
- Since React prohibits passing non-supported props to DOM elements we now have a whitelist of supported props declared in PropTypes. Other props are no longer passed to `ListItem` and `ListCustom`.
741
-
742
- ### 29-08-2016: The long-deprecated .ring-input__error-bubble and .ring-form__footer styles were removed
743
-
744
- Please migrate to `.ring-error-bubble` and `.ring-panel`
745
-
746
- ### 25-08-2016: SelectNg requires pack size to be specified in infinite scroll mode
747
-
748
- infiniteScrollPackSize should match the value of `$top` REST parameter.
749
-
750
- Before:
751
- ```
752
- <rg-select ...
753
- with-infinite-scroll="true">
754
- </rg-select>
755
- ```
756
-
757
- After:
758
- ```
759
- <rg-select ...
760
- infinite-scroll-pack-size="50">
761
- </rg-select>
762
- ```
763
-
764
- ### 10-08-2016: Introduced new versioning system
765
-
766
- To make Ring UI installable with `npm install ring-ui` we have changed the versioning scheme.
767
-
768
- Before:
769
- ```
770
- 2.4.0-4995 (major.minor.patch-build)
771
- ```
772
-
773
- After:
774
- ```
775
- 2.4.4996 (major.minor.build)
776
- ```
777
-
778
- ### 29-06-2016: Added "ring-" suffix to the constants in palette/palette.scss
779
-
780
- Before:
781
- ```
782
- $palette-array, $palette-white-text, $palette-grey-text
783
- ```
784
-
785
- After:
786
- ```
787
- $ring-palette-array, $ring-palette-white-text, $ring-palette-grey-text
788
- ```
789
-
790
- ### 27-05-2016: rgba-attribute mixin was removed
791
-
792
- Use rgba colors directly as we no longer support ancient IE versions.
793
-
794
- Before:
795
- ```
796
- @include rgba-attribute('border-color', rgba(0, 0, 0, 0.15));
797
- ```
798
-
799
- After:
800
- ```
801
- border-color: rgba(0, 0, 0, 0.15);
802
- ```
803
-
804
- ### 04-04-2016: Browser requirements for Autoprefixer should be specified in the target project (RG-963)
805
-
806
- Place a [`browserslist`](https://github.com/ai/browserslist#config-file) file in your project directory. Default query is `> 1%, last 2 versions, Firefox ESR` which currently resolves to:
807
-
808
- ```
809
- and_chr 49
810
- and_uc 9.9
811
- android 4.4
812
- chrome 49
813
- chrome 48
814
- edge 13
815
- edge 12
816
- firefox 45
817
- firefox 44
818
- firefox 38
819
- ie 11
820
- ie 10
821
- ie_mob 11
822
- ie_mob 10
823
- ios_saf 9.3
824
- ios_saf 9.0-9.2
825
- ios_saf 8.1-8.4
826
- op_mini 5.0-8.0
827
- opera 36
828
- opera 35
829
- safari 9.1
830
- safari 9
831
- ```
832
-
833
- ### 17-05-2016: ES6! All existing code was converted, new code should be written in ES6 only
834
-
835
- ### 22-04-2016: Permissions: parameter "config" does not have property config.serviceId, use config.services instead
836
-
837
- Before:
838
- ```
839
- new Permissions(auth, {serviceId: auth.serviceId})
840
- ```
841
-
842
- After:
843
- ```
844
- new Permissions(auth, {services: [auth.serviceId]})
845
- ```
846
-
847
- ### 20-02-2016: `Button.Modifiers` enum was removed, attributes should be used instead
848
-
849
- Before:
850
- ```
851
- <Button modifier={Button.Modifiers.BLUE}>{'Button text'}</Button>
852
- ```
853
-
854
- After:
855
- ```
856
- <Button blue={true}>{'Button text'}</Button>
857
- ```
858
-
859
- ### 03-02-2016: `in-space` parameter of `rg-permission` and `rg-permission-if` directives was renamed to `in-project` (RG-750)
860
-
861
- Before:
862
- ```
863
- <div rg-permission="space-read" in-space="0-0-0-0-0">
864
- Is visible if user has permission 'read-space' in space 0-0-0-0-0.
865
- </div>
866
- ```
867
-
868
- After:
869
- ```
870
- <div rg-permission="project-read" in-project="0-0-0-0-0">
871
- Is visible if user has permission 'read-project' in project 0-0-0-0-0.
872
- </div>
873
- ```
874
-
875
- ### 28-01-2016: Changed the way form control sizes are set
876
-
877
- To set the size of the form controls, use the `ring-input-size_<size>` class, where `<size>` can be "sx" (50px), "s" (100px), "md" (200px) or "l" (400px).
878
-
879
- Before:
880
- ```
881
- <div class="ring-form">
882
- <input class="ring-input"/>
883
- ...
884
- <input class="ring-input ring-input_long"/>
885
- </div>
886
- ```
887
-
888
- After:
889
- ```
890
- <div class="ring-form">
891
- <input class="ring-input ring-input-size_md"/>
892
- ...
893
- <input class="ring-input ring-input-size_l"/>
894
- </div>
895
- ```
896
-
897
- ### 28-01-2016: CSS class .ring-form__error-bubble was renamed to .ring-error-bubble
898
-
899
- ### 11-01-2016: Popup API change: "Corner" and "Direction" props replaced with "Directions" array
900
-
901
- The arcane bitwise API was replaced with a more straightforward [direction specification](https://en.bem.info/libs/bem-components/v2.4.0/desktop/popup/#directions-field). "Corner" and "Direction" properties were dropped, "Directions" array was introduced. Example:
902
-
903
- Before:
904
- ```
905
- props: {
906
- ...
907
- Corner: Popup.PopupProps.Corner.BOTTOM_LEFT,
908
- Direction: Popup.PopupProps.Direction.DOWN | Popup.PopupProps.Direction.RIGHT
909
- ...
910
- }
911
- ```
912
- After:
913
- ```
914
- props: {
915
- ...
916
- Directions: Popup.PopupProps.Directions.BOTTOM_RIGHT
917
- ...
918
- }
919
- ```
920
-
921
- ### 22-12-2015: "form-ng__update-text" component was removed
922
-
923
- Please use the `rg-save-field` component instead.
924
-
925
- ### 18-12-2015: "textarea" component was removed
926
-
927
- Please use `ring-input` instead.
928
-
929
- ### 11-12-2015: SVGO is not used in Ring UI anymore, its config has been removed
930
-
931
- `jetbrains-icons` (since 1.0.12) and `jetbrains-logos` (since 1.0.5) packages now contain compressed SVG images, so there is no more `RingSVGOConfig` in `webpack.config.js`. Migration path: update `jetbrains-icons` and `jetbrains-logos`.
932
-
933
- ### 07-12-2015: Changes in markup of ring-input, ring-textarea, error-bubble and ring-form__control (RG-965)
934
-
935
- * If ring-input or ring-textarea is used outside of `ring-form__control`, it should have class `ring-input_medium` (`ring-textarea_medium`), otherwise it will have a width of 100%
936
- * Class `ring-input_full-width` renamed to `ring-form__control_full-width` (as `ring-input` is now full-width by default)
937
-
938
- ### 19-11-2015: LoaderInline was reimplemented
939
-
940
- Usages should be updated if you're not using the React component. ([See example](loader-inline.html)).
941
-
942
- ### 02-11-2015: Auth: Hub 1.0 defaults applied
943
-
944
- * `redirect` param in Auth is now `false` by default
945
- * `redirect` param in Auth doesn't have the `background-unsafe` value anymore, so it should be removed from project's Auth configs
946
- * Background token refresh always uses `request_credentials` mode `silent`
947
-
948
- ### 30-10-2015: webpack.config.js does not provide loaders for applications' code anymore, you will need to set up all the necessary loaders in your project configuration.
949
-
950
- ### 30-10-2015: Icons are now loaded using [svg-sprite-loader](https://github.com/kisenka/svg-sprite-loader). They were also moved to a separate package (RG-550, RG-834)
951
-
952
- Icon's `glyph` property now accepts URL from loader instead of ID, e.g. `<Icon glyph={require('jetbrains-icons/add.svg')}>`.
953
-
954
- ### 30-10-2015: Migration to ES6, React 0.14 and Babel (RG-361, RG-420)
955
-
956
- jQuery, when.js, and mout are not used anymore.
957
-
958
- ### 30-10-2015: Components should be addressed by full path
959
-
960
- E.g. you should use import `ring-ui/components/react-ng/react-ng` instead of `react-ng/react-ng`.
961
-
962
- ### 29-10-2015: Loader was renamed to LoaderInline to give place to the brand new Loader
963
-
964
- LoaderInline is `display: inline-block` by default and shouldn't be used as the main loader anymore.
965
-
966
- ### 22-05-2015: "user2" icon duplicate removed
967
-
968
- ### 06-05-2015: Unused filtering functionality removed from `popup-menu` (RG-700)
969
-
970
- `filter` property doesn't make sense anymore
971
-
972
- ### 06-05-2015: `form-ng__update-text` is no more required in `form-ng` (part of RG-676)
973
-
974
- `form-ng__update-text` should be required separately from `form-ng` in consuming code
975
-
976
- ### 28-04-2015: `ring-island` refactoring (RG-662)
977
-
978
- * Renamed `_island.scss` to `island.scss`
979
- * Removed `display: block` from the main class and dropped the `.ring-island_inline` modifier completely
980
-
981
- ### 21-04-2015: Removed deprecated Auth.prototype.isGuest method (RG-644)
982
-
983
- Use the `guest` field of the user object instead. It is included by default in `Auth.prototype.requestUser` response.
984
-
985
- ### 20-04-2015: userFields introduced in Auth config (RG-640)
986
-
987
- It's now required to set `userFields` in the `Auth` config if any fields other than `guest, id, name, profile/avatar/url` are needed in auth.requestUser. Please note that you need to explicitly specify `profile` sub-fields to request them, specifying `profile` won't do anything.
988
-
989
- Example:
990
- ```js
991
- var auth = new Auth({
992
- serverUri: 'http://localhost/',
993
- userFields: ['login', 'profile/email']
994
- });
995
- ```