arengibook 0.0.0 → 0.0.2
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/dist/assets/index-D8b4DHJx.css +1 -0
- package/dist/assets/index-DEHK2vBv.js +41 -0
- package/{index.html → dist/index.html} +2 -1
- package/dist/index.js +14844 -0
- package/package.json +5 -1
- package/.storybook/main.js +0 -20
- package/.storybook/preview.js +0 -18
- package/.storybook/vitest.setup.js +0 -9
- package/rollup.config.js +0 -28
- package/src/App.css +0 -42
- package/src/App.jsx +0 -35
- package/src/index.css +0 -68
- package/src/index.js +0 -5
- package/src/main.jsx +0 -10
- package/src/stories/Button.jsx +0 -45
- package/src/stories/Button.stories.js +0 -71
- package/src/stories/Configure.mdx +0 -364
- package/src/stories/DatePicker.jsx +0 -40
- package/src/stories/DatePicker.stories.jsx +0 -62
- package/src/stories/Header.jsx +0 -56
- package/src/stories/Header.stories.js +0 -29
- package/src/stories/Page.jsx +0 -69
- package/src/stories/Page.stories.js +0 -28
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +0 -1
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +0 -1
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +0 -1
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +0 -1
- package/src/stories/assets/youtube.svg +0 -1
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -32
- package/src/stories/page.css +0 -68
- /package/{src/assets/react.svg → dist/assets/react-CHdo91hT.svg} +0 -0
- /package/{public → dist}/vite.svg +0 -0
|
@@ -1,364 +0,0 @@
|
|
|
1
|
-
import { Meta } from "@storybook/blocks";
|
|
2
|
-
|
|
3
|
-
import Github from "./assets/github.svg";
|
|
4
|
-
import Discord from "./assets/discord.svg";
|
|
5
|
-
import Youtube from "./assets/youtube.svg";
|
|
6
|
-
import Tutorials from "./assets/tutorials.svg";
|
|
7
|
-
import Styling from "./assets/styling.png";
|
|
8
|
-
import Context from "./assets/context.png";
|
|
9
|
-
import Assets from "./assets/assets.png";
|
|
10
|
-
import Docs from "./assets/docs.png";
|
|
11
|
-
import Share from "./assets/share.png";
|
|
12
|
-
import FigmaPlugin from "./assets/figma-plugin.png";
|
|
13
|
-
import Testing from "./assets/testing.png";
|
|
14
|
-
import Accessibility from "./assets/accessibility.png";
|
|
15
|
-
import Theming from "./assets/theming.png";
|
|
16
|
-
import AddonLibrary from "./assets/addon-library.png";
|
|
17
|
-
|
|
18
|
-
export const RightArrow = () => <svg
|
|
19
|
-
viewBox="0 0 14 14"
|
|
20
|
-
width="8px"
|
|
21
|
-
height="14px"
|
|
22
|
-
style={{
|
|
23
|
-
marginLeft: '4px',
|
|
24
|
-
display: 'inline-block',
|
|
25
|
-
shapeRendering: 'inherit',
|
|
26
|
-
verticalAlign: 'middle',
|
|
27
|
-
fill: 'currentColor',
|
|
28
|
-
'path fill': 'currentColor'
|
|
29
|
-
}}
|
|
30
|
-
>
|
|
31
|
-
<path d="m11.1 7.35-5.5 5.5a.5.5 0 0 1-.7-.7L10.04 7 4.9 1.85a.5.5 0 1 1 .7-.7l5.5 5.5c.2.2.2.5 0 .7Z" />
|
|
32
|
-
</svg>
|
|
33
|
-
|
|
34
|
-
<Meta title="Configure your project" />
|
|
35
|
-
|
|
36
|
-
<div className="sb-container">
|
|
37
|
-
<div className='sb-section-title'>
|
|
38
|
-
# Configure your project
|
|
39
|
-
|
|
40
|
-
Because Storybook works separately from your app, you'll need to configure it for your specific stack and setup. Below, explore guides for configuring Storybook with popular frameworks and tools. If you get stuck, learn how you can ask for help from our community.
|
|
41
|
-
</div>
|
|
42
|
-
<div className="sb-section">
|
|
43
|
-
<div className="sb-section-item">
|
|
44
|
-
<img
|
|
45
|
-
src={Styling}
|
|
46
|
-
alt="A wall of logos representing different styling technologies"
|
|
47
|
-
/>
|
|
48
|
-
<h4 className="sb-section-item-heading">Add styling and CSS</h4>
|
|
49
|
-
<p className="sb-section-item-paragraph">Like with web applications, there are many ways to include CSS within Storybook. Learn more about setting up styling within Storybook.</p>
|
|
50
|
-
<a
|
|
51
|
-
href="https://storybook.js.org/docs/configure/styling-and-css/?renderer=react"
|
|
52
|
-
target="_blank"
|
|
53
|
-
>Learn more<RightArrow /></a>
|
|
54
|
-
</div>
|
|
55
|
-
<div className="sb-section-item">
|
|
56
|
-
<img
|
|
57
|
-
src={Context}
|
|
58
|
-
alt="An abstraction representing the composition of data for a component"
|
|
59
|
-
/>
|
|
60
|
-
<h4 className="sb-section-item-heading">Provide context and mocking</h4>
|
|
61
|
-
<p className="sb-section-item-paragraph">Often when a story doesn't render, it's because your component is expecting a specific environment or context (like a theme provider) to be available.</p>
|
|
62
|
-
<a
|
|
63
|
-
href="https://storybook.js.org/docs/writing-stories/decorators/?renderer=react#context-for-mocking"
|
|
64
|
-
target="_blank"
|
|
65
|
-
>Learn more<RightArrow /></a>
|
|
66
|
-
</div>
|
|
67
|
-
<div className="sb-section-item">
|
|
68
|
-
<img src={Assets} alt="A representation of typography and image assets" />
|
|
69
|
-
<div>
|
|
70
|
-
<h4 className="sb-section-item-heading">Load assets and resources</h4>
|
|
71
|
-
<p className="sb-section-item-paragraph">To link static files (like fonts) to your projects and stories, use the
|
|
72
|
-
`staticDirs` configuration option to specify folders to load when
|
|
73
|
-
starting Storybook.</p>
|
|
74
|
-
<a
|
|
75
|
-
href="https://storybook.js.org/docs/configure/images-and-assets/?renderer=react"
|
|
76
|
-
target="_blank"
|
|
77
|
-
>Learn more<RightArrow /></a>
|
|
78
|
-
</div>
|
|
79
|
-
</div>
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
<div className="sb-container">
|
|
83
|
-
<div className='sb-section-title'>
|
|
84
|
-
# Do more with Storybook
|
|
85
|
-
|
|
86
|
-
Now that you know the basics, let's explore other parts of Storybook that will improve your experience. This list is just to get you started. You can customise Storybook in many ways to fit your needs.
|
|
87
|
-
</div>
|
|
88
|
-
|
|
89
|
-
<div className="sb-section">
|
|
90
|
-
<div className="sb-features-grid">
|
|
91
|
-
<div className="sb-grid-item">
|
|
92
|
-
<img src={Docs} alt="A screenshot showing the autodocs tag being set, pointing a docs page being generated" />
|
|
93
|
-
<h4 className="sb-section-item-heading">Autodocs</h4>
|
|
94
|
-
<p className="sb-section-item-paragraph">Auto-generate living,
|
|
95
|
-
interactive reference documentation from your components and stories.</p>
|
|
96
|
-
<a
|
|
97
|
-
href="https://storybook.js.org/docs/writing-docs/autodocs/?renderer=react"
|
|
98
|
-
target="_blank"
|
|
99
|
-
>Learn more<RightArrow /></a>
|
|
100
|
-
</div>
|
|
101
|
-
<div className="sb-grid-item">
|
|
102
|
-
<img src={Share} alt="A browser window showing a Storybook being published to a chromatic.com URL" />
|
|
103
|
-
<h4 className="sb-section-item-heading">Publish to Chromatic</h4>
|
|
104
|
-
<p className="sb-section-item-paragraph">Publish your Storybook to review and collaborate with your entire team.</p>
|
|
105
|
-
<a
|
|
106
|
-
href="https://storybook.js.org/docs/sharing/publish-storybook/?renderer=react#publish-storybook-with-chromatic"
|
|
107
|
-
target="_blank"
|
|
108
|
-
>Learn more<RightArrow /></a>
|
|
109
|
-
</div>
|
|
110
|
-
<div className="sb-grid-item">
|
|
111
|
-
<img src={FigmaPlugin} alt="Windows showing the Storybook plugin in Figma" />
|
|
112
|
-
<h4 className="sb-section-item-heading">Figma Plugin</h4>
|
|
113
|
-
<p className="sb-section-item-paragraph">Embed your stories into Figma to cross-reference the design and live
|
|
114
|
-
implementation in one place.</p>
|
|
115
|
-
<a
|
|
116
|
-
href="https://storybook.js.org/docs/sharing/design-integrations/?renderer=react#embed-storybook-in-figma-with-the-plugin"
|
|
117
|
-
target="_blank"
|
|
118
|
-
>Learn more<RightArrow /></a>
|
|
119
|
-
</div>
|
|
120
|
-
<div className="sb-grid-item">
|
|
121
|
-
<img src={Testing} alt="Screenshot of tests passing and failing" />
|
|
122
|
-
<h4 className="sb-section-item-heading">Testing</h4>
|
|
123
|
-
<p className="sb-section-item-paragraph">Use stories to test a component in all its variations, no matter how
|
|
124
|
-
complex.</p>
|
|
125
|
-
<a
|
|
126
|
-
href="https://storybook.js.org/docs/writing-tests/?renderer=react"
|
|
127
|
-
target="_blank"
|
|
128
|
-
>Learn more<RightArrow /></a>
|
|
129
|
-
</div>
|
|
130
|
-
<div className="sb-grid-item">
|
|
131
|
-
<img src={Accessibility} alt="Screenshot of accessibility tests passing and failing" />
|
|
132
|
-
<h4 className="sb-section-item-heading">Accessibility</h4>
|
|
133
|
-
<p className="sb-section-item-paragraph">Automatically test your components for a11y issues as you develop.</p>
|
|
134
|
-
<a
|
|
135
|
-
href="https://storybook.js.org/docs/writing-tests/accessibility-testing/?renderer=react"
|
|
136
|
-
target="_blank"
|
|
137
|
-
>Learn more<RightArrow /></a>
|
|
138
|
-
</div>
|
|
139
|
-
<div className="sb-grid-item">
|
|
140
|
-
<img src={Theming} alt="Screenshot of Storybook in light and dark mode" />
|
|
141
|
-
<h4 className="sb-section-item-heading">Theming</h4>
|
|
142
|
-
<p className="sb-section-item-paragraph">Theme Storybook's UI to personalize it to your project.</p>
|
|
143
|
-
<a
|
|
144
|
-
href="https://storybook.js.org/docs/configure/theming/?renderer=react"
|
|
145
|
-
target="_blank"
|
|
146
|
-
>Learn more<RightArrow /></a>
|
|
147
|
-
</div>
|
|
148
|
-
</div>
|
|
149
|
-
</div>
|
|
150
|
-
</div>
|
|
151
|
-
<div className='sb-addon'>
|
|
152
|
-
<div className='sb-addon-text'>
|
|
153
|
-
<h4>Addons</h4>
|
|
154
|
-
<p className="sb-section-item-paragraph">Integrate your tools with Storybook to connect workflows.</p>
|
|
155
|
-
<a
|
|
156
|
-
href="https://storybook.js.org/addons/"
|
|
157
|
-
target="_blank"
|
|
158
|
-
>Discover all addons<RightArrow /></a>
|
|
159
|
-
</div>
|
|
160
|
-
<div className='sb-addon-img'>
|
|
161
|
-
<img src={AddonLibrary} alt="Integrate your tools with Storybook to connect workflows." />
|
|
162
|
-
</div>
|
|
163
|
-
</div>
|
|
164
|
-
|
|
165
|
-
<div className="sb-section sb-socials">
|
|
166
|
-
<div className="sb-section-item">
|
|
167
|
-
<img src={Github} alt="Github logo" className="sb-explore-image"/>
|
|
168
|
-
Join our contributors building the future of UI development.
|
|
169
|
-
|
|
170
|
-
<a
|
|
171
|
-
href="https://github.com/storybookjs/storybook"
|
|
172
|
-
target="_blank"
|
|
173
|
-
>Star on GitHub<RightArrow /></a>
|
|
174
|
-
</div>
|
|
175
|
-
<div className="sb-section-item">
|
|
176
|
-
<img src={Discord} alt="Discord logo" className="sb-explore-image"/>
|
|
177
|
-
<div>
|
|
178
|
-
Get support and chat with frontend developers.
|
|
179
|
-
|
|
180
|
-
<a
|
|
181
|
-
href="https://discord.gg/storybook"
|
|
182
|
-
target="_blank"
|
|
183
|
-
>Join Discord server<RightArrow /></a>
|
|
184
|
-
</div>
|
|
185
|
-
</div>
|
|
186
|
-
<div className="sb-section-item">
|
|
187
|
-
<img src={Youtube} alt="Youtube logo" className="sb-explore-image"/>
|
|
188
|
-
<div>
|
|
189
|
-
Watch tutorials, feature previews and interviews.
|
|
190
|
-
|
|
191
|
-
<a
|
|
192
|
-
href="https://www.youtube.com/@chromaticui"
|
|
193
|
-
target="_blank"
|
|
194
|
-
>Watch on YouTube<RightArrow /></a>
|
|
195
|
-
</div>
|
|
196
|
-
</div>
|
|
197
|
-
<div className="sb-section-item">
|
|
198
|
-
<img src={Tutorials} alt="A book" className="sb-explore-image"/>
|
|
199
|
-
<p>Follow guided walkthroughs on for key workflows.</p>
|
|
200
|
-
|
|
201
|
-
<a
|
|
202
|
-
href="https://storybook.js.org/tutorials/"
|
|
203
|
-
target="_blank"
|
|
204
|
-
>Discover tutorials<RightArrow /></a>
|
|
205
|
-
</div>
|
|
206
|
-
</div>
|
|
207
|
-
|
|
208
|
-
<style>
|
|
209
|
-
{`
|
|
210
|
-
.sb-container {
|
|
211
|
-
margin-bottom: 48px;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.sb-section {
|
|
215
|
-
width: 100%;
|
|
216
|
-
display: flex;
|
|
217
|
-
flex-direction: row;
|
|
218
|
-
gap: 20px;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
img {
|
|
222
|
-
object-fit: cover;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
.sb-section-title {
|
|
226
|
-
margin-bottom: 32px;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
.sb-section a:not(h1 a, h2 a, h3 a) {
|
|
230
|
-
font-size: 14px;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
.sb-section-item, .sb-grid-item {
|
|
234
|
-
flex: 1;
|
|
235
|
-
display: flex;
|
|
236
|
-
flex-direction: column;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
.sb-section-item-heading {
|
|
240
|
-
padding-top: 20px !important;
|
|
241
|
-
padding-bottom: 5px !important;
|
|
242
|
-
margin: 0 !important;
|
|
243
|
-
}
|
|
244
|
-
.sb-section-item-paragraph {
|
|
245
|
-
margin: 0;
|
|
246
|
-
padding-bottom: 10px;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
.sb-chevron {
|
|
250
|
-
margin-left: 5px;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
.sb-features-grid {
|
|
254
|
-
display: grid;
|
|
255
|
-
grid-template-columns: repeat(2, 1fr);
|
|
256
|
-
grid-gap: 32px 20px;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
.sb-socials {
|
|
260
|
-
display: grid;
|
|
261
|
-
grid-template-columns: repeat(4, 1fr);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
.sb-socials p {
|
|
265
|
-
margin-bottom: 10px;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
.sb-explore-image {
|
|
269
|
-
max-height: 32px;
|
|
270
|
-
align-self: flex-start;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
.sb-addon {
|
|
274
|
-
width: 100%;
|
|
275
|
-
display: flex;
|
|
276
|
-
align-items: center;
|
|
277
|
-
position: relative;
|
|
278
|
-
background-color: #EEF3F8;
|
|
279
|
-
border-radius: 5px;
|
|
280
|
-
border: 1px solid rgba(0, 0, 0, 0.05);
|
|
281
|
-
background: #EEF3F8;
|
|
282
|
-
height: 180px;
|
|
283
|
-
margin-bottom: 48px;
|
|
284
|
-
overflow: hidden;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
.sb-addon-text {
|
|
288
|
-
padding-left: 48px;
|
|
289
|
-
max-width: 240px;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
.sb-addon-text h4 {
|
|
293
|
-
padding-top: 0px;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
.sb-addon-img {
|
|
297
|
-
position: absolute;
|
|
298
|
-
left: 345px;
|
|
299
|
-
top: 0;
|
|
300
|
-
height: 100%;
|
|
301
|
-
width: 200%;
|
|
302
|
-
overflow: hidden;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
.sb-addon-img img {
|
|
306
|
-
width: 650px;
|
|
307
|
-
transform: rotate(-15deg);
|
|
308
|
-
margin-left: 40px;
|
|
309
|
-
margin-top: -72px;
|
|
310
|
-
box-shadow: 0 0 1px rgba(255, 255, 255, 0);
|
|
311
|
-
backface-visibility: hidden;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
@media screen and (max-width: 800px) {
|
|
315
|
-
.sb-addon-img {
|
|
316
|
-
left: 300px;
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
@media screen and (max-width: 600px) {
|
|
321
|
-
.sb-section {
|
|
322
|
-
flex-direction: column;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
.sb-features-grid {
|
|
326
|
-
grid-template-columns: repeat(1, 1fr);
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
.sb-socials {
|
|
330
|
-
grid-template-columns: repeat(2, 1fr);
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
.sb-addon {
|
|
334
|
-
height: 280px;
|
|
335
|
-
align-items: flex-start;
|
|
336
|
-
padding-top: 32px;
|
|
337
|
-
overflow: hidden;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
.sb-addon-text {
|
|
341
|
-
padding-left: 24px;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
.sb-addon-img {
|
|
345
|
-
right: 0;
|
|
346
|
-
left: 0;
|
|
347
|
-
top: 130px;
|
|
348
|
-
bottom: 0;
|
|
349
|
-
overflow: hidden;
|
|
350
|
-
height: auto;
|
|
351
|
-
width: 124%;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
.sb-addon-img img {
|
|
355
|
-
width: 1200px;
|
|
356
|
-
transform: rotate(-12deg);
|
|
357
|
-
margin-left: 0;
|
|
358
|
-
margin-top: 48px;
|
|
359
|
-
margin-bottom: -40px;
|
|
360
|
-
margin-left: -24px;
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
`}
|
|
364
|
-
</style>
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
// src/components/DatePicker.jsx
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Calendar } from 'primereact/calendar';
|
|
4
|
-
|
|
5
|
-
export const DatePicker = ({
|
|
6
|
-
value,
|
|
7
|
-
onChange,
|
|
8
|
-
placeholder,
|
|
9
|
-
dateFormat = "dd/mm/yy",
|
|
10
|
-
view = 'date',
|
|
11
|
-
invalid = false,
|
|
12
|
-
errorMessage = '',
|
|
13
|
-
disabled = false
|
|
14
|
-
}) => {
|
|
15
|
-
const style = {
|
|
16
|
-
border: invalid ? '1px solid red' : '1px solid #ccc',
|
|
17
|
-
padding: '0.5rem',
|
|
18
|
-
borderRadius: '6px',
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<div className="flex flex-col gap-1">
|
|
23
|
-
<Calendar
|
|
24
|
-
value={value}
|
|
25
|
-
onChange={onChange}
|
|
26
|
-
showIcon
|
|
27
|
-
placeholder={placeholder}
|
|
28
|
-
dateFormat={dateFormat}
|
|
29
|
-
inputStyle={style}
|
|
30
|
-
view={view}
|
|
31
|
-
disabled={disabled}
|
|
32
|
-
showWeek
|
|
33
|
-
showTime hourFormat="24"
|
|
34
|
-
/>
|
|
35
|
-
{invalid && (
|
|
36
|
-
<small style={{ color: 'red', fontStyle: 'italic' }}>{errorMessage || 'Date invalide'}</small>
|
|
37
|
-
)}
|
|
38
|
-
</div>
|
|
39
|
-
);
|
|
40
|
-
};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
// src/components/DatePicker.stories.jsx
|
|
2
|
-
import React, { useState } from 'react';
|
|
3
|
-
import { DatePicker } from './DatePicker.jsx';
|
|
4
|
-
import { action } from '@storybook/addon-actions';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Components/DatePicker',
|
|
8
|
-
component: DatePicker,
|
|
9
|
-
argTypes: {
|
|
10
|
-
placeholder: { control: 'text' },
|
|
11
|
-
dateFormat: { control: 'text' },
|
|
12
|
-
view: {
|
|
13
|
-
control: {
|
|
14
|
-
type: 'select',
|
|
15
|
-
options: ['date', 'month', 'year'],
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const Template = (args) => {
|
|
22
|
-
const [date, setDate] = useState(null);
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<DatePicker
|
|
26
|
-
{...args}
|
|
27
|
-
value={date}
|
|
28
|
-
onChange={(e) => setDate(e.value)}
|
|
29
|
-
/>
|
|
30
|
-
);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const Default = Template.bind({});
|
|
34
|
-
Default.args = {
|
|
35
|
-
placeholder: 'Choisis une date',
|
|
36
|
-
dateFormat: 'dd/mm/yy',
|
|
37
|
-
view: 'date',
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const MonthOnly = Template.bind({});
|
|
41
|
-
MonthOnly.args = {
|
|
42
|
-
placeholder: 'Choisis un mois',
|
|
43
|
-
dateFormat: 'mm/yy',
|
|
44
|
-
view: 'month',
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const Invalid = Template.bind({});
|
|
48
|
-
Invalid.args = {
|
|
49
|
-
placeholder: 'Date non valide',
|
|
50
|
-
dateFormat: 'dd/mm/yy',
|
|
51
|
-
view: 'date',
|
|
52
|
-
invalid: true,
|
|
53
|
-
errorMessage: 'Cette date est incorrecte',
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export const Disabled = Template.bind({});
|
|
57
|
-
Disabled.args = {
|
|
58
|
-
placeholder: 'Choisis une date',
|
|
59
|
-
dateFormat: 'dd/mm/yy',
|
|
60
|
-
view: 'date',
|
|
61
|
-
disabled: true,
|
|
62
|
-
};
|
package/src/stories/Header.jsx
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
|
|
5
|
-
import { Button } from './Button.jsx';
|
|
6
|
-
import './header.css';
|
|
7
|
-
|
|
8
|
-
export const Header = ({ user = null, onLogin, onLogout, onCreateAccount }) => (
|
|
9
|
-
<header>
|
|
10
|
-
<div className="storybook-header">
|
|
11
|
-
<div>
|
|
12
|
-
<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
|
13
|
-
<g fill="none" fillRule="evenodd">
|
|
14
|
-
<path
|
|
15
|
-
d="M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z"
|
|
16
|
-
fill="#FFF"
|
|
17
|
-
/>
|
|
18
|
-
<path
|
|
19
|
-
d="M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z"
|
|
20
|
-
fill="#555AB9"
|
|
21
|
-
/>
|
|
22
|
-
<path
|
|
23
|
-
d="M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z"
|
|
24
|
-
fill="#91BAF8"
|
|
25
|
-
/>
|
|
26
|
-
</g>
|
|
27
|
-
</svg>
|
|
28
|
-
<h1>Acme</h1>
|
|
29
|
-
</div>
|
|
30
|
-
<div>
|
|
31
|
-
{user ? (
|
|
32
|
-
<>
|
|
33
|
-
<span className="welcome">
|
|
34
|
-
Welcome, <b>{user.name}</b>!
|
|
35
|
-
</span>
|
|
36
|
-
<Button size="small" onClick={onLogout} label="Log out" />
|
|
37
|
-
</>
|
|
38
|
-
) : (
|
|
39
|
-
<>
|
|
40
|
-
<Button size="small" onClick={onLogin} label="Log in" />
|
|
41
|
-
<Button primary size="small" onClick={onCreateAccount} label="Sign up" />
|
|
42
|
-
</>
|
|
43
|
-
)}
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
</header>
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
Header.propTypes = {
|
|
50
|
-
user: PropTypes.shape({
|
|
51
|
-
name: PropTypes.string.isRequired,
|
|
52
|
-
}),
|
|
53
|
-
onLogin: PropTypes.func.isRequired,
|
|
54
|
-
onLogout: PropTypes.func.isRequired,
|
|
55
|
-
onCreateAccount: PropTypes.func.isRequired,
|
|
56
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { fn } from '@storybook/test';
|
|
2
|
-
|
|
3
|
-
import { Header } from './Header';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Example/Header',
|
|
7
|
-
component: Header,
|
|
8
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
9
|
-
tags: ['autodocs'],
|
|
10
|
-
parameters: {
|
|
11
|
-
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
|
|
12
|
-
layout: 'fullscreen',
|
|
13
|
-
},
|
|
14
|
-
args: {
|
|
15
|
-
onLogin: fn(),
|
|
16
|
-
onLogout: fn(),
|
|
17
|
-
onCreateAccount: fn(),
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const LoggedIn = {
|
|
22
|
-
args: {
|
|
23
|
-
user: {
|
|
24
|
-
name: 'Jane Doe',
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const LoggedOut = {};
|
package/src/stories/Page.jsx
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Header } from './Header.jsx';
|
|
4
|
-
import './page.css';
|
|
5
|
-
|
|
6
|
-
export const Page = () => {
|
|
7
|
-
const [user, setUser] = React.useState();
|
|
8
|
-
|
|
9
|
-
return (
|
|
10
|
-
<article>
|
|
11
|
-
<Header
|
|
12
|
-
user={user}
|
|
13
|
-
onLogin={() => setUser({ name: 'Jane Doe' })}
|
|
14
|
-
onLogout={() => setUser(undefined)}
|
|
15
|
-
onCreateAccount={() => setUser({ name: 'Jane Doe' })}
|
|
16
|
-
/>
|
|
17
|
-
|
|
18
|
-
<section className="storybook-page">
|
|
19
|
-
<h2>Pages in Storybook</h2>
|
|
20
|
-
<p>
|
|
21
|
-
We recommend building UIs with a{' '}
|
|
22
|
-
<a href="https://componentdriven.org" target="_blank" rel="noopener noreferrer">
|
|
23
|
-
<strong>component-driven</strong>
|
|
24
|
-
</a>{' '}
|
|
25
|
-
process starting with atomic components and ending with pages.
|
|
26
|
-
</p>
|
|
27
|
-
<p>
|
|
28
|
-
Render pages with mock data. This makes it easy to build and review page states without
|
|
29
|
-
needing to navigate to them in your app. Here are some handy patterns for managing page
|
|
30
|
-
data in Storybook:
|
|
31
|
-
</p>
|
|
32
|
-
<ul>
|
|
33
|
-
<li>
|
|
34
|
-
Use a higher-level connected component. Storybook helps you compose such data from the
|
|
35
|
-
"args" of child component stories
|
|
36
|
-
</li>
|
|
37
|
-
<li>
|
|
38
|
-
Assemble data in the page component from your services. You can mock these services out
|
|
39
|
-
using Storybook.
|
|
40
|
-
</li>
|
|
41
|
-
</ul>
|
|
42
|
-
<p>
|
|
43
|
-
Get a guided tutorial on component-driven development at{' '}
|
|
44
|
-
<a href="https://storybook.js.org/tutorials/" target="_blank" rel="noopener noreferrer">
|
|
45
|
-
Storybook tutorials
|
|
46
|
-
</a>
|
|
47
|
-
. Read more in the{' '}
|
|
48
|
-
<a href="https://storybook.js.org/docs" target="_blank" rel="noopener noreferrer">
|
|
49
|
-
docs
|
|
50
|
-
</a>
|
|
51
|
-
.
|
|
52
|
-
</p>
|
|
53
|
-
<div className="tip-wrapper">
|
|
54
|
-
<span className="tip">Tip</span> Adjust the width of the canvas with the{' '}
|
|
55
|
-
<svg width="10" height="10" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">
|
|
56
|
-
<g fill="none" fillRule="evenodd">
|
|
57
|
-
<path
|
|
58
|
-
d="M1.5 5.2h4.8c.3 0 .5.2.5.4v5.1c-.1.2-.3.3-.4.3H1.4a.5.5 0 01-.5-.4V5.7c0-.3.2-.5.5-.5zm0-2.1h6.9c.3 0 .5.2.5.4v7a.5.5 0 01-1 0V4H1.5a.5.5 0 010-1zm0-2.1h9c.3 0 .5.2.5.4v9.1a.5.5 0 01-1 0V2H1.5a.5.5 0 010-1zm4.3 5.2H2V10h3.8V6.2z"
|
|
59
|
-
id="a"
|
|
60
|
-
fill="#999"
|
|
61
|
-
/>
|
|
62
|
-
</g>
|
|
63
|
-
</svg>
|
|
64
|
-
Viewports addon in the toolbar
|
|
65
|
-
</div>
|
|
66
|
-
</section>
|
|
67
|
-
</article>
|
|
68
|
-
);
|
|
69
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { expect, userEvent, within } from '@storybook/test';
|
|
2
|
-
|
|
3
|
-
import { Page } from './Page';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Example/Page',
|
|
7
|
-
component: Page,
|
|
8
|
-
parameters: {
|
|
9
|
-
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
|
|
10
|
-
layout: 'fullscreen',
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export const LoggedOut = {};
|
|
15
|
-
|
|
16
|
-
// More on component testing: https://storybook.js.org/docs/writing-tests/component-testing
|
|
17
|
-
export const LoggedIn = {
|
|
18
|
-
play: async ({ canvasElement }) => {
|
|
19
|
-
const canvas = within(canvasElement);
|
|
20
|
-
const loginButton = canvas.getByRole('button', { name: /Log in/i });
|
|
21
|
-
await expect(loginButton).toBeInTheDocument();
|
|
22
|
-
await userEvent.click(loginButton);
|
|
23
|
-
await expect(loginButton).not.toBeInTheDocument();
|
|
24
|
-
|
|
25
|
-
const logoutButton = canvas.getByRole('button', { name: /Log out/i });
|
|
26
|
-
await expect(logoutButton).toBeInTheDocument();
|
|
27
|
-
},
|
|
28
|
-
};
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" fill="none" viewBox="0 0 48 48"><title>Accessibility</title><circle cx="24.334" cy="24" r="24" fill="#A849FF" fill-opacity=".3"/><path fill="#A470D5" fill-rule="evenodd" d="M27.8609 11.585C27.8609 9.59506 26.2497 7.99023 24.2519 7.99023C22.254 7.99023 20.6429 9.65925 20.6429 11.585C20.6429 13.575 22.254 15.1799 24.2519 15.1799C26.2497 15.1799 27.8609 13.575 27.8609 11.585ZM21.8922 22.6473C21.8467 23.9096 21.7901 25.4788 21.5897 26.2771C20.9853 29.0462 17.7348 36.3314 17.3325 37.2275C17.1891 37.4923 17.1077 37.7955 17.1077 38.1178C17.1077 39.1519 17.946 39.9902 18.9802 39.9902C19.6587 39.9902 20.253 39.6293 20.5814 39.0889L20.6429 38.9874L24.2841 31.22C24.2841 31.22 27.5529 37.9214 27.9238 38.6591C28.2948 39.3967 28.8709 39.9902 29.7168 39.9902C30.751 39.9902 31.5893 39.1519 31.5893 38.1178C31.5893 37.7951 31.3639 37.2265 31.3639 37.2265C30.9581 36.3258 27.698 29.0452 27.0938 26.2771C26.8975 25.4948 26.847 23.9722 26.8056 22.7236C26.7927 22.333 26.7806 21.9693 26.7653 21.6634C26.7008 21.214 27.0231 20.8289 27.4097 20.7005L35.3366 18.3253C36.3033 18.0685 36.8834 16.9773 36.6256 16.0144C36.3678 15.0515 35.2722 14.4737 34.3055 14.7305C34.3055 14.7305 26.8619 17.1057 24.2841 17.1057C21.7062 17.1057 14.456 14.7947 14.456 14.7947C13.4893 14.5379 12.3937 14.9873 12.0715 15.9502C11.7493 16.9131 12.3293 18.0044 13.3604 18.3253L21.2873 20.7005C21.674 20.8289 21.9318 21.214 21.9318 21.6634C21.9174 21.9493 21.9053 22.2857 21.8922 22.6473Z" clip-rule="evenodd"/></svg>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="33" height="32" fill="none" viewBox="0 0 33 32"><g clip-path="url(#clip0_10031_177575)"><mask id="mask0_10031_177575" style="mask-type:luminance" width="33" height="25" x="0" y="4" maskUnits="userSpaceOnUse"><path fill="#fff" d="M32.5034 4.00195H0.503906V28.7758H32.5034V4.00195Z"/></mask><g mask="url(#mask0_10031_177575)"><path fill="#5865F2" d="M27.5928 6.20817C25.5533 5.27289 23.3662 4.58382 21.0794 4.18916C21.0378 4.18154 20.9962 4.20057 20.9747 4.23864C20.6935 4.73863 20.3819 5.3909 20.1637 5.90358C17.7042 5.53558 15.2573 5.53558 12.8481 5.90358C12.6299 5.37951 12.307 4.73863 12.0245 4.23864C12.003 4.20184 11.9614 4.18281 11.9198 4.18916C9.63431 4.58255 7.44721 5.27163 5.40641 6.20817C5.38874 6.21578 5.3736 6.22848 5.36355 6.24497C1.21508 12.439 0.078646 18.4809 0.636144 24.4478C0.638667 24.477 0.655064 24.5049 0.677768 24.5227C3.41481 26.5315 6.06609 27.7511 8.66815 28.5594C8.70979 28.5721 8.75392 28.5569 8.78042 28.5226C9.39594 27.6826 9.94461 26.7968 10.4151 25.8653C10.4428 25.8107 10.4163 25.746 10.3596 25.7244C9.48927 25.3945 8.66058 24.9922 7.86343 24.5354C7.80038 24.4986 7.79533 24.4084 7.85333 24.3653C8.02108 24.2397 8.18888 24.109 8.34906 23.977C8.37804 23.9529 8.41842 23.9478 8.45249 23.963C13.6894 26.3526 19.359 26.3526 24.5341 23.963C24.5682 23.9465 24.6086 23.9516 24.6388 23.9757C24.799 24.1077 24.9668 24.2397 25.1358 24.3653C25.1938 24.4084 25.19 24.4986 25.127 24.5354C24.3298 25.0011 23.5011 25.3945 22.6296 25.7232C22.5728 25.7447 22.5476 25.8107 22.5754 25.8653C23.0559 26.7955 23.6046 27.6812 24.2087 28.5213C24.234 28.5569 24.2794 28.5721 24.321 28.5594C26.9357 27.7511 29.5869 26.5315 32.324 24.5227C32.348 24.5049 32.3631 24.4783 32.3656 24.4491C33.0328 17.5506 31.2481 11.5584 27.6344 6.24623C27.6256 6.22848 27.6105 6.21578 27.5928 6.20817ZM11.1971 20.8146C9.62043 20.8146 8.32129 19.3679 8.32129 17.5913C8.32129 15.8146 9.59523 14.368 11.1971 14.368C12.8115 14.368 14.0981 15.8273 14.0729 17.5913C14.0729 19.3679 12.7989 20.8146 11.1971 20.8146ZM21.8299 20.8146C20.2533 20.8146 18.9541 19.3679 18.9541 17.5913C18.9541 15.8146 20.228 14.368 21.8299 14.368C23.4444 14.368 24.7309 15.8273 24.7057 17.5913C24.7057 19.3679 23.4444 20.8146 21.8299 20.8146Z"/></g></g><defs><clipPath id="clip0_10031_177575"><rect width="32" height="32" fill="#fff" transform="translate(0.5)"/></clipPath></defs></svg>
|
|
Binary file
|
|
Binary file
|