-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Conformance Tests #53
Conversation
Nice explanation!! Reads super easy!! |
value: PropTypes.string, | ||
}; | ||
|
||
static defaultProps = { |
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.
were these unnecessary default props, and that is why they were removed?
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.
Yep, none of these are required now since we inherit props and classes. We don't need to define every prop and it's type, since any prop and type you add will be passed down. We just need to define the ones we need to use. Like className
and label
.
Same for defaultProps
, this library will be generic and assume no defaults. If you'd like 3 rows, simply add rows={3}
to the component. 👍
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.
ah, makes total sense! sounds good.
Just a few general questions, but everything looks good!! 🐙 |
Cool! I think I covered them all now. Let me know if there are any other questions/comments/doubts. |
Checkout the [Documentation](https://technologyadvice.github.io/stardust/). | ||
|
||
Review our [Component Guidelines] | ||
(https://github.com/TechnologyAdvice/stardust/blob/master/docs/app/Component Guidelines.md). |
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.
Added a link to the guideline doc in the readme.
let classes = classNames( | ||
'sd-confirm', | ||
this.props.className, | ||
); |
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 use the classnames
module to add the sd-*
class, inherit this.props.className
and add Semantic UI classes.
Everything here looks great to me 🌞 |
The below document is linked in the README.md. I included it here for ease of access.
Stardust Component Guidelines
Every component in Stardust must conform to these guidelines. They ensure consistency and optimal development experience for Stardust users.
This document will be minimally maintained. See
\test
for the current conformance tests.Extends React.Component
Valid
Invalid
Constructor name matches component name
Give
MyComponent.js
is a component attached tostardust.MyComponent
:Valid
Invalid
Has the
sd-<component>
element as its first child (no wrapper elements)Valid
Invalid
Has props.className after
sd-<component>
Valid
Invalid
Has
sd-<component>
as the first classValid
Invalid
Has
ui
class immediately aftersd-<component>
Only for components that utilize the
ui
class (i.eui grid
but notcolumn
).Valid
Invalid
Has props.className immediately after
ui
Only for components that utilize the
ui
class (i.eui form
but notfield
).Valid
Invalid
Spreads props
Allows access to the underlying element of concern.
Valid
Invalid