From 4d32ef455e506feb1a86887c29182ee47a6dbbc6 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Wed, 29 Jan 2025 12:52:08 +0100 Subject: [PATCH 1/6] feat(NcButton): Allow to set the color variant using `variant` prop. Deprecate `type` for usage with the color variant. Also deprecate `nativeType` in favor of `type` and `variant`. Signed-off-by: Ferdinand Thiessen --- CHANGELOG.md | 15 +++ src/components/NcButton/NcButton.vue | 97 ++++++++++++++----- tests/unit/components/NcButton/button.spec.js | 46 ++++++++- 3 files changed, 133 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94a3188282..275a2951ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,21 @@ # Changelog +## UNRELEASED + +### 📝 Notes +#### `NcButton` color variant and native type +`NcButton` now provides a `variant` prop to set the color variant to use (e.g. `'primary'`) and allows to set the native button type using the `type` prop. +The legacy behavior, `type` for the color variant and `nativeType` for the button type, still works but will be removed in the next major version. + +To make a later migration to version 9 easier you can already migrate your `NcButton` usage like this: +```vue + +Submit + +Submit +``` + ## [v8.23.1](https://github.com/nextcloud-libraries/nextcloud-vue/tree/v8.23.1) (2025-02-13) [Full Changelog](https://github.com/nextcloud-libraries/nextcloud-vue/compare/v8.23.0...v8.23.1) diff --git a/src/components/NcButton/NcButton.vue b/src/components/NcButton/NcButton.vue index 189ddd9d4c..370629add9 100644 --- a/src/components/NcButton/NcButton.vue +++ b/src/components/NcButton/NcButton.vue @@ -37,7 +37,7 @@ It can be used with one or multiple actions. aria-label="Example text" :disabled="disabled" :size="size" - type="tertiary-no-background"> + variant="tertiary-no-background">