diff --git a/projects/demo-playwright/tests/kit/action-bar/action-bar.mobile.spec.ts b/projects/demo-playwright/tests/kit/action-bar/action-bar.mobile.spec.ts index 0ec8abe194b8..7831652bfe51 100644 --- a/projects/demo-playwright/tests/kit/action-bar/action-bar.mobile.spec.ts +++ b/projects/demo-playwright/tests/kit/action-bar/action-bar.mobile.spec.ts @@ -19,7 +19,7 @@ test.describe('ActionBar', () => { test('works', async ({page}) => { await tuiGoto(page, DemoRoute.ActionBar); - const example = page.locator('#base'); + const example = page.locator('#size--m'); const showActionBarButton = example.locator('label').first(); await showActionBarButton.click(); diff --git a/projects/demo-playwright/tests/kit/action-bar/action-bar.spec.ts b/projects/demo-playwright/tests/kit/action-bar/action-bar.spec.ts index 6dc5fec8bf28..c4b7bfc2e941 100644 --- a/projects/demo-playwright/tests/kit/action-bar/action-bar.spec.ts +++ b/projects/demo-playwright/tests/kit/action-bar/action-bar.spec.ts @@ -9,7 +9,7 @@ test.describe('ActionBar', () => { test('works', async ({page}) => { await tuiGoto(page, DemoRoute.ActionBar); - const example = page.locator('#base'); + const example = page.locator('#size--m'); const showActionBarButton = example.locator('label').first(); await showActionBarButton.click(); diff --git a/projects/demo/src/modules/app/pages.ts b/projects/demo/src/modules/app/pages.ts index 392e0fedbe92..b64ba7687a5b 100644 --- a/projects/demo/src/modules/app/pages.ts +++ b/projects/demo/src/modules/app/pages.ts @@ -891,7 +891,7 @@ export const pages: TuiDocRoutePages = [ { section: 'Navigation', title: 'Segmented', - keywords: 'tabs, control, radio, navigation, навигация, beaver, вкладки, таб', + keywords: 'tabs, control, radio, navigation, навигация, вкладки, таб', route: DemoRoute.Segmented, }, { @@ -934,7 +934,7 @@ export const pages: TuiDocRoutePages = [ { section: 'Layout', title: 'Navigation', - keywords: 'шапка, header, sidebar, aside, сайдбар, навигация', + keywords: 'шапка, header, sidebar, aside, сайдбар, навигация, beaver', route: DemoRoute.Navigation, }, { diff --git a/projects/demo/src/modules/components/action-bar/examples/1/index.html b/projects/demo/src/modules/components/action-bar/examples/1/index.html index db0ca43c37e5..b24835ad8aa4 100644 --- a/projects/demo/src/modules/components/action-bar/examples/1/index.html +++ b/projects/demo/src/modules/components/action-bar/examples/1/index.html @@ -68,42 +68,91 @@ + + +
- Selected: {{ selected }} of {{ items.length }} - + Selected: {{ selected }} of {{ items.length }}
+ + + + + + + + + + + + + + + + + + diff --git a/projects/demo/src/modules/components/action-bar/examples/2/index.less b/projects/demo/src/modules/components/action-bar/examples/2/index.less deleted file mode 100644 index f01b0f68fc8d..000000000000 --- a/projects/demo/src/modules/components/action-bar/examples/2/index.less +++ /dev/null @@ -1,5 +0,0 @@ -tui-action-bar { - left: 3rem; - right: 3rem; - background: var(--tui-chart-categorical-13); -} diff --git a/projects/demo/src/modules/components/action-bar/examples/2/index.ts b/projects/demo/src/modules/components/action-bar/examples/2/index.ts index beaaa3548002..577ab632fc9b 100644 --- a/projects/demo/src/modules/components/action-bar/examples/2/index.ts +++ b/projects/demo/src/modules/components/action-bar/examples/2/index.ts @@ -1,15 +1,23 @@ -import {Component, signal} from '@angular/core'; +import {NgIf} from '@angular/common'; +import {Component, inject, signal} from '@angular/core'; +import {toSignal} from '@angular/core/rxjs-interop'; import {changeDetection} from '@demo/emulate/change-detection'; -import {TuiButton} from '@taiga-ui/core'; +import {encapsulation} from '@demo/emulate/encapsulation'; +import {TuiBreakpointService, TuiButton} from '@taiga-ui/core'; import {TuiActionBar} from '@taiga-ui/kit'; +import {map} from 'rxjs'; @Component({ standalone: true, - imports: [TuiActionBar, TuiButton], + imports: [NgIf, TuiActionBar, TuiButton], templateUrl: './index.html', - styleUrls: ['./index.less'], + encapsulation, changeDetection, }) export default class Example { protected open = signal(false); + + protected readonly isMobile = toSignal( + inject(TuiBreakpointService).pipe(map((size) => size === 'mobile')), + ); } diff --git a/projects/demo/src/modules/components/action-bar/index.html b/projects/demo/src/modules/components/action-bar/index.html index 679d016ae2f4..b0bcf522593a 100644 --- a/projects/demo/src/modules/components/action-bar/index.html +++ b/projects/demo/src/modules/components/action-bar/index.html @@ -4,23 +4,15 @@ type="components" > -

- It is an element on the bottom of screen to show actions by multiselect of some items. It works with custom - content. -

+ It is an element on the bottom of screen to show actions by multiselect of some items. It works with custom + content. - -
diff --git a/projects/demo/src/modules/components/action-bar/index.ts b/projects/demo/src/modules/components/action-bar/index.ts index d8d72f53e33b..2759645d6635 100644 --- a/projects/demo/src/modules/components/action-bar/index.ts +++ b/projects/demo/src/modules/components/action-bar/index.ts @@ -9,4 +9,6 @@ import {TuiDemo} from '@demo/utils'; styleUrls: ['./index.less'], changeDetection, }) -export default class Page {} +export default class Page { + protected readonly examples = ['Size M', 'Size S']; +} diff --git a/projects/demo/used-icons.ts b/projects/demo/used-icons.ts index c53ea95328d4..d6b3fd11ed1c 100644 --- a/projects/demo/used-icons.ts +++ b/projects/demo/used-icons.ts @@ -19,13 +19,13 @@ export const TUI_USED_ICONS = [ '@tui.trash', '@tui.layout-grid', '@tui.x', + '@tui.star', '@tui.check', '@tui.user', '@tui.chevron-left', '@tui.mastercard', '@tui.box', '@tui.lock', - '@tui.star', '@tui.gift', '@tui.arrow-right', '@tui.users', diff --git a/projects/kit/components/action-bar/action-bar.component.ts b/projects/kit/components/action-bar/action-bar.component.ts index c6ab38738fc7..495f433128d6 100644 --- a/projects/kit/components/action-bar/action-bar.component.ts +++ b/projects/kit/components/action-bar/action-bar.component.ts @@ -1,7 +1,12 @@ import {ChangeDetectionStrategy, Component, inject, Input} from '@angular/core'; +import {tuiProvide} from '@taiga-ui/cdk/utils/miscellaneous'; import {tuiFadeIn, tuiSlideInTop} from '@taiga-ui/core/animations'; +import type {TuiButtonOptions} from '@taiga-ui/core/components/button'; +import {TUI_BUTTON_OPTIONS} from '@taiga-ui/core/components/button'; import {TuiExpandComponent} from '@taiga-ui/core/components/expand'; +import {tuiLinkOptionsProvider} from '@taiga-ui/core/components/link'; import {TUI_ANIMATIONS_SPEED} from '@taiga-ui/core/tokens'; +import type {TuiSizeS} from '@taiga-ui/core/types'; import {tuiToAnimationOptions} from '@taiga-ui/core/utils/miscellaneous'; @Component({ @@ -11,16 +16,26 @@ import {tuiToAnimationOptions} from '@taiga-ui/core/utils/miscellaneous'; templateUrl: './action-bar.template.html', styleUrls: ['./action-bar.style.less'], changeDetection: ChangeDetectionStrategy.OnPush, + providers: [ + tuiProvide(TUI_BUTTON_OPTIONS, TuiActionBarComponent), + tuiLinkOptionsProvider({appearance: 'icon', pseudo: true}), + ], animations: [tuiFadeIn, tuiSlideInTop], host: { tuiTheme: 'dark', + '[attr.data-size]': 'size', '[@tuiFadeIn]': 'animation', '[@tuiSlideInTop]': 'animation', }, }) -export class TuiActionBarComponent { +export class TuiActionBarComponent implements TuiButtonOptions { protected readonly animation = tuiToAnimationOptions(inject(TUI_ANIMATIONS_SPEED)); @Input() public expanded = false; + + @Input() + public size: TuiSizeS = 'm'; + + public readonly appearance = 'glass'; } diff --git a/projects/kit/components/action-bar/action-bar.style.less b/projects/kit/components/action-bar/action-bar.style.less index 10a7bb4ae76e..924c6a459086 100644 --- a/projects/kit/components/action-bar/action-bar.style.less +++ b/projects/kit/components/action-bar/action-bar.style.less @@ -2,37 +2,70 @@ :host { position: fixed; - left: 1rem; - right: 1rem; + left: ~'max(calc(50% - 37rem), 1.5rem)'; bottom: 1rem; display: flex; + inline-size: 100%; + max-inline-size: ~'min(calc(100vw - 3rem), 74rem)'; box-sizing: border-box; - min-block-size: 4rem; - border-radius: var(--tui-radius-xl); + border-radius: 1rem; background: var(--tui-service-backdrop); color: var(--tui-text-primary); backdrop-filter: blur(2rem); flex-direction: column; justify-content: center; - padding: 0.625rem; + padding: 0.75rem; + text-indent: 0.75rem; + font: var(--tui-font-text-m); + white-space: nowrap; + + &[data-size='s'] { + border-radius: var(--tui-radius-l); + font: var(--tui-font-text-s); + padding: 0.5rem; + } + + :host-context(tui-root._mobile) & { + padding: 1rem; + border-radius: 1.25rem; + text-indent: 0; + } ::ng-deep tui-data-list[data-size] { - padding: 0.25rem 0 0.5rem; + padding: 0; + margin: -0.625rem -0.625rem 1rem; + } + + ::ng-deep tui-items-with-more { + text-indent: 0.5rem; + + :host-context(tui-root._mobile) & { + display: none; + } } } .t-content { display: flex; - justify-content: space-between; align-items: center; - padding-left: 0.625rem; + gap: 0.7rem 2.5rem; + + :host-context(tui-root._mobile) & { + flex-wrap: wrap; + } } .t-actions { display: flex; + justify-content: flex-end; gap: 0.5rem; + margin-inline-start: auto; :host-context(tui-root._mobile) & { - gap: 0.375rem; + flex: 1; + + ::ng-deep [tuiButton] { + flex: 1; + } } } diff --git a/projects/kit/components/items-with-more/items-with-more.style.less b/projects/kit/components/items-with-more/items-with-more.style.less index 2df16972d7cd..5a684c894629 100644 --- a/projects/kit/components/items-with-more/items-with-more.style.less +++ b/projects/kit/components/items-with-more/items-with-more.style.less @@ -1,6 +1,8 @@ :host { position: relative; display: flex; + min-inline-size: 0; + flex: 1; align-items: center; white-space: nowrap; }