Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

[DS-38] feat: move all dev stuff from lib to dev dir #182

Merged
merged 1 commit into from
Aug 2, 2021
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ The example is based on the `Button` component.
```tsx
import React from 'react';
import { IconPlus } from 'static/icons';
import { Sizes, StateMap, Priorities } from 'lib/state-map';
import { block } from 'lib/block';
import { Sizes, StateMap, Priorities } from 'dev/state-map';
import { block } from 'dev/block';

import { Button } from '../index';

Expand Down
1 change: 1 addition & 0 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ exports.onCreateWebpackConfig = ({ actions }) => {
actions.setWebpackConfig({
resolve: {
alias: {
dev: path.resolve(__dirname, './src/dev/'),
lib: path.resolve(__dirname, './src/lib/'),
static: path.resolve(__dirname, './src/static/'),
ui: path.resolve(__dirname, './src/woly/'),
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/lib/global.ts → src/dev/global.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from 'styled-components';
import { createPalette } from 'lib/palette';

import { createPalette } from './palette';
import { systemUi } from './font-stacks';

export const Global = styled.div`
Expand Down
4 changes: 2 additions & 2 deletions src/lib/map-generation.tsx → src/dev/map-generation.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-disable react/no-array-index-key */
import React from 'react';
import styled, { StyledComponent } from 'styled-components';
import { Global } from 'lib/global';
import { Global } from 'dev/global';
import { Grid, Heading } from 'ui';
import { useUniqueID } from 'lib/hooks';

import { ConfiguratorName, Configurators } from './configurators';
import { useUniqueID } from './hooks/use-unique-id';

export type SizeProps = 'N' | 'XS' | 'S' | 'M' | 'L' | 'XL' | 'H';

Expand Down
2 changes: 1 addition & 1 deletion src/lib/playground.tsx → src/dev/playground.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import styled from 'styled-components';
import React, { useRef } from 'react';
import { useUniqueID } from 'lib/hooks';

import { ConfiguratorName, Configurators } from './configurators';
import { Global } from './global';
import { block } from './block';
import { useUniqueID } from './hooks/use-unique-id';

export { block };

Expand Down
File renamed without changes.
13 changes: 0 additions & 13 deletions src/lib/branch.tsx

This file was deleted.

3 changes: 3 additions & 0 deletions src/lib/hooks/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { useForceUpdate } from './use-force-update';
export { useSyncHeight } from './use-sync-height';
export { useUniqueID } from './use-unique-id';
5 changes: 0 additions & 5 deletions src/lib/index.ts

This file was deleted.

3 changes: 3 additions & 0 deletions src/lib/keyboard/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from './keyboard-event';
export * from './list-handlers';
export * from './select-handlers';
2 changes: 1 addition & 1 deletion src/upload/molecules/button-uploader/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Button} from 'ui'
import {Playground, StateEvent,FormBlock} from 'lib/playground';
import {Playground, StateEvent,FormBlock} from 'dev/playground';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick (non-blocking): пробел

import {IconPlus} from 'static/icons';
import {ButtonUploader} from './index';

Expand Down
2 changes: 1 addition & 1 deletion src/upload/molecules/drag-uploader/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Button} from 'ui'
import {Playground, StateEvent,FormBlock} from 'lib/playground';
import {Playground, StateEvent,FormBlock} from 'dev/playground';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

и тут тоже

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Irinaristova это usage, там почти везде такие пробелы из-за настроек шторма для mdx

import {DragUploader} from './index';

# DragUploader
Expand Down
2 changes: 1 addition & 1 deletion src/woly/atoms/avatar/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Avatar} from 'ui'
import {Playground, block} from 'lib/playground'
import {Playground, block} from 'dev/playground'

`Avatar` shows user avatar

Expand Down
2 changes: 1 addition & 1 deletion src/woly/atoms/backdrop/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Playground, State} from 'lib/playground'
import {Playground, State} from 'dev/playground'
import {Button, Field, Input, Modal} from 'ui'

`Backdrop` is a dark layer that covers full screen. It can be used in Modal windows or Aside menu panel.
Expand Down
2 changes: 1 addition & 1 deletion src/woly/atoms/box/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Box, BoxVertical} from './index';
import {Text, Tooltip, Button, Accordion, TextArea, Input, Checkbox} from 'ui';
import {block, Playground, State} from 'lib/playground';
import {block, Playground, State} from 'dev/playground';
import {IconInfo} from 'static/icons';

