-
Notifications
You must be signed in to change notification settings - Fork 3
feat(docs): tabs examples (#DS-2907) #329
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
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
5516aee
tabs new docs
sk8knut 8adcac3
cspell
sk8knut 735a049
linter fix
sk8knut a63c38a
overview, vertical and disabled examples
sk8knut 922fe97
linter fixes + empty example + styles
sk8knut 946b32e
all examples done
sk8knut eef3c12
text fixes
sk8knut ecef192
style fixes
sk8knut 0a413a5
closed empty tags
sk8knut c0e7293
styles fixes
sk8knut 0838101
Merge branch 'main' into feat/DS-2907
sk8knut 2171360
first underlined tabs example
sk8knut 2bf6f8a
added actionbar example + refactor + review
sk8knut b4d8647
actionbar cspell
sk8knut 6ad9c5c
Merge branch 'main' into feat/DS-2907
sk8knut 4f0b382
tooltip work in vetical icons example + added tab text to all tabs
sk8knut eba779f
fixes md file head
sk8knut 2d30918
different text for tabs
sk8knut e5fb00f
Merge branch 'main' into feat/DS-2907
sk8knut 0281e2e
vetical icons example tooltips placement
sk8knut 777bb82
more review fixes
sk8knut 22156ea
prettier fix
sk8knut 9a141f0
added empty label color
sk8knut 732bedc
crazy attemts to fix right padding when scroll example container
sk8knut dcda352
new review fixes
sk8knut 34dab6d
tabs actionbar with scroll WIN
sk8knut 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
2 changes: 1 addition & 1 deletion
2
apps/docs/src/app/components/docs-live-example-viewer/docs-live-example-viewer.html
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,23 +1,65 @@ | ||
### Default tabs | ||
Вкладки — способ отображения связанной информации на отдельных подписанных областях экрана. | ||
|
||
<!-- example(tabs-overview) --> | ||
|
||
### Vertical tabs | ||
### Состояния | ||
|
||
#### Вертикальные вкладки | ||
|
||
Длинный список вкладок можно разместить вертикально, чтобы все элементы были видны без прокрутки. | ||
|
||
<!-- example(tabs-vertical) --> | ||
|
||
### Stretch tabs | ||
Вертикальный вкладки можно использовать и без подписи. Добавляйте тултип иконкам, чтобы пояснить название раздела. | ||
|
||
<!-- example(tabs-stretch) --> | ||
<!-- example(tabs-vertical-icons) --> | ||
|
||
### Tabs with scroll | ||
#### Вкладки с полоской | ||
|
||
<!-- example(tabs-with-scroll) --> | ||
<!-- example(tabs-underlined) --> | ||
|
||
#### Disabled | ||
|
||
Неактивный таб нельзя выбрать, а выбранный неактивный нельзя переключить. | ||
|
||
### Empty tab | ||
<!-- example(tabs-disabled) --> | ||
|
||
#### Пустая вкладка | ||
|
||
Вкладка, внутри которой нет контента, может оформляться по‑особенному, чтобы заранее обозначить для пользователя, что нет нужды изучать содержимое: она будет серой в невыбранном состоянии. | ||
|
||
<!-- example(tabs-empty) --> | ||
|
||
### Old tabs | ||
#### Прокрутка | ||
|
||
Горизонтальные вкладки скрываются за областью видимости без переноса на новую строку или колонку (для вертикальных вкладок) и появляется прокрутка. | ||
|
||
<!-- example(tabs-with-scroll) --> | ||
|
||
### Примеры использования | ||
|
||
#### Выравнивание по ширине | ||
|
||
По умолчанию ширина горизонтальных вкладов зависит от подписей внутри элементов, но при необходимости панель табов может заполнять все пространство контейнера. | ||
|
||
<!-- example(tabs-stretch) --> | ||
|
||
#### Кнопки в строке вкладок | ||
|
||
Кнопки действий удобно разместить в строке с более высокими подчеркнутыми вкладками. | ||
|
||
<!-- example(tabs-actionbar) --> | ||
|
||
### Рекомендации | ||
|
||
Используйте для навигации по контенту на странице, когда важно дать быстрый доступ его к отдельным частям. | ||
|
||
По внешним признакам вкладки похожи на навигационное меню или на шаги формы-мастера. Дизайнеру стоит избегать этой путаницы, поэтому стилизовать эти элементы нужно по-разному. В нестандартных случаях лучше оставлять примечания для разработчика, например: обрати внимание, это не вкладки, а шаги формы. | ||
|
||
Не используйте вкладки: | ||
|
||
<!-- example(tabs-old) --> | ||
- Когда весь контент можно разместить на одной странице, на одном экране. Незачем прятать его части под вкладки. Когда предполагается всего одна вкладка, то панель вкладок вовсе не нужна. | ||
- Для выбора значения в формах. Не путайте вкладки с полями ввода: [радиокнопками](/components/radio), [кнопками-переключателями](/components/button-toggle). Вкладки — это навигация. | ||
- Для основной навигации, для этого есть компонент [Navbar](/components/navbar). Используйте вкладки для второстепенной навигации. | ||
- Когда надо изменить представление одних и тех же данных (список, плитка, таблица). Взамен используйте [кнопку-меню](/components/dropdown) или [кнопку-переключатель](/components/button-toggle). | ||
- Когда контент уже вложен во вкладку. В том числе нельзя одновременно использовать вертикальные и горизонтальные вкладки. Вместо этого сократите количество вкладок, используйте только один вид вкладок или кнопку-переключатель, кнопку-меню. |
This file contains hidden or 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
47 changes: 47 additions & 0 deletions
47
packages/docs-examples/components/tabs/tabs-actionbar/tabs-actionbar-example.css
This file contains hidden or 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,47 @@ | ||
.docs-live-example__example_tabs-actionbar { | ||
padding-right: 0; | ||
} | ||
|
||
.tabs-actionbar-example { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
position: relative; | ||
} | ||
|
||
.tabs-actionbar-example__center { | ||
position: relative; | ||
width: 100%; | ||
height: 48px; | ||
min-width: 16px; | ||
|
||
&:after { | ||
content: ''; | ||
position: absolute; | ||
left: 0; | ||
bottom: 0; | ||
right: 0; | ||
height: 1px; | ||
background: rgba(13, 14, 18, 0.12); | ||
} | ||
} | ||
|
||
.tabs-actionbar-example__controls { | ||
position: relative; | ||
display: flex; | ||
padding: 8px 20px 8px 0; | ||
|
||
&:after { | ||
content: ''; | ||
position: absolute; | ||
left: 0; | ||
bottom: 0; | ||
right: 20px; | ||
height: 1px; | ||
background: rgba(13, 14, 18, 0.12); | ||
} | ||
|
||
button + button { | ||
margin-left: 8px; | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
packages/docs-examples/components/tabs/tabs-actionbar/tabs-actionbar-example.html
This file contains hidden or 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,37 @@ | ||
<div class="tabs-actionbar-example"> | ||
<kbq-tab-group underlined> | ||
<kbq-tab [label]="'BitDefender'" /> | ||
<kbq-tab [label]="'Fortinet'" /> | ||
<kbq-tab [label]="'Kaspersky'" /> | ||
</kbq-tab-group> | ||
<div class="tabs-actionbar-example__center"></div> | ||
<div class="tabs-actionbar-example__controls"> | ||
<button | ||
kbq-button | ||
class="kbq-button_transparent" | ||
[color]="'contrast'" | ||
> | ||
<i | ||
kbq-icon="kbq-list_16" | ||
[color]="'theme'" | ||
></i> | ||
</button> | ||
<button | ||
kbq-button | ||
class="kbq-button_transparent" | ||
[color]="'contrast'" | ||
> | ||
<i | ||
kbq-icon="kbq-filter_16" | ||
[color]="'theme'" | ||
></i> | ||
</button> | ||
<button | ||
kbq-button | ||
[color]="'contrast'" | ||
> | ||
<i kbq-icon="kbq-plus_16"></i> | ||
Создать дашборд | ||
</button> | ||
</div> | ||
</div> |
12 changes: 12 additions & 0 deletions
12
packages/docs-examples/components/tabs/tabs-actionbar/tabs-actionbar-example.ts
This file contains hidden or 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, ViewEncapsulation } from '@angular/core'; | ||
|
||
/** | ||
* @title Tabs actionbar | ||
*/ | ||
@Component({ | ||
selector: 'tabs-actionbar-example', | ||
templateUrl: 'tabs-actionbar-example.html', | ||
styleUrls: ['tabs-actionbar-example.css'], | ||
encapsulation: ViewEncapsulation.None | ||
}) | ||
export class TabsActionbarExample {} |
5 changes: 5 additions & 0 deletions
5
packages/docs-examples/components/tabs/tabs-disabled/tabs-disabled-example.css
This file contains hidden or 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,5 @@ | ||
.tabs-disabled-example { | ||
kbq-tab-group + kbq-tab-group { | ||
margin-top: 16px; | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
packages/docs-examples/components/tabs/tabs-disabled/tabs-disabled-example.html
This file contains hidden or 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,30 @@ | ||
<div class="tabs-disabled-example"> | ||
<kbq-tab-group> | ||
<kbq-tab [label]="'Bruteforce'" /> | ||
<kbq-tab | ||
[disabled]="true" | ||
[label]="'Complex Attack'" | ||
/> | ||
<kbq-tab [label]="'DDoS'" /> | ||
<kbq-tab [label]="'DoS'" /> | ||
</kbq-tab-group> | ||
|
||
<kbq-tab-group> | ||
<kbq-tab | ||
[disabled]="true" | ||
[label]="'Bruteforce'" | ||
/> | ||
<kbq-tab | ||
[disabled]="true" | ||
[label]="'Complex Attack'" | ||
/> | ||
<kbq-tab | ||
[disabled]="true" | ||
[label]="'DDoS'" | ||
/> | ||
<kbq-tab | ||
[disabled]="true" | ||
[label]="'DoS'" | ||
/> | ||
</kbq-tab-group> | ||
</div> |
12 changes: 12 additions & 0 deletions
12
packages/docs-examples/components/tabs/tabs-disabled/tabs-disabled-example.ts
This file contains hidden or 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, ViewEncapsulation } from '@angular/core'; | ||
|
||
/** | ||
* @title Tabs disabled | ||
*/ | ||
@Component({ | ||
selector: 'tabs-disabled-example', | ||
templateUrl: 'tabs-disabled-example.html', | ||
styleUrls: ['tabs-disabled-example.css'], | ||
encapsulation: ViewEncapsulation.None | ||
}) | ||
export class TabsDisabledExample {} |
9 changes: 7 additions & 2 deletions
9
packages/docs-examples/components/tabs/tabs-empty/tabs-empty-example.css
This file contains hidden or 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,3 +1,8 @@ | ||
.empty-tab-content { | ||
text-align: center; | ||
.tabs-empty-example { | ||
.empty-tab-content { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
height: 200px; | ||
} | ||
} |
Oops, something went wrong.
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.
почему сразу не писать standalone? меньше же потом рефакторить прийдется