Skip to content

Commit a4baf3e

Browse files
Merge pull request #99 from Chia-Chi-Shen/storybook
Merge Storybook version 1
2 parents 2ed60d0 + 9ae655c commit a4baf3e

File tree

99 files changed

+27859
-19166
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+27859
-19166
lines changed

.eslintrc.js

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/deploy.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Deploy Storybook to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- storybook
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '20.16.0'
20+
21+
- name: Install dependencies
22+
run: npm install
23+
24+
- name: Build Storybook
25+
env:
26+
STORYBOOK_AZURE_MAPS_KEY: ${{ secrets.STORYBOOK_AZURE_MAPS_KEY }}
27+
run: npm run build-storybook
28+
29+
- name: Deploy to GitHub Pages
30+
uses: peaceiris/actions-gh-pages@v3
31+
with:
32+
github_token: ${{ secrets.GITHUB_TOKEN }}
33+
publish_dir: ./storybook-static

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@
55
/.yalc
66
/.pnp
77
.pnp.js
8-
yalc.lock
98

109
# testing
1110
/coverage
12-
/src/key.ts
1311

1412
# production
1513
/build
1614

1715
# misc
1816
.DS_Store
17+
.env
1918
.env.local
2019
.env.development.local
2120
.env.test.local
@@ -24,3 +23,5 @@ yalc.lock
2423
npm-debug.log*
2524
yarn-debug.log*
2625
yarn-error.log*
26+
27+
*storybook.log

.storybook/AZMtheme.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { create } from '@storybook/theming/create';
2+
3+
export default create({
4+
base: 'light',
5+
brandTitle: 'React Azure Maps',
6+
brandUrl: 'https://github.com/Azure/react-azure-maps',
7+
brandImage: 'logo1.png',
8+
brandTarget: '_blank',
9+
});

.storybook/main.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import type { StorybookConfig } from '@storybook/react-webpack5';
2+
3+
const config: StorybookConfig = {
4+
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
5+
addons: [
6+
'@storybook/preset-create-react-app',
7+
'@storybook/addon-onboarding',
8+
'@storybook/addon-links',
9+
{
10+
name: '@storybook/addon-essentials',
11+
options: {
12+
actions: false,
13+
interactions: false,
14+
},
15+
},
16+
{
17+
name: '@storybook/addon-storysource',
18+
options: {
19+
loaderOptions: {
20+
parser: 'typescript',
21+
},
22+
},
23+
},
24+
],
25+
framework: {
26+
name: '@storybook/react-webpack5',
27+
options: {},
28+
},
29+
staticDirs: ['../public'],
30+
};
31+
export default config;

.storybook/manager.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { addons } from '@storybook/manager-api';
2+
import Theme from './AZMtheme';
3+
4+
addons.setConfig({
5+
theme: Theme,
6+
});

.storybook/preview.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import React from 'react';
2+
import type { Preview } from '@storybook/react';
3+
import 'azure-maps-control/dist/atlas.min.css';
4+
import '../src/Storybook.css';
5+
import { Story, Canvas } from '@storybook/addon-docs';
6+
7+
const preview: Preview = {
8+
parameters: {
9+
controls: {
10+
matchers: {
11+
color: /(background|color)$/i,
12+
date: /Date$/i,
13+
},
14+
},
15+
options: {
16+
storySort: {
17+
order: [
18+
'Getting Started',
19+
'Basic Usage',
20+
['*', 'Map Reference'],
21+
'Map Annotations',
22+
'*',
23+
'Data Visualization',
24+
['Introduction'],
25+
],
26+
},
27+
},
28+
},
29+
};
30+
31+
export default preview;

README.md

Lines changed: 4 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,5 @@
1-
## React Azure Maps Playground
1+
## React Azure Maps Storybook
22

