feat: Add consistent variant prop for design variant of buttons / chips#6472
Merged
Conversation
Antreesy
reviewed
Jan 30, 2025
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>
ShGKme
approved these changes
Mar 3, 2025
Comment on lines
+27
to
+20
| <!-- Before: --> | ||
| <NcButton type="primary" native-type="submit">Submit</NcButton> | ||
| <!-- After: --> | ||
| <NcButton type="submit" variant="primary">Submit</NcButton> |
Contributor
There was a problem hiding this comment.
To keep semantics - only prop names were renamed
Suggested change
| <!-- 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> |
4 tasks
st3iny
approved these changes
Mar 4, 2025
Contributor
Author
|
/backport to next |
2 tasks
skjnldsv
reviewed
Mar 13, 2025
| * Accepted values: primary, secondary, tertiary, tertiary-no-background, tertiary-on-primary, error, warning, success. | ||
| * | ||
| * @default 'secondary' | ||
| * @since 8.23.0 |
Contributor
There was a problem hiding this comment.
I was wondering why that wasn't working 🙈
This is in 8.24.0 😁
3 tasks
Merged
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@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