`Box` and `BoxVertical` are wrapper components, that add a box model to elements that don't have it.
Expand Down
2 changes: 1 addition & 1 deletion src/woly/atoms/button-icon/state-props.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { ButtonIcon } from 'ui';
import { GenerateMap, SizeProps } from 'lib/map-generation';
import { GenerateMap, SizeProps } from 'dev/map-generation';
import { IconSearch } from 'static/icons';

interface ComponentProps {
Expand Down
2 changes: 1 addition & 1 deletion src/woly/atoms/button-icon/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Playground} from 'lib/playground'
import {Playground} from 'dev/playground'
import {IconEyeOpened, IconSearch} from 'static/icons';
import {ButtonIcon} from 'ui';

Expand Down
4 changes: 2 additions & 2 deletions src/woly/atoms/button/__screenshot-test__/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { IconPlus } from 'static/icons';
import { Priorities, Sizes, StateMap } from 'lib/state-map';
import { block } from 'lib/block';
import { Priorities, Sizes, StateMap } from 'dev/state-map';
import { block } from 'dev/block';

import { Button } from '../index';

Expand Down
2 changes: 1 addition & 1 deletion src/woly/atoms/button/state-props.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable react/jsx-props-no-spreading */
import * as React from 'react';
import { GenerateMap } from 'lib/map-generation';
import { GenerateMap } from 'dev/map-generation';
import { IconSearch } from 'static/icons';

import { Button } from '.';
Expand Down
2 changes: 1 addition & 1 deletion src/woly/atoms/button/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Button} from './index'
import {block, Playground} from 'lib/playground'
import {block, Playground} from 'dev/playground'
import {IconPlus, IconSearch} from 'static/icons';

`Button` allows users to take actions and make choices with a single tap.
Expand Down
4 changes: 2 additions & 2 deletions src/woly/atoms/chip/__screenshot-test__/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { IconClose } from 'static/icons';
import { Priorities, Sizes, StateMap } from 'lib/state-map';
import { block } from 'lib/block';
import { Priorities, Sizes, StateMap } from 'dev/state-map';
import { block } from 'dev/block';

import { ButtonIcon } from '../../button-icon';
import { Chip } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/woly/atoms/chip/state-props.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { ButtonIcon, Chip } from 'ui';
import { GenerateMap, SizeBlock, SizeProps } from 'lib/map-generation';
import { GenerateMap, SizeBlock, SizeProps } from 'dev/map-generation';
import { IconSearch } from 'static/icons';

interface ChipProps {
Expand Down
2 changes: 1 addition & 1 deletion src/woly/atoms/chip/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {ButtonIcon, Chip} from 'ui';
import {IconClose, IconPlus} from 'static/icons';
import {block, Playground} from 'lib/playground'
import {block, Playground} from 'dev/playground'

`Chip` is used for categorizing or markup.
Chips allow users to enter information, make selections, filter content, or trigger actions.
Expand Down
2 changes: 1 addition & 1 deletion src/woly/atoms/header-panel/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {block, FormBlock, Playground, State} from 'lib/playground'
import {block, FormBlock, Playground, State} from 'dev/playground'
import {Button, HeaderPanel, Input, Label, Surface} from 'ui'

`HeaderPanel` is a navigation component that displays information and actions relating to the current screen.
Expand Down
2 changes: 1 addition & 1 deletion src/woly/atoms/heading/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Playground} from 'lib/playground'
import {Playground} from 'dev/playground'
import {Heading} from './index';

Heading component is used as a header of page.
Expand Down
2 changes: 1 addition & 1 deletion src/woly/atoms/icon-box/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IconBox, Box, Tooltip, Text, Input } from 'ui';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick (non-blocking): с отступами что-то произошло в usage: где-то вот так с пробелами - import { IconBox, Box, Tooltip, Text, Input } from 'ui';, а где-то без пробелов - import {block, Playground} from 'dev/playground';

import {IconClose, IconInfo} from 'static/icons';
import {block, Playground} from 'lib/playground';
import {block, Playground} from 'dev/playground';

### Example

