From 91167087ab85f21c514e55c566ab9dac62dcec54 Mon Sep 17 00:00:00 2001 From: Pablo Lopez Date: Wed, 18 Dec 2024 13:29:57 -0300 Subject: [PATCH] expanded panel modal --- .../expanded-panel.component.html | 13 ++++ .../expanded-panel.component.scss | 64 +++++++++++++++++++ .../expanded-panel.component.spec.ts | 23 +++++++ .../expanded-panel.component.ts | 30 +++++++++ .../expanded-panel/expanded-panel.stories.ts | 53 +++++++++++++++ 5 files changed, 183 insertions(+) create mode 100644 src/interface/src/styleguide/expanded-panel/expanded-panel.component.html create mode 100644 src/interface/src/styleguide/expanded-panel/expanded-panel.component.scss create mode 100644 src/interface/src/styleguide/expanded-panel/expanded-panel.component.spec.ts create mode 100644 src/interface/src/styleguide/expanded-panel/expanded-panel.component.ts create mode 100644 src/interface/src/styleguide/expanded-panel/expanded-panel.stories.ts diff --git a/src/interface/src/styleguide/expanded-panel/expanded-panel.component.html b/src/interface/src/styleguide/expanded-panel/expanded-panel.component.html new file mode 100644 index 000000000..85505ac23 --- /dev/null +++ b/src/interface/src/styleguide/expanded-panel/expanded-panel.component.html @@ -0,0 +1,13 @@ +
+
+ +
+
+ +
+
+
+ +
diff --git a/src/interface/src/styleguide/expanded-panel/expanded-panel.component.scss b/src/interface/src/styleguide/expanded-panel/expanded-panel.component.scss new file mode 100644 index 000000000..c4d3e2324 --- /dev/null +++ b/src/interface/src/styleguide/expanded-panel/expanded-panel.component.scss @@ -0,0 +1,64 @@ +@import 'colors'; +@import 'mixins'; + +:host { + display: flex; + flex-direction: column; + width: 500px; + background-color: white; + max-height: 700px; + border-radius: 4px; + justify-content: space-between; +} + +.header { + @include h4(); + display: flex; + flex-shrink: 0; + flex-direction: row; + justify-content: space-between; + align-items: center; + font-family: 'Public Sans'; + font-size: 18px; + font-weight: 600; + line-height: 32px; + text-align: left; + padding: 10px 16px; + border-bottom: 1px solid $color-soft-gray; + height: 64px; + + +} + + +.title-buttons { + + display: flex; + flex-direction: row; + justify-content: space-between; + gap: 16px; + + .button-icon { + width: 20px; + height: 20px; + } + + button { + background: none; + border: none; + padding: 6px; + margin: 0; + line-height: 0; + cursor: pointer; + height: auto; + width: auto; + } +} + +.header-title { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + gap: 16px; +} diff --git a/src/interface/src/styleguide/expanded-panel/expanded-panel.component.spec.ts b/src/interface/src/styleguide/expanded-panel/expanded-panel.component.spec.ts new file mode 100644 index 000000000..1344fe9e0 --- /dev/null +++ b/src/interface/src/styleguide/expanded-panel/expanded-panel.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ExpandedPanelComponent } from './expanded-panel.component'; + +describe('ExpandedPanelComponent', () => { + let component: ExpandedPanelComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ExpandedPanelComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(ExpandedPanelComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/interface/src/styleguide/expanded-panel/expanded-panel.component.ts b/src/interface/src/styleguide/expanded-panel/expanded-panel.component.ts new file mode 100644 index 000000000..193ebb088 --- /dev/null +++ b/src/interface/src/styleguide/expanded-panel/expanded-panel.component.ts @@ -0,0 +1,30 @@ +import { Component } from '@angular/core'; +import { CommonModule, NgIf } from '@angular/common'; +import { MatIconModule } from '@angular/material/icon'; +import { MatMenuModule } from '@angular/material/menu'; +import { MatDividerModule } from '@angular/material/divider'; +import { MatDialogModule } from '@angular/material/dialog'; +import { ButtonComponent } from '@styleguide'; +import { MatButtonModule } from '@angular/material/button'; + +@Component({ + selector: 'sg-expanded-panel', + templateUrl: './expanded-panel.component.html', + styleUrls: ['./expanded-panel.component.scss'], + standalone: true, + imports: [ + CommonModule, + NgIf, + MatDialogModule, + ButtonComponent, + MatIconModule, + MatDividerModule, + MatMenuModule, + MatButtonModule, + ], +}) +export class ExpandedPanelComponent { + constructor() {} + + handleCloseButton(): void {} +} diff --git a/src/interface/src/styleguide/expanded-panel/expanded-panel.stories.ts b/src/interface/src/styleguide/expanded-panel/expanded-panel.stories.ts new file mode 100644 index 000000000..6d548c805 --- /dev/null +++ b/src/interface/src/styleguide/expanded-panel/expanded-panel.stories.ts @@ -0,0 +1,53 @@ +import { + argsToTemplate, + Meta, + moduleMetadata, + StoryObj, +} from '@storybook/angular'; +import { + MAT_DIALOG_DATA, + MatDialogModule, + MatDialogRef, +} from '@angular/material/dialog'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { ModalInfoComponent } from '../modal-info-box/modal-info.component'; +import { ExpandedPanelComponent } from './expanded-panel.component'; + +const meta: Meta = { + title: 'Components/Expanded Panel', + component: ExpandedPanelComponent, + tags: ['autodocs'], + decorators: [ + moduleMetadata({ + imports: [MatDialogModule, BrowserAnimationsModule, ModalInfoComponent], + providers: [ + { provide: MAT_DIALOG_DATA, useValue: {} }, + { provide: MatDialogRef, useValue: {} }, + ], + }), + ], +}; + +export default meta; + +type Story = StoryObj; + +const containerStyle = `style="background-color: gray; + height: 400px; + align-content: center; + display: flex; + flex-direction: row; + justify-content: center; + align-items: center;"`; + +export const Default: Story = { + args: {}, + render: (args) => ({ + props: args, + template: `
+ +
The title
+
Just a basic expaded panel
+
`, + }), +};