-
Notifications
You must be signed in to change notification settings - Fork 0
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
coreui NoteBox component #1276
base: main
Are you sure you want to change the base?
coreui NoteBox component #1276
Conversation
163d857
to
8c7ffcc
Compare
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.
} | ||
|
||
const baseCss = css` | ||
border-left: 0.25em solid var(--note-box-border-color); |
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.
ive never seen this before. That's very slick
|
||
const Template: Story<Props> = function Template(props) { | ||
return ( | ||
<UIThemeProvider |
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.
Is there a reason to add the theme here? Or is it just to check that we get the correct colors regardless of theme?
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.
I was just following the same pattern as another story file (can't remember which one). I guess we could take it out, but not sure it hurts?
children: ReactNode; | ||
} | ||
|
||
const baseCss = css` |
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.
Perhaps additionally a default font? I believe coreui generally uses Inter or Roboto
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.
For content, I think we should use the same font as the rest of the site, but I will take a look at using one of these other fonts.
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.
I think I'm going to leave the font as-is.
</div> | ||
), | ||
}, | ||
}); |
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.
A story using a different type of child (for example, an image or some other non-text element) would be helpful if time allows
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.
or an expandable one
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.
Yes, I agree! I will add a couple more, soon.
: props.type === 'error' | ||
? errorCss | ||
: infoCss; | ||
return <div css={finalCss}>{props.children}</div>; |
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.
Perhaps for later, but it'd be nice to pair the icon with the NoteBox type. We picked one icon for error, warning, and info ( a looong time ago and i think it was never actually impllemented). Of course, one could pass that as part of the child, but if we want to keep coreui very opinionated then there could be a useIcon
prop and if that is true. the appropriate icon for that NoteBox style appears.
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.
Agreed!
{warningText} | ||
</div> | ||
)} | ||
{warningText && <NoteBox type="error">{warningText}</NoteBox>} |
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.
we should either change warningText
to errorText
or use the type='warning'
. Having "warning" text in an error Notebox is confusing.
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.
This is one of those things where someone wanted the box to be red, even though it isn't strictly an error. I will change it to errorText
for clarity.
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.
Done!
Ahh okay. Thanks @dmfalke ! Then I think all the rest of my comments are suggestions 👍 |
While testing this PR, I noticed a bug that was introduced by #1270: The persistence of record page table state was also moved to wdk-client. There is at least one place that uses the old I will make a new issue for this. |
A part of this involved increasing padding and border-width to compensate for the additional space needed for the icon.
I've added icon support, and made some additional stories to highlight the option. I also modified the padding and border width to compensate for the additional space needed for the icon. |
e5e9782
to
8f1e79c
Compare
This PR introduces a
NoteBox
component. It is meant to be an alternative toBanner
, integrating better on content-heavy pages, like record pages.