3-
This project is community-driven initiative originally created by amazing [@psrednicki](https://github.com/psrednicki), [@msasinowski](https://github.com/msasinowski) and [@tbajda](https://github.com/tbajda) and is now maintained by the Azure Maps team.
4-
5-
- How to link local package version:
6-
- run `yarn watch` in `azure-maps-react`
7-
- run `yarn link` in `azure-maps-react`
8-
- go to `azure-maps-playground` and run `yarn link "react-azure-maps"`
9-
10-
- How to avoid "Invalid Hook call" caused by multiple React instances
11-
- go to `azure-maps-playground` and run
12-
```
13-
cd node_modules/react
14-
yarn link
15-
```
16-
- go to `azure-maps-react` and run `yarn link react`
17-
18-
### Subscription key
19-
20-
Please remember to create file and add key to `/src/key.ts`
21-
22-
`export const key = '<Your Subcription Key>'`
23-
24-
## Creators ✨
25-
26-
<!-- CREATORS:START - Do not remove or modify this section -->
27-
<!-- prettier-ignore-start -->
28-
<!-- markdownlint-disable -->
29-
<table>
30-
<tr>
31-
<td style="text-align: center; vertical-align: middle;">
32-
<a href="https://github.com/psrednicki"
33-
><img
34-
src="https://avatars2.githubusercontent.com/u/41010528?v=4"
35-
width="100px;"
36-
alt=""
37-
/><br /><sub><b>psrednicki</b></sub></a
38-
><br />
39-
<div>
40-
<a
41-
href="https://pl.linkedin.com/in/patryk-%C5%9Brednicki-718204187/"
42-
title="LinkedIn"
43-
style="text-align:center"
44-
><img
45-
src="https://cdn-icons-png.flaticon.com/512/174/174857.png"
46-
width="24px;"
47-
alt=""
48-
/></a>
49-
</div>
50-
</td>
51-
<td style="text-align: center; vertical-align: middle;">
52-
<a href="https://github.com/msasinowski"
53-
><img
54-
src="https://avatars2.githubusercontent.com/u/38035075?v=4"
55-
width="100px;"
56-
alt=""
57-
/><br /><sub><b>msasinowski</b></sub></a
58-
>
59-
<div>
60-
<a
61-
href="https://www.linkedin.com/in/maciej-sasinowski-92076815a/"
62-
title="LinkedIn"
63-
style="text-align:center"
64-
><img
65-
src="https://cdn-icons-png.flaticon.com/512/174/174857.png"
66-
width="24px;"
67-
alt=""
68-
/></a>
69-
</div>
70-
</td>
71-
<td style="text-align: center; vertical-align: middle;">
72-
<a href="https://github.com/tbajda"
73-
><img
74-
src="https://avatars2.githubusercontent.com/u/27700326?v=4"
75-
width="100px;"
76-
alt=""
77-
/><br /><sub><b>tbajda</b></sub></a
78-
>
79-
<div>
80-
<a
81-
href="https://www.linkedin.com/in/tomasz-bajda-ab4468165/"
82-
title="LinkedIn"
83-
><img
84-
src="https://cdn-icons-png.flaticon.com/512/174/174857.png"
85-
width="24px;"
86-
alt=""
87-
/></a>
88-
</div>
89-
</td>
90-
</tr>
91-
</table>
92-
93-
<!-- markdownlint-enable -->
94-
<!-- prettier-ignore-end -->
95-
96-
<!-- CREATORS:END -->
3+
The React Azure Map Storybook provides a hands-on way to explore and interact with **react-azure-maps**. <br/>
4+
With Storybook, You can try adjusting various settings and see how these components work in real-time. <br/>
5+
This helps you understand the practical applications of the package and how to integrate Azure Maps into your React projects effectively.

desktop.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[.ShellClassInfo]
2+
IconResource=C:\Windows\System32\SHELL32.dll,41
3+
[ViewState]
4+
Mode=
5+
Vid=
6+
FolderType=Generic

0 commit comments

Comments
 (0)