-
-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: nested grouping of stories with "group/story" syntax (#486)
- Loading branch information
Showing
35 changed files
with
1,071 additions
and
345 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
module.exports = { | ||
root: true, | ||
extends: '@react-native', | ||
|
||
// overrides: [...conf.overrides, { files: ['*.ts', '*.tsx'], rules: { 'no-undef': 'off' } }], | ||
rules: { | ||
'react-native/no-inline-styles': 'off', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,6 @@ node_modules | |
*.log | ||
.idea | ||
*.iml | ||
.vscode/* | ||
!.vscode/launch.json | ||
*.sw* | ||
npm-shrinkwrap.json | ||
dist | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"typescript.tsdk": "node_modules/typescript/lib" | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export { default } from './.storybook/Storybook'; | ||
export { default } from './.storybook'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
examples/expo-example/components/NestingExample/ChatMessage.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import type { ComponentMeta, ComponentStoryObj } from '@storybook/react-native'; | ||
import { Text } from 'react-native'; | ||
import React from 'react'; | ||
|
||
const MyComponent = ({ text }) => <Text>{text}</Text>; | ||
|
||
export default { | ||
title: 'NestingExample/Message', | ||
component: MyComponent, | ||
} as ComponentMeta<typeof MyComponent>; | ||
|
||
export const MessageFirst: ComponentStoryObj<typeof MyComponent> = { | ||
args: { | ||
text: 'Hello', | ||
}, | ||
}; | ||
|
||
export const MessageSecond: ComponentStoryObj<typeof MyComponent> = { | ||
args: { | ||
text: 'Message two', | ||
}, | ||
}; |
23 changes: 23 additions & 0 deletions
23
examples/expo-example/components/NestingExample/ChatMessageBubble.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import type { ComponentMeta, ComponentStoryObj } from '@storybook/react-native'; | ||
import { Text } from 'react-native'; | ||
import React from 'react'; | ||
|
||
const MyComponent = ({ text }) => <Text>{text}</Text>; | ||
|
||
export default { | ||
title: 'NestingExample/Message/bubble', | ||
component: MyComponent, | ||
} as ComponentMeta<typeof MyComponent>; | ||
|
||
export const First: ComponentStoryObj<typeof MyComponent> = { | ||
args: { | ||
text: 'First', | ||
}, | ||
}; | ||
|
||
export const Second: ComponentStoryObj<typeof MyComponent> = { | ||
storyName: 'Second Story', | ||
args: { | ||
text: 'Second', | ||
}, | ||
}; |
24 changes: 24 additions & 0 deletions
24
examples/expo-example/components/NestingExample/ChatMessageBubbleAgain.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import type { ComponentMeta, ComponentStoryObj } from '@storybook/react-native'; | ||
import { Text } from 'react-native'; | ||
import React from 'react'; | ||
|
||
const MyComponent = ({ text }) => <Text>{text}</Text>; | ||
|
||
export default { | ||
title: | ||
'NestingExample/Message/bubble/a very long name for a title that just keeps going and going', | ||
component: MyComponent, | ||
} as ComponentMeta<typeof MyComponent>; | ||
|
||
export const First: ComponentStoryObj<typeof MyComponent> = { | ||
args: { | ||
text: 'First', | ||
}, | ||
}; | ||
|
||
export const Second: ComponentStoryObj<typeof MyComponent> = { | ||
storyName: 'Second Story', | ||
args: { | ||
text: 'Second', | ||
}, | ||
}; |
16 changes: 16 additions & 0 deletions
16
examples/expo-example/components/NestingExample/ChatMessageMessageInput.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { ComponentMeta, ComponentStoryObj } from '@storybook/react-native'; | ||
import { Text } from 'react-native'; | ||
import React from 'react'; | ||
|
||
const MyComponent = ({ text }) => <Text>{text}</Text>; | ||
|
||
export default { | ||
title: 'NestingExample/MessageInput', | ||
component: MyComponent, | ||
} as ComponentMeta<typeof MyComponent>; | ||
|
||
export const Basic: ComponentStoryObj<typeof MyComponent> = { | ||
args: { | ||
text: 'Hello', | ||
}, | ||
}; |
22 changes: 22 additions & 0 deletions
22
examples/expo-example/components/NestingExample/ChatMessageReactions.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import type { ComponentMeta, ComponentStoryObj } from '@storybook/react-native'; | ||
import { Text } from 'react-native'; | ||
import React from 'react'; | ||
|
||
const MyComponent = ({ text }) => <Text>{text}</Text>; | ||
|
||
export default { | ||
title: 'NestingExample/Message/Reactions', | ||
component: MyComponent, | ||
} as ComponentMeta<typeof MyComponent>; | ||
|
||
export const MessageOne: ComponentStoryObj<typeof MyComponent> = { | ||
args: { | ||
text: 'Hello', | ||
}, | ||
}; | ||
|
||
export const MessageTwo: ComponentStoryObj<typeof MyComponent> = { | ||
args: { | ||
text: 'Message two', | ||
}, | ||
}; |
71 changes: 71 additions & 0 deletions
71
examples/expo-example/components/NestingExample/StoryList.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { ComponentMeta, ComponentStoryObj } from '@storybook/react'; | ||
import StoryListView from '@storybook/react-native/dist/preview/components/StoryListView/StoryListView'; | ||
|
||
export default { | ||
title: 'StoryListView', | ||
component: StoryListView, | ||
} as ComponentMeta<typeof StoryListView>; | ||
|
||
export const Basic: ComponentStoryObj<typeof StoryListView> = { | ||
args: { | ||
storyIndex: { | ||
stories: { | ||
'chat-message--message-first': { | ||
id: 'chat-message--message-first', | ||
importPath: './components/NestingExample/ChatMessage.stories.tsx', | ||
name: 'Message First', | ||
title: 'Chat/Message', | ||
}, | ||
'chat-message--message-second': { | ||
id: 'chat-message--message-second', | ||
importPath: './components/NestingExample/ChatMessage.stories.tsx', | ||
name: 'Message Second', | ||
title: 'Chat/Message', | ||
}, | ||
'chat-message-bubble--first': { | ||
id: 'chat-message-bubble--first', | ||
importPath: './components/NestingExample/ChatMessageBubble.stories.tsx', | ||
name: 'First', | ||
title: 'Chat/Message/bubble', | ||
}, | ||
'chat-message-bubble--second': { | ||
id: 'chat-message-bubble--second', | ||
importPath: './components/NestingExample/ChatMessageBubble.stories.tsx', | ||
name: 'Second Story', | ||
title: 'Chat/Message/bubble', | ||
}, | ||
'chat-message-reactions--message-one': { | ||
id: 'chat-message-reactions--message-one', | ||
importPath: './components/NestingExample/ChatMessageReactions.stories.tsx', | ||
name: 'Message One', | ||
title: 'Chat/Message/Reactions', | ||
}, | ||
'chat-message-reactions--message-two': { | ||
id: 'chat-message-reactions--message-two', | ||
importPath: './components/NestingExample/ChatMessageReactions.stories.tsx', | ||
name: 'Message Two', | ||
title: 'Chat/Message/Reactions', | ||
}, | ||
'chat-messageinput--basic': { | ||
id: 'chat-messageinput--basic', | ||
importPath: './components/NestingExample/ChatMessageMessageInput.stories.tsx', | ||
name: 'Basic', | ||
title: 'Chat/MessageInput', | ||
}, | ||
'storylistview--basic': { | ||
id: 'storylistview--basic', | ||
importPath: './components/NestingExample/StoryList.stories.tsx', | ||
name: 'Basic', | ||
title: 'StoryListView', | ||
}, | ||
'text-control--basic': { | ||
id: 'text-control--basic', | ||
importPath: './components/ControlExamples/Text/Text.stories.tsx', | ||
name: 'Basic', | ||
title: 'Text control', | ||
}, | ||
}, | ||
v: 3, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.