diff --git a/projects/addon-doc/src/components/demo/demo.component.ts b/projects/addon-doc/src/components/demo/demo.component.ts index 3d389ac7db1e..f3b7c81f354e 100644 --- a/projects/addon-doc/src/components/demo/demo.component.ts +++ b/projects/addon-doc/src/components/demo/demo.component.ts @@ -17,7 +17,7 @@ import { } from '@angular/core'; import {AbstractControl, FormControl, FormGroup} from '@angular/forms'; import {UrlSerializer} from '@angular/router'; -import {TuiDestroyService} from '@taiga-ui/cdk'; +import {TUI_IS_MOBILE, TuiDestroyService} from '@taiga-ui/cdk'; import {TuiBrightness, TuiModeDirective} from '@taiga-ui/core'; import {Subject} from 'rxjs'; import {startWith, takeUntil} from 'rxjs/operators'; @@ -55,6 +55,8 @@ export class TuiDocDemoComponent implements OnInit, AfterViewInit { @ContentChild(TemplateRef) readonly template?: TemplateRef<{}>; + readonly items: readonly TuiBrightness[] = ['onLight', 'onDark']; + private initialX = 0; private wrapperWidth = 0; @@ -70,6 +72,7 @@ export class TuiDocDemoComponent implements OnInit, AfterViewInit { private readonly isBrowser: boolean; constructor( + @Inject(TUI_IS_MOBILE) readonly isMobile: boolean, @Inject(TuiDestroyService) private readonly destroy$: TuiDestroyService, @Inject(Renderer2) private readonly renderer: Renderer2, @Inject(PLATFORM_ID) platformId: Object, @@ -79,7 +82,7 @@ export class TuiDocDemoComponent implements OnInit, AfterViewInit { ) { this.isBrowser = isPlatformBrowser(platformId); - const parsedMode = locationRef.path().match(/tui-mode=(light|dark)/); + const parsedMode = locationRef.path().match(/tui-mode=(onDark|onLight)/); if (parsedMode !== null && parsedMode.length > 0) { this.modeControl.setValue(parsedMode[1]); diff --git a/projects/addon-doc/src/components/demo/demo.module.ts b/projects/addon-doc/src/components/demo/demo.module.ts index daa700a212aa..f33e86b2e878 100644 --- a/projects/addon-doc/src/components/demo/demo.module.ts +++ b/projects/addon-doc/src/components/demo/demo.module.ts @@ -8,6 +8,7 @@ import { TuiDataListModule, TuiExpandModule, TuiGroupModule, + TuiHintControllerModule, TuiLinkModule, TuiModeModule, TuiSvgModule, @@ -42,6 +43,7 @@ import {TuiDocDemoComponent} from './demo.component'; TuiDataListWrapperModule, TuiDataListModule, TuiTextfieldControllerModule, + TuiHintControllerModule, ], declarations: [TuiDocDemoComponent], exports: [TuiDocDemoComponent], diff --git a/projects/addon-doc/src/components/demo/demo.style.less b/projects/addon-doc/src/components/demo/demo.style.less index 333529a871a4..36fa86d11a9b 100644 --- a/projects/addon-doc/src/components/demo/demo.style.less +++ b/projects/addon-doc/src/components/demo/demo.style.less @@ -115,6 +115,10 @@ border-radius: 4px; } +.mode { + width: 200px; +} + .select { max-width: 240px; } @@ -169,9 +173,11 @@ } @supports (position: sticky) { - :host { - position: sticky; - top: 8px; - z-index: 2; + @media screen and (min-height: 600px) { + :host { + position: sticky; + top: 74px; + z-index: 2; + } } } diff --git a/projects/addon-doc/src/components/demo/demo.template.html b/projects/addon-doc/src/components/demo/demo.template.html index 5acc292cc5b0..0af9ba77064e 100644 --- a/projects/addon-doc/src/components/demo/demo.template.html +++ b/projects/addon-doc/src/components/demo/demo.template.html @@ -1,45 +1,61 @@
- tuiMode: - - - {{texts[0]}} - - tuiMode - - - -
- + {{texts[0]}} + + tuiMode + + + + - null - - - onDark - - - onLight - -
+ tuiMode + + + + + tuiMode: + +
+ + null + + + onDark + + + onLight + +
+