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

Migrate react-styleguide to ^10.0.0 #256

Closed
Closed
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Precise UI Changelog

## 1.1.1

- Migrate `react-styleguidist` to `^10.0.0`
- Update all examples to use ES modules

## 1.1.0

- Add `borderless` and `tagRenderer` props to AutocompleteTagBuilder
Expand Down
5 changes: 2 additions & 3 deletions docs/components/ComponentsList.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import * as React from 'react';
import { ActionLink, Expander, styled, distance, Icon, ActionLinkProps } from '../../src';
import { ActionLink, Expander, styled, distance, themed, Icon, ActionLinkProps } from '../../src';

// @ts-ignore
import getUrl from 'react-styleguidist/lib/utils/getUrl';
import { themed } from '../../src';
import getUrl from 'react-styleguidist/lib/client/utils/getUrl';

interface ComponentDefinition {
hasExamples: boolean;
Expand Down
6 changes: 3 additions & 3 deletions docs/components/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { styled, Headline, Icon, IconName, Button, BodyText, StackPanel, StackItem, colors } from '../../src';

// @ts-ignore
import Markdown from 'react-styleguidist/lib/rsg-components/Markdown';
import Markdown from 'react-styleguidist/lib/client/rsg-components/Markdown';

const HeadIcon = styled(Icon)`
vertical-align: text-bottom;
Expand Down Expand Up @@ -77,8 +77,8 @@ function codeBlock(language: string, block: string) {

const cb = '```';
// edit via https://codepen.io/anon/pen/GzRYXd
const installation = codeBlock('sh', 'npm i precise-ui');
const dependencies = codeBlock('sh', 'npm i react@16 styled-components@2');
const installation = codeBlock('bash', 'npm i precise-ui');
const dependencies = codeBlock('bash', 'npm i react@16 styled-components@2');
const usageExample = codeBlock(
'jsx',
`<span class="hljs-keyword">import</span> * <span class="hljs-keyword">as</span> React <span class="hljs-keyword">from</span> <span class="hljs-string">'react'</span>;
Expand Down
2 changes: 1 addition & 1 deletion docs/components/ReactComponentRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { Tabs, TabPage, styled, Headline, distance, TabChangeEvent } from '../../src';

// @ts-ignore
import Pathline from 'react-styleguidist/lib/rsg-components/Pathline';
import Pathline from 'react-styleguidist/lib/client/rsg-components/Pathline';

interface ReactComponentRendererProps {
name: string;
Expand Down
4 changes: 2 additions & 2 deletions docs/components/SectionRenderer.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as React from 'react';

// @ts-ignore
import SectionHeading from 'react-styleguidist/lib/rsg-components/SectionHeading';
import SectionHeading from 'react-styleguidist/lib/client/rsg-components/SectionHeading';
// @ts-ignore
import Markdown from 'react-styleguidist/lib/rsg-components/Markdown';
import Markdown from 'react-styleguidist/lib/client/rsg-components/Markdown';

interface SectionRendererProps {
name: string;
Expand Down
6 changes: 3 additions & 3 deletions docs/components/StyleGuideRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { HomePage } from './HomePage';
import { AppState } from './context';

// @ts-ignore
import Ribbon from 'react-styleguidist/lib/rsg-components/Ribbon';
import Ribbon from 'react-styleguidist/lib/client/rsg-components/Ribbon';
// @ts-ignore
import Logo from 'react-styleguidist/lib/rsg-components/Logo';
import Logo from 'react-styleguidist/lib/client/rsg-components/Logo';
import { createGlobalStyle } from '../../src';

interface StyleGuideRendererProps {
Expand Down Expand Up @@ -39,7 +39,7 @@ function useTheme() {
}

/*
CSS animations should be disabled to ensure that animations don't
CSS animations should be disabled to ensure that animations don't
affect `react-styleguidist-visual` screenshots
*/
const GlobalStyle = createGlobalStyle`
Expand Down
6 changes: 3 additions & 3 deletions docs/introduction/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ Precise UI can be easily integrated in your frontend project by using npm or Yar

1. Firstly, you have to install it:

```sh
```bash
npm i precise-ui
```

or alternatively, using Yarn

```sh
```bash
yarn add precise-ui
```

2. Then, make sure that you have also all peer dependencies installed:

```sh
```bash
npm i react@16 styled-components@2
```

Expand Down
3 changes: 2 additions & 1 deletion docs/styleguide/colors.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
The following generic colors are available.

```jsx
const { colors, clipboardCopy, notify, Notifications, invertColor, MetroInfoTile, StackPanel, StackPanelDirection } = require('precise-ui');
import { colors, clipboardCopy, notify, Notifications, invertColor, MetroInfoTile, StackPanel, StackPanelDirection } from 'precise-ui';

const namedColors = Object.keys(colors.all);

const ColorTile = ({ colorName, color }) => typeof color === 'string' ? (
Expand Down
8 changes: 5 additions & 3 deletions docs/styleguide/typography.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Library exports helper functions `getFontLineHeight`, `getFontSize`, `getFontWei
### Font weights:

```
const { styled, getFontStyle } = require('precise-ui');
import { getFontStyle } from 'precise-ui';
import styled from 'styled-components';

const fontWeights = ['light', 'regular', 'medium', 'bold'];

Expand All @@ -23,7 +24,8 @@ const StyledText = styled.p`
### Font sizes:

```
const { styled, getFontStyle } = require('precise-ui');
import { getFontStyle } from 'precise-ui';
import styled from 'styled-components';

const fontSizes = ['xSmall', 'small', 'medium', 'large', 'xLarge', 'xxLarge', 'xxxLarge'];

Expand All @@ -36,4 +38,4 @@ const StyledText = styled.p`
{fontSizes.map((size) => <StyledText key={size} size={size}>Lorem ipsum dolor sit amet [{size}]</StyledText>)}
</div>;

```
```
24 changes: 13 additions & 11 deletions docs/theme/colors.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
The following colors are available. Feel free to change them.

```jsx
const {
colors,
clipboardCopy,
notify,
themes,
Notifications,
Table,
TextField,
Flyout,
serializeColor,
} = require('precise-ui');
import {
colors,
clipboardCopy,
notify,
themes,
Notifications,
MetroInfoTile,
ColorPicker,
Table,
TextField,
Flyout,
serializeColor
} from 'precise-ui';

const isUi = m => /^ui[0-9]+$/.test(m);
const isText = m => /^text[0-9]+$/.test(m);
Expand Down
Loading