From 999e3e30682c3c25cc0166b8e8a3765a765f961e Mon Sep 17 00:00:00 2001 From: Adam Azzam <33043305+AAAZZAM@users.noreply.github.com> Date: Wed, 24 Apr 2024 12:57:20 -0400 Subject: [PATCH 1/4] add size + variants props --- src/components/Button/PButton.vue | 40 ++++++++++++++++--------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/src/components/Button/PButton.vue b/src/components/Button/PButton.vue index 4280b0fbd..4fef1a6e3 100644 --- a/src/components/Button/PButton.vue +++ b/src/components/Button/PButton.vue @@ -31,6 +31,8 @@ import { isRouteExternal } from '@/utilities/router' const props = defineProps<{ + variant?: 'default' | 'secondary' | 'destructive' | 'outline' | 'ghost' | 'link', + size?: 'default' | 'sm' | 'lg' | 'icon', primary?: boolean, flat?: boolean, selected?: boolean, @@ -80,10 +82,10 @@ const classes = computed(() => ({ 'p-button--icon-only': props.icon && !slots.default, - 'p-button--primary': props.primary, - 'p-button--danger': props.dangerous, - 'p-button--flat': props.flat, - 'p-button--small': props.small, + 'p-button--default': props.primary || props.variant === 'default' || props.variant === 'destructive', + 'p-button--destructive': props.dangerous || props.variant === 'destructive', + 'p-button--ghost': props.flat || props.variant === 'ghost', + 'p-button--small': props.small || props.size === 'sm', 'p-button--icon-prepend': props.icon && slots.default, 'p-button--icon-append': props.iconAppend && slots.default, 'p-button--disabled': props.disabled || props.loading, @@ -151,81 +153,81 @@ font-normal } -.p-button--primary { +.p-button--default { background-color: var(--p-color-button-primary-bg); border-color: var(--p-color-button-primary-border); color: var(--p-color-button-primary-text); } -.p-button--primary:not(:disabled):hover { +.p-button--default:not(:disabled):hover { background-color: var(--p-color-button-primary-bg-hover); border-color: var(--p-color-button-primary-border-hover); color: var(--p-color-button-primary-text-hover); } -.p-button--primary:not(:disabled):active { +.p-button--default:not(:disabled):active { background-color: var(--p-color-button-primary-bg-active); border-color: var(--p-color-button-primary-border-active); color: var(--p-color-button-primary-text-active); } -.p-button--danger { +.p-button--destructive { background-color: var(--p-color-button-danger-bg); border-color: var(--p-color-button-danger-border); color: var(--p-color-button-danger-text); } -.p-button--danger:not(:disabled):hover { +.p-button--destructive:not(:disabled):hover { background-color: var(--p-color-button-danger-bg-hover); border-color: var(--p-color-button-danger-border-hover); color: var(--p-color-button-danger-text-hover); } -.p-button--danger:not(:disabled):active { +.p-button--destructive:not(:disabled):active { background-color: var(--p-color-button-danger-bg-active); border-color: var(--p-color-button-danger-border-active); color: var(--p-color-button-danger-text-active); } -.p-button--primary.p-button--danger { +.p-button--default.p-button--destructive { background-color: var(--p-color-button-primary-danger-bg); border-color: var(--p-color-button-primary-danger-border); color: var(--p-color-button-primary-danger-text); } -.p-button--primary.p-button--danger:not(:disabled):hover { +.p-button--default.p-button--destructive:not(:disabled):hover { background-color: var(--p-color-button-primary-danger-bg-hover); border-color: var(--p-color-button-primary-danger-border-hover); color: var(--p-color-button-primary-danger-text-hover); } -.p-button--primary.p-button--danger:not(:disabled):active { +.p-button--default.p-button--destructive:not(:disabled):active { background-color: var(--p-color-button-primary-danger-bg-active); border-color: var(--p-color-button-primary-danger-border-active); color: var(--p-color-button-primary-danger-text-active); } -.p-button--flat { +.p-button--ghost { background-color: var(--p-color-button-flat-bg); border-color: var(--p-color-button-flat-border); color: var(--p-color-button-flat-text); } -.p-button--flat:not(:disabled):hover { +.p-button--ghost:not(:disabled):hover { background-color: var(--p-color-button-flat-bg-hover); border-color: var(--p-color-button-flat-border-hover); color: var(--p-color-button-flat-text-hover); } -.p-button--flat:not(:disabled):active { +.p-button--ghost:not(:disabled):active { background-color: var(--p-color-button-flat-bg-active); border-color: var(--p-color-button-flat-border-active); color: var(--p-color-button-flat-text-active); } -.p-button--flat.p-button--danger { +.p-button--ghost.p-button--destructive { background-color: var(--p-color-button-flat-danger-bg); border-color: var(--p-color-button-flat-danger-border); color: var(--p-color-button-flat-danger-text); } -.p-button--flat.p-button--danger:not(:disabled):hover { +.p-button--ghost.p-button--destructive:not(:disabled):hover { background-color: var(--p-color-button-flat-danger-bg-hover); border-color: var(--p-color-button-flat-danger-border-hover); color: var(--p-color-button-flat-danger-text-hover); } -.p-button--flat.p-button--danger:not(:disabled):active { +.p-button--ghost.p-button--destructive:not(:disabled):active { background-color: var(--p-color-button-flat-danger-bg-active); border-color: var(--p-color-button-flat-danger-border-active); color: var(--p-color-button-flat-danger-text-active); From d1f8b6bce84fb9a85cfc2322971c40b1c0f3b4ce Mon Sep 17 00:00:00 2001 From: Adam Azzam <33043305+AAAZZAM@users.noreply.github.com> Date: Wed, 24 Apr 2024 12:57:24 -0400 Subject: [PATCH 2/4] Update Buttons.vue --- demo/sections/components/Buttons.vue | 32 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/demo/sections/components/Buttons.vue b/demo/sections/components/Buttons.vue index bfc1df997..575a875af 100644 --- a/demo/sections/components/Buttons.vue +++ b/demo/sections/components/Buttons.vue @@ -25,7 +25,7 @@ Appended Icon - + Dangerous @@ -33,13 +33,13 @@
- + Button - + With Icon - + Appended Icon
@@ -47,19 +47,19 @@ @@ -92,13 +92,13 @@ Button - + Button Button - + Button From c9268fbd68ace1fefdcf12643f6209f436416466 Mon Sep 17 00:00:00 2001 From: Adam Azzam <33043305+AAAZZAM@users.noreply.github.com> Date: Wed, 24 Apr 2024 13:15:51 -0400 Subject: [PATCH 3/4] Update Buttons.vue --- demo/sections/components/Buttons.vue | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/demo/sections/components/Buttons.vue b/demo/sections/components/Buttons.vue index 575a875af..8d46d6d18 100644 --- a/demo/sections/components/Buttons.vue +++ b/demo/sections/components/Buttons.vue @@ -56,7 +56,7 @@ Disabled - + Dangerous @@ -69,21 +69,20 @@
- +
- +
@@ -95,15 +94,14 @@ Button - + Button - + Button - - + From 3df2208e6d285f263f5d4c8f6597705d0331bd61 Mon Sep 17 00:00:00 2001 From: Adam Azzam <33043305+AAAZZAM@users.noreply.github.com> Date: Wed, 24 Apr 2024 13:40:39 -0400 Subject: [PATCH 4/4] Update Buttons.vue --- demo/sections/components/Buttons.vue | 78 ++++++++++++++++------------ 1 file changed, 44 insertions(+), 34 deletions(-) diff --git a/demo/sections/components/Buttons.vue b/demo/sections/components/Buttons.vue index 8d46d6d18..ae4574af8 100644 --- a/demo/sections/components/Buttons.vue +++ b/demo/sections/components/Buttons.vue @@ -2,69 +2,82 @@ - - -