Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🏷️ Label: change "meta" field type to ReactNode #3341

Merged
merged 2 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export type AutocompleteProps<T> = {
/** Variants */
variant?: Variants
/** Meta text, for instance unit */
meta?: string
meta?: ReactNode
/** Disabled state
* @default false
*/
Expand Down
3 changes: 2 additions & 1 deletion packages/eds-core-react/src/components/Label/Label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type LabelBaseType = {
const LabelBase = styled.label<LabelBaseType>`
display: flex;
justify-content: space-between;
align-items: flex-end;
position: relative;
${typographyTemplate(tokens.typography)}
margin-left: ${tokens.spacings.left};
Expand All @@ -26,7 +27,7 @@ const Text = styled.span`

export type LabelProps = {
label: ReactNode
meta?: string
meta?: ReactNode
disabled?: boolean
} & LabelHTMLAttributes<HTMLLabelElement>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ exports[`Label Matches snapshot 1`] = `
.c0 {
display: flex;
justify-content: space-between;
align-items: flex-end;
position: relative;
margin: 0;
color: var(--eds_text__static_icons__tertiary, rgba(111, 111, 111, 1));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { forwardRef, SelectHTMLAttributes } from 'react'
import { forwardRef, SelectHTMLAttributes, ReactNode } from 'react'
import styled, { css, ThemeProvider } from 'styled-components'
import { Label } from '../Label'
import { nativeselect as tokens } from './NativeSelect.tokens'
Expand Down Expand Up @@ -73,7 +73,7 @@ export type NativeSelectProps = {
/** Label for the select element */
label: string
/** Meta text, for instance unit */
meta?: string
meta?: ReactNode
/** Disabled state */
disabled?: boolean
/** The user can choose multiple items */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ exports[`NativeSelect Matches snapshot 1`] = `
.c1 {
display: flex;
justify-content: space-between;
align-items: flex-end;
position: relative;
margin: 0;
color: var(--eds_text__static_icons__tertiary, rgba(111, 111, 111, 1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type SharedTextFieldProps = {
/** Label text */
label?: ReactNode
/** Meta text */
meta?: string
meta?: ReactNode
/** Unit text */
unit?: string
/** Helper text */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ exports[`TextField Matches snapshot 1`] = `
.c0 {
display: flex;
justify-content: space-between;
align-items: flex-end;
position: relative;
margin: 0;
color: var(--eds_text__static_icons__tertiary, rgba(111, 111, 111, 1));
Expand Down
Loading