@platformatic/ui-components 0.1.49 → 0.1.51
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/ci.yml +26 -26
- package/.nvmrc +1 -1
- package/LICENSE +201 -201
- package/README.md +30 -30
- package/dist/api-icon-closed.svg +6 -0
- package/dist/api-icon.svg +9 -0
- package/dist/assets/Montserrat-Regular.dcfe8df2.ttf +0 -0
- package/dist/assets/index.691ca940.css +1 -0
- package/dist/assets/index.ff0dadfc.js +797 -0
- package/dist/index.html +14 -0
- package/dist/stats.html +6177 -0
- package/dist/vite.svg +1 -0
- package/fonts/Montserrat/README.txt +81 -81
- package/index.html +12 -12
- package/index.js +71 -71
- package/package.json +76 -76
- package/postcss.config.cjs +8 -8
- package/public/api-icon-closed.svg +6 -6
- package/public/api-icon.svg +9 -9
- package/src/App.jsx +12 -12
- package/src/components/BorderedBox.jsx +18 -18
- package/src/components/BorderedBox.module.css +8 -8
- package/src/components/BorderedText.jsx +8 -8
- package/src/components/BorderedText.module.css +2 -2
- package/src/components/Box.jsx +14 -14
- package/src/components/Box.module.css +7 -7
- package/src/components/Button.jsx +95 -95
- package/src/components/Button.module.css +127 -127
- package/src/components/ButtonFullRounded.jsx +17 -17
- package/src/components/ButtonFullRounded.module.css +28 -28
- package/src/components/Checkbox.jsx +11 -11
- package/src/components/Checkbox.module.css +18 -18
- package/src/components/Common.module.css +28 -28
- package/src/components/DetailedMetric.jsx +32 -32
- package/src/components/DetailedMetric.module.css +2 -2
- package/src/components/DropDown.jsx +35 -36
- package/src/components/DropDown.module.css +25 -27
- package/src/components/FollowUs.jsx +35 -35
- package/src/components/FollowUs.module.css +11 -11
- package/src/components/GHLoginButton.jsx +14 -14
- package/src/components/HorizontalSeparator.jsx +15 -15
- package/src/components/HorizontalSeparator.module.css +26 -26
- package/src/components/InfoBox.jsx +50 -50
- package/src/components/InfoBox.module.css +5 -5
- package/src/components/List.jsx +20 -20
- package/src/components/List.module.css +11 -11
- package/src/components/ListElement.jsx +23 -23
- package/src/components/ListElement.module.css +23 -23
- package/src/components/Loadable.jsx +34 -34
- package/src/components/Loadable.module.css +13 -13
- package/src/components/Loader.jsx +22 -22
- package/src/components/Loader.module.css +13 -13
- package/src/components/LoginButton.jsx +17 -17
- package/src/components/LoginButton.module.css +7 -7
- package/src/components/LoginButton.test.jsx +25 -25
- package/src/components/Logo.jsx +62 -62
- package/src/components/Logo.module.css +5 -5
- package/src/components/Main.jsx +33 -33
- package/src/components/MetricValue.jsx +15 -15
- package/src/components/MetricValue.module.css +9 -9
- package/src/components/Modal.jsx +93 -93
- package/src/components/Modal.module.css +50 -50
- package/src/components/PlatformaticIcon.jsx +57 -57
- package/src/components/PlatformaticIcon.module.css +2 -2
- package/src/components/Playground.jsx +9 -9
- package/src/components/SearchBar.jsx +63 -63
- package/src/components/SearchBar.module.css +20 -20
- package/src/components/Sidebar.jsx +151 -153
- package/src/components/Sidebar.module.css +70 -66
- package/src/components/SimpleMetric.jsx +28 -28
- package/src/components/SimpleMetric.module.css +6 -6
- package/src/components/Status.jsx +26 -26
- package/src/components/TabbedWindow.jsx +39 -39
- package/src/components/TabbedWindow.module.css +16 -16
- package/src/components/TextWithLabel.jsx +11 -11
- package/src/components/TextWithLabel.module.css +8 -8
- package/src/components/Versions.jsx +9 -9
- package/src/components/VerticalSeparator.jsx +5 -5
- package/src/components/forms/Field.jsx +53 -20
- package/src/components/forms/Field.module.css +23 -17
- package/src/components/forms/Input.jsx +80 -80
- package/src/components/forms/Input.module.css +28 -28
- package/src/components/forms/Preview.jsx +75 -77
- package/src/components/forms/Preview.module.css +14 -14
- package/src/components/forms/ToggleSwitch.jsx +18 -18
- package/src/components/forms/ToggleSwitch.module.css +42 -42
- package/src/components/forms/index.js +8 -8
- package/src/components/icons/AddIcon.jsx +78 -0
- package/src/components/icons/AlertIcon.jsx +81 -0
- package/src/components/icons/AllInOneIcon.jsx +111 -0
- package/src/components/icons/ApiCloudIcon.jsx +93 -0
- package/src/components/icons/ApiEmptyIcon.jsx +107 -107
- package/src/components/icons/ApiIcon.jsx +84 -29
- package/src/components/icons/ApiIconClosed.jsx +19 -19
- package/src/components/icons/AppEmptyIcon.jsx +94 -94
- package/src/components/icons/AppIcon.jsx +85 -38
- package/src/components/icons/AppListIcon.jsx +73 -73
- package/src/components/icons/ArrowDownFullIcon.jsx +76 -0
- package/src/components/icons/ArrowDownIcon.jsx +75 -0
- package/src/components/icons/ArrowLeftIcon.jsx +75 -0
- package/src/components/icons/ArrowRightIcon.jsx +75 -0
- package/src/components/icons/ArrowUpIcon.jsx +75 -0
- package/src/components/icons/Calendar1DayIcon.jsx +90 -0
- package/src/components/icons/Calendar7DaysIcon.jsx +88 -0
- package/src/components/icons/CalendarIcon.jsx +102 -56
- package/src/components/icons/CircleAddIcon.jsx +81 -40
- package/src/components/icons/CircleBackIcon.jsx +51 -51
- package/src/components/icons/{Calendar1Icon.jsx → CircleCheckMarkIcon.jsx} +66 -54
- package/src/components/icons/CircleCloseHoverIcon.jsx +42 -42
- package/src/components/icons/CircleCloseIcon.jsx +32 -32
- package/src/components/icons/CircleExclamationIcon.jsx +29 -29
- package/src/components/icons/CloseIcon.jsx +79 -31
- package/src/components/icons/CopyPasteIcon.jsx +81 -0
- package/src/components/icons/DatabaseIcon.jsx +81 -0
- package/src/components/icons/EditIcon.jsx +81 -38
- package/src/components/icons/GearIcon.jsx +78 -40
- package/src/components/icons/Icons.module.css +46 -29
- package/src/components/icons/LiveIcon.jsx +43 -43
- package/src/components/icons/MetricsIcon.jsx +52 -52
- package/src/components/icons/PlayIcon.jsx +20 -20
- package/src/components/icons/PullRequestIcon.jsx +35 -35
- package/src/components/icons/StopIcon.jsx +21 -21
- package/src/components/icons/TerminalIcon.jsx +22 -22
- package/src/components/icons/UpgradeIcon.jsx +48 -48
- package/src/components/icons/Users2Icon.jsx +84 -0
- package/src/components/icons/WorkspaceDynamicIcon.jsx +87 -0
- package/src/components/icons/WorkspaceReadyIcon.jsx +144 -0
- package/src/components/icons/WorkspaceStaticIcon.jsx +84 -0
- package/src/components/icons/index.js +83 -61
- package/src/components/layouts/Layout.jsx +11 -11
- package/src/components/layouts/TwoColumnsLayout.jsx +12 -12
- package/src/components/layouts/TwoColumnsLayout.module.css +9 -9
- package/src/hooks/useEscapeKey.js +20 -20
- package/src/lib/utils.js +23 -23
- package/src/main.jsx +9 -9
- package/src/stories/BorderedBox.stories.jsx +33 -33
- package/src/stories/BorderedText.stories.jsx +24 -24
- package/src/stories/Button.stories.jsx +114 -114
- package/src/stories/ButtonFullRounded.stories.jsx +61 -61
- package/src/stories/Checkbox.stories.jsx +27 -27
- package/src/stories/DetailedMetric.stories.jsx +33 -33
- package/src/stories/DropDown.stories.jsx +62 -62
- package/src/stories/FollowUs.stories.jsx +14 -14
- package/src/stories/GHLoginButton.stories.jsx +14 -14
- package/src/stories/HorizontalSeparator.stories.jsx +12 -12
- package/src/stories/InfoBox.stories.jsx +46 -46
- package/src/stories/Introduction.stories.mdx +211 -211
- package/src/stories/List.stories.jsx +29 -29
- package/src/stories/ListElement.stories.jsx +15 -15
- package/src/stories/Loadable.stories.jsx +75 -75
- package/src/stories/Loader.stories.jsx +44 -44
- package/src/stories/LoginButton.stories.jsx +15 -15
- package/src/stories/Logo.stories.jsx +17 -17
- package/src/stories/Modal.stories.jsx +100 -100
- package/src/stories/PlatformaticIcon.stories.jsx +57 -35
- package/src/stories/SearchBar.stories.jsx +28 -28
- package/src/stories/Sidebar.stories.jsx +61 -61
- package/src/stories/SimpleMetric.stories.jsx +41 -41
- package/src/stories/Status.stories.jsx +31 -31
- package/src/stories/TextWithLabel.stories.jsx +25 -25
- package/src/stories/TwoColumnsLayout.stories.jsx +42 -42
- package/src/stories/forms/Field.stories.jsx +89 -81
- package/src/stories/forms/Input.stories.jsx +89 -89
- package/src/stories/forms/Preview.stories.jsx +57 -57
- package/src/stories/forms/ToggleSwitch.stories.jsx +15 -15
- package/src/stories/icons/Icons.stories.jsx +68 -74
- package/src/styles/main.css +22 -15
- package/tailwind.config.cjs +60 -60
- package/vite.config.js +6 -6
- package/vitest.config.js +14 -14
- package/dist/main.css +0 -704
- package/src/components/icons/Calendar7Icon.jsx +0 -55
- package/src/components/icons/CopyIcon.jsx +0 -75
- package/src/components/icons/CreatedWorkspaceIcon.jsx +0 -70
- package/src/components/icons/DynamicWorkspaceIcon.jsx +0 -125
- package/src/components/icons/StaticWorkspaceIcon.jsx +0 -119
- package/src/components/icons/TriangleExclamationIcon.jsx +0 -26
|
@@ -1,211 +1,211 @@
|
|
|
1
|
-
import { Meta } from '@storybook/addon-docs';
|
|
2
|
-
import Code from './assets/code-brackets.svg';
|
|
3
|
-
import Colors from './assets/colors.svg';
|
|
4
|
-
import Comments from './assets/comments.svg';
|
|
5
|
-
import Direction from './assets/direction.svg';
|
|
6
|
-
import Flow from './assets/flow.svg';
|
|
7
|
-
import Plugin from './assets/plugin.svg';
|
|
8
|
-
import Repo from './assets/repo.svg';
|
|
9
|
-
import StackAlt from './assets/stackalt.svg';
|
|
10
|
-
|
|
11
|
-
<Meta title="Example/Introduction" />
|
|
12
|
-
|
|
13
|
-
<style>
|
|
14
|
-
{`
|
|
15
|
-
.subheading {
|
|
16
|
-
--mediumdark: '#999999';
|
|
17
|
-
font-weight: 900;
|
|
18
|
-
font-size: 13px;
|
|
19
|
-
color: #999;
|
|
20
|
-
letter-spacing: 6px;
|
|
21
|
-
line-height: 24px;
|
|
22
|
-
text-transform: uppercase;
|
|
23
|
-
margin-bottom: 12px;
|
|
24
|
-
margin-top: 40px;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.link-list {
|
|
28
|
-
display: grid;
|
|
29
|
-
grid-template-columns: 1fr;
|
|
30
|
-
grid-template-rows: 1fr 1fr;
|
|
31
|
-
row-gap: 10px;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@media (min-width: 620px) {
|
|
35
|
-
.link-list {
|
|
36
|
-
row-gap: 20px;
|
|
37
|
-
column-gap: 20px;
|
|
38
|
-
grid-template-columns: 1fr 1fr;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
@media all and (-ms-high-contrast:none) {
|
|
43
|
-
.link-list {
|
|
44
|
-
display: -ms-grid;
|
|
45
|
-
-ms-grid-columns: 1fr 1fr;
|
|
46
|
-
-ms-grid-rows: 1fr 1fr;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.link-item {
|
|
51
|
-
display: block;
|
|
52
|
-
padding: 20px 30px 20px 15px;
|
|
53
|
-
border: 1px solid #00000010;
|
|
54
|
-
border-radius: 5px;
|
|
55
|
-
transition: background 150ms ease-out, border 150ms ease-out, transform 150ms ease-out;
|
|
56
|
-
color: #333333;
|
|
57
|
-
display: flex;
|
|
58
|
-
align-items: flex-start;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.link-item:hover {
|
|
62
|
-
border-color: #1EA7FD50;
|
|
63
|
-
transform: translate3d(0, -3px, 0);
|
|
64
|
-
box-shadow: rgba(0, 0, 0, 0.08) 0 3px 10px 0;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.link-item:active {
|
|
68
|
-
border-color: #1EA7FD;
|
|
69
|
-
transform: translate3d(0, 0, 0);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.link-item strong {
|
|
73
|
-
font-weight: 700;
|
|
74
|
-
display: block;
|
|
75
|
-
margin-bottom: 2px;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.link-item img {
|
|
79
|
-
height: 40px;
|
|
80
|
-
width: 40px;
|
|
81
|
-
margin-right: 15px;
|
|
82
|
-
flex: none;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.link-item span {
|
|
86
|
-
font-size: 14px;
|
|
87
|
-
line-height: 20px;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.tip {
|
|
91
|
-
display: inline-block;
|
|
92
|
-
border-radius: 1em;
|
|
93
|
-
font-size: 11px;
|
|
94
|
-
line-height: 12px;
|
|
95
|
-
font-weight: 700;
|
|
96
|
-
background: #E7FDD8;
|
|
97
|
-
color: #66BF3C;
|
|
98
|
-
padding: 4px 12px;
|
|
99
|
-
margin-right: 10px;
|
|
100
|
-
vertical-align: top;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.tip-wrapper {
|
|
104
|
-
font-size: 13px;
|
|
105
|
-
line-height: 20px;
|
|
106
|
-
margin-top: 40px;
|
|
107
|
-
margin-bottom: 40px;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.tip-wrapper code {
|
|
111
|
-
font-size: 12px;
|
|
112
|
-
display: inline-block;
|
|
113
|
-
}
|
|
114
|
-
`}
|
|
115
|
-
</style>
|
|
116
|
-
|
|
117
|
-
# Welcome to Storybook
|
|
118
|
-
|
|
119
|
-
Storybook helps you build UI components in isolation from your app's business logic, data, and context.
|
|
120
|
-
That makes it easy to develop hard-to-reach states. Save these UI states as **stories** to revisit during development, testing, or QA.
|
|
121
|
-
|
|
122
|
-
Browse example stories now by navigating to them in the sidebar.
|
|
123
|
-
View their code in the `stories` directory to learn how they work.
|
|
124
|
-
We recommend building UIs with a [**component-driven**](https://componentdriven.org) process starting with atomic components and ending with pages.
|
|
125
|
-
|
|
126
|
-
<div className="subheading">Configure</div>
|
|
127
|
-
|
|
128
|
-
<div className="link-list">
|
|
129
|
-
<a
|
|
130
|
-
className="link-item"
|
|
131
|
-
href="https://storybook.js.org/docs/react/addons/addon-types"
|
|
132
|
-
target="_blank"
|
|
133
|
-
>
|
|
134
|
-
<img src={Plugin} alt="plugin" />
|
|
135
|
-
<span>
|
|
136
|
-
<strong>Presets for popular tools</strong>
|
|
137
|
-
Easy setup for TypeScript, SCSS and more.
|
|
138
|
-
</span>
|
|
139
|
-
</a>
|
|
140
|
-
<a
|
|
141
|
-
className="link-item"
|
|
142
|
-
href="https://storybook.js.org/docs/react/configure/webpack"
|
|
143
|
-
target="_blank"
|
|
144
|
-
>
|
|
145
|
-
<img src={StackAlt} alt="Build" />
|
|
146
|
-
<span>
|
|
147
|
-
<strong>Build configuration</strong>
|
|
148
|
-
How to customize webpack and Babel
|
|
149
|
-
</span>
|
|
150
|
-
</a>
|
|
151
|
-
<a
|
|
152
|
-
className="link-item"
|
|
153
|
-
href="https://storybook.js.org/docs/react/configure/styling-and-css"
|
|
154
|
-
target="_blank"
|
|
155
|
-
>
|
|
156
|
-
<img src={Colors} alt="colors" />
|
|
157
|
-
<span>
|
|
158
|
-
<strong>Styling</strong>
|
|
159
|
-
How to load and configure CSS libraries
|
|
160
|
-
</span>
|
|
161
|
-
</a>
|
|
162
|
-
<a
|
|
163
|
-
className="link-item"
|
|
164
|
-
href="https://storybook.js.org/docs/react/get-started/setup#configure-storybook-for-your-stack"
|
|
165
|
-
target="_blank"
|
|
166
|
-
>
|
|
167
|
-
<img src={Flow} alt="flow" />
|
|
168
|
-
<span>
|
|
169
|
-
<strong>Data</strong>
|
|
170
|
-
Providers and mocking for data libraries
|
|
171
|
-
</span>
|
|
172
|
-
</a>
|
|
173
|
-
</div>
|
|
174
|
-
|
|
175
|
-
<div className="subheading">Learn</div>
|
|
176
|
-
|
|
177
|
-
<div className="link-list">
|
|
178
|
-
<a className="link-item" href="https://storybook.js.org/docs" target="_blank">
|
|
179
|
-
<img src={Repo} alt="repo" />
|
|
180
|
-
<span>
|
|
181
|
-
<strong>Storybook documentation</strong>
|
|
182
|
-
Configure, customize, and extend
|
|
183
|
-
</span>
|
|
184
|
-
</a>
|
|
185
|
-
<a className="link-item" href="https://storybook.js.org/tutorials/" target="_blank">
|
|
186
|
-
<img src={Direction} alt="direction" />
|
|
187
|
-
<span>
|
|
188
|
-
<strong>In-depth guides</strong>
|
|
189
|
-
Best practices from leading teams
|
|
190
|
-
</span>
|
|
191
|
-
</a>
|
|
192
|
-
<a className="link-item" href="https://github.com/storybookjs/storybook" target="_blank">
|
|
193
|
-
<img src={Code} alt="code" />
|
|
194
|
-
<span>
|
|
195
|
-
<strong>GitHub project</strong>
|
|
196
|
-
View the source and add issues
|
|
197
|
-
</span>
|
|
198
|
-
</a>
|
|
199
|
-
<a className="link-item" href="https://discord.gg/storybook" target="_blank">
|
|
200
|
-
<img src={Comments} alt="comments" />
|
|
201
|
-
<span>
|
|
202
|
-
<strong>Discord chat</strong>
|
|
203
|
-
Chat with maintainers and the community
|
|
204
|
-
</span>
|
|
205
|
-
</a>
|
|
206
|
-
</div>
|
|
207
|
-
|
|
208
|
-
<div className="tip-wrapper">
|
|
209
|
-
<span className="tip">Tip</span>Edit the Markdown in{' '}
|
|
210
|
-
<code>stories/Introduction.stories.mdx</code>
|
|
211
|
-
</div>
|
|
1
|
+
import { Meta } from '@storybook/addon-docs';
|
|
2
|
+
import Code from './assets/code-brackets.svg';
|
|
3
|
+
import Colors from './assets/colors.svg';
|
|
4
|
+
import Comments from './assets/comments.svg';
|
|
5
|
+
import Direction from './assets/direction.svg';
|
|
6
|
+
import Flow from './assets/flow.svg';
|
|
7
|
+
import Plugin from './assets/plugin.svg';
|
|
8
|
+
import Repo from './assets/repo.svg';
|
|
9
|
+
import StackAlt from './assets/stackalt.svg';
|
|
10
|
+
|
|
11
|
+
<Meta title="Example/Introduction" />
|
|
12
|
+
|
|
13
|
+
<style>
|
|
14
|
+
{`
|
|
15
|
+
.subheading {
|
|
16
|
+
--mediumdark: '#999999';
|
|
17
|
+
font-weight: 900;
|
|
18
|
+
font-size: 13px;
|
|
19
|
+
color: #999;
|
|
20
|
+
letter-spacing: 6px;
|
|
21
|
+
line-height: 24px;
|
|
22
|
+
text-transform: uppercase;
|
|
23
|
+
margin-bottom: 12px;
|
|
24
|
+
margin-top: 40px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.link-list {
|
|
28
|
+
display: grid;
|
|
29
|
+
grid-template-columns: 1fr;
|
|
30
|
+
grid-template-rows: 1fr 1fr;
|
|
31
|
+
row-gap: 10px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@media (min-width: 620px) {
|
|
35
|
+
.link-list {
|
|
36
|
+
row-gap: 20px;
|
|
37
|
+
column-gap: 20px;
|
|
38
|
+
grid-template-columns: 1fr 1fr;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@media all and (-ms-high-contrast:none) {
|
|
43
|
+
.link-list {
|
|
44
|
+
display: -ms-grid;
|
|
45
|
+
-ms-grid-columns: 1fr 1fr;
|
|
46
|
+
-ms-grid-rows: 1fr 1fr;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.link-item {
|
|
51
|
+
display: block;
|
|
52
|
+
padding: 20px 30px 20px 15px;
|
|
53
|
+
border: 1px solid #00000010;
|
|
54
|
+
border-radius: 5px;
|
|
55
|
+
transition: background 150ms ease-out, border 150ms ease-out, transform 150ms ease-out;
|
|
56
|
+
color: #333333;
|
|
57
|
+
display: flex;
|
|
58
|
+
align-items: flex-start;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.link-item:hover {
|
|
62
|
+
border-color: #1EA7FD50;
|
|
63
|
+
transform: translate3d(0, -3px, 0);
|
|
64
|
+
box-shadow: rgba(0, 0, 0, 0.08) 0 3px 10px 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.link-item:active {
|
|
68
|
+
border-color: #1EA7FD;
|
|
69
|
+
transform: translate3d(0, 0, 0);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.link-item strong {
|
|
73
|
+
font-weight: 700;
|
|
74
|
+
display: block;
|
|
75
|
+
margin-bottom: 2px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.link-item img {
|
|
79
|
+
height: 40px;
|
|
80
|
+
width: 40px;
|
|
81
|
+
margin-right: 15px;
|
|
82
|
+
flex: none;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.link-item span {
|
|
86
|
+
font-size: 14px;
|
|
87
|
+
line-height: 20px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.tip {
|
|
91
|
+
display: inline-block;
|
|
92
|
+
border-radius: 1em;
|
|
93
|
+
font-size: 11px;
|
|
94
|
+
line-height: 12px;
|
|
95
|
+
font-weight: 700;
|
|
96
|
+
background: #E7FDD8;
|
|
97
|
+
color: #66BF3C;
|
|
98
|
+
padding: 4px 12px;
|
|
99
|
+
margin-right: 10px;
|
|
100
|
+
vertical-align: top;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.tip-wrapper {
|
|
104
|
+
font-size: 13px;
|
|
105
|
+
line-height: 20px;
|
|
106
|
+
margin-top: 40px;
|
|
107
|
+
margin-bottom: 40px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.tip-wrapper code {
|
|
111
|
+
font-size: 12px;
|
|
112
|
+
display: inline-block;
|
|
113
|
+
}
|
|
114
|
+
`}
|
|
115
|
+
</style>
|
|
116
|
+
|
|
117
|
+
# Welcome to Storybook
|
|
118
|
+
|
|
119
|
+
Storybook helps you build UI components in isolation from your app's business logic, data, and context.
|
|
120
|
+
That makes it easy to develop hard-to-reach states. Save these UI states as **stories** to revisit during development, testing, or QA.
|
|
121
|
+
|
|
122
|
+
Browse example stories now by navigating to them in the sidebar.
|
|
123
|
+
View their code in the `stories` directory to learn how they work.
|
|
124
|
+
We recommend building UIs with a [**component-driven**](https://componentdriven.org) process starting with atomic components and ending with pages.
|
|
125
|
+
|
|
126
|
+
<div className="subheading">Configure</div>
|
|
127
|
+
|
|
128
|
+
<div className="link-list">
|
|
129
|
+
<a
|
|
130
|
+
className="link-item"
|
|
131
|
+
href="https://storybook.js.org/docs/react/addons/addon-types"
|
|
132
|
+
target="_blank"
|
|
133
|
+
>
|
|
134
|
+
<img src={Plugin} alt="plugin" />
|
|
135
|
+
<span>
|
|
136
|
+
<strong>Presets for popular tools</strong>
|
|
137
|
+
Easy setup for TypeScript, SCSS and more.
|
|
138
|
+
</span>
|
|
139
|
+
</a>
|
|
140
|
+
<a
|
|
141
|
+
className="link-item"
|
|
142
|
+
href="https://storybook.js.org/docs/react/configure/webpack"
|
|
143
|
+
target="_blank"
|
|
144
|
+
>
|
|
145
|
+
<img src={StackAlt} alt="Build" />
|
|
146
|
+
<span>
|
|
147
|
+
<strong>Build configuration</strong>
|
|
148
|
+
How to customize webpack and Babel
|
|
149
|
+
</span>
|
|
150
|
+
</a>
|
|
151
|
+
<a
|
|
152
|
+
className="link-item"
|
|
153
|
+
href="https://storybook.js.org/docs/react/configure/styling-and-css"
|
|
154
|
+
target="_blank"
|
|
155
|
+
>
|
|
156
|
+
<img src={Colors} alt="colors" />
|
|
157
|
+
<span>
|
|
158
|
+
<strong>Styling</strong>
|
|
159
|
+
How to load and configure CSS libraries
|
|
160
|
+
</span>
|
|
161
|
+
</a>
|
|
162
|
+
<a
|
|
163
|
+
className="link-item"
|
|
164
|
+
href="https://storybook.js.org/docs/react/get-started/setup#configure-storybook-for-your-stack"
|
|
165
|
+
target="_blank"
|
|
166
|
+
>
|
|
167
|
+
<img src={Flow} alt="flow" />
|
|
168
|
+
<span>
|
|
169
|
+
<strong>Data</strong>
|
|
170
|
+
Providers and mocking for data libraries
|
|
171
|
+
</span>
|
|
172
|
+
</a>
|
|
173
|
+
</div>
|
|
174
|
+
|
|
175
|
+
<div className="subheading">Learn</div>
|
|
176
|
+
|
|
177
|
+
<div className="link-list">
|
|
178
|
+
<a className="link-item" href="https://storybook.js.org/docs" target="_blank">
|
|
179
|
+
<img src={Repo} alt="repo" />
|
|
180
|
+
<span>
|
|
181
|
+
<strong>Storybook documentation</strong>
|
|
182
|
+
Configure, customize, and extend
|
|
183
|
+
</span>
|
|
184
|
+
</a>
|
|
185
|
+
<a className="link-item" href="https://storybook.js.org/tutorials/" target="_blank">
|
|
186
|
+
<img src={Direction} alt="direction" />
|
|
187
|
+
<span>
|
|
188
|
+
<strong>In-depth guides</strong>
|
|
189
|
+
Best practices from leading teams
|
|
190
|
+
</span>
|
|
191
|
+
</a>
|
|
192
|
+
<a className="link-item" href="https://github.com/storybookjs/storybook" target="_blank">
|
|
193
|
+
<img src={Code} alt="code" />
|
|
194
|
+
<span>
|
|
195
|
+
<strong>GitHub project</strong>
|
|
196
|
+
View the source and add issues
|
|
197
|
+
</span>
|
|
198
|
+
</a>
|
|
199
|
+
<a className="link-item" href="https://discord.gg/storybook" target="_blank">
|
|
200
|
+
<img src={Comments} alt="comments" />
|
|
201
|
+
<span>
|
|
202
|
+
<strong>Discord chat</strong>
|
|
203
|
+
Chat with maintainers and the community
|
|
204
|
+
</span>
|
|
205
|
+
</a>
|
|
206
|
+
</div>
|
|
207
|
+
|
|
208
|
+
<div className="tip-wrapper">
|
|
209
|
+
<span className="tip">Tip</span>Edit the Markdown in{' '}
|
|
210
|
+
<code>stories/Introduction.stories.mdx</code>
|
|
211
|
+
</div>
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import List from '../components/List'
|
|
3
|
-
import ListElement from '../components/ListElement'
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Platformatic/List',
|
|
7
|
-
component: List
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const Template = (args) => <List {...args} />
|
|
11
|
-
export const ListWithNoElements = Template.bind({})
|
|
12
|
-
ListWithNoElements.args = {
|
|
13
|
-
title: 'List Title'
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const TemplateWithElements = (args) => (
|
|
17
|
-
<List {...args}>
|
|
18
|
-
<ListElement title='List Element 1' detail='Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed et dui facilisis, molestie urna sed, volutpat nibh.' />
|
|
19
|
-
<ListElement title='List Element 2' detail='Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed et dui facilisis, molestie urna sed, volutpat nibh.' />
|
|
20
|
-
</List>
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
export const ListWithElements = TemplateWithElements.bind({})
|
|
24
|
-
ListWithElements.args = {
|
|
25
|
-
title: 'List Title'
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export const ListWithElementsNoTitle = TemplateWithElements.bind({})
|
|
29
|
-
ListWithElementsNoTitle.args = {}
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import List from '../components/List'
|
|
3
|
+
import ListElement from '../components/ListElement'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Platformatic/List',
|
|
7
|
+
component: List
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const Template = (args) => <List {...args} />
|
|
11
|
+
export const ListWithNoElements = Template.bind({})
|
|
12
|
+
ListWithNoElements.args = {
|
|
13
|
+
title: 'List Title'
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const TemplateWithElements = (args) => (
|
|
17
|
+
<List {...args}>
|
|
18
|
+
<ListElement title='List Element 1' detail='Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed et dui facilisis, molestie urna sed, volutpat nibh.' />
|
|
19
|
+
<ListElement title='List Element 2' detail='Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed et dui facilisis, molestie urna sed, volutpat nibh.' />
|
|
20
|
+
</List>
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
export const ListWithElements = TemplateWithElements.bind({})
|
|
24
|
+
ListWithElements.args = {
|
|
25
|
+
title: 'List Title'
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const ListWithElementsNoTitle = TemplateWithElements.bind({})
|
|
29
|
+
ListWithElementsNoTitle.args = {}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import ListElement from '../components/ListElement'
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Platformatic/ListElement',
|
|
6
|
-
component: ListElement
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const Template = (args) => <ListElement {...args} />
|
|
10
|
-
|
|
11
|
-
export const ListElementFull = Template.bind({})
|
|
12
|
-
ListElementFull.args = {
|
|
13
|
-
title: 'List Element Title',
|
|
14
|
-
detail: 'Lorem Ipsum dolor sit amet consectetur adipiscing elit. Qui enim potest, nisi quis potest, negare'
|
|
15
|
-
}
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import ListElement from '../components/ListElement'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Platformatic/ListElement',
|
|
6
|
+
component: ListElement
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const Template = (args) => <ListElement {...args} />
|
|
10
|
+
|
|
11
|
+
export const ListElementFull = Template.bind({})
|
|
12
|
+
ListElementFull.args = {
|
|
13
|
+
title: 'List Element Title',
|
|
14
|
+
detail: 'Lorem Ipsum dolor sit amet consectetur adipiscing elit. Qui enim potest, nisi quis potest, negare'
|
|
15
|
+
}
|
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
import React, { useEffect } from 'react'
|
|
2
|
-
import Loadable from '../components/Loadable'
|
|
3
|
-
import BorderedBox from '../components/BorderedBox'
|
|
4
|
-
|
|
5
|
-
const loremIpsum = `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus est nisl, maximus aliquet urna eu, consequat semper nisi. Nam vel elit feugiat dui congue elementum. Sed turpis urna, egestas at pharetra et, lacinia ac mauris. Pellentesque cursus, ipsum nec malesuada ornare, dui purus ultrices elit, non blandit nisi quam non nisi. Suspendisse sapien leo, ultricies pretium vulputate sed, malesuada sed justo. Suspendisse euismod erat ut lacus feugiat malesuada. In tempor a eros et egestas. Nam pretium dolor sollicitudin, cursus sem vitae, elementum enim. Nam in nisi ipsum.
|
|
6
|
-
`
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
title: 'Platformatic/Loadable',
|
|
10
|
-
component: Loadable
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const ContentThatLoads = ({ startLoading }) => {
|
|
14
|
-
startLoading()
|
|
15
|
-
return <BorderedBox>{loremIpsum}</BorderedBox>
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const Loading = args =>
|
|
19
|
-
<Loadable {...args}>
|
|
20
|
-
<ContentThatLoads />
|
|
21
|
-
</Loadable>
|
|
22
|
-
Loading.args = {}
|
|
23
|
-
|
|
24
|
-
const ContentThatLoadsAndStops = ({ startLoading, stopLoading }) => {
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
startLoading()
|
|
27
|
-
const timer = setTimeout(() => {
|
|
28
|
-
stopLoading()
|
|
29
|
-
}, 2000)
|
|
30
|
-
return () => clearTimeout(timer)
|
|
31
|
-
}, [])
|
|
32
|
-
return <BorderedBox>{loremIpsum}</BorderedBox>
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export const LoadsAndStops = args => {
|
|
36
|
-
return (
|
|
37
|
-
<Loadable {...args}>
|
|
38
|
-
<ContentThatLoadsAndStops />
|
|
39
|
-
</Loadable>
|
|
40
|
-
)
|
|
41
|
-
}
|
|
42
|
-
LoadsAndStops.args = {}
|
|
43
|
-
|
|
44
|
-
export const LoadsAndStops2 = args => {
|
|
45
|
-
return (
|
|
46
|
-
<Loadable {...args}>
|
|
47
|
-
<ContentThatLoadsAndStops />
|
|
48
|
-
<ContentThatLoadsAndStops />
|
|
49
|
-
</Loadable>
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
LoadsAndStops2.args = {}
|
|
53
|
-
|
|
54
|
-
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
|
|
55
|
-
const ContentThatToggle = ({ startLoading, stopLoading }) => {
|
|
56
|
-
useEffect(() => {
|
|
57
|
-
startLoading()
|
|
58
|
-
const toggle = async () => {
|
|
59
|
-
await sleep(1000)
|
|
60
|
-
stopLoading()
|
|
61
|
-
await sleep(1000)
|
|
62
|
-
startLoading(true)
|
|
63
|
-
}
|
|
64
|
-
toggle()
|
|
65
|
-
}, [])
|
|
66
|
-
return <BorderedBox>{loremIpsum}</BorderedBox>
|
|
67
|
-
}
|
|
68
|
-
export const Toggle = args => {
|
|
69
|
-
return (
|
|
70
|
-
<Loadable {...args}>
|
|
71
|
-
<ContentThatToggle />
|
|
72
|
-
</Loadable>
|
|
73
|
-
)
|
|
74
|
-
}
|
|
75
|
-
Toggle.args = {}
|
|
1
|
+
import React, { useEffect } from 'react'
|
|
2
|
+
import Loadable from '../components/Loadable'
|
|
3
|
+
import BorderedBox from '../components/BorderedBox'
|
|
4
|
+
|
|
5
|
+
const loremIpsum = `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus est nisl, maximus aliquet urna eu, consequat semper nisi. Nam vel elit feugiat dui congue elementum. Sed turpis urna, egestas at pharetra et, lacinia ac mauris. Pellentesque cursus, ipsum nec malesuada ornare, dui purus ultrices elit, non blandit nisi quam non nisi. Suspendisse sapien leo, ultricies pretium vulputate sed, malesuada sed justo. Suspendisse euismod erat ut lacus feugiat malesuada. In tempor a eros et egestas. Nam pretium dolor sollicitudin, cursus sem vitae, elementum enim. Nam in nisi ipsum.
|
|
6
|
+
`
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Platformatic/Loadable',
|
|
10
|
+
component: Loadable
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const ContentThatLoads = ({ startLoading }) => {
|
|
14
|
+
startLoading()
|
|
15
|
+
return <BorderedBox>{loremIpsum}</BorderedBox>
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const Loading = args =>
|
|
19
|
+
<Loadable {...args}>
|
|
20
|
+
<ContentThatLoads />
|
|
21
|
+
</Loadable>
|
|
22
|
+
Loading.args = {}
|
|
23
|
+
|
|
24
|
+
const ContentThatLoadsAndStops = ({ startLoading, stopLoading }) => {
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
startLoading()
|
|
27
|
+
const timer = setTimeout(() => {
|
|
28
|
+
stopLoading()
|
|
29
|
+
}, 2000)
|
|
30
|
+
return () => clearTimeout(timer)
|
|
31
|
+
}, [])
|
|
32
|
+
return <BorderedBox>{loremIpsum}</BorderedBox>
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const LoadsAndStops = args => {
|
|
36
|
+
return (
|
|
37
|
+
<Loadable {...args}>
|
|
38
|
+
<ContentThatLoadsAndStops />
|
|
39
|
+
</Loadable>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
LoadsAndStops.args = {}
|
|
43
|
+
|
|
44
|
+
export const LoadsAndStops2 = args => {
|
|
45
|
+
return (
|
|
46
|
+
<Loadable {...args}>
|
|
47
|
+
<ContentThatLoadsAndStops />
|
|
48
|
+
<ContentThatLoadsAndStops />
|
|
49
|
+
</Loadable>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
LoadsAndStops2.args = {}
|
|
53
|
+
|
|
54
|
+
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
|
|
55
|
+
const ContentThatToggle = ({ startLoading, stopLoading }) => {
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
startLoading()
|
|
58
|
+
const toggle = async () => {
|
|
59
|
+
await sleep(1000)
|
|
60
|
+
stopLoading()
|
|
61
|
+
await sleep(1000)
|
|
62
|
+
startLoading(true)
|
|
63
|
+
}
|
|
64
|
+
toggle()
|
|
65
|
+
}, [])
|
|
66
|
+
return <BorderedBox>{loremIpsum}</BorderedBox>
|
|
67
|
+
}
|
|
68
|
+
export const Toggle = args => {
|
|
69
|
+
return (
|
|
70
|
+
<Loadable {...args}>
|
|
71
|
+
<ContentThatToggle />
|
|
72
|
+
</Loadable>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
Toggle.args = {}
|