Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addon-onboarding: Move onboarding to monorepo #26176

Merged
merged 391 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
391 commits
Select commit Hold shift + click to select a range
245de33
Bump version to: 0.0.21 [skip ci]
Jun 8, 2023
40ce2c4
improve README
yannbf Jun 8, 2023
004a238
fix query parameter when skipping onboarding
yannbf Jun 8, 2023
35a9153
change the way the addon is triggered, warn user upon completion
yannbf Jun 8, 2023
3f0e1eb
Improved confetti look and feel
cdedreuille Jun 8, 2023
4c88ac0
Merge pull request #43 from storybookjs/fix/improve-confetti
cdedreuille Jun 8, 2023
74f2d86
Merge branch 'main' into feat/misc-fixes
cdedreuille Jun 8, 2023
f2bfd23
Update CHANGELOG.md [skip ci]
Jun 8, 2023
a4f9388
Bump version to: 0.0.22 [skip ci]
Jun 8, 2023
cad9470
Merge pull request #44 from storybookjs/feat/misc-fixes
cdedreuille Jun 8, 2023
2835e60
Update CHANGELOG.md [skip ci]
Jun 8, 2023
43491e1
Bump version to: 0.0.23 [skip ci]
Jun 8, 2023
e8c20d9
use the correct event to detect args change
yannbf Jun 8, 2023
ac7ecc6
Merge pull request #45 from storybookjs/fix/control-toggle-step
yannbf Jun 8, 2023
e51e3db
Update CHANGELOG.md [skip ci]
Jun 8, 2023
5f27441
Bump version to: 0.0.24 [skip ci]
Jun 8, 2023
014c2ee
improve addon bootstrapping
yannbf Jun 8, 2023
9331c8a
Start removing the opening and closing anim on modal
cdedreuille Jun 8, 2023
e7cfba6
change last step
yannbf Jun 8, 2023
7f9dcc7
Skip onboarding cleanup
cdedreuille Jun 8, 2023
c779e85
fix writeStories story
yannbf Jun 8, 2023
569a919
Merge pull request #46 from storybookjs/fix/improve-addon-bootstrapping
cdedreuille Jun 8, 2023
97e1ac3
Merge branch 'main' into remove-animation-modal
cdedreuille Jun 8, 2023
31de9f1
Update CHANGELOG.md [skip ci]
Jun 8, 2023
1395d78
Bump version to: 0.0.25 [skip ci]
Jun 8, 2023
69a984a
Fix conflicts
cdedreuille Jun 8, 2023
191af16
Merge pull request #47 from storybookjs/remove-animation-modal
yannbf Jun 8, 2023
c142e14
Update CHANGELOG.md [skip ci]
Jun 8, 2023
247c877
Bump version to: 0.0.26 [skip ci]
Jun 8, 2023
33995a8
add previous button to write stories modal
yannbf Jun 9, 2023
e9e2981
Improve Button styling of previous
cdedreuille Jun 9, 2023
5035011
Merge pull request #48 from storybookjs/feat/add-previous-button-to-m…
cdedreuille Jun 9, 2023
98a5602
Update CHANGELOG.md [skip ci]
Jun 9, 2023
da2499e
Bump version to: 0.0.27 [skip ci]
Jun 9, 2023
56231ae
fix bug where button was out of place
yannbf Jun 9, 2023
5c830ee
improve texts
yannbf Jun 9, 2023
786e8ac
WIP add configure your project layout
yannbf Jun 12, 2023
5900eea
Update Introduction.mdx
cdedreuille Jun 12, 2023
bd8e606
Added 3 images
cdedreuille Jun 12, 2023
bf4ea29
Update Introduction.mdx
cdedreuille Jun 12, 2023
12818b4
Merge pull request #49 from storybookjs/feat/overall-improvements
cdedreuille Jun 12, 2023
7e6aff1
Update CHANGELOG.md [skip ci]
Jun 12, 2023
024ca07
Bump version to: 0.0.28 [skip ci]
Jun 12, 2023
7271aac
[skip ci] fix anchor styles
yannbf Jun 12, 2023
4dba997
Merge branch 'main' into valentin/implement-tracking
yannbf Jun 13, 2023
006f101
[skip ci] update copy
yannbf Jun 13, 2023
69103b8
wrap up presets
yannbf Jun 13, 2023
3282e5c
cleanup
yannbf Jun 13, 2023
e99afd9
cleanup dependencies
yannbf Jun 13, 2023
7f64975
Update CHANGELOG.md [skip ci]
Jun 13, 2023
755bfca
Bump version to: 0.0.29 [skip ci]
Jun 13, 2023
e1445ac
[skip ci] cleanup
yannbf Jun 13, 2023
4b3e02d
fix dependencies
yannbf Jun 13, 2023
9cbd35d
switch to pnpm
yannbf Jun 13, 2023
db0cd1c
Merge branch 'main' into valentin/implement-tracking
yannbf Jun 13, 2023
f8197a1
adjust scripts
yannbf Jun 13, 2023
e082a12
fix peer deps
yannbf Jun 13, 2023
ce4e7a6
update test instructions
yannbf Jun 13, 2023
9b151a4
Merge pull request #40 from storybookjs/valentin/implement-tracking
yannbf Jun 13, 2023
0b4d759
Update CHANGELOG.md [skip ci]
Jun 13, 2023
71379f9
Bump version to: 0.0.30 [skip ci]
Jun 13, 2023
b26f2a1
Copy tweaks
shilman Jun 14, 2023
cbab81a
Oops
shilman Jun 14, 2023
61fffcd
Merge pull request #50 from storybookjs/shilman/copy-tweaks
yannbf Jun 14, 2023
da190f1
Update CHANGELOG.md [skip ci]
Jun 14, 2023
f66abbb
Bump version to: 0.0.31 [skip ci]
Jun 14, 2023
9a9b85d
Added the missing Story type
cdedreuille Jun 14, 2023
2a73dfa
Fixes the highlighter language
cdedreuille Jun 14, 2023
3a67213
Add missing type for Nextjs
cdedreuille Jun 14, 2023
ecf9f9e
Fix some unnecessary outline
cdedreuille Jun 14, 2023
1aab375
Fix syntaxHighlighter moving when initialised
cdedreuille Jun 14, 2023
4d49654
Fix the backdrop moving
cdedreuille Jun 14, 2023
90d99d1
Update SyntaxHighlighter.tsx
cdedreuille Jun 14, 2023
1300d8e
Update SyntaxHighlighter.stories.tsx
cdedreuille Jun 14, 2023
21b3e99
Put path underneath the text
cdedreuille Jun 14, 2023
78f3e71
Update SyntaxHighlighter.stories.tsx
cdedreuille Jun 14, 2023
cda7cd6
fix story test
yannbf Jun 14, 2023
f943f1f
Merge pull request #51 from storybookjs/fixes-on-syntax-highlighter
yannbf Jun 14, 2023
f3cebc0
Update CHANGELOG.md [skip ci]
Jun 14, 2023
e0350d8
Bump version to: 0.0.32 [skip ci]
Jun 14, 2023
939beb1
misc fixes
yannbf Jun 14, 2023
bc0de14
Merge pull request #52 from storybookjs/misc-fixes
yannbf Jun 14, 2023
c88ea7a
Update CHANGELOG.md [skip ci]
Jun 14, 2023
23e43db
Bump version to: 0.0.33 [skip ci]
Jun 14, 2023
015826f
Update Introduction.mdx
cdedreuille Jun 14, 2023
471a550
Merge pull request #53 from storybookjs/fix-configuration-layout
yannbf Jun 14, 2023
a851e97
Update CHANGELOG.md [skip ci]
Jun 14, 2023
cedfe8e
Bump version to: 0.0.34 [skip ci]
Jun 14, 2023
bacbacc
[skip ci] rename Introduction.mdx file
yannbf Jun 14, 2023
b09015a
[skip ci] add min-width to section img
yannbf Jun 14, 2023
f522dec
add dark mode styles to tooltip
yannbf Jun 15, 2023
3fb8b82
fix watch mode
yannbf Jun 15, 2023
73cda09
Merge pull request #55 from storybookjs/fix/watch-mode
yannbf Jun 15, 2023
9077091
fix button animation
yannbf Jun 15, 2023
8463de1
fix tooltip size
yannbf Jun 15, 2023
f640780
Merge pull request #56 from storybookjs/fix/ui-fixes
cdedreuille Jun 16, 2023
f80b37a
Merge pull request #54 from storybookjs/feat/dark-mode-tooltip
cdedreuille Jun 16, 2023
eecb37c
Update CHANGELOG.md [skip ci]
Jun 16, 2023
e844070
Bump version to: 0.0.35 [skip ci]
Jun 16, 2023
96a0c60
Fix secondary button background
cdedreuille Jun 16, 2023
6cc1a93
Fixed tooltip colour in dark mode
cdedreuille Jun 16, 2023
a5dbb09
fix tooltip in dark mode
yannbf Jun 16, 2023
ddefce1
Merge remote-tracking branch 'origin/feat/tooltip-border' into improv…
cdedreuille Jun 16, 2023
cc0f34a
Fix some details on dark and light mode
cdedreuille Jun 16, 2023
917f09a
Merge pull request #58 from storybookjs/improve-dark-mode
cdedreuille Jun 16, 2023
997e2e8
Update CHANGELOG.md [skip ci]
Jun 16, 2023
e1d0310
Bump version to: 0.0.36 [skip ci]
Jun 16, 2023
6769eeb
fix spotlight distance, border radius and overlay border
yannbf Jun 19, 2023
5dcd1f0
Add some small fixes to the highlighter
cdedreuille Jun 19, 2023
60ceb81
Fi the line below the header title
cdedreuille Jun 19, 2023
7bc5014
Small updates
cdedreuille Jun 19, 2023
b9a800e
Update WriteStoriesModal.styled.tsx
cdedreuille Jun 19, 2023
32f989c
Merge pull request #61 from storybookjs/fix/more-ui-fixes
cdedreuille Jun 19, 2023
3208c71
Update CHANGELOG.md [skip ci]
Jun 19, 2023
d7adb82
Bump version to: 0.0.37 [skip ci]
Jun 19, 2023
6768a55
pass addon version in telemetry event
yannbf Jun 19, 2023
272692c
Merge pull request #62 from storybookjs/feat/version-in-events
valentinpalkovic Jun 19, 2023
7a3f2b1
Update CHANGELOG.md [skip ci]
Jun 19, 2023
9e827bc
Bump version to: 0.0.38 [skip ci]
Jun 19, 2023
616da39
Fix preset.js entry point
valentinpalkovic Jun 20, 2023
6b784e7
Fix comment in code section
valentinpalkovic Jun 20, 2023
b540c5d
Merge pull request #64 from storybookjs/fix-comment-in-code-section
valentinpalkovic Jun 20, 2023
5e4810a
Update CHANGELOG.md [skip ci]
Jun 20, 2023
3b01870
Bump version to: 0.0.39 [skip ci]
Jun 20, 2023
fbb1a1b
Merge branch 'main' into fix-preset-js-entry
valentinpalkovic Jun 20, 2023
aadb757
Merge pull request #63 from storybookjs/fix-preset-js-entry
valentinpalkovic Jun 20, 2023
d7b2003
Update CHANGELOG.md [skip ci]
Jun 20, 2023
b4c57d1
Bump version to: 0.0.40 [skip ci]
Jun 20, 2023
405d22d
Minor improvements
valentinpalkovic Jun 21, 2023
f481459
Merge pull request #65 from storybookjs/valentin/minor-improvements
valentinpalkovic Jun 21, 2023
af45ca4
Update CHANGELOG.md [skip ci]
Jun 21, 2023
7b1d89d
Bump version to: 0.0.41 [skip ci]
Jun 21, 2023
9e9f0ab
remove unnecessary code step for nextjs
yannbf Jun 21, 2023
f14b4ce
update configure mdx
yannbf Jun 21, 2023
6be486a
upgrade storybook deps
yannbf Jun 21, 2023
45e393c
Merge pull request #66 from storybookjs/fix/nextjs-typescript-source
yannbf Jun 21, 2023
320dd0e
Update CHANGELOG.md [skip ci]
Jun 21, 2023
4359334
Bump version to: 0.0.42 [skip ci]
Jun 21, 2023
7eb8f84
fix links in configure.mdx [skip ci]
yannbf Jun 21, 2023
06a8d19
Merge pull request #67 from storybookjs/fix/mdx-links
yannbf Jun 21, 2023
7a25b91
Fix react joyride in yarn pnp mode
valentinpalkovic Jun 22, 2023
d0f4736
Merge pull request #69 from storybookjs/valentin/fix-react-joyride-in…
valentinpalkovic Jun 22, 2023
515fcf0
Update CHANGELOG.md [skip ci]
Jun 22, 2023
510cb8a
Bump version to: 0.0.43 [skip ci]
Jun 22, 2023
ecf0c58
Fix text for Javascript Projects
valentinpalkovic Jun 22, 2023
e66f5c5
Merge branch 'main' into valentin/fix-text-for-javascript-projects
valentinpalkovic Jun 22, 2023
1b5b39c
Merge pull request #68 from storybookjs/valentin/fix-text-for-javascr…
valentinpalkovic Jun 22, 2023
0bab026
[skip ci]: Update README.md
valentinpalkovic Jun 22, 2023
06e37fe
Release 1.0.0
valentinpalkovic Jun 22, 2023
d4b3387
Update auto.config.js to reset to default labels
valentinpalkovic Jun 22, 2023
599aed3
Merge pull request #70 from storybookjs/valentin/1.0.0-release
valentinpalkovic Jun 22, 2023
9becc2e
Update CHANGELOG.md [skip ci]
Jun 22, 2023
3350d34
Bump version to: 1.0.0 [skip ci]
Jun 22, 2023
0e45505
Fix build assets
valentinpalkovic Jun 22, 2023
bbe5eb8
Merge pull request #71 from storybookjs/valentin/fix-build-assets
valentinpalkovic Jun 22, 2023
44f3ce1
Update CHANGELOG.md [skip ci]
Jun 22, 2023
399fecc
Bump version to: 1.0.1 [skip ci]
Jun 22, 2023
37bb3b0
Fix package.json version extraction
valentinpalkovic Jun 22, 2023
be7922a
Do not log welcome event twice
valentinpalkovic Jun 22, 2023
940c761
Use fs to read package.json during runtime
valentinpalkovic Jun 22, 2023
f943172
Increase timeout on syntaxhighlighter
valentinpalkovic Jun 22, 2023
35f429c
Merge pull request #72 from storybookjs/valentin/fix-package-json-ver…
valentinpalkovic Jun 22, 2023
06786f5
Update CHANGELOG.md [skip ci]
Jun 22, 2023
c2d9b6c
Bump version to: 1.0.2 [skip ci]
Jun 22, 2023
bb7a9bb
display the button story filename in tooltip
yannbf Jun 23, 2023
7cade1c
fix stories
yannbf Jun 23, 2023
74a44cb
Merge pull request #73 from storybookjs/feat/display-filename-in-tooltip
yannbf Jun 23, 2023
dbbc333
Update CHANGELOG.md [skip ci]
Jun 23, 2023
7fcc007
Bump version to: 1.0.3 [skip ci]
Jun 23, 2023
eb22573
initial styling update for v10
JReinhold Jul 4, 2023
aef957a
fix spacing, update assets
JReinhold Jul 5, 2023
e7addea
Update copy
JReinhold Jul 5, 2023
f237b33
update image alts
JReinhold Jul 5, 2023
557031f
replace chevron with right-arrow
JReinhold Jul 5, 2023
5385a02
Add the addon section
cdedreuille Jul 6, 2023
4af5e6a
Update SyntaxHighlighter.stories.tsx
cdedreuille Jul 6, 2023
ad350d6
Fix responsive issues
cdedreuille Jul 6, 2023
85c1178
Update Configure.mdx
cdedreuille Jul 6, 2023
89bbe97
Merge pull request #74 from storybookjs/update-configure-page-styles
cdedreuille Jul 6, 2023
7b88cf3
Update CHANGELOG.md [skip ci]
Jul 6, 2023
4e713e3
Bump version to: 1.0.4 [skip ci]
Jul 6, 2023
33810e6
remove nextjs-specific code
yannbf Jul 10, 2023
c78d3bd
Merge pull request #75 from storybookjs/fix/language-examples
valentinpalkovic Jul 10, 2023
ee6e7ab
Update CHANGELOG.md [skip ci]
Jul 10, 2023
7276282
Bump version to: 1.0.5 [skip ci]
Jul 10, 2023
4f74e6d
Fix language detection
valentinpalkovic Jul 10, 2023
1fa4e72
Merge pull request #76 from storybookjs/valentin/fix-language-detection
valentinpalkovic Jul 10, 2023
5a0156c
Update CHANGELOG.md [skip ci]
Jul 10, 2023
78e1108
Bump version to: 1.0.6 [skip ci]
Jul 10, 2023
b895661
Replace chevron icon on Configure page to avoid @storybook/components…
valentinpalkovic Jul 11, 2023
e286b7d
Merge pull request #77 from storybookjs/valentin/replace-chevron-icon…
valentinpalkovic Jul 11, 2023
c5d00e2
Update CHANGELOG.md [skip ci]
Jul 11, 2023
1d215c5
Bump version to: 1.0.7 [skip ci]
Jul 11, 2023
fc52bf1
Create CODEOWNERS
valentinpalkovic Jul 20, 2023
c7d495a
Update CHANGELOG.md [skip ci]
Jul 20, 2023
f9003d9
Bump version to: 1.0.8 [skip ci]
Jul 20, 2023
a21205b
fix z-index in modal elements
cdedreuille Sep 26, 2023
623d2b2
update step selector
yannbf Sep 26, 2023
91e23d0
update telemetry version
yannbf Dec 1, 2023
3e0df9a
Merge pull request #79 from storybookjs/fix/upgrade-telemetry
yannbf Dec 1, 2023
0dda21a
Update CHANGELOG.md [skip ci]
Dec 1, 2023
cafd630
Bump version to: 1.0.9 [skip ci]
Dec 1, 2023
e30e708
Fix Yarn remove command in README
githrdw Dec 11, 2023
4b7e5e4
Merge pull request #80 from githrdw/fix/yarn-remove-command
valentinpalkovic Dec 11, 2023
acec985
Update CHANGELOG.md [skip ci]
Dec 11, 2023
346e139
Bump version to: 1.0.10 [skip ci]
Dec 11, 2023
9bdace7
Revert "update step selector"
yannbf Dec 27, 2023
8f95282
Merge pull request #78 from storybookjs/charles/fix-z-index
yannbf Dec 27, 2023
dc9d5ea
make selectors storybook 8 compatible
yannbf Dec 27, 2023
b82da02
Merge pull request #81 from storybookjs/fix/storybook-8
yannbf Dec 27, 2023
870db45
add z-index wrapper
ndelangen Jan 23, 2024
08ed7fc
Merge pull request #82 from storybookjs/norbert/fix-z-index
yannbf Jan 23, 2024
360b17b
Update CHANGELOG.md [skip ci]
Jan 23, 2024
9da85cb
Bump version to: 1.0.11 [skip ci]
Jan 23, 2024
dfd1d9c
Add Storybook 8.0 support
Jan 24, 2024
4019311
Fix Chromatic GH Action
Jan 24, 2024
bbb5f5b
Update Node.js version on CI to 18.x
valentinpalkovic Jan 24, 2024
2e7c31e
Remove duplicate auto config
valentinpalkovic Jan 24, 2024
ce99b28
Upgrade dependencies
valentinpalkovic Jan 24, 2024
fe09b4b
Fix type issues
valentinpalkovic Jan 24, 2024
047c2ec
Format tsup.config.ts
valentinpalkovic Jan 25, 2024
245bbce
Merge pull request #84 from storybookjs/valentin/add-sb-8-support
valentinpalkovic Jan 25, 2024
35f562f
Replace deprecated Icon component
valentinpalkovic Jan 25, 2024
1c18b81
Merge pull request #85 from storybookjs/valentin/replace-deprecated-i…
valentinpalkovic Jan 25, 2024
6cf3e64
Add esbuild options for handling PNG files
valentinpalkovic Jan 26, 2024
9eec28b
Merge pull request #86 from storybookjs/valentin/fix-image-embedding
valentinpalkovic Jan 26, 2024
a2f275a
add script
ndelangen Feb 23, 2024
172497e
delete files not needed for merge
ndelangen Feb 23, 2024
db74dd7
move files to nester directory
ndelangen Feb 23, 2024
7f63e60
Merge branch 'norbert/prep-for-merge' of github.com:storybookjs/addon…
ndelangen Feb 23, 2024
5bf7327
remove import-repo script, didn't end up using it
ndelangen Feb 23, 2024
ba5cc6c
connect to monorepo & linting fixes
ndelangen Feb 23, 2024
596f3d9
update CLI with new package version
ndelangen Feb 23, 2024
6827ee0
add to root, fix typos
ndelangen Feb 23, 2024
bdff5a2
fix react-confetti & add safety catches
ndelangen Feb 23, 2024
b2caeba
typescript fixes / workarounds
ndelangen Feb 23, 2024
d9bde9d
Merge branch 'next' into monorepo-migration
ndelangen Feb 23, 2024
50c3157
cleanup
ndelangen Feb 23, 2024
25ee02d
remove stories that are unused
ndelangen Feb 23, 2024
e72e3b2
Merge branch 'next' into monorepo-migration
ndelangen Feb 23, 2024
67206cd
fixes
ndelangen Feb 24, 2024
de94881
bump
ndelangen Feb 24, 2024
58a54fa
arg, that explains it
ndelangen Feb 24, 2024
ad9b18a
replace `as any` with slightly less worse code
ndelangen Feb 27, 2024
2c22292
bundle in images into addon entries destined fro the browser
ndelangen Feb 27, 2024
11525f5
remove try-catch as per https://github.com/storybookjs/storybook/pull…
ndelangen Feb 27, 2024
0496de9
Update code/addons/onboarding/src/App.tsx
ndelangen Feb 27, 2024
e072ee4
Merge branch 'next' into monorepo-migration
ndelangen Feb 27, 2024
27eaa3f
Update code/addons/onboarding/src/manager.tsx
yannbf Feb 27, 2024
e03e42e
Merge branch 'next' into monorepo-migration
ndelangen Feb 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
686 changes: 686 additions & 0 deletions code/addons/onboarding/CHANGELOG.md

