Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,59 +5,19 @@ <h2>Examples</h2>
<div class="flex flex-col lg:flex-row lg:justify-between lg:items-center p-4" id="header">
<h3>Component preview</h3>
<div class="flex flex-col lg:flex-row lg:items-center gap-ids-container-gap-8">
<button
type="button"
idsIconButton
appearance="standard"
size="comfortable"
variant="primary"
[attr.aria-pressed]="isDark()"
(click)="toggleDark()"
>
<ids-icon icon-leading [fontIcon]="isDark() ? 'light-mode' : 'dark-mode'" />
</button>
<button
type="button"
idsButton
appearance="text"
size="comfortable"
variant="primary"
class="flex items-center gap-2"
(click)="toggleFooter()"
>
{{ isOpen() ? "Hide code" : "Show code" }}
<ids-icon icon-leading [fontIcon]="isOpen() ? 'visibility-off' : 'visibility'" />
<ids-icon icon-trailing size="compact" class="ml-1" [fontIcon]="isOpen() ? 'chevron-up' : 'chevron-down'" />
</button>
<button type="button" idsButton appearance="text" size="comfortable" variant="primary" (click)="onResetClick()">
<ids-icon icon-leading alt="" fontIcon="reload" />
</button>
</div>
</div>
<div
class="flex flex-col lg:flex-row transition-colors duration-300 w-full"
[class.bg-gray-900]="isDark()"
[class.text-white]="isDark()"
[class.bg-ids-container-bg-surface-lighter-10]="!isDark()"
>
<div class="flex flex-col lg:flex-row transition-colors duration-300 w-full bg-ids-container-bg-surface-lighter-10">
<div class="w-full lg:w-2/3 demohost-container">
<ng-content select="[demo]"/>
<ng-content select="[demo]" />
</div>
<div class="lg:w-1/3 text-ids-container-bg-surface-darker-95 bg-ids-container-bg-surface-lighter-10">
<ng-content select="[controls]"/>
<ng-content select="[controls]" />
</div>
</div>
@if (isOpen()) {
<div class="p-4 bg-ids-container-bg-surface-lighter-10 rounded-b-2xl relative h-[23.4rem] overflow-y-auto" id="footer">
<div class="absolute top-4 right-4">
<button type="button" idsButton appearance="outlined" size="comfortable" variant="primary" id="copy">
Copy code
<ids-icon icon-leading fontIcon="file-copy" />
</button>
</div>
<p>Code</p>
</div>
}
</ids-card>

<ng-content select="[examples]" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import { ComponentDetailsComponent } from '../../../pages/components/component-details/component-details.component';

import { Component, EventEmitter, inject, Output, signal } from '@angular/core';
import { Component, EventEmitter, inject, Output } from '@angular/core';
import { IdsButtonComponent } from '@i-cell/ids-angular/button';
import { IdsCardComponent } from '@i-cell/ids-angular/card';
import { IdsChipComponent } from '@i-cell/ids-angular/chip';
import { IdsIconComponent } from '@i-cell/ids-angular/icon';
import { IdsIconButtonComponent } from '@i-cell/ids-angular/icon-button';
@Component({
selector: 'app-demo-and-code',
imports: [
IdsChipComponent,
IdsCardComponent,
IdsIconComponent,
IdsIconButtonComponent,
IdsButtonComponent,
],
templateUrl: './demo-and-code.component.html',
Expand All @@ -23,17 +21,6 @@ export class DemoAndCodeComponent {
private _componentDetails = inject(ComponentDetailsComponent);
protected _lastModified = this._componentDetails.lastModified;

public isOpen = signal(false);
public isDark = signal(false);

public toggleFooter(): void {
this.isOpen.update((open) => !open);
}

public toggleDark(): void {
this.isDark.update((dark) => !dark);
}

public onResetClick(): void {
this.resetDemo.emit();
}
Expand Down
Loading