Expand Down
2 changes: 1 addition & 1 deletion src/woly/atoms/input/state-props.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { GenerateMap, SizeBlock, SizeProps } from 'lib/map-generation';
import { GenerateMap, SizeBlock, SizeProps } from 'dev/map-generation';
import { IconSearch } from 'static/icons';

import { Input } from '.';
Expand Down
2 changes: 1 addition & 1 deletion src/woly/atoms/input/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {ButtonIcon, Input} from 'ui';
import {IconInfo} from 'static/icons';

import {block, Form, Playground} from 'lib/playground'
import {block, Form, Playground} from 'dev/playground'

`Input` is a field to accept data from the user. Input is used to create form fields that accept user input.
They typically appear in forms and dialogs.
Expand Down
2 changes: 1 addition & 1 deletion src/woly/atoms/label/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Playground} from 'lib/playground'
import {Playground} from 'dev/playground'
import {Label} from 'ui';

The Label component lets you add captions for other elements in your project, such as other UI components that don't have their own labels.
Expand Down
2 changes: 1 addition & 1 deletion src/woly/atoms/list/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {block, Playground, State} from 'lib/playground'
import {block, Playground, State} from 'dev/playground'
import {Button, Checkbox, Input, ListContainer, ListItem, Surface} from 'ui';
import {IconInfo} from 'static/icons';

Expand Down
2 changes: 1 addition & 1 deletion src/woly/atoms/loader/example.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { ListContainer, ListItem } from 'ui';
import { StateCallback } from 'lib/playground';
import { StateCallback } from 'dev/playground';

export const loadUsers = async ({ value, change }: StateCallback) => {
change({ ...value, loading: true });
Expand Down
2 changes: 1 addition & 1 deletion src/woly/atoms/loader/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Loader, Button, Text} from 'ui';
import {Playground, State, StateEvent} from 'lib/playground';
import {Playground, State, StateEvent} from 'dev/playground';
import {loadUsers, UsersList} from './example';

`Loader` component is used when retrieving data or performing slow computations and helps to notify users that loading is underway.
Expand Down
2 changes: 1 addition & 1 deletion src/woly/atoms/separator/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Playground} from 'lib/playground'
import {Playground} from 'dev/playground'
import {Heading, Input, Separator} from 'ui'

`Sepatator` is a line that divides blocks or content.
Expand Down
2 changes: 1 addition & 1 deletion src/woly/atoms/surface/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
Menu,
Playground,
State
} from 'lib/playground'
} from 'dev/playground'
import {Button, ButtonIcon, Input, Label, Surface, Popover, ListContainer, ListItem, Text} from 'ui';
import {IconClose, Threebars} from 'static/icons';

Expand Down
2 changes: 1 addition & 1 deletion src/woly/atoms/table/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Playground} from 'lib/playground'
import {Playground} from 'dev/playground'
import {Table, Tbody, Td, Th, Thead, Tr} from 'ui'

export const tableHead = [
Expand Down
2 changes: 1 addition & 1 deletion src/woly/atoms/text-area/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {TextArea} from 'ui';
import {block, Playground} from 'lib/playground';
import {block, Playground} from 'dev/playground';

`TextArea` defines a multi-line text input control.

Expand Down
2 changes: 1 addition & 1 deletion src/woly/atoms/text/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Line, Playground} from 'lib/playground'
import {Line, Playground} from 'dev/playground'
import {Input, Text, TextArea} from 'ui';

Text component is used as a simple text or a hint/error message for Input or TextArea components.
Expand Down
2 changes: 1 addition & 1 deletion src/woly/molecules/accordion/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Playground} from 'lib/playground'
import {Playground} from 'dev/playground'
import {
Accordion,
Field,
Expand Down
3 changes: 2 additions & 1 deletion src/woly/molecules/checkbox/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import * as React from 'react';
import styled, { StyledComponent } from 'styled-components';
import { IconCheckFilled, IconFilledUnchecked } from 'static/icons';
import { Priority, keyboardEventHandle } from 'lib';
import { Priority } from 'lib/types';
import { boxInline } from 'ui/elements/box';
import { keyboardEventHandle } from 'lib/keyboard';

interface CheckboxProps {
className?: string;
Expand Down
2 changes: 1 addition & 1 deletion src/woly/molecules/checkbox/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Checkbox} from 'ui';
import {Playground, State} from 'lib/playground'
import {Playground, State} from 'dev/playground'

Checkboxes allow you to setup selectable options for your users - either to toggle a single setting on or off, or to allow for multiple choices.

Expand Down
2 changes: 1 addition & 1 deletion src/woly/molecules/field/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Playground, State} from 'lib/playground';
import {Playground, State} from 'dev/playground';
import {Checkbox, Field, Input, InputPassword, Switch, TextArea} from 'ui'
import {IconEyeClosed, IconEyeOpened} from 'static/icons';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { Priorities, Sizes, StateMap } from 'lib/state-map';
import { block } from 'lib/block';
import { Priorities, Sizes, StateMap } from 'dev/state-map';
import { block } from 'dev/block';