Large diffs are not rendered by default.

50 changes: 50 additions & 0 deletions code/addons/onboarding/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Storybook Addon Onboarding

This addon provides a guided tour in some of Storybook's features, helping you get to know about the basics of Storybook and learn how to write stories!

![](./.github/assets/onboarding-intro.png)

## Triggering the onboarding

This addon comes installed by default in Storybook projects and should trigger automatically.
If you want to retrigger the addon, you should make sure that your Storybook still contains the example stories that come when initializing Storybook, and you can then navigate to http://localhost:6006/?path=/onboarding after running Storybook.

## Uninstalling

This addon serves to provide you a guided experience on the basics of Storybook. Once you are done, the addon is therefore not needed anymore and will not get activated (unless triggered manually), so you can freely remove it. Here's how to do so:

### 1. Remove the dependency

yarn:

```zsh
yarn remove @storybook/addon-onboarding
```

npm:

```zsh
npm uninstall -D @storybook/addon-onboarding
```

pnpm:

```zsh
pnpm remove -D @storybook/addon-onboarding
```

### 2. Remove the addon in your `.storybook/main.js` file

```diff
const config = {
stories: [
"../stories/**/*.stories.mdx",
"../stories/**/*.stories.@(js|jsx|ts|tsx)",
],
addons: [
"@storybook/addon-essentials",
- "@storybook/addon-onboarding"
],
};
export default config;
```
83 changes: 83 additions & 0 deletions code/addons/onboarding/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"name": "@storybook/addon-onboarding",
"version": "8.0.0-beta.5",
"description": "Storybook Addon Onboarding - Introduces a new onboarding experience",
"keywords": [
"storybook-addons",
"addon-onboarding"
],
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/addons/onboarding",
"bugs": {
"url": "https://github.com/storybookjs/storybook/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/storybookjs/storybook.git",
"directory": "code/addons/onboarding"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/storybook"
},
"license": "MIT",
"exports": {
".": {
"types": "./dist/index.d.ts",
"node": "./dist/index.js",
"require": "./dist/index.js",
"import": "./dist/index.mjs"
},
"./manager": "./dist/manager.js",
"./preset": "./dist/preset.js",
"./package.json": "./package.json"
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist/**/*",
"README.md",
"*.js",
"*.d.ts",
"!src/**/*"
],
"scripts": {
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
},
"devDependencies": {
"@radix-ui/react-dialog": "^1.0.5",
"@storybook/channels": "workspace:*",
"@storybook/components": "workspace:*",
"@storybook/core-events": "workspace:*",
"@storybook/icons": "^1.2.5",
"@storybook/manager-api": "workspace:*",
"@storybook/react": "workspace:*",
"@storybook/telemetry": "workspace:*",
"@storybook/test": "workspace:*",
"@storybook/testing-library": "next",
"@storybook/theming": "workspace:*",
"@storybook/types": "workspace:*",
"framer-motion": "^11.0.3",
"react": "^18.2.0",
"react-confetti": "^6.1.0",
"react-dom": "^18.2.0",
"react-joyride": "^2.7.2",
"react-use-measure": "^2.1.1",
"typescript": "^5.3.2"
},
"publishConfig": {
"access": "public"
},
"bundler": {
"exportEntries": [
"./src/index.ts"
],
"managerEntries": [
"./src/manager.tsx"
],
"nodeEntries": [
"./src/preset.ts"
]
}
}
8 changes: 8 additions & 0 deletions code/addons/onboarding/preset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
function managerEntries(entry = []) {
Copy link
Member

@shilman shilman Feb 25, 2024

Choose a reason for hiding this comment

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

I know this PR is just porting over the existing code, but any idea why this is needed? If there is a good reason we should add a comment here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I have no idea.

We'd have to ask the authors @yannbf or @valentinpalkovic ?

Copy link
Contributor

Choose a reason for hiding this comment

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

@shilman Could you please be a bit more precise about what exactly you are referring to? Are you saying that the managerEntries should just be exported in the src/preset.ts file like described here: https://storybook.js.org/docs/addons/writing-presets#root-level-presets? I don't understand the intention of your question.

return [...entry, require.resolve('./dist/manager.mjs')];
}

