Skip to content

Commit

Permalink
feat: use gravity-ui/uikit instead of yandex-cloud/uikit (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
korvin89 authored Oct 1, 2022
1 parent 41f0789 commit afb2300
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .storybook/contextDecorator.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import {Story as StoryType, StoryContext} from '@storybook/react';
import {ThemeProvider, MobileProvider, useTheme, useMobile} from '@yandex-cloud/uikit';
import {ThemeProvider, MobileProvider, useTheme, useMobile} from '@gravity-ui/uikit';
import {settings} from '../src/libs';

export function withContext(Story: StoryType, context: StoryContext) {
Expand Down
2 changes: 1 addition & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {MINIMAL_VIEWPORTS} from '@storybook/addon-viewport';
import {withContext} from './contextDecorator';

import '@yandex-cloud/uikit/styles/styles.scss';
import '@gravity-ui/uikit/styles/styles.scss';

export const decorators = [withContext];

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ React component used to render charts based on any sources you need
## Install

```shell
npm i --save-dev @yandex-cloud/chartkit @yandex-cloud/uikit @yandex-cloud/i18n
npm i --save-dev @yandex-cloud/chartkit @gravity-ui/uikit @yandex-cloud/i18n
```

## Usage

```typescript
import {ThemeProvider} from '@yandex-cloud/uikit';
import {ThemeProvider} from '@gravity-ui/uikit';
import ChartKit, {settings} from '@yandex-cloud/chartkit';
import {YagrPlugin, YagrWidgetData} from '@yandex-cloud/chartkit/build/plugins';

Expand Down
87 changes: 44 additions & 43 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"yagr": "1.3.7"
},
"devDependencies": {
"@gravity-ui/uikit": "^3.0.2",
"@storybook/addon-essentials": "^6.5.9",
"@storybook/addon-knobs": "^6.4.0",
"@storybook/preset-scss": "^1.0.3",
Expand All @@ -33,7 +34,6 @@
"@yandex-cloud/prettier-config": "^1.0.0",
"@yandex-cloud/stylelint-config": "^1.2.0",
"@yandex-cloud/tsconfig": "^1.0.0",
"@yandex-cloud/uikit": "^2.7.0",
"eslint": "^8.11.0",
"gulp": "^4.0.2",
"gulp-cli": "^2.3.0",
Expand All @@ -59,7 +59,7 @@
"peerDependencies": {
"react": "^16.0.0 || ^17.0.0",
"moment": "^2.19.3",
"@yandex-cloud/uikit": "^2.0.0",
"@gravity-ui/uikit": "^3.0.0",
"@yandex-cloud/i18n": "^0.5.0"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ChartKit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {ChartkitType, ChartKitRef, ChartKitWidgetRef, ChartKitProps} from '
import {ErrorBoundary} from './ErrorBoundary/ErrorBoundary';
import {Loader} from './Loader/Loader';

import '@yandex-cloud/uikit/styles/styles.scss';
import '@gravity-ui/uikit/styles/styles.scss';
import './ChartKit.scss';

const b = block('chartkit');
Expand Down
2 changes: 1 addition & 1 deletion src/components/Loader/Loader.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import block from 'bem-cn-lite';
import {Loader as BaseLoader, LoaderProps as BaseLoaderProps} from '@yandex-cloud/uikit';
import {Loader as BaseLoader, LoaderProps as BaseLoaderProps} from '@gravity-ui/uikit';

import './Loader.scss';

Expand Down
2 changes: 2 additions & 0 deletions src/libs/settings/settings.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import moment from 'moment';
import {configure} from '@gravity-ui/uikit';
import {i18nFactory} from '../../i18n';
import type {ChartKitPlugin, ChartKitLang} from '../../types';

Expand Down Expand Up @@ -29,6 +30,7 @@ const updateLocale = (args: {lang: ChartKitLang; locale?: moment.LocaleSpecifica
}

moment.locale(lang);
configure({lang});
i18nFactory.setLang(lang);
};

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/indicator/__stories__/Indicator.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import {Meta, Story} from '@storybook/react';
import {withKnobs, boolean, color as colorKnob, radios, text} from '@storybook/addon-knobs';
import {cloneDeep} from 'lodash';
import {Button} from '@yandex-cloud/uikit';
import {Button} from '@gravity-ui/uikit';
import {settings} from '../../../libs';
import {ChartKit} from '../../../components/ChartKit';
import type {ChartKitRef} from '../../../types';
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/yagr/__stories__/Yagr.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import {Meta, Story} from '@storybook/react';
import {Button} from '@yandex-cloud/uikit';
import {Button} from '@gravity-ui/uikit';
import {settings} from '../../../libs';
import {YagrPlugin} from '../../../plugins';
import {ChartKit} from '../../../components/ChartKit';
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/yagr/renderer/YagrWidget.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import moment from 'moment';
import debounce from 'lodash/debounce';
import {useThemeValue} from '@yandex-cloud/uikit';
import {useThemeValue} from '@gravity-ui/uikit';
import YagrComponent, {YagrChartProps} from 'yagr/dist/react';
import {
YagrConfig,
Expand Down

0 comments on commit afb2300

Please sign in to comment.