@appquality/unguess-design-system 2.8.3 → 2.8.6
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/.github/workflows/storybook.yml +37 -37
- package/.prettierrc +3 -3
- package/CHANGELOG.md +586 -550
- package/README.md +73 -73
- package/generate-story.sh +60 -60
- package/package.json +119 -119
- package/build/hooks/useWindowSize.d.ts +0 -4
- package/build/index.d.ts +0 -63
- package/build/index.js +0 -2135
- package/build/stories/accordions/_types.d.ts +0 -25
- package/build/stories/accordions/index.d.ts +0 -17
- package/build/stories/accordions/index.stories.d.ts +0 -21
- package/build/stories/avatar/_types.d.ts +0 -19
- package/build/stories/avatar/index.d.ts +0 -13
- package/build/stories/avatar/index.stories.d.ts +0 -10
- package/build/stories/breadcrumbs/_types.d.ts +0 -5
- package/build/stories/breadcrumbs/index.d.ts +0 -11
- package/build/stories/breadcrumbs/index.stories.d.ts +0 -6
- package/build/stories/buttons/anchor/_types.d.ts +0 -11
- package/build/stories/buttons/anchor/index.d.ts +0 -12
- package/build/stories/buttons/anchor/index.stories.d.ts +0 -8
- package/build/stories/buttons/button/_types.d.ts +0 -30
- package/build/stories/buttons/button/index.d.ts +0 -22
- package/build/stories/buttons/button/index.stories.d.ts +0 -19
- package/build/stories/buttons/button-group/_types.d.ts +0 -5
- package/build/stories/buttons/button-group/index.d.ts +0 -9
- package/build/stories/buttons/button-group/index.stories.d.ts +0 -15
- package/build/stories/buttons/icon-button/_types.d.ts +0 -19
- package/build/stories/buttons/icon-button/index.d.ts +0 -14
- package/build/stories/buttons/icon-button/index.stories.d.ts +0 -9
- package/build/stories/buttons/shared/_shared.d.ts +0 -2
- package/build/stories/buttons/split-button/_types.d.ts +0 -2
- package/build/stories/buttons/split-button/index.d.ts +0 -11
- package/build/stories/buttons/split-button/index.stories.d.ts +0 -6
- package/build/stories/buttons/utils/useButtonVariant.d.ts +0 -5
- package/build/stories/campaignCards/_types.d.ts +0 -43
- package/build/stories/campaignCards/index.d.ts +0 -4
- package/build/stories/campaignCards/index.stories.d.ts +0 -7
- package/build/stories/cards/_types.d.ts +0 -7
- package/build/stories/cards/index.d.ts +0 -10
- package/build/stories/cards/index.stories.d.ts +0 -11
- package/build/stories/close/_types.d.ts +0 -3
- package/build/stories/close/index.d.ts +0 -7
- package/build/stories/close/index.stories.d.ts +0 -6
- package/build/stories/counter/_types.d.ts +0 -5
- package/build/stories/counter/index.d.ts +0 -13
- package/build/stories/counter/index.stories.d.ts +0 -15
- package/build/stories/dropdowns/field/_types.d.ts +0 -2
- package/build/stories/dropdowns/field/index.d.ts +0 -4
- package/build/stories/dropdowns/item/_types.d.ts +0 -9
- package/build/stories/dropdowns/item/index.d.ts +0 -4
- package/build/stories/dropdowns/menu/_types.d.ts +0 -47
- package/build/stories/dropdowns/menu/index.d.ts +0 -14
- package/build/stories/dropdowns/menu/index.stories.d.ts +0 -6
- package/build/stories/dropdowns/multiselect/_types.d.ts +0 -17
- package/build/stories/dropdowns/multiselect/index.d.ts +0 -11
- package/build/stories/dropdowns/multiselect/index.stories.d.ts +0 -21
- package/build/stories/dropdowns/select/_types.d.ts +0 -31
- package/build/stories/dropdowns/select/index.d.ts +0 -16
- package/build/stories/dropdowns/select/index.stories.d.ts +0 -20
- package/build/stories/forms/checkbox/_types.d.ts +0 -8
- package/build/stories/forms/checkbox/index.d.ts +0 -14
- package/build/stories/forms/checkbox/index.stories.d.ts +0 -6
- package/build/stories/forms/field/_types.d.ts +0 -3
- package/build/stories/forms/field/index.d.ts +0 -8
- package/build/stories/forms/field/index.stories.d.ts +0 -6
- package/build/stories/forms/input/_types.d.ts +0 -9
- package/build/stories/forms/input/index.d.ts +0 -11
- package/build/stories/forms/input/index.stories.d.ts +0 -9
- package/build/stories/forms/radio/_types.d.ts +0 -3
- package/build/stories/forms/radio/index.d.ts +0 -14
- package/build/stories/forms/radio/index.stories.d.ts +0 -7
- package/build/stories/forms/textarea/_types.d.ts +0 -15
- package/build/stories/forms/textarea/index.d.ts +0 -10
- package/build/stories/forms/textarea/index.stories.d.ts +0 -8
- package/build/stories/forms/toggle/_types.d.ts +0 -3
- package/build/stories/forms/toggle/index.d.ts +0 -13
- package/build/stories/forms/toggle/index.stories.d.ts +0 -10
- package/build/stories/grid/col/_types.d.ts +0 -77
- package/build/stories/grid/col/index.d.ts +0 -4
- package/build/stories/grid/col/index.stories.d.ts +0 -8
- package/build/stories/grid/grid/_types.d.ts +0 -9
- package/build/stories/grid/grid/index.d.ts +0 -10
- package/build/stories/grid/grid/index.stories.d.ts +0 -12
- package/build/stories/grid/row/_types.d.ts +0 -48
- package/build/stories/grid/row/index.d.ts +0 -4
- package/build/stories/grid/row/index.stories.d.ts +0 -10
- package/build/stories/icons/_types.d.ts +0 -7
- package/build/stories/icons/index.d.ts +0 -4
- package/build/stories/icons/index.stories.d.ts +0 -6
- package/build/stories/label/_types.d.ts +0 -5
- package/build/stories/label/index.d.ts +0 -8
- package/build/stories/label/index.stories.d.ts +0 -7
- package/build/stories/loaders/progress/_types.d.ts +0 -12
- package/build/stories/loaders/progress/index.d.ts +0 -14
- package/build/stories/loaders/progress/index.stories.d.ts +0 -6
- package/build/stories/loaders/skeleton/_types.d.ts +0 -9
- package/build/stories/loaders/skeleton/index.d.ts +0 -17
- package/build/stories/loaders/skeleton/index.stories.d.ts +0 -7
- package/build/stories/loaders/spinner/_types.d.ts +0 -19
- package/build/stories/loaders/spinner/index.d.ts +0 -11
- package/build/stories/loaders/spinner/index.stories.d.ts +0 -6
- package/build/stories/login-form/_types.d.ts +0 -29
- package/build/stories/login-form/index.d.ts +0 -10
- package/build/stories/login-form/index.stories.d.ts +0 -7
- package/build/stories/logo/_types.d.ts +0 -9
- package/build/stories/logo/index.d.ts +0 -13
- package/build/stories/logo/index.stories.d.ts +0 -6
- package/build/stories/modals/_types.d.ts +0 -34
- package/build/stories/modals/index.d.ts +0 -11
- package/build/stories/modals/index.stories.d.ts +0 -19
- package/build/stories/navigation/app-header/_types.d.ts +0 -18
- package/build/stories/navigation/app-header/index.d.ts +0 -8
- package/build/stories/navigation/app-header/index.stories.d.ts +0 -6
- package/build/stories/navigation/body/_types.d.ts +0 -5
- package/build/stories/navigation/body/index.d.ts +0 -7
- package/build/stories/navigation/chrome/_types.d.ts +0 -7
- package/build/stories/navigation/chrome/index.d.ts +0 -10
- package/build/stories/navigation/content/_types.d.ts +0 -2
- package/build/stories/navigation/content/index.d.ts +0 -7
- package/build/stories/navigation/header/_types.d.ts +0 -5
- package/build/stories/navigation/header/header-item/_types.d.ts +0 -32
- package/build/stories/navigation/header/header-item/brandItem.d.ts +0 -4
- package/build/stories/navigation/header/header-item/headerItem.d.ts +0 -4
- package/build/stories/navigation/header/header-item/headerItemIcon.d.ts +0 -4
- package/build/stories/navigation/header/header-item/headerItemText.d.ts +0 -4
- package/build/stories/navigation/header/header-item/index.d.ts +0 -5
- package/build/stories/navigation/header/header-item/utils.d.ts +0 -13
- package/build/stories/navigation/header/index.d.ts +0 -13
- package/build/stories/navigation/main/_types.d.ts +0 -2
- package/build/stories/navigation/main/index.d.ts +0 -7
- package/build/stories/navigation/nav/_types.d.ts +0 -5
- package/build/stories/navigation/nav/index.d.ts +0 -10
- package/build/stories/navigation/nav/nav-item/_types.d.ts +0 -29
- package/build/stories/navigation/nav/nav-item/index.d.ts +0 -7
- package/build/stories/navigation/nav/nav-item/navDivider.d.ts +0 -4
- package/build/stories/navigation/nav/nav-item/navItem.d.ts +0 -4
- package/build/stories/navigation/nav/nav-item/navItemIcon.d.ts +0 -4
- package/build/stories/navigation/nav/nav-item/navItemProject.d.ts +0 -8
- package/build/stories/navigation/nav/nav-item/navItemText.d.ts +0 -4
- package/build/stories/navigation/nav/nav-item/navToggle.d.ts +0 -4
- package/build/stories/navigation/sidebar/_types.d.ts +0 -17
- package/build/stories/navigation/sidebar/index.d.ts +0 -10
- package/build/stories/navigation/sidebar/index.stories.d.ts +0 -9
- package/build/stories/notifications/_types.d.ts +0 -9
- package/build/stories/notifications/index.d.ts +0 -20
- package/build/stories/notifications/index.stories.d.ts +0 -10
- package/build/stories/page/index.d.ts +0 -8
- package/build/stories/page/index.stories.d.ts +0 -6
- package/build/stories/pagination/_types.d.ts +0 -34
- package/build/stories/pagination/index.d.ts +0 -17
- package/build/stories/pagination/index.stories.d.ts +0 -7
- package/build/stories/profile-modal/UserContainer.d.ts +0 -3
- package/build/stories/profile-modal/_types.d.ts +0 -41
- package/build/stories/profile-modal/helpMenuItem.d.ts +0 -18
- package/build/stories/profile-modal/index.d.ts +0 -11
- package/build/stories/profile-modal/index.stories.d.ts +0 -6
- package/build/stories/profile-modal/languageMenuItem.d.ts +0 -14
- package/build/stories/profile-modal/menuItem.d.ts +0 -11
- package/build/stories/profile-modal/menuItemIcon.d.ts +0 -9
- package/build/stories/profile-modal/previousMenuButton.d.ts +0 -3
- package/build/stories/profile-modal/userMenu.d.ts +0 -3
- package/build/stories/profile-modal/utils.d.ts +0 -1
- package/build/stories/shared/globalStyle.d.ts +0 -2
- package/build/stories/table/_types.d.ts +0 -83
- package/build/stories/table/grouped.d.ts +0 -5
- package/build/stories/table/index.d.ts +0 -21
- package/build/stories/table/index.stories.d.ts +0 -18
- package/build/stories/tags/_types.d.ts +0 -17
- package/build/stories/tags/index.d.ts +0 -22
- package/build/stories/tags/index.stories.d.ts +0 -19
- package/build/stories/theme/gradients.d.ts +0 -4
- package/build/stories/theme/index.d.ts +0 -244
- package/build/stories/theme/mixins.d.ts +0 -3
- package/build/stories/theme/palette.d.ts +0 -141
- package/build/stories/theme/palette.stories.d.ts +0 -15
- package/build/stories/theme/utils.d.ts +0 -3
- package/build/stories/tiles/_types.d.ts +0 -12
- package/build/stories/tiles/index.d.ts +0 -22
- package/build/stories/tiles/index.stories.d.ts +0 -25
- package/build/stories/title/_types.d.ts +0 -5
- package/build/stories/title/index.d.ts +0 -7
- package/build/stories/title/index.stories.d.ts +0 -6
- package/build/stories/trigger/_types.d.ts +0 -3
- package/build/stories/trigger/index.d.ts +0 -7
- package/build/stories/typography/block-quote/_types.d.ts +0 -5
- package/build/stories/typography/block-quote/index.d.ts +0 -7
- package/build/stories/typography/block-quote/index.stories.d.ts +0 -5
- package/build/stories/typography/code/_types.d.ts +0 -7
- package/build/stories/typography/code/index.d.ts +0 -7
- package/build/stories/typography/code/index.stories.d.ts +0 -8
- package/build/stories/typography/ellipsis/_types.d.ts +0 -9
- package/build/stories/typography/ellipsis/index.d.ts +0 -7
- package/build/stories/typography/ellipsis/index.stories.d.ts +0 -5
- package/build/stories/typography/lists/_types.d.ts +0 -17
- package/build/stories/typography/lists/index.d.ts +0 -16
- package/build/stories/typography/lists/ordered.stories.d.ts +0 -9
- package/build/stories/typography/lists/unordered.stories.d.ts +0 -9
- package/build/stories/typography/paragraph/_types.d.ts +0 -5
- package/build/stories/typography/paragraph/index.d.ts +0 -7
- package/build/stories/typography/paragraph/index.stories.d.ts +0 -6
- package/build/stories/typography/span/_types.d.ts +0 -13
- package/build/stories/typography/span/index.d.ts +0 -13
- package/build/stories/typography/span/index.stories.d.ts +0 -6
- package/build/stories/typography/typescale/_types.d.ts +0 -43
- package/build/stories/typography/typescale/index.d.ts +0 -12
- package/build/stories/typography/typescale/index.stories.d.ts +0 -5
package/README.md
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
# UNGUESS Design System
|
|
2
|
-
|
|
3
|
-
[](http://commitizen.github.io/cz-cli/)
|
|
4
|
-
|
|
5
|
-
## Used by
|
|
6
|
-
|
|
7
|
-
- [Unguess platform](https://app.unguess.io/)
|
|
8
|
-
|
|
9
|
-
## Tech stack
|
|
10
|
-
|
|
11
|
-
Building components
|
|
12
|
-
|
|
13
|
-
- 🪴 [Zendesk Garden](https://garden.zendesk.com/) as base design system
|
|
14
|
-
- ⚛️ [React](https://reactjs.org/) declarative component-centric UI
|
|
15
|
-
- 📚 [Storybook](https://storybook.js.org) for UI component development and [auto-generated docs](https://medium.com/storybookjs/storybook-docs-sneak-peak-5be78445094a)
|
|
16
|
-
- 👩🎤 [Styled Components](https://styled-components.com/) for component-scoped styling
|
|
17
|
-
|
|
18
|
-
Maintaining the system
|
|
19
|
-
|
|
20
|
-
- 📦 [Yarn](https://yarnpkg.com/) for package management
|
|
21
|
-
- 📦 [NPM](https://www.npmjs.com/) for distribution
|
|
22
|
-
- ✅ [Chromatic](https://www.chromatic.com/) to prevent UI bugs in components (by Storybook maintainers)
|
|
23
|
-
|
|
24
|
-
## Why
|
|
25
|
-
|
|
26
|
-
The Unguess design system codifies existing UI components into a central, well-maintained repository. It is built to address having to paste the same components into multiple projects again and again. This simplifies building UI's with Storybook's design patterns.
|
|
27
|
-
|
|
28
|
-
## Install
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
yarn
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Global Styles
|
|
35
|
-
|
|
36
|
-
Components within the design system assume that a set of global styles have been configured. Depending upon the needs of the application, this can be done several ways:
|
|
37
|
-
|
|
38
|
-
#### Option 1: Render the `GlobalStyle` component
|
|
39
|
-
|
|
40
|
-
Useful when you don't need any custom `body` styling in the application, typically this would be placed in a layout component that wraps all pages, or a top-level `App` component.
|
|
41
|
-
|
|
42
|
-
```javascript
|
|
43
|
-
import { global } from '@storybook/design-system';
|
|
44
|
-
const { GlobalStyle } = global;
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
```javascript
|
|
48
|
-
/* Render the global styles once per page */
|
|
49
|
-
<GlobalStyle />
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
#### Option 2: Use the `bodyStyles` to apply styling
|
|
53
|
-
|
|
54
|
-
Useful when you want build upon the shared global styling.
|
|
55
|
-
|
|
56
|
-
```javascript
|
|
57
|
-
import { Global, css } from '@storybook/theming';
|
|
58
|
-
import { global } from '@storybook/design-system';
|
|
59
|
-
const { bodyStyles } = global;
|
|
60
|
-
|
|
61
|
-
const customGlobalStyle = css`
|
|
62
|
-
body {
|
|
63
|
-
${bodyStyles}// Custom body styling for the app
|
|
64
|
-
}
|
|
65
|
-
`;
|
|
66
|
-
|
|
67
|
-
const CustomGlobalStyle = () => <Global styles={customGlobalStyle} />;
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
```javascript
|
|
71
|
-
/* Render the global styles once per page */
|
|
72
|
-
<CustomGlobalStyle />
|
|
73
|
-
```
|
|
1
|
+
# UNGUESS Design System
|
|
2
|
+
|
|
3
|
+
[](http://commitizen.github.io/cz-cli/)
|
|
4
|
+
|
|
5
|
+
## Used by
|
|
6
|
+
|
|
7
|
+
- [Unguess platform](https://app.unguess.io/)
|
|
8
|
+
|
|
9
|
+
## Tech stack
|
|
10
|
+
|
|
11
|
+
Building components
|
|
12
|
+
|
|
13
|
+
- 🪴 [Zendesk Garden](https://garden.zendesk.com/) as base design system
|
|
14
|
+
- ⚛️ [React](https://reactjs.org/) declarative component-centric UI
|
|
15
|
+
- 📚 [Storybook](https://storybook.js.org) for UI component development and [auto-generated docs](https://medium.com/storybookjs/storybook-docs-sneak-peak-5be78445094a)
|
|
16
|
+
- 👩🎤 [Styled Components](https://styled-components.com/) for component-scoped styling
|
|
17
|
+
|
|
18
|
+
Maintaining the system
|
|
19
|
+
|
|
20
|
+
- 📦 [Yarn](https://yarnpkg.com/) for package management
|
|
21
|
+
- 📦 [NPM](https://www.npmjs.com/) for distribution
|
|
22
|
+
- ✅ [Chromatic](https://www.chromatic.com/) to prevent UI bugs in components (by Storybook maintainers)
|
|
23
|
+
|
|
24
|
+
## Why
|
|
25
|
+
|
|
26
|
+
The Unguess design system codifies existing UI components into a central, well-maintained repository. It is built to address having to paste the same components into multiple projects again and again. This simplifies building UI's with Storybook's design patterns.
|
|
27
|
+
|
|
28
|
+
## Install
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
yarn
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Global Styles
|
|
35
|
+
|
|
36
|
+
Components within the design system assume that a set of global styles have been configured. Depending upon the needs of the application, this can be done several ways:
|
|
37
|
+
|
|
38
|
+
#### Option 1: Render the `GlobalStyle` component
|
|
39
|
+
|
|
40
|
+
Useful when you don't need any custom `body` styling in the application, typically this would be placed in a layout component that wraps all pages, or a top-level `App` component.
|
|
41
|
+
|
|
42
|
+
```javascript
|
|
43
|
+
import { global } from '@storybook/design-system';
|
|
44
|
+
const { GlobalStyle } = global;
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
```javascript
|
|
48
|
+
/* Render the global styles once per page */
|
|
49
|
+
<GlobalStyle />
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
#### Option 2: Use the `bodyStyles` to apply styling
|
|
53
|
+
|
|
54
|
+
Useful when you want build upon the shared global styling.
|
|
55
|
+
|
|
56
|
+
```javascript
|
|
57
|
+
import { Global, css } from '@storybook/theming';
|
|
58
|
+
import { global } from '@storybook/design-system';
|
|
59
|
+
const { bodyStyles } = global;
|
|
60
|
+
|
|
61
|
+
const customGlobalStyle = css`
|
|
62
|
+
body {
|
|
63
|
+
${bodyStyles}// Custom body styling for the app
|
|
64
|
+
}
|
|
65
|
+
`;
|
|
66
|
+
|
|
67
|
+
const CustomGlobalStyle = () => <Global styles={customGlobalStyle} />;
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```javascript
|
|
71
|
+
/* Render the global styles once per page */
|
|
72
|
+
<CustomGlobalStyle />
|
|
73
|
+
```
|
package/generate-story.sh
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
print_help () {
|
|
3
|
-
echo "Usage"
|
|
4
|
-
echo " $0 new-story-name"
|
|
5
|
-
exit
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
if [ $# -lt 1 ]; then
|
|
9
|
-
print_help
|
|
10
|
-
fi
|
|
11
|
-
|
|
12
|
-
STORY_NAME="${1}"
|
|
13
|
-
STORY_NAME_LOWER="$(tr '[:upper:]' '[:lower:]' <<< "${STORY_NAME}")"
|
|
14
|
-
generate_component() {
|
|
15
|
-
cat << EOF
|
|
16
|
-
import { ${STORY_NAME}Props } from "./_types";
|
|
17
|
-
|
|
18
|
-
export const Basic${STORY_NAME} = ({}: ${STORY_NAME}Props) => {};
|
|
19
|
-
EOF
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
generate_types() {
|
|
23
|
-
cat << EOF
|
|
24
|
-
import { BaseProps } from "../../shared/_types";
|
|
25
|
-
export interface ${STORY_NAME}Props extends BaseProps {};
|
|
26
|
-
|
|
27
|
-
EOF
|
|
28
|
-
}
|
|
29
|
-
generate_styled_component() {
|
|
30
|
-
cat << EOF
|
|
31
|
-
import styled from "styled-components";
|
|
32
|
-
import { Basic${STORY_NAME} } from "./_component";
|
|
33
|
-
|
|
34
|
-
export const ${STORY_NAME} = styled(Basic${STORY_NAME})\`\`;
|
|
35
|
-
EOF
|
|
36
|
-
}
|
|
37
|
-
generate_stories() {
|
|
38
|
-
cat << EOF
|
|
39
|
-
import { Story, Meta } from "@storybook/react";
|
|
40
|
-
import { ${STORY_NAME}Props } from "./_types";
|
|
41
|
-
import { ${STORY_NAME} } from "./${STORY_NAME}";
|
|
42
|
-
|
|
43
|
-
export default {
|
|
44
|
-
title: "${STORY_NAME}",
|
|
45
|
-
component: ${STORY_NAME},
|
|
46
|
-
} as Meta;
|
|
47
|
-
|
|
48
|
-
const Template: Story<${STORY_NAME}Props> = (args) => <${STORY_NAME} {...args} />;
|
|
49
|
-
|
|
50
|
-
export const ${STORY_NAME}Base = Template.bind({});
|
|
51
|
-
${STORY_NAME}Base.args = {};
|
|
52
|
-
EOF
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
mkdir "src/test-stories/$STORY_NAME_LOWER"
|
|
56
|
-
|
|
57
|
-
generate_component > "src/test-stories/$STORY_NAME_LOWER/_component.tsx"
|
|
58
|
-
generate_types > "src/test-stories/$STORY_NAME_LOWER/_types.ts"
|
|
59
|
-
generate_styled_component > "src/test-stories/$STORY_NAME_LOWER/$STORY_NAME.tsx"
|
|
60
|
-
generate_stories > "src/test-stories/$STORY_NAME_LOWER/$STORY_NAME.stories.tsx"
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
print_help () {
|
|
3
|
+
echo "Usage"
|
|
4
|
+
echo " $0 new-story-name"
|
|
5
|
+
exit
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
if [ $# -lt 1 ]; then
|
|
9
|
+
print_help
|
|
10
|
+
fi
|
|
11
|
+
|
|
12
|
+
STORY_NAME="${1}"
|
|
13
|
+
STORY_NAME_LOWER="$(tr '[:upper:]' '[:lower:]' <<< "${STORY_NAME}")"
|
|
14
|
+
generate_component() {
|
|
15
|
+
cat << EOF
|
|
16
|
+
import { ${STORY_NAME}Props } from "./_types";
|
|
17
|
+
|
|
18
|
+
export const Basic${STORY_NAME} = ({}: ${STORY_NAME}Props) => {};
|
|
19
|
+
EOF
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
generate_types() {
|
|
23
|
+
cat << EOF
|
|
24
|
+
import { BaseProps } from "../../shared/_types";
|
|
25
|
+
export interface ${STORY_NAME}Props extends BaseProps {};
|
|
26
|
+
|
|
27
|
+
EOF
|
|
28
|
+
}
|
|
29
|
+
generate_styled_component() {
|
|
30
|
+
cat << EOF
|
|
31
|
+
import styled from "styled-components";
|
|
32
|
+
import { Basic${STORY_NAME} } from "./_component";
|
|
33
|
+
|
|
34
|
+
export const ${STORY_NAME} = styled(Basic${STORY_NAME})\`\`;
|
|
35
|
+
EOF
|
|
36
|
+
}
|
|
37
|
+
generate_stories() {
|
|
38
|
+
cat << EOF
|
|
39
|
+
import { Story, Meta } from "@storybook/react";
|
|
40
|
+
import { ${STORY_NAME}Props } from "./_types";
|
|
41
|
+
import { ${STORY_NAME} } from "./${STORY_NAME}";
|
|
42
|
+
|
|
43
|
+
export default {
|
|
44
|
+
title: "${STORY_NAME}",
|
|
45
|
+
component: ${STORY_NAME},
|
|
46
|
+
} as Meta;
|
|
47
|
+
|
|
48
|
+
const Template: Story<${STORY_NAME}Props> = (args) => <${STORY_NAME} {...args} />;
|
|
49
|
+
|
|
50
|
+
export const ${STORY_NAME}Base = Template.bind({});
|
|
51
|
+
${STORY_NAME}Base.args = {};
|
|
52
|
+
EOF
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
mkdir "src/test-stories/$STORY_NAME_LOWER"
|
|
56
|
+
|
|
57
|
+
generate_component > "src/test-stories/$STORY_NAME_LOWER/_component.tsx"
|
|
58
|
+
generate_types > "src/test-stories/$STORY_NAME_LOWER/_types.ts"
|
|
59
|
+
generate_styled_component > "src/test-stories/$STORY_NAME_LOWER/$STORY_NAME.tsx"
|
|
60
|
+
generate_stories > "src/test-stories/$STORY_NAME_LOWER/$STORY_NAME.stories.tsx"
|
|
61
61
|
2606:50c0:8003::154
|
package/package.json
CHANGED
|
@@ -1,119 +1,119 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@appquality/unguess-design-system",
|
|
3
|
-
"version": "2.8.
|
|
4
|
-
"dependencies": {
|
|
5
|
-
"@zendeskgarden/react-accordions": "^8.49.0",
|
|
6
|
-
"@zendeskgarden/react-avatars": "^8.49.0",
|
|
7
|
-
"@zendeskgarden/react-breadcrumbs": "^8.49.0",
|
|
8
|
-
"@zendeskgarden/react-buttons": "^8.48.2",
|
|
9
|
-
"@zendeskgarden/react-chrome": "^8.49.0",
|
|
10
|
-
"@zendeskgarden/react-dropdowns": "^8.49.0",
|
|
11
|
-
"@zendeskgarden/react-grid": "^8.49.0",
|
|
12
|
-
"@zendeskgarden/react-loaders": "^8.49.0",
|
|
13
|
-
"@zendeskgarden/react-modals": "^8.49.0",
|
|
14
|
-
"@zendeskgarden/react-notifications": "^8.49.0",
|
|
15
|
-
"@zendeskgarden/react-pagination": "^8.49.0",
|
|
16
|
-
"@zendeskgarden/react-tables": "^8.49.0",
|
|
17
|
-
"@zendeskgarden/react-tags": "^8.49.0",
|
|
18
|
-
"@zendeskgarden/react-tooltips": "^8.49.0",
|
|
19
|
-
"@zendeskgarden/react-typography": "^8.49.0",
|
|
20
|
-
"react-spring": "^9.4.4",
|
|
21
|
-
"react-window": "^1.8.6"
|
|
22
|
-
},
|
|
23
|
-
"scripts": {
|
|
24
|
-
"start": "react-scripts start",
|
|
25
|
-
"build": "yarn run clean && rollup -c",
|
|
26
|
-
"build-storybook": "build-storybook",
|
|
27
|
-
"storybook": "start-storybook -p 6006",
|
|
28
|
-
"clean": "rimraf build",
|
|
29
|
-
"release": "npx auto shipit --base-branch=master",
|
|
30
|
-
"test": "react-scripts test"
|
|
31
|
-
},
|
|
32
|
-
"eslintConfig": {
|
|
33
|
-
"extends": [
|
|
34
|
-
"react-app",
|
|
35
|
-
"react-app/jest"
|
|
36
|
-
],
|
|
37
|
-
"overrides": [
|
|
38
|
-
{
|
|
39
|
-
"files": [
|
|
40
|
-
"**/*.stories.*"
|
|
41
|
-
],
|
|
42
|
-
"rules": {
|
|
43
|
-
"import/no-anonymous-default-export": "off"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
]
|
|
47
|
-
},
|
|
48
|
-
"browserslist": {
|
|
49
|
-
"production": [
|
|
50
|
-
">0.2%",
|
|
51
|
-
"not dead",
|
|
52
|
-
"not op_mini all"
|
|
53
|
-
],
|
|
54
|
-
"development": [
|
|
55
|
-
"last 1 chrome version",
|
|
56
|
-
"last 1 firefox version",
|
|
57
|
-
"last 1 safari version"
|
|
58
|
-
]
|
|
59
|
-
},
|
|
60
|
-
"peerDependencies": {
|
|
61
|
-
"@zendeskgarden/react-theming": "^8.48.2",
|
|
62
|
-
"formik": "^2.2.9",
|
|
63
|
-
"react": "^17.0.2",
|
|
64
|
-
"react-dom": "^17.0.2",
|
|
65
|
-
"styled-components": "^5.3.3"
|
|
66
|
-
},
|
|
67
|
-
"devDependencies": {
|
|
68
|
-
"@babel/core": "^7.17.5",
|
|
69
|
-
"@rollup/plugin-image": "^2.1.1",
|
|
70
|
-
"@storybook/addon-actions": "^6.4.19",
|
|
71
|
-
"@storybook/addon-essentials": "^6.4.19",
|
|
72
|
-
"@storybook/addon-interactions": "^6.4.19",
|
|
73
|
-
"@storybook/addon-links": "^6.4.19",
|
|
74
|
-
"@storybook/preset-create-react-app": "^3.1.7",
|
|
75
|
-
"@storybook/react": "^6.4.19",
|
|
76
|
-
"@storybook/testing-library": "^0.0.9",
|
|
77
|
-
"@svgr/rollup": "^6.2.1",
|
|
78
|
-
"@testing-library/jest-dom": "^5.16.2",
|
|
79
|
-
"@testing-library/react": "^12.1.3",
|
|
80
|
-
"@testing-library/user-event": "^13.5.0",
|
|
81
|
-
"@types/jest": "^27.4.1",
|
|
82
|
-
"@types/node": "^16.11.26",
|
|
83
|
-
"@types/react": "^17.0.39",
|
|
84
|
-
"@types/react-dom": "^17.0.11",
|
|
85
|
-
"@types/react-window": "^1.8.5",
|
|
86
|
-
"@types/styled-components": "^5.1.23",
|
|
87
|
-
"@zendeskgarden/react-theming": "^8.48.2",
|
|
88
|
-
"@zendeskgarden/svg-icons": "^6.31.1",
|
|
89
|
-
"auto": "^10.36.5",
|
|
90
|
-
"babel-loader": "^8.2.3",
|
|
91
|
-
"commitizen": "^4.2.4",
|
|
92
|
-
"cz-conventional-changelog": "3.3.0",
|
|
93
|
-
"formik": "^2.2.9",
|
|
94
|
-
"react": "^17.0.2",
|
|
95
|
-
"react-dom": "^17.0.2",
|
|
96
|
-
"react-scripts": "4.0.3",
|
|
97
|
-
"rimraf": "^3.0.2",
|
|
98
|
-
"rollup": "^2.68.0",
|
|
99
|
-
"rollup-plugin-typescript2": "^0.31.2",
|
|
100
|
-
"storybook-addon-designs": "^6.2.1",
|
|
101
|
-
"styled-components": "^5.3.3",
|
|
102
|
-
"typescript": "^4.5.0",
|
|
103
|
-
"web-vitals": "^2.1.4"
|
|
104
|
-
},
|
|
105
|
-
"description": "Unguess design system",
|
|
106
|
-
"author": "Luca Cannarozzo (@cannarocks)",
|
|
107
|
-
"main": "build/index.js",
|
|
108
|
-
"types": "build/index.d.ts",
|
|
109
|
-
"repository": {
|
|
110
|
-
"type": "git",
|
|
111
|
-
"url": "git+https://github.com/AppQuality/unguess-design-system.git"
|
|
112
|
-
},
|
|
113
|
-
"license": "ISC",
|
|
114
|
-
"config": {
|
|
115
|
-
"commitizen": {
|
|
116
|
-
"path": "./node_modules/cz-conventional-changelog"
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@appquality/unguess-design-system",
|
|
3
|
+
"version": "2.8.6",
|
|
4
|
+
"dependencies": {
|
|
5
|
+
"@zendeskgarden/react-accordions": "^8.49.0",
|
|
6
|
+
"@zendeskgarden/react-avatars": "^8.49.0",
|
|
7
|
+
"@zendeskgarden/react-breadcrumbs": "^8.49.0",
|
|
8
|
+
"@zendeskgarden/react-buttons": "^8.48.2",
|
|
9
|
+
"@zendeskgarden/react-chrome": "^8.49.0",
|
|
10
|
+
"@zendeskgarden/react-dropdowns": "^8.49.0",
|
|
11
|
+
"@zendeskgarden/react-grid": "^8.49.0",
|
|
12
|
+
"@zendeskgarden/react-loaders": "^8.49.0",
|
|
13
|
+
"@zendeskgarden/react-modals": "^8.49.0",
|
|
14
|
+
"@zendeskgarden/react-notifications": "^8.49.0",
|
|
15
|
+
"@zendeskgarden/react-pagination": "^8.49.0",
|
|
16
|
+
"@zendeskgarden/react-tables": "^8.49.0",
|
|
17
|
+
"@zendeskgarden/react-tags": "^8.49.0",
|
|
18
|
+
"@zendeskgarden/react-tooltips": "^8.49.0",
|
|
19
|
+
"@zendeskgarden/react-typography": "^8.49.0",
|
|
20
|
+
"react-spring": "^9.4.4",
|
|
21
|
+
"react-window": "^1.8.6"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"start": "react-scripts start",
|
|
25
|
+
"build": "yarn run clean && rollup -c",
|
|
26
|
+
"build-storybook": "build-storybook",
|
|
27
|
+
"storybook": "start-storybook -p 6006",
|
|
28
|
+
"clean": "rimraf build",
|
|
29
|
+
"release": "npx auto shipit --base-branch=master",
|
|
30
|
+
"test": "react-scripts test"
|
|
31
|
+
},
|
|
32
|
+
"eslintConfig": {
|
|
33
|
+
"extends": [
|
|
34
|
+
"react-app",
|
|
35
|
+
"react-app/jest"
|
|
36
|
+
],
|
|
37
|
+
"overrides": [
|
|
38
|
+
{
|
|
39
|
+
"files": [
|
|
40
|
+
"**/*.stories.*"
|
|
41
|
+
],
|
|
42
|
+
"rules": {
|
|
43
|
+
"import/no-anonymous-default-export": "off"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"browserslist": {
|
|
49
|
+
"production": [
|
|
50
|
+
">0.2%",
|
|
51
|
+
"not dead",
|
|
52
|
+
"not op_mini all"
|
|
53
|
+
],
|
|
54
|
+
"development": [
|
|
55
|
+
"last 1 chrome version",
|
|
56
|
+
"last 1 firefox version",
|
|
57
|
+
"last 1 safari version"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"@zendeskgarden/react-theming": "^8.48.2",
|
|
62
|
+
"formik": "^2.2.9",
|
|
63
|
+
"react": "^17.0.2",
|
|
64
|
+
"react-dom": "^17.0.2",
|
|
65
|
+
"styled-components": "^5.3.3"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@babel/core": "^7.17.5",
|
|
69
|
+
"@rollup/plugin-image": "^2.1.1",
|
|
70
|
+
"@storybook/addon-actions": "^6.4.19",
|
|
71
|
+
"@storybook/addon-essentials": "^6.4.19",
|
|
72
|
+
"@storybook/addon-interactions": "^6.4.19",
|
|
73
|
+
"@storybook/addon-links": "^6.4.19",
|
|
74
|
+
"@storybook/preset-create-react-app": "^3.1.7",
|
|
75
|
+
"@storybook/react": "^6.4.19",
|
|
76
|
+
"@storybook/testing-library": "^0.0.9",
|
|
77
|
+
"@svgr/rollup": "^6.2.1",
|
|
78
|
+
"@testing-library/jest-dom": "^5.16.2",
|
|
79
|
+
"@testing-library/react": "^12.1.3",
|
|
80
|
+
"@testing-library/user-event": "^13.5.0",
|
|
81
|
+
"@types/jest": "^27.4.1",
|
|
82
|
+
"@types/node": "^16.11.26",
|
|
83
|
+
"@types/react": "^17.0.39",
|
|
84
|
+
"@types/react-dom": "^17.0.11",
|
|
85
|
+
"@types/react-window": "^1.8.5",
|
|
86
|
+
"@types/styled-components": "^5.1.23",
|
|
87
|
+
"@zendeskgarden/react-theming": "^8.48.2",
|
|
88
|
+
"@zendeskgarden/svg-icons": "^6.31.1",
|
|
89
|
+
"auto": "^10.36.5",
|
|
90
|
+
"babel-loader": "^8.2.3",
|
|
91
|
+
"commitizen": "^4.2.4",
|
|
92
|
+
"cz-conventional-changelog": "3.3.0",
|
|
93
|
+
"formik": "^2.2.9",
|
|
94
|
+
"react": "^17.0.2",
|
|
95
|
+
"react-dom": "^17.0.2",
|
|
96
|
+
"react-scripts": "4.0.3",
|
|
97
|
+
"rimraf": "^3.0.2",
|
|
98
|
+
"rollup": "^2.68.0",
|
|
99
|
+
"rollup-plugin-typescript2": "^0.31.2",
|
|
100
|
+
"storybook-addon-designs": "^6.2.1",
|
|
101
|
+
"styled-components": "^5.3.3",
|
|
102
|
+
"typescript": "^4.5.0",
|
|
103
|
+
"web-vitals": "^2.1.4"
|
|
104
|
+
},
|
|
105
|
+
"description": "Unguess design system",
|
|
106
|
+
"author": "Luca Cannarozzo (@cannarocks)",
|
|
107
|
+
"main": "build/index.js",
|
|
108
|
+
"types": "build/index.d.ts",
|
|
109
|
+
"repository": {
|
|
110
|
+
"type": "git",
|
|
111
|
+
"url": "git+https://github.com/AppQuality/unguess-design-system.git"
|
|
112
|
+
},
|
|
113
|
+
"license": "ISC",
|
|
114
|
+
"config": {
|
|
115
|
+
"commitizen": {
|
|
116
|
+
"path": "./node_modules/cz-conventional-changelog"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
package/build/index.d.ts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { GlobalStyle } from "./stories/shared/globalStyle";
|
|
2
|
-
export * from "./stories/accordions";
|
|
3
|
-
export * from "./stories/avatar";
|
|
4
|
-
export * from "./stories/breadcrumbs";
|
|
5
|
-
export * from "./stories/buttons/anchor";
|
|
6
|
-
export * from "./stories/buttons/button";
|
|
7
|
-
export * from "./stories/buttons/button-group";
|
|
8
|
-
export * from "./stories/buttons/icon-button";
|
|
9
|
-
export * from "./stories/buttons/split-button";
|
|
10
|
-
export * from "./stories/cards";
|
|
11
|
-
export * from "./stories/campaignCards";
|
|
12
|
-
export * from "./stories/close";
|
|
13
|
-
export * from "./stories/counter";
|
|
14
|
-
export * as DropdownField from "./stories/dropdowns/field";
|
|
15
|
-
export * from "./stories/dropdowns/item";
|
|
16
|
-
export * from "./stories/dropdowns/menu";
|
|
17
|
-
export * from "./stories/dropdowns/multiselect";
|
|
18
|
-
export * from "./stories/dropdowns/select";
|
|
19
|
-
export * from "./stories/forms/checkbox";
|
|
20
|
-
export * as FormField from "./stories/forms/field";
|
|
21
|
-
export * from "./stories/forms/input";
|
|
22
|
-
export * from "./stories/forms/radio";
|
|
23
|
-
export * from "./stories/forms/textarea";
|
|
24
|
-
export * from "./stories/forms/toggle";
|
|
25
|
-
export * from "./stories/grid/col";
|
|
26
|
-
export * from "./stories/grid/row";
|
|
27
|
-
export * from "./stories/grid/grid";
|
|
28
|
-
export * from "./stories/icons";
|
|
29
|
-
export * from "./stories/label";
|
|
30
|
-
export * from "./stories/loaders/progress";
|
|
31
|
-
export * from "./stories/loaders/skeleton";
|
|
32
|
-
export * from "./stories/loaders/spinner";
|
|
33
|
-
export * from "./stories/login-form";
|
|
34
|
-
export * from "./stories/logo";
|
|
35
|
-
export * from "./stories/modals";
|
|
36
|
-
export * from "./stories/navigation/body";
|
|
37
|
-
export * from "./stories/navigation/content";
|
|
38
|
-
export * from "./stories/navigation/header";
|
|
39
|
-
export * from "./stories/navigation/header/header-item";
|
|
40
|
-
export * from "./stories/navigation/app-header";
|
|
41
|
-
export * from "./stories/navigation/main";
|
|
42
|
-
export * from "./stories/navigation/nav";
|
|
43
|
-
export * from "./stories/navigation/nav/nav-item";
|
|
44
|
-
export * from "./stories/navigation/sidebar";
|
|
45
|
-
export * from "./stories/navigation/chrome";
|
|
46
|
-
export * from "./stories/notifications";
|
|
47
|
-
export * from "./stories/pagination";
|
|
48
|
-
export * from "./stories/profile-modal";
|
|
49
|
-
export { Table, Head as TableHead, HeaderRow, HeaderCell, Body as TableBody, Row as TableRow, Cell as TableCell, Caption, } from "./stories/table";
|
|
50
|
-
export { GroupRow, GroupedTable, } from "./stories/table/grouped";
|
|
51
|
-
export * from "./stories/tags";
|
|
52
|
-
export * from "./stories/tiles";
|
|
53
|
-
export * from "./stories/theme";
|
|
54
|
-
export * from "./stories/title";
|
|
55
|
-
export * from "./stories/trigger";
|
|
56
|
-
export * from "./stories/typography/block-quote";
|
|
57
|
-
export * from "./stories/typography/code";
|
|
58
|
-
export * from "./stories/typography/ellipsis";
|
|
59
|
-
export * from "./stories/typography/lists";
|
|
60
|
-
export * from "./stories/typography/paragraph";
|
|
61
|
-
export * from "./stories/typography/span";
|
|
62
|
-
export * from "./stories/typography/typescale";
|
|
63
|
-
export { GlobalStyle };
|