import { InputPassword } from '..';

Expand Down
2 changes: 1 addition & 1 deletion src/woly/molecules/input-password/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {InputPassword} from './index';
import {block, Playground, State} from 'lib/playground';
import {block, Playground, State} from 'dev/playground';

`InputPassword` provide a way for the user to securely enter a password
The component includes a button-icon that toggle to hide and show the
Expand Down
2 changes: 1 addition & 1 deletion src/woly/molecules/modal/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Playground, State} from 'lib/playground'
import {Playground, State} from 'dev/playground'
import {Button, Field, Input, Modal, Checkbox} from 'ui';
import {IconSearch} from 'static/icons';

Expand Down
2 changes: 1 addition & 1 deletion src/woly/molecules/notification/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Notification} from './index';
import { Button } from 'ui';
import { Playground, block, StateEvent, State } from 'lib/playground';
import { Playground, block, StateEvent, State } from 'dev/playground';

`Notification` display the notification message globaly.

Expand Down
2 changes: 1 addition & 1 deletion src/woly/molecules/popover/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import styled, { StyledComponent } from 'styled-components';
import { Priority } from 'lib/types';
import { Surface } from 'ui/atoms';
import { positionRelativeGet } from 'lib';
import { positionRelativeGet } from 'lib/position-relative';

interface Props {
className?: string;
Expand Down
2 changes: 1 addition & 1 deletion src/woly/molecules/popover/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {block, Playground} from 'lib/playground'
import {block, Playground} from 'dev/playground'
import {Button, ButtonIcon, ListContainer, ListItem, Popover} from 'ui';
import {IconSearch, IconInfo} from 'static/icons';

Expand Down
2 changes: 1 addition & 1 deletion src/woly/molecules/radio-button/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import styled, { StyledComponent } from 'styled-components';
import { Priority } from 'lib/types';
import { keyboardEventHandle } from 'lib';
import { keyboardEventHandle } from 'lib/keyboard';

interface RadioButtonProps {
className?: string;
Expand Down
2 changes: 1 addition & 1 deletion src/woly/molecules/radio-button/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {RadioButton} from 'ui';
import {Playground, State} from 'lib/playground';
import {Playground, State} from 'dev/playground';

The `RadioButton` component lets you add a radio button and assign it to a radio group.
Users can select only one radio button at a time within a radio group.
Expand Down
2 changes: 1 addition & 1 deletion src/woly/molecules/select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import styled, { StyledComponent } from 'styled-components';
import { Priority } from 'lib/types';
import { box } from 'ui/elements/box';
import { keyHandlerGet, keyboardEventHandle } from 'lib';
import { keyHandlerGet, keyboardEventHandle } from 'lib/keyboard';

interface SelectOptionProps {
children: React.ReactNode;
Expand Down
2 changes: 1 addition & 1 deletion src/woly/molecules/select/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Select} from 'ui';
import {Playground, StateEvent} from 'lib/playground';
import {Playground, StateEvent} from 'dev/playground';
import {IconArrowDown} from 'static/icons';

Select is a type of input that is used in forms,
Expand Down
2 changes: 1 addition & 1 deletion src/woly/molecules/switch/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import styled, { StyledComponent } from 'styled-components';
import { Priority } from 'lib/types';
import { keyboardEventHandle } from 'lib';
import { keyboardEventHandle } from 'lib/keyboard';

interface SwitchProps extends React.InputHTMLAttributes<HTMLInputElement> {
className?: string;
Expand Down
Loading