Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use gravity-ui/uikit instead of yandex-cloud/uikit #46

Merged
merged 1 commit into from
Oct 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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