-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Label)!: remove deprecated props (#1868)
- remove `requiredLabel` from component - remove `optionalLabel` from component neither of these are used, and removing them adds clarity and simplicity to the component. Also added an additional story to the component documentation for clarity.
- Loading branch information
1 parent
f9d73dd
commit 907cc39
Showing
5 changed files
with
60 additions
and
56 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import type { StoryObj, Meta } from '@storybook/react'; | ||
import React from 'react'; | ||
|
||
import { Label } from './Label'; | ||
import Tooltip from '../Tooltip'; | ||
|
||
export default { | ||
title: 'Components/Label', | ||
component: Label, | ||
parameters: { | ||
badges: ['1.0'], | ||
}, | ||
} as Meta<Args>; | ||
|
||
type Args = React.ComponentProps<typeof Label>; | ||
|
||
/** | ||
* Labels can denote some text to label the content, and whether that content is marked as required. | ||
*/ | ||
export const Default: StoryObj<Args> = { | ||
args: { | ||
text: 'Label', | ||
required: true, | ||
}, | ||
}; | ||
|
||
/** | ||
* You can use `labelAfter` to affix additional functionality to the label, like an optional `<Tooltip>`. | ||
*/ | ||
export const LabelAfter: StoryObj<Args> = { | ||
args: { | ||
text: 'Label', | ||
labelAfter: ( | ||
<Tooltip text="Test"> | ||
<span>*</span> | ||
</Tooltip> | ||
), | ||
}, | ||
}; |
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