From feb24d155550047bc8071e6d636e9ada751e1521 Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Sat, 3 Feb 2024 12:41:06 +0300 Subject: [PATCH] #5200 for badge and tag, new secondary and contrast variants --- api-generator/components/badge.js | 2 +- api-generator/components/tag.js | 2 +- components/lib/badge/Badge.d.ts | 2 +- components/lib/badge/style/BadgeStyle.js | 4 +- components/lib/button/Button.d.ts | 2 +- components/lib/tag/Tag.d.ts | 2 +- components/lib/tag/style/TagStyle.js | 2 + doc/badge/SeverityDoc.vue | 12 +- doc/button/BadgesDoc.vue | 18 +- doc/tag/SeverityDoc.vue | 10 +- public/themes/arya-blue/theme.css | 5841 +--------------- public/themes/arya-green/theme.css | 5841 +--------------- public/themes/arya-orange/theme.css | 5841 +--------------- public/themes/arya-purple/theme.css | 5841 +--------------- public/themes/aura-dark-amber/theme.css | 16 + public/themes/aura-dark-blue/theme.css | 16 + public/themes/aura-dark-cyan/theme.css | 16 + public/themes/aura-dark-green/theme.css | 16 + public/themes/aura-dark-indigo/theme.css | 16 + public/themes/aura-dark-lime/theme.css | 16 + public/themes/aura-dark-noir/theme.css | 16 + public/themes/aura-dark-pink/theme.css | 16 + public/themes/aura-dark-purple/theme.css | 16 + public/themes/aura-dark-teal/theme.css | 16 + public/themes/aura-light-amber/theme.css | 16 + public/themes/aura-light-blue/theme.css | 16 + public/themes/aura-light-cyan/theme.css | 16 + public/themes/aura-light-green/theme.css | 16 + public/themes/aura-light-indigo/theme.css | 16 + public/themes/aura-light-lime/theme.css | 16 + public/themes/aura-light-noir/theme.css | 16 + public/themes/aura-light-pink/theme.css | 16 + public/themes/aura-light-purple/theme.css | 16 + public/themes/aura-light-teal/theme.css | 16 + public/themes/bootstrap4-dark-blue/theme.css | 16 + .../themes/bootstrap4-dark-purple/theme.css | 16 + public/themes/bootstrap4-light-blue/theme.css | 16 + .../themes/bootstrap4-light-purple/theme.css | 16 + public/themes/fluent-light/theme.css | 5975 +--------------- public/themes/lara-dark-amber/theme.css | 16 + public/themes/lara-dark-blue/theme.css | 16 + public/themes/lara-dark-cyan/theme.css | 16 + public/themes/lara-dark-green/theme.css | 16 + public/themes/lara-dark-indigo/theme.css | 16 + public/themes/lara-dark-pink/theme.css | 16 + public/themes/lara-dark-purple/theme.css | 16 + public/themes/lara-dark-teal/theme.css | 16 + public/themes/lara-light-amber/theme.css | 16 + public/themes/lara-light-blue/theme.css | 16 + public/themes/lara-light-cyan/theme.css | 16 + public/themes/lara-light-green/theme.css | 16 + public/themes/lara-light-indigo/theme.css | 16 + public/themes/lara-light-pink/theme.css | 16 + public/themes/lara-light-purple/theme.css | 16 + public/themes/lara-light-teal/theme.css | 16 + public/themes/luna-amber/theme.css | 5785 +--------------- public/themes/luna-blue/theme.css | 5785 +--------------- public/themes/luna-green/theme.css | 5785 +--------------- public/themes/luna-pink/theme.css | 5785 +--------------- public/themes/md-dark-deeppurple/theme.css | 16 + public/themes/md-dark-indigo/theme.css | 16 + public/themes/md-light-deeppurple/theme.css | 16 + public/themes/md-light-indigo/theme.css | 16 + public/themes/mdc-dark-deeppurple/theme.css | 16 + public/themes/mdc-dark-indigo/theme.css | 16 + public/themes/mdc-light-deeppurple/theme.css | 16 + public/themes/mdc-light-indigo/theme.css | 16 + public/themes/mira/theme.css | 6055 +---------------- public/themes/nano/theme.css | 5827 +--------------- public/themes/nova-accent/theme.css | 5810 +--------------- public/themes/nova-alt/theme.css | 5812 +--------------- public/themes/nova-vue/theme.css | 5800 +--------------- public/themes/nova/theme.css | 5800 +--------------- public/themes/rhea/theme.css | 5788 +--------------- public/themes/saga-blue/theme.css | 5838 +--------------- public/themes/saga-green/theme.css | 5838 +--------------- public/themes/saga-orange/theme.css | 5838 +--------------- public/themes/saga-purple/theme.css | 5838 +--------------- public/themes/soho-dark/theme.css | 16 + public/themes/soho-light/theme.css | 16 + public/themes/tailwind-light/theme.css | 5945 +--------------- public/themes/vela-blue/theme.css | 5841 +--------------- public/themes/vela-green/theme.css | 5841 +--------------- public/themes/vela-orange/theme.css | 5841 +--------------- public/themes/vela-purple/theme.css | 5841 +--------------- public/themes/viva-dark/theme.css | 16 + public/themes/viva-light/theme.css | 16 + 87 files changed, 1319 insertions(+), 145601 deletions(-) diff --git a/api-generator/components/badge.js b/api-generator/components/badge.js index c9d9c6024..b1450d0d7 100644 --- a/api-generator/components/badge.js +++ b/api-generator/components/badge.js @@ -9,7 +9,7 @@ const BadgeProps = [ name: 'severity', type: 'string', default: 'null', - description: 'Severity type of the badge.' + description: 'Severity type of the badge. Valid severities are "secondary", "success", "info", "warning", "danger" and "contrast".' }, { name: 'size', diff --git a/api-generator/components/tag.js b/api-generator/components/tag.js index 1713f6b12..e476acea2 100644 --- a/api-generator/components/tag.js +++ b/api-generator/components/tag.js @@ -9,7 +9,7 @@ const TagProps = [ name: 'severity', type: 'string', default: 'null', - description: 'Severity type of the tag. Valid severities are "success", "info", "warning" and "danger".' + description: 'Severity type of the tag. Valid severities are "secondary", "success", "info", "warning", "danger" and "contrast".' }, { name: 'rounded', diff --git a/components/lib/badge/Badge.d.ts b/components/lib/badge/Badge.d.ts index 6002e5770..83405a673 100644 --- a/components/lib/badge/Badge.d.ts +++ b/components/lib/badge/Badge.d.ts @@ -70,7 +70,7 @@ export interface BadgeProps { /** * Severity type of the badge. */ - severity?: 'info' | 'success' | 'warning' | 'danger' | string | null | undefined; + severity?: 'secondary' | 'info' | 'success' | 'warning' | 'danger' | 'contrast' | string | null | undefined; /** * Size of the badge, valid options are 'large' and 'xlarge'. */ diff --git a/components/lib/badge/style/BadgeStyle.js b/components/lib/badge/style/BadgeStyle.js index 25e700ca8..fa5402f8a 100644 --- a/components/lib/badge/style/BadgeStyle.js +++ b/components/lib/badge/style/BadgeStyle.js @@ -49,7 +49,9 @@ const classes = { 'p-badge-info': props.severity === 'info', 'p-badge-success': props.severity === 'success', 'p-badge-warning': props.severity === 'warning', - 'p-badge-danger': props.severity === 'danger' + 'p-badge-danger': props.severity === 'danger', + 'p-badge-secondary': props.severity === 'secondary', + 'p-badge-contrast': props.severity === 'contrast' } ] }; diff --git a/components/lib/button/Button.d.ts b/components/lib/button/Button.d.ts index e323b3706..260f6fbb3 100755 --- a/components/lib/button/Button.d.ts +++ b/components/lib/button/Button.d.ts @@ -119,7 +119,7 @@ export interface ButtonProps extends ButtonHTMLAttributes { /** * Severity type of the badge. */ - badgeSeverity?: 'info' | 'success' | 'warning' | 'danger' | string | null | undefined; + badgeSeverity?: 'secondary' | 'info' | 'success' | 'warning' | 'danger' | 'contrast' | string | null | undefined; /** * Whether the button is in loading state. * @defaultValue false diff --git a/components/lib/tag/Tag.d.ts b/components/lib/tag/Tag.d.ts index 6f51ea39c..78f448328 100644 --- a/components/lib/tag/Tag.d.ts +++ b/components/lib/tag/Tag.d.ts @@ -82,7 +82,7 @@ export interface TagProps { /** * Severity type of the tag. */ - severity?: 'success' | 'info' | 'warning' | 'danger' | string | undefined; + severity?: 'secondary' | 'success' | 'info' | 'warning' | 'danger' | 'contrast' | string | undefined; /** * Whether the corners of the tag are rounded. * @defaultValue false diff --git a/components/lib/tag/style/TagStyle.js b/components/lib/tag/style/TagStyle.js index 011563b16..54dff4d47 100644 --- a/components/lib/tag/style/TagStyle.js +++ b/components/lib/tag/style/TagStyle.js @@ -28,6 +28,8 @@ const classes = { 'p-tag-success': props.severity === 'success', 'p-tag-warning': props.severity === 'warning', 'p-tag-danger': props.severity === 'danger', + 'p-tag-secondary': props.severity === 'secondary', + 'p-tag-contrast': props.severity === 'contrast', 'p-tag-rounded': props.rounded } ], diff --git a/doc/badge/SeverityDoc.vue b/doc/badge/SeverityDoc.vue index 5aefac39c..c4a890054 100644 --- a/doc/badge/SeverityDoc.vue +++ b/doc/badge/SeverityDoc.vue @@ -1,13 +1,15 @@ @@ -19,39 +21,43 @@ export default { code: { basic: ` + + `, options: `