Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions angular/projects/catalyst/src/lib/directives/proxies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export declare interface CatBadge extends Components.CatBadge {}
'icon',
'iconOnly',
'iconRight',
'inline',
'loading',
'name',
'nativeAttributes',
Expand Down Expand Up @@ -133,6 +134,7 @@ export declare interface CatBadge extends Components.CatBadge {}
'icon',
'iconOnly',
'iconRight',
'inline',
'loading',
'name',
'nativeAttributes',
Expand Down
10 changes: 10 additions & 0 deletions core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ export namespace Components {
* @default false
*/
"iconRight": boolean;
/**
* Link behaves as an inline element.
* @default false
*/
"inline": boolean;
/**
* Displays the button in a loading state with a spinner. Just like a disabled button, an inactive button is unusable and un-clickable. However, it retains the current focus state.
* @default false
Expand Down Expand Up @@ -2791,6 +2796,11 @@ declare namespace LocalJSX {
* @default false
*/
"iconRight"?: boolean;
/**
* Link behaves as an inline element.
* @default false
*/
"inline"?: boolean;
/**
* Displays the button in a loading state with a spinner. Just like a disabled button, an inactive button is unusable and un-clickable. However, it retains the current focus state.
* @default false
Expand Down
13 changes: 11 additions & 2 deletions core/src/components/cat-button/cat-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ $button-sizes: (
outline: 2px solid cat-token('color.ui.border.focus');
outline-offset: 1px;
}

&.cat-button-inline {
display: inline;
padding: 0;
}
}

// ----- content
Expand All @@ -60,6 +65,10 @@ $button-sizes: (
.cat-button-empty & {
display: none;
}

.cat-button-inline & {
display: inline;
}
}

.cat-button-content-inner {
Expand Down Expand Up @@ -188,11 +197,11 @@ $button-sizes: (
}

&:hover:not(.cat-button-disabled):not(.cat-button-loading) {
text-decoration-style: cat-token('font.decoration.linkButtonHover');
text-decoration: cat-token('font.decoration.linkButtonHover');
}

&.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading) {
text-decoration-style: cat-token('font.decoration.linkButtonHover');
text-decoration: cat-token('font.decoration.linkButtonHover');
}
}

Expand Down
8 changes: 7 additions & 1 deletion core/src/components/cat-button/cat-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ export class CatButton {
*/
@Prop() urlTarget?: '_blank' | '_self';

/**
* Link behaves as an inline element.
*/
@Prop() inline = false;

/**
* The name of an icon to be displayed in the button.
*/
Expand Down Expand Up @@ -268,7 +273,8 @@ export class CatButton {
'cat-button-round': this.round,
'cat-button-loading': this.loading,
'cat-button-disabled': this.disabled,
'cat-button-ellipsed': !this.noEllipsis && !this.isIconButton,
'cat-button-ellipsed': !this.noEllipsis && !this.isIconButton && !this.inline,
'cat-button-inline': this.inline,
[`cat-button-${this.variant}`]: Boolean(this.variant),
[`cat-button-${this.color}`]: Boolean(this.color),
[`cat-button-${this.size}`]: Boolean(this.size),
Expand Down
1 change: 1 addition & 0 deletions core/src/components/cat-button/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ once per view for main call-to-action.
| `icon` | `icon` | The name of an icon to be displayed in the button. | `string \| undefined` | `undefined` |
| `iconOnly` | `icon-only` | Hide the actual button content and only display the icon. | `"l" \| "m" \| "s" \| "xl" \| "xs" \| boolean` | `false` |
| `iconRight` | `icon-right` | Display the icon on the right. | `boolean` | `false` |
| `inline` | `inline` | Link behaves as an inline element. | `boolean` | `false` |
| `loading` | `loading` | Displays the button in a loading state with a spinner. Just like a disabled button, an inactive button is unusable and un-clickable. However, it retains the current focus state. | `boolean` | `false` |
| `name` | `name` | The name of the button, which gets paired with the button's value when submitted as part of a form. Corresponds with the native HTML name attribute. | `string \| undefined` | `undefined` |
| `nativeAttributes` | -- | Attributes that will be added to the native HTML button element | `undefined \| { [key: string]: string; }` | `undefined` |
Expand Down
2 changes: 2 additions & 0 deletions core/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,8 @@ <h3>Links</h3>
<cat-button url="http://www.google.de">Google</cat-button>
<cat-button url="http://www.google.de" url-target="_blank">Google (ext.)</cat-button>

<div class="cat-mt-s"><cat-button inline="true" variant="link" url="http://www.google.de">Link 1</cat-button><cat-button inline="true" variant="link" url="http://www.google.de">Link 2</cat-button></div>

<h3>Active</h3>
<cat-button icon="sparkle-filled" active="true" variant="filled" color="primary">Primary</cat-button>
<cat-button icon="sparkle-filled" active="true" variant="outlined" color="primary">Primary</cat-button>
Expand Down
1 change: 1 addition & 0 deletions vue/src/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const CatButton = /*@__PURE__*/ defineContainer<JSX.CatButton>('cat-butto
'round',
'url',
'urlTarget',
'inline',
'icon',
'iconOnly',
'iconRight',
Expand Down
Loading