-
Notifications
You must be signed in to change notification settings - Fork 474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(kit)!: Action
better customization + new API
#2505
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a791c05
feat(kit)!: `Action` better customization + new API
nsbarsukov 70a0a9f
refactor: return built-in marker-icon inside `Action`
nsbarsukov 73084e4
chore: remove code block inside example
nsbarsukov e311971
chore: add warning `This component requires @taiga-ui/styles...`
nsbarsukov 01a8847
refactor: move `MarkerIcon` specific logic inside `Action`
nsbarsukov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
39 changes: 39 additions & 0 deletions
39
projects/demo/src/modules/components/action/examples/3/index.html
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,39 @@ | ||
<button tuiAction> | ||
<section> | ||
<h3 class="header tui-text_body-s">Header</h3> | ||
<p class="description tui-text_body-xs">Description</p> | ||
</section> | ||
<tui-marker-icon | ||
size="xs" | ||
src="tuiIconStarLarge" | ||
class="tui-island__marker" | ||
></tui-marker-icon> | ||
</button> | ||
|
||
<button tuiAction> | ||
<section> | ||
<h3 class="header tui-text_body-m">Header</h3> | ||
<p class="description tui-text_body-s">Description</p> | ||
</section> | ||
<tui-marker-icon | ||
size="s" | ||
src="tuiIconBellLarge" | ||
class="tui-island__marker" | ||
></tui-marker-icon> | ||
</button> | ||
|
||
<button tuiAction> | ||
<section> | ||
<h3 class="header tui-text_h6">Header</h3> | ||
<p class="description tui-text_body-m"> | ||
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the | ||
industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and | ||
scrambled it to make a type specimen book. | ||
</p> | ||
</section> | ||
<tui-marker-icon | ||
size="m" | ||
src="tuiIconFlagLarge" | ||
class="tui-island__marker" | ||
></tui-marker-icon> | ||
</button> |
21 changes: 21 additions & 0 deletions
21
projects/demo/src/modules/components/action/examples/3/index.less
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,21 @@ | ||
[tuiAction] { | ||
max-width: 26rem; | ||
align-items: center; | ||
|
||
&:not(:last-child) { | ||
margin-bottom: 1.5rem; | ||
} | ||
} | ||
|
||
.header, | ||
.description { | ||
margin: 0; | ||
} | ||
|
||
.header { | ||
font-weight: bold; | ||
} | ||
|
||
.description { | ||
color: var(--tui-text-02); | ||
} |
12 changes: 12 additions & 0 deletions
12
projects/demo/src/modules/components/action/examples/3/index.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,12 @@ | ||
import {Component} from '@angular/core'; | ||
import {changeDetection} from '@demo/emulate/change-detection'; | ||
import {encapsulation} from '@demo/emulate/encapsulation'; | ||
|
||
@Component({ | ||
selector: `tui-action-example-3`, | ||
templateUrl: `./index.html`, | ||
styleUrls: [`./index.less`], | ||
changeDetection, | ||
encapsulation, | ||
}) | ||
export class TuiActionExample3 {} |
29 changes: 29 additions & 0 deletions
29
projects/demo/src/modules/components/action/examples/4/index.html
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,29 @@ | ||
<button tuiAction> | ||
<tui-marker-icon | ||
size="s" | ||
src="tuiIconLikeLarge" | ||
class="tui-island__marker" | ||
></tui-marker-icon> | ||
<section> | ||
<h3 class="header tui-text_body-s">Header</h3> | ||
<p class="description tui-text_body-xs">Description</p> | ||
</section> | ||
</button> | ||
|
||
<button | ||
tuiAction | ||
class="no-shadow" | ||
> | ||
<tui-marker-icon | ||
size="s" | ||
src="tuiIconDislikeLarge" | ||
class="tui-island__marker" | ||
></tui-marker-icon> | ||
<section> | ||
<h3 class="header tui-text_body-s">Header</h3> | ||
<p class="description tui-text_body-xs"> | ||
Use | ||
<code>box-shadow: none</code> | ||
</p> | ||
</section> | ||
</button> |
33 changes: 33 additions & 0 deletions
33
projects/demo/src/modules/components/action/examples/4/index.less
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,33 @@ | ||
:host { | ||
display: flex; | ||
flex-wrap: wrap; | ||
column-gap: 3rem; | ||
row-gap: 1.5rem; | ||
} | ||
|
||
[tuiAction] { | ||
flex: 1; | ||
justify-content: start; | ||
align-items: center; | ||
} | ||
|
||
.no-shadow { | ||
box-shadow: none; | ||
|
||
&:hover { | ||
box-shadow: none; | ||
} | ||
} | ||
|
||
.header, | ||
.description { | ||
margin: 0; | ||
} | ||
|
||
.header { | ||
font-weight: bold; | ||
} | ||
|
||
.description { | ||
color: var(--tui-text-02); | ||
} |
12 changes: 12 additions & 0 deletions
12
projects/demo/src/modules/components/action/examples/4/index.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,12 @@ | ||
import {Component} from '@angular/core'; | ||
import {changeDetection} from '@demo/emulate/change-detection'; | ||
import {encapsulation} from '@demo/emulate/encapsulation'; | ||
|
||
@Component({ | ||
selector: `tui-action-example-4`, | ||
templateUrl: `./index.html`, | ||
styleUrls: [`./index.less`], | ||
changeDetection, | ||
encapsulation, | ||
}) | ||
export class TuiActionExample4 {} |
19 changes: 19 additions & 0 deletions
19
projects/demo/src/modules/components/action/examples/5/index.html
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,19 @@ | ||
<a | ||
tuiAction | ||
target="_blank" | ||
href="http://www.montypython.com" | ||
> | ||
<section> | ||
<tui-marker-icon | ||
size="s" | ||
src="tuiIconAlignJustifyLarge" | ||
class="tui-island__marker" | ||
></tui-marker-icon> | ||
<h3 class="header tui-text_body-m">Header</h3> | ||
<p class="description tui-text_body-s"> | ||
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the | ||
industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and | ||
scrambled it to make a type specimen book. | ||
</p> | ||
</section> | ||
</a> |
18 changes: 18 additions & 0 deletions
18
projects/demo/src/modules/components/action/examples/5/index.less
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 @@ | ||
[tuiAction] { | ||
max-width: 20rem; | ||
align-items: center; | ||
} | ||
|
||
.header, | ||
.description { | ||
margin: 0; | ||
} | ||
|
||
.header { | ||
margin-top: 0.5rem; | ||
font-weight: bold; | ||
} | ||
|
||
.description { | ||
color: var(--tui-text-02); | ||
} |
12 changes: 12 additions & 0 deletions
12
projects/demo/src/modules/components/action/examples/5/index.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,12 @@ | ||
import {Component} from '@angular/core'; | ||
import {changeDetection} from '@demo/emulate/change-detection'; | ||
import {encapsulation} from '@demo/emulate/encapsulation'; | ||
|
||
@Component({ | ||
selector: `tui-action-example-5`, | ||
templateUrl: `./index.html`, | ||
styleUrls: [`./index.less`], | ||
changeDetection, | ||
encapsulation, | ||
}) | ||
export class TuiActionExample5 {} |
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 |
---|---|---|
@@ -1,27 +1,19 @@ | ||
@import 'taiga-ui-local'; | ||
|
||
:host { | ||
.hoverable-with-shadow(); | ||
.clearbtn(); | ||
position: relative; | ||
display: flex; | ||
justify-content: space-between; | ||
font: var(--tui-font-text-m); | ||
padding: 0.875rem; | ||
color: var(--tui-text-01); | ||
text-decoration: none; | ||
border: 2px solid transparent; | ||
border-radius: var(--tui-radius-l); | ||
outline: none; | ||
text-align: start; | ||
|
||
&._focus-visible { | ||
border-color: var(--tui-focus); | ||
} | ||
} | ||
|
||
.t-icon { | ||
margin-left: 1.25rem; | ||
color: var(--tui-action-color, var(--tui-link)); | ||
background-color: var(--tui-action-background, var(--tui-base-02)); | ||
&:after { | ||
display: none; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<ng-content></ng-content> | ||
<tui-marker-icon | ||
*ngIf="icon" | ||
size="s" | ||
class="t-icon" | ||
class="tui-island__marker" | ||
[src]="icon" | ||
></tui-marker-icon> |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this all of a sudden? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, we can't override these lines :(
https://github.com/Tinkoff/taiga-ui/blob/9a7fa2aa170353e68d086952812b99b18a666adc/projects/kit/components/marker-icon/marker-icon.style.less#L17-L18
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can instead leave those styles inside
action.style.less
? Since they areAction
related, notIsland
related?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done ✅