-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core/link-button): add link button component (#580)
Co-authored-by: Daniel Leroux <daniel.leroux@siemens.com>
- Loading branch information
1 parent
3b6dea9
commit d98cabc
Showing
24 changed files
with
595 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
packages/angular-test-app/src/preview-examples/link-button-disabled.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 Siemens AG | ||
* | ||
* SPDX-License-Identifier: MIT | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-example', | ||
template: ` | ||
<ix-link-button url="https://ix.siemens.io/" disabled | ||
>Link text</ix-link-button | ||
> | ||
`, | ||
}) | ||
export default class LinkButtonDisabled {} |
18 changes: 18 additions & 0 deletions
18
packages/angular-test-app/src/preview-examples/link-button.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 Siemens AG | ||
* | ||
* SPDX-License-Identifier: MIT | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-example', | ||
template: ` | ||
<ix-link-button url="https://ix.siemens.io/">Link text</ix-link-button> | ||
`, | ||
}) | ||
export default class LinkButton {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 Siemens AG | ||
* | ||
* SPDX-License-Identifier: MIT | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
@import 'common-variables'; | ||
@import './components/buttons'; | ||
@import 'mixins/hover'; | ||
|
||
:host { | ||
display: inline-flex; | ||
height: $x-large-space; | ||
font-size: $font-size-default; | ||
font-weight: $font-weight-normal; | ||
min-width: $x-large-space; | ||
|
||
.link-button { | ||
display: inline-flex; | ||
position: relative; | ||
width: 100%; | ||
padding: 0 $tiny-space 0 0; | ||
align-items: center; | ||
justify-content: center; | ||
background-color: transparent; | ||
color: var(--theme-color-primary); | ||
cursor: pointer; | ||
text-decoration: none; | ||
|
||
.link { | ||
display: block; | ||
position: relative; | ||
width: 100%; | ||
white-space: nowrap; | ||
text-overflow: ellipsis; | ||
overflow: hidden; | ||
} | ||
|
||
@include hover { | ||
color: var(--theme-color-dynamic--hover); | ||
|
||
.link { | ||
text-decoration: underline; | ||
text-underline-offset: 0.2rem; | ||
} | ||
} | ||
|
||
@include active { | ||
color: var(--theme-color-dynamic--active); | ||
|
||
.link { | ||
text-decoration: underline; | ||
text-underline-offset: 0.2rem; | ||
} | ||
} | ||
|
||
&.disabled { | ||
cursor: default; | ||
color: var(--theme-color-weak-text); | ||
} | ||
|
||
a { | ||
all: unset; | ||
} | ||
} | ||
|
||
:focus-visible { | ||
outline: 1px solid var(--theme-color-focus-bdr); | ||
} | ||
} |
Oops, something went wrong.