-
Notifications
You must be signed in to change notification settings - Fork 536
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
143 additions
and
52 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@primer/react": minor | ||
--- | ||
|
||
Migrate 'InlineMessage' component to use CSS modules |
18 changes: 18 additions & 0 deletions
18
packages/react/src/InlineMessage/InlineMessage.dev.stories.tsx
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,18 @@ | ||
import type {Meta} from '@storybook/react' | ||
import React from 'react' | ||
import {InlineMessage} from '.' | ||
|
||
const meta = { | ||
title: 'Experimental/Components/InlineMessage/Dev', | ||
component: InlineMessage, | ||
} satisfies Meta<typeof InlineMessage> | ||
|
||
export default meta | ||
|
||
export const Default = () => { | ||
return ( | ||
<InlineMessage variant="unavailable" sx={{color: 'red'}}> | ||
An example inline message | ||
</InlineMessage> | ||
) | ||
} |
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,42 @@ | ||
.InlineMessage { | ||
display: grid; | ||
/* stylelint-disable-next-line primer/typography */ | ||
font-size: var(--inline-message-fontSize); | ||
/* stylelint-disable-next-line primer/typography */ | ||
line-height: var(--inline-message-lineHeight); | ||
/* stylelint-disable-next-line primer/colors */ | ||
color: var(--inline-message-fgColor); | ||
column-gap: 0.5rem; | ||
grid-template-columns: auto 1fr; | ||
align-items: start; | ||
|
||
&[data-size='small'] { | ||
--inline-message-fontSize: var(--text-body-size-small); | ||
--inline-message-lineHeight: var(--text-body-lineHeight-small, 1.6666); | ||
} | ||
|
||
&[data-size='medium'] { | ||
--inline-message-fontSize: var(--text-body-size-medium); | ||
--inline-message-lineHeight: var(--text-body-lineHeight-medium, 1.4285); | ||
} | ||
|
||
&[data-variant='warning'] { | ||
--inline-message-fgColor: var(--fgColor-attention); | ||
} | ||
|
||
&[data-variant='critical'] { | ||
--inline-message-fgColor: var(--fgColor-danger); | ||
} | ||
|
||
&[data-variant='success'] { | ||
--inline-message-fgColor: var(--fgColor-success); | ||
} | ||
|
||
&[data-variant='unavailable'] { | ||
--inline-message-fgColor: var(--fgColor-muted); | ||
} | ||
} | ||
|
||
.InlineMessageIcon { | ||
min-height: calc(var(--inline-message-lineHeight) * var(--inline-message-fontSize)) !important; | ||
} |
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