forked from carbon-design-system/carbon-for-ibm-dotcom
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(storybook): updated 7 component stories to v7 (carbon-design-sys…
…tem#11344) * fix(loading): update story to v7 * fix(modal): update to v7 * fix(checkbox): update to v7 * fix(list): update to v7 * fix(inline-loading): updated to v7 * fix(data-table): update to v7 * chore(prettier): ran formatter * fix(list): remove double mdxs * fix(markdown): replaced description * Update packages/carbon-web-components/src/components/list/ordered-list.stories.ts * Update packages/carbon-web-components/src/components/list/ordered-list.stories.ts --------- Co-authored-by: kennylam <[email protected]>
- Loading branch information
1 parent
316b114
commit 93ce902
Showing
35 changed files
with
1,695 additions
and
1,262 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
119 changes: 0 additions & 119 deletions
119
packages/carbon-web-components/src/components/checkbox/checkbox-story.ts
This file was deleted.
Oops, something went wrong.
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
148 changes: 148 additions & 0 deletions
148
packages/carbon-web-components/src/components/checkbox/checkbox.stories.ts
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,148 @@ | ||
/** | ||
* @license | ||
* | ||
* Copyright IBM Corp. 2019, 2023 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import { html } from 'lit'; | ||
import { prefix } from '../../globals/settings'; | ||
import storyDocs from './checkbox.mdx'; | ||
import './index'; | ||
|
||
const checkboxLabel = 'Checkbox label'; | ||
|
||
const defaultArgs = { | ||
disabled: false, | ||
helperText: 'Helper text goes here', | ||
invalid: false, | ||
invalidText: 'Invalid message goes here', | ||
legendText: 'Group label', | ||
readonly: false, | ||
warn: false, | ||
warnText: 'Warn message goes here', | ||
}; | ||
|
||
const controls = { | ||
disabled: { | ||
control: 'boolean', | ||
description: 'Specify whether the checkbox should be disabled.', | ||
}, | ||
helperText: { | ||
control: 'textNullable', | ||
description: 'Provide text for the form group for additional help.', | ||
}, | ||
invalid: { | ||
control: 'boolean', | ||
description: 'Specify whether the form group is currently invalid.', | ||
}, | ||
invalidText: { | ||
control: 'textNullable', | ||
description: | ||
'Provide the text that is displayed when the form group is in an invalid state.', | ||
}, | ||
legendText: { | ||
control: 'textNullable', | ||
description: 'Provide the text to be rendered inside of the fieldset.', | ||
}, | ||
readonly: { | ||
control: 'boolean', | ||
description: 'Specify whether the checkbox group is read-only.', | ||
}, | ||
warn: { | ||
control: 'boolean', | ||
description: | ||
'Specify whether the form group is currently in warning state.', | ||
}, | ||
warnText: { | ||
control: 'textNullable', | ||
description: | ||
'Provide the text that is displayed when the form group is in warning state.', | ||
}, | ||
}; | ||
|
||
export const Default = { | ||
render: () => html` | ||
<cds-checkbox-group legend-text="Group label"> | ||
<cds-checkbox>${checkboxLabel}</cds-checkbox> | ||
<cds-checkbox>${checkboxLabel}</cds-checkbox> | ||
</cds-checkbox-group> | ||
`, | ||
}; | ||
|
||
export const Skeleton = { | ||
render: () => html` | ||
<fieldset class="${prefix}--fieldset"> | ||
<cds-checkbox-skeleton>${checkboxLabel}</cds-checkbox-skeleton> | ||
</fieldset> | ||
`, | ||
}; | ||
|
||
export const Single = { | ||
render: () => html` | ||
<cds-checkbox helper-text="Helper text goes here" | ||
>${checkboxLabel}</cds-checkbox | ||
> | ||
<br /><br /> | ||
<cds-checkbox invalid invalid-text="Invalid test goes here" | ||
>${checkboxLabel}</cds-checkbox | ||
> | ||
<br /><br /> | ||
<cds-checkbox warn warn-text="Warning test goes here" | ||
>${checkboxLabel}</cds-checkbox | ||
> | ||
<br /><br /> | ||
<cds-checkbox readonly>${checkboxLabel}</cds-checkbox> | ||
`, | ||
}; | ||
|
||
export const Playground = { | ||
args: defaultArgs, | ||
argTypes: controls, | ||
render: ({ | ||
disabled, | ||
readonly, | ||
onChange, | ||
helperText, | ||
invalid, | ||
invalidText, | ||
legendText, | ||
warn, | ||
warnText, | ||
}) => | ||
html` | ||
<cds-checkbox-group | ||
helper-text="${helperText}" | ||
?disabled="${disabled}" | ||
?invalid="${invalid}" | ||
invalid-text="${invalidText}" | ||
legend-text="${legendText}" | ||
?readonly="${readonly}" | ||
?warn="${warn}" | ||
warn-text="${warnText}"> | ||
<cds-checkbox checked @cds-checkbox-changed="${onChange}" | ||
>Checkbox label</cds-checkbox | ||
> | ||
<cds-checkbox @cds-checkbox-changed="${onChange}" | ||
>Checkbox label</cds-checkbox | ||
> | ||
<cds-checkbox disabled @cds-checkbox-changed="${onChange}" | ||
>Checkbox label</cds-checkbox | ||
> | ||
</cds-checkbox-group> | ||
`, | ||
}; | ||
|
||
const meta = { | ||
title: 'Components/Checkbox', | ||
parameters: { | ||
actions: { argTypesRegex: '^on.*' }, | ||
docs: { | ||
page: storyDocs, | ||
}, | ||
}, | ||
}; | ||
|
||
export default meta; |
Oops, something went wrong.