-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Allow ReactElement in LabeledValue value (#7679)
* Allow ReactNode as LabeledValue value * Add useEffect * Fix linter errors * Fix error case tests * fix story * Remove todo * Fix error test * Add docs * Fix linter * Remove console.error check * Fix docs * Fix lint errors * Fix lint errors * Update to use ReactElement * Update packages/@react-spectrum/labeledvalue/stories/LabeledValue.stories.tsx * Fix errorMessage test --------- Co-authored-by: Sana Malik <[email protected]> Co-authored-by: Reid Barber <[email protected]> Co-authored-by: Robert Snow <[email protected]>
- Loading branch information
1 parent
41ef71d
commit 2905848
Showing
5 changed files
with
99 additions
and
24 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,10 +1,11 @@ | ||
import {DateTime, LabeledValueBaseProps} from '@react-spectrum/labeledvalue/src/LabeledValue'; | ||
import {RangeValue} from '@react-types/shared'; | ||
import {ReactElement} from 'react'; | ||
|
||
// The doc generator is not smart enough to handle the real types for LabeledValue so this is a simpler one. | ||
export interface LabeledValueProps extends LabeledValueBaseProps { | ||
/** The value to display. */ | ||
value: string | string[] | number | RangeValue<number> | DateTime | RangeValue<DateTime>, | ||
value: string | string[] | number | RangeValue<number> | DateTime | RangeValue<DateTime> | ReactElement, | ||
/** Formatting options for the value. The available options depend on the type passed to the `value` prop. */ | ||
formatOptions?: Intl.NumberFormatOptions | Intl.DateTimeFormatOptions | Intl.ListFormatOptions | ||
} |
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
2905848
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verdaccio builds:
CRA Test App
NextJS Test App
RAC Tailwind Example
RAC Spectrum + Tailwind Example
S2 Parcel Example
S2 Webpack Example
CRA Test App Size
NextJS App Size
Publish stats
Size diff since last release
Docs
Storybook
S2 Storybook