-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'next' into kasper/test-package
- Loading branch information
Showing
17 changed files
with
149 additions
and
30 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 |
---|---|---|
|
@@ -88,15 +88,6 @@ jobs: | |
git config --global user.email '[email protected]' | ||
yarn release:pick-patches | ||
- name: Cancel when 0 picked | ||
if: steps.pick-patches.outputs.pr-count == '0' | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# From https://stackoverflow.com/a/75809743 | ||
run: | | ||
gh run cancel ${{ github.run_id }} | ||
gh run watch ${{ github.run_id }} | ||
- name: Bump version deferred | ||
id: bump-version | ||
if: steps.unreleased-changes.outputs.has-changes-to-release == 'true' | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
```js | ||
// my-component/component.stories.js|jsx | ||
|
||
import { useArgs } from '@storybook/preview-api'; | ||
import { Checkbox } from './checkbox'; | ||
|
||
export default { | ||
title: 'Inputs/Checkbox', | ||
component: Checkbox, | ||
}; | ||
|
||
export const Example = { | ||
args: { | ||
isChecked: false, | ||
label: 'Try Me!', | ||
}, | ||
/** | ||
* 👇 To avoid linting issues, it is recommended to use a function with a capitalized name. | ||
* If you are not concerned with linting, you may use an arrow function. | ||
*/ | ||
render: function Render(args) { | ||
const [{ isChecked }, updateArgs] = useArgs(); | ||
|
||
function onChange() { | ||
updateArgs({ isChecked: !isChecked }); | ||
} | ||
|
||
return <Checkbox {...args} onChange={onChange} isChecked={isChecked} />; | ||
}, | ||
}; | ||
``` |
35 changes: 35 additions & 0 deletions
35
docs/snippets/react/page-story-args-within-story.ts-4-9.mdx
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,35 @@ | ||
```ts | ||
// my-component/component.stories.ts|tsx | ||
|
||
import { StoryObj, Meta } from '@storybook/react'; | ||
import { useArgs } from '@storybook/preview-api'; | ||
import { Checkbox } from './checkbox'; | ||
|
||
const meta = { | ||
title: 'Inputs/Checkbox', | ||
component: Checkbox, | ||
} satisfies Meta<typeof Checkbox>; | ||
export default meta; | ||
|
||
type Story = StoryObj<typeof Checkbox>; | ||
|
||
export const Example = { | ||
args: { | ||
isChecked: false, | ||
label: 'Try Me!', | ||
}, | ||
/** | ||
* 👇 To avoid linting issues, it is recommended to use a function with a capitalized name. | ||
* If you are not concerned with linting, you may use an arrow function. | ||
*/ | ||
render: function Render(args) { | ||
const [{ isChecked }, updateArgs] = useArgs(); | ||
|
||
function onChange() { | ||
updateArgs({ isChecked: !isChecked }); | ||
} | ||
|
||
return <Checkbox {...args} onChange={onChange} isChecked={isChecked} />; | ||
}, | ||
} satisfies Story; | ||
``` |
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,35 @@ | ||
```ts | ||
// my-component/component.stories.ts|tsx | ||
|
||
import { StoryObj, Meta } from '@storybook/react'; | ||
import { useArgs } from '@storybook/preview-api'; | ||
import { Checkbox } from './checkbox'; | ||
|
||
const meta: Meta<typeof Checkbox> = { | ||
title: 'Inputs/Checkbox', | ||
component: Checkbox, | ||
}; | ||
export default meta; | ||
|
||
type Story = StoryObj<typeof Checkbox>; | ||
|
||
export const Example: Story = { | ||
args: { | ||
isChecked: false, | ||
label: 'Try Me!', | ||
}, | ||
/** | ||
* 👇 To avoid linting issues, it is recommended to use a function with a capitalized name. | ||
* If you are not concerned with linting, you may use an arrow function. | ||
*/ | ||
render: function Render(args) { | ||
const [{ isChecked }, updateArgs] = useArgs(); | ||
|
||
function onChange() { | ||
updateArgs({ isChecked: !isChecked }); | ||
} | ||
|
||
return <Checkbox {...args} onChange={onChange} isChecked={isChecked} />; | ||
}, | ||
}; | ||
``` |
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