diff --git a/src/app/components/button/button.ts b/src/app/components/button/button.ts index e44c9df85d0..3237ce4087c 100755 --- a/src/app/components/button/button.ts +++ b/src/app/components/button/button.ts @@ -320,6 +320,46 @@ export class Button implements AfterContentInit { * @group Props */ @Input() loadingIcon: string | undefined; + /** + * Add a shadow to indicate elevation. + * @group Props + */ + @Input() raised: boolean = false; + /** + * Add a circular border radius to the button. + * @group Props + */ + @Input() rounded: boolean = false; + /** + * Add a textual class to the button without a background initially. + * @group Props + */ + @Input() text: boolean = false; + /** + * Add a plain textual class to the button without a background initially. + * @group Props + */ + @Input() plain: boolean = false; + /** + * Defines the style of the button. + * @group Props + */ + @Input() severity: 'secondary' | 'success' | 'info' | 'warning' | 'help' | 'danger' | string | undefined; + /** + * Add a border class without a background initially. + * @group Props + */ + @Input() outlined: boolean = false; + /** + * Add a link style to the button. + * @group Props + */ + @Input() link: boolean = false; + /** + * Defines the size of the button. + * @group Props + */ + @Input() size: 'small' | 'large' | undefined; /** * Inline style of the element. * @group Props @@ -393,7 +433,16 @@ export class Button implements AfterContentInit { 'p-button-vertical': (this.iconPos === 'top' || this.iconPos === 'bottom') && this.label, 'p-disabled': this.disabled || this.loading, 'p-button-loading': this.loading, - 'p-button-loading-label-only': this.loading && !this.icon && this.label && !this.loadingIcon && this.iconPos === 'left' + 'p-button-loading-label-only': this.loading && !this.icon && this.label && !this.loadingIcon && this.iconPos === 'left', + 'p-button-link': this.link, + [`p-button-${this.severity}`]: this.severity, + 'p-button-raised': this.raised, + 'p-button-rounded': this.rounded, + 'p-button-text': this.text, + 'p-button-outlined': this.outlined, + 'p-button-sm': this.size === 'small', + 'p-button-lg': this.size === 'large', + 'p-button-plain': this.plain }; } diff --git a/src/app/showcase/doc/apidoc/index.json b/src/app/showcase/doc/apidoc/index.json index 34c7f685c92..940d29058f2 100644 --- a/src/app/showcase/doc/apidoc/index.json +++ b/src/app/showcase/doc/apidoc/index.json @@ -4251,7 +4251,7 @@ "name": "severity", "optional": false, "readonly": false, - "type": "\"success\" | \"warning\" | \"danger\" | \"info\"", + "type": "\"success\" | \"warning\" | \"info\" | \"danger\"", "description": "Severity type of the badge." } ] @@ -4287,7 +4287,7 @@ "name": "severity", "optional": false, "readonly": false, - "type": "\"success\" | \"warning\" | \"danger\" | \"info\"", + "type": "\"success\" | \"warning\" | \"info\" | \"danger\"", "description": "Severity type of the badge." }, { @@ -4588,6 +4588,68 @@ "type": "string", "description": "Icon to display in loading state." }, + { + "name": "raised", + "optional": false, + "readonly": false, + "type": "boolean", + "default": "false", + "description": "Add a shadow to indicate elevation." + }, + { + "name": "rounded", + "optional": false, + "readonly": false, + "type": "boolean", + "default": "false", + "description": "Add a circular border radius to the button." + }, + { + "name": "text", + "optional": false, + "readonly": false, + "type": "boolean", + "default": "false", + "description": "Add a textual class to the button without a background initially." + }, + { + "name": "plain", + "optional": false, + "readonly": false, + "type": "boolean", + "default": "false", + "description": "Add a plain textual class to the button without a background initially." + }, + { + "name": "severity", + "optional": false, + "readonly": false, + "type": "string", + "description": "Defines the style of the button." + }, + { + "name": "outlined", + "optional": false, + "readonly": false, + "type": "boolean", + "default": "false", + "description": "Add a border class without a background initially." + }, + { + "name": "link", + "optional": false, + "readonly": false, + "type": "boolean", + "default": "false", + "description": "Add a link style to the button." + }, + { + "name": "size", + "optional": false, + "readonly": false, + "type": "\"small\" | \"large\"", + "description": "Defines the size of the button." + }, { "name": "style", "optional": false, diff --git a/src/app/showcase/doc/button/linkdoc.ts b/src/app/showcase/doc/button/linkdoc.ts index bfcd1cb87bb..f78aad9e69c 100644 --- a/src/app/showcase/doc/button/linkdoc.ts +++ b/src/app/showcase/doc/button/linkdoc.ts @@ -8,7 +8,7 @@ import { Code } from '../../domain/code';

A button can be rendered as a link as well.

- +
` @@ -20,11 +20,11 @@ export class LinkDoc { code: Code = { basic: ` -`, +`, html: `
- +
`, typescript: ` diff --git a/src/app/showcase/doc/button/outlineddoc.ts b/src/app/showcase/doc/button/outlineddoc.ts index bd7e9b211a7..a1b03dd0ba0 100644 --- a/src/app/showcase/doc/button/outlineddoc.ts +++ b/src/app/showcase/doc/button/outlineddoc.ts @@ -8,13 +8,13 @@ import { Code } from '../../domain/code';

Outlined buttons display a border without a background initially.

- - - - - - - + + + + + + +
` @@ -26,23 +26,23 @@ export class OutlinedDoc { code: Code = { basic: ` - - - - - - -`, + + + + + + +`, html: `
- - - - - - - + + + + + + +
`, typescript: ` diff --git a/src/app/showcase/doc/button/raiseddoc.ts b/src/app/showcase/doc/button/raiseddoc.ts index a2dc8b90ecd..8b35015b4f3 100644 --- a/src/app/showcase/doc/button/raiseddoc.ts +++ b/src/app/showcase/doc/button/raiseddoc.ts @@ -8,13 +8,13 @@ import { Code } from '../../domain/code';

Raised buttons display a shadow to indicate elevation.

- - - - - - - + + + + + + +
` @@ -26,23 +26,23 @@ export class RaisedDoc { code: Code = { basic: ` - - - - - - -`, + + + + + + +`, html: `
- - - - - - - + + + + + + +
`, typescript: ` diff --git a/src/app/showcase/doc/button/raisedtextdoc.ts b/src/app/showcase/doc/button/raisedtextdoc.ts index 68419cad4e7..59312a59125 100644 --- a/src/app/showcase/doc/button/raisedtextdoc.ts +++ b/src/app/showcase/doc/button/raisedtextdoc.ts @@ -8,13 +8,14 @@ import { Code } from '../../domain/code';

Text buttons can be displayed as raised for elevation.

- - - - - - - + + + + + + + +
` @@ -26,23 +27,25 @@ export class RaisedTextDoc { code: Code = { basic: ` - - - - - - -`, + + + + + + + +`, html: `
- - - - - - - + + + + + + + +
`, typescript: ` diff --git a/src/app/showcase/doc/button/roundeddoc.ts b/src/app/showcase/doc/button/roundeddoc.ts index f951e16385a..716a03dfc42 100644 --- a/src/app/showcase/doc/button/roundeddoc.ts +++ b/src/app/showcase/doc/button/roundeddoc.ts @@ -8,13 +8,13 @@ import { Code } from '../../domain/code';

Rounded buttons have a circular border radius.

- - - - - - - + + + + + + +
` @@ -26,23 +26,23 @@ export class RoundedDoc { code: Code = { basic: ` - - - - - - -`, + + + + + + +`, html: `
- - - - - - - + + + + + + +
`, typescript: ` diff --git a/src/app/showcase/doc/button/severitydoc.ts b/src/app/showcase/doc/button/severitydoc.ts index c594945fb04..87b7ffc7995 100644 --- a/src/app/showcase/doc/button/severitydoc.ts +++ b/src/app/showcase/doc/button/severitydoc.ts @@ -9,12 +9,12 @@ import { Code } from '../../domain/code';
- - - - - - + + + + + +
` @@ -27,22 +27,22 @@ export class SeverityDoc { code: Code = { basic: ` - - - - - -`, + + + + + +`, html: `
- - - - - - + + + + + +
`, typescript: ` diff --git a/src/app/showcase/doc/button/sizesdoc.ts b/src/app/showcase/doc/button/sizesdoc.ts index 04b0fdebbf1..139bceb5a67 100644 --- a/src/app/showcase/doc/button/sizesdoc.ts +++ b/src/app/showcase/doc/button/sizesdoc.ts @@ -8,9 +8,9 @@ import { Code } from '../../domain/code';

Button provides small and large sizes as alternatives to the standard.

- - - + + +
` @@ -22,15 +22,15 @@ export class SizesDoc { code: Code = { basic: ` - - -`, + + +`, html: `
- - - + + +
`, typescript: ` diff --git a/src/app/showcase/doc/button/templatedoc.ts b/src/app/showcase/doc/button/templatedoc.ts index 66019ff6ca5..156e10e21cc 100644 --- a/src/app/showcase/doc/button/templatedoc.ts +++ b/src/app/showcase/doc/button/templatedoc.ts @@ -8,7 +8,7 @@ import { Code } from '../../domain/code';

Custom content inside a button is defined as children.

- + logo PrimeNG @@ -23,14 +23,14 @@ export class TemplateDoc { code: Code = { basic: ` - + logo PrimeNG `, html: `
- + logo PrimeNG diff --git a/src/app/showcase/doc/button/textdoc.ts b/src/app/showcase/doc/button/textdoc.ts index ee2dee3daac..dca11b7d1a8 100644 --- a/src/app/showcase/doc/button/textdoc.ts +++ b/src/app/showcase/doc/button/textdoc.ts @@ -8,13 +8,14 @@ import { Code } from '../../domain/code';

Text buttons are displayed as textual elements.

- - - - - - - + + + + + + + +
` @@ -26,23 +27,25 @@ export class TextDoc { code: Code = { basic: ` - - - - - - -`, + + + + + + + +`, html: `
- - - - - - - + + + + + + + +
`, typescript: `