-
Notifications
You must be signed in to change notification settings - Fork 95
feat: Add consistent variant prop for design variant of buttons / chips
#6472
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
Conversation
Deprecate `type` for usage with the color variant. Also deprecate `nativeType` in favor of `type` and `variant`. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This is done to align with `NcButton`. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
To align with `NcButton`. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
…`type` prop To align with `NcButton`. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
…e` prop To align with `NcButton`. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
| <!-- Before: --> | ||
| <NcButton type="primary" native-type="submit">Submit</NcButton> | ||
| <!-- After: --> | ||
| <NcButton type="submit" variant="primary">Submit</NcButton> |
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.
To keep semantics - only prop names were renamed
| <!-- Before: --> | |
| <NcButton type="primary" native-type="submit">Submit</NcButton> | |
| <!-- After: --> | |
| <NcButton type="submit" variant="primary">Submit</NcButton> | |
| <!-- Before: --> | |
| <NcButton type="primary" native-type="submit">Submit</NcButton> | |
| <!-- After: --> | |
| <NcButton variant="primary" type="submit">Submit</NcButton> |
|
/backport to next |
| * Accepted values: primary, secondary, tertiary, tertiary-no-background, tertiary-on-primary, error, warning, success. | ||
| * | ||
| * @default 'secondary' | ||
| * @since 8.23.0 |
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 wondering why that wasn't working 🙈
This is in 8.24.0 😁
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.
@susnux
@nextcloud/vue v9breaking changes #6384 (comment)☑️ Resolves
Currently we need to wrap the native
typeprop of a button intonativeTypeofNcButton.This is confusing and we should never use names for props that are already attributes of the native HTML element.
The solution is to rename
typetovariant.To not make it breaking following is applied:
variantprop is added replacingtypenativeTypeis deprecated in favor oftypetypeallows both, the native button type and the color variantnativeTypeThe same is also applied for
NcDialogButtonandNcActions.NcChipalso referred to theNcButtonfor thetypeso this is also migrated the same way to make the wordingvariantconsistent.In a last step all components are refactored to use the new props instead.
🖼️ Screenshots
Nothing visually changed - if it does that's a regression 😨
🏁 Checklist
nextrequested with a Vue 3 upgrade