Skip to content

Commit

Permalink
feature: 17733 updated tage demo page
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxim Yarosh authored and jmksm96 committed Apr 25, 2024
1 parent 123390f commit 2139ee5
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@
</pupa-tag-action-button>
</pupa-tag>

<pupa-tag kind="selected" [clickable]="true">
<pupa-tag-text>Selected</pupa-tag-text>
<pupa-tag-action-button *pupaTagActionButtonTemplate>
<pupa-icon [name]="'app-chevron-down'"></pupa-icon>
</pupa-tag-action-button>
</pupa-tag>

<pupa-tag kind="custom" [clickable]="true">
<pupa-tag-text>Custom</pupa-tag-text>
<pupa-tag-action-button *pupaTagActionButtonTemplate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<pupa-tag kind="success" [disabled]="true">Success</pupa-tag>
<pupa-tag kind="danger" [disabled]="true">Danger</pupa-tag>
<pupa-tag kind="warning" [disabled]="true">Warning</pupa-tag>
<pupa-tag kind="selected" [disabled]="true">Selected</pupa-tag>
<pupa-tag kind="custom" [disabled]="true">Custom</pupa-tag>
</div>
<div class="tag-container">
Expand Down Expand Up @@ -42,6 +43,13 @@
</pupa-tag-action-button>
</pupa-tag>

<pupa-tag kind="selected" [clickable]="true" [disabled]="true">
<pupa-tag-text>Selected</pupa-tag-text>
<pupa-tag-action-button *pupaTagActionButtonTemplate>
<pupa-icon [name]="'app-chevron-down'"></pupa-icon>
</pupa-tag-action-button>
</pupa-tag>

<pupa-tag kind="custom" [clickable]="true" [disabled]="true">
<pupa-tag-text>Custom</pupa-tag-text>
<pupa-tag-action-button *pupaTagActionButtonTemplate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,24 @@
</pupa-select-dropdown>
</pupa-select>

<pupa-select class="select" [withReset]="true" [formControl]="control6">
<pupa-select-trigger-tag [kind]="'selected'">
{{ control6.value }}
</pupa-select-trigger-tag>

<pupa-select-dropdown width="320">
<pupa-select-options-container>
<pupa-select-option *ngFor="let option of options$ | async" [value]="option.value">
<pupa-icon name="app-cube-3d"></pupa-icon>
{{ option.caption }}
</pupa-select-option>
</pupa-select-options-container>
</pupa-select-dropdown>
</pupa-select>

<pupa-select class="select" [withReset]="true" [formControl]="control5">
<pupa-select-trigger-tag [kind]="'custom'">
{{ control6.value }}
{{ control7.value }}
</pupa-select-trigger-tag>

<pupa-select-dropdown width="320">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const SELECT_OPTIONS: SelectOption[] = [
{ value: 'Value 4', caption: 'Report 4' },
{ value: 'Value 5', caption: 'Report 5' },
{ value: 'Value 6', caption: 'Report 6' },
{ value: 'Value 7', caption: 'Report 7' },
];

@Component({
Expand All @@ -30,5 +31,6 @@ export class TagExample6Component {
public readonly control4: FormControl<string> = new FormControl<string>(SELECT_OPTIONS[3].value);
public readonly control5: FormControl<string> = new FormControl<string>(SELECT_OPTIONS[4].value);
public readonly control6: FormControl<string> = new FormControl<string>(SELECT_OPTIONS[5].value);
public readonly control7: FormControl<string> = new FormControl<string>(SELECT_OPTIONS[6].value);
public readonly options$: BehaviorSubject<SelectOption[]> = new BehaviorSubject<SelectOption[]>(SELECT_OPTIONS);
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,23 @@
</pupa-tag>
</div>

<div class="trigger-container" #tagSelected>
<pupa-tag kind="selected" [clickable]="true">
<pupa-tag-text>Ninja tag</pupa-tag-text>

<pupa-tag-action-button
*pupaTagActionButtonTemplate
pupaDropdown
#dropdown="pupaDropdown"
[pupaDropdownRealTriggerElement]="tagSelected"
>
<pupa-icon [name]="(dropdown.opened$ | async) ? 'app-eye-off' : 'app-eye-on'"></pupa-icon>

<div *pupaDropdownTemplate="dropdown">Hello ninja! 🥷</div>
</pupa-tag-action-button>
</pupa-tag>
</div>

<div class="trigger-container" #tagCustom>
<pupa-tag kind="custom" [clickable]="true">
<pupa-tag-text>Ninja tag</pupa-tag-text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@
</pupa-tag-action-button>
</pupa-tag>

<pupa-tag kind="selected">
<pupa-tag-text>Ninja tag</pupa-tag-text>

<pupa-tag-action-button *pupaTagActionButtonTemplate [pupaPopover]="popover5">
<pupa-icon [name]="'app-resize'"></pupa-icon>
</pupa-tag-action-button>
</pupa-tag>

<pupa-tag kind="custom">
<pupa-tag-text>Ninja tag</pupa-tag-text>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ <h3 demoAnchor>Tag inline</h3>
<pupa-tag [kind]="kind$ | async" [disabled]="disabled$ | async" [clickable]="clickable$ | async">
Tag
<pupa-tag-action-button *pupaTagActionButtonTemplate>
<pupa-icon [name]="'app-cube'"></pupa-icon>
<pupa-icon [name]="'app-chevron-down'"></pupa-icon>
</pupa-tag-action-button>
</pupa-tag>
</div>
Expand Down
1 change: 1 addition & 0 deletions projects/demo/src/app/pages/tag-demo/tag-demo.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export class TagDemoComponent {
{ caption: 'Success', value: 'success' },
{ caption: 'Danger', value: 'danger' },
{ caption: 'Warning', value: 'warning' },
{ caption: 'Selected', value: 'selected' },
{ caption: 'Custom', value: 'custom' },
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
@include tag-preset.pupa-action-button-color-state('warning');
}

&.pupa-button_selected {
border-left: 1px solid functions.semantic-color(lines-opacity);
background-color: functions.semantic-color(kind-primary-normal, alpha-7);
color: functions.semantic-color(text-primary);
}

&.pupa-button_custom {
--pupa-tag_action_border-color-default: #{functions.semantic-color(lines-opacity)};

Expand Down

0 comments on commit 2139ee5

Please sign in to comment.