module.exports = {
managerEntries,
...require('./dist/preset'),
};
6 changes: 6 additions & 0 deletions code/addons/onboarding/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "@storybook/addon-onboarding",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"implicitDependencies": [],
"type": "library"
}
158 changes: 158 additions & 0 deletions code/addons/onboarding/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
import React, { useCallback, useEffect, useState } from 'react';
import { ThemeProvider, convert } from '@storybook/theming';
import { addons, type API } from '@storybook/manager-api';

import { GuidedTour } from './features/GuidedTour/GuidedTour';
import { WelcomeModal } from './features/WelcomeModal/WelcomeModal';
import { WriteStoriesModal } from './features/WriteStoriesModal/WriteStoriesModal';
import { Confetti } from './components/Confetti/Confetti';
import { STORYBOOK_ADDON_ONBOARDING_CHANNEL } from './constants';
import { useGetProject } from './features/WriteStoriesModal/hooks/useGetProject';

type Step =
| '1:Welcome'
| '2:StorybookTour'
| '3:WriteYourStory'
| '4:VisitNewStory'
| '5:ConfigureYourProject';

const theme = convert();

export default function App({ api }: { api: API }) {
const [enabled, setEnabled] = useState(true);
const [showConfetti, setShowConfetti] = useState(false);
const [step, setStep] = useState<Step>('1:Welcome');
const { data: codeSnippets } = useGetProject();

const skipOnboarding = useCallback(() => {
// remove onboarding query parameter from current url
const url = new URL(window.location.href);
const path = decodeURIComponent(url.searchParams.get('path') as any);
ndelangen marked this conversation as resolved.
Show resolved Hide resolved
url.search = `?path=${path}&onboarding=false`;
history.replaceState({}, '', url.href);
api.setQueryParams({ onboarding: 'false' });
setEnabled(false);
}, [setEnabled, api]);

useEffect(() => {
api.emit(STORYBOOK_ADDON_ONBOARDING_CHANNEL, {
step: '1:Welcome',
type: 'telemetry',
});
}, []);

useEffect(() => {
if (step !== '1:Welcome') {
api.emit(STORYBOOK_ADDON_ONBOARDING_CHANNEL, {
step,
type: 'telemetry',
});
}
}, [api, step]);

useEffect(() => {
let stepTimeout: number;
if (step === '4:VisitNewStory') {
setShowConfetti(true);
stepTimeout = window.setTimeout(() => {
setStep('5:ConfigureYourProject');
}, 2000);
}

return () => {
clearTimeout(stepTimeout);
};
}, [step]);

useEffect(() => {
const storyId = api.getCurrentStoryData()?.id;
api.setQueryParams({ onboarding: 'true' });
// make sure the initial state is set correctly:
// 1. Selected story is primary button
// 2. The addon panel is opened, in the bottom and the controls tab is selected
if (storyId !== 'example-button--primary') {
try {
api.selectStory('example-button--primary', undefined, {
ref: undefined,
});
} catch (e) {
//
}
}
}, []);

if (!enabled) {
return null;
}

return (
<ThemeProvider theme={theme}>
{enabled && showConfetti && (
<Confetti
numberOfPieces={800}
recycle={false}
tweenDuration={20000}
onConfettiComplete={(confetti) => {
confetti?.reset();
setShowConfetti(false);
}}
/>
)}
{enabled && step === '1:Welcome' && (
<WelcomeModal
onProceed={() => {
setStep('2:StorybookTour');
}}
skipOnboarding={() => {
skipOnboarding();

api.emit(STORYBOOK_ADDON_ONBOARDING_CHANNEL, {
step: 'X:SkippedOnboarding',
where: 'WelcomeModal',
type: 'telemetry',
});
}}
/>
)}
{enabled && (step === '2:StorybookTour' || step === '5:ConfigureYourProject') && (
<GuidedTour
api={api}
isFinalStep={step === '5:ConfigureYourProject'}
onFirstTourDone={() => {
setStep('3:WriteYourStory');
}}
codeSnippets={codeSnippets as any}
onLastTourDone={() => {
try {
api.selectStory('configure-your-project--docs');
} catch (e) {
//
}
api.emit(STORYBOOK_ADDON_ONBOARDING_CHANNEL, {
step: '6:FinishedOnboarding',
type: 'telemetry',
});
skipOnboarding();
}}
/>
)}
{enabled && step === '3:WriteYourStory' && (
<WriteStoriesModal
api={api}
codeSnippets={codeSnippets as any}
addonsStore={addons}
onFinish={() => {
try {
api.selectStory('example-button--primary');
ndelangen marked this conversation as resolved.
Show resolved Hide resolved
} catch (e) {
//
}

setStep('4:VisitNewStory');
}}
skipOnboarding={skipOnboarding}
/>
)}
</ThemeProvider>
);
}
15 changes: 15 additions & 0 deletions code/addons/onboarding/src/components/Button/Button.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { Meta, StoryObj } from '@storybook/react';
import { Button } from './Button';

const meta: Meta<typeof Button> = {
title: 'Components/Button',
component: Button,
};

export default meta;

type Story = StoryObj<typeof Button>;

export const Default: Story = {
args: { children: 'Button' },
};
Loading
Loading