Restructure layout components architecture
- Move layout components from layouts/ directory to components/layout/ - Reorganize divider component from data-display to layout category - Add comprehensive layout component collection including aspect-ratio, bento-grid, box, breakpoint-container, center, column, dashboard-shell, feed-layout, flex, grid-container, hstack, list-detail-layout, scroll-container, section, sidebar-layout, stack, supporting-pane-layout, tabs-container, and vstack - Update all demo components to match new layout structure - Refactor routing and index exports to reflect reorganized component architecture 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,197 @@
|
||||
@use '../../../../../ui-design-system/src/styles/semantic/index' as *;
|
||||
|
||||
.demo-container {
|
||||
padding: $semantic-spacing-layout-section-md;
|
||||
}
|
||||
|
||||
.demo-section {
|
||||
margin-bottom: $semantic-spacing-layout-section-lg;
|
||||
|
||||
h3 {
|
||||
font-family: map-get($semantic-typography-heading-h3, font-family);
|
||||
font-size: map-get($semantic-typography-heading-h3, font-size);
|
||||
font-weight: map-get($semantic-typography-heading-h3, font-weight);
|
||||
line-height: map-get($semantic-typography-heading-h3, line-height);
|
||||
color: $semantic-color-text-primary;
|
||||
margin-bottom: $semantic-spacing-content-heading;
|
||||
}
|
||||
}
|
||||
|
||||
.demo-row {
|
||||
display: flex;
|
||||
gap: $semantic-spacing-grid-gap-md;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.demo-column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: $semantic-spacing-stack-md;
|
||||
}
|
||||
|
||||
.demo-example {
|
||||
flex: 1;
|
||||
min-width: 250px;
|
||||
|
||||
h4 {
|
||||
font-family: map-get($semantic-typography-heading-h4, font-family);
|
||||
font-size: map-get($semantic-typography-heading-h4, font-size);
|
||||
font-weight: map-get($semantic-typography-heading-h4, font-weight);
|
||||
line-height: map-get($semantic-typography-heading-h4, line-height);
|
||||
color: $semantic-color-text-primary;
|
||||
margin-bottom: $semantic-spacing-component-sm;
|
||||
}
|
||||
}
|
||||
|
||||
.demo-boundary {
|
||||
border: 2px dashed $semantic-color-border-secondary;
|
||||
background-color: rgba(128, 128, 128, 0.1);
|
||||
min-height: 100px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.demo-content {
|
||||
background: $semantic-color-surface-elevated;
|
||||
padding: $semantic-spacing-component-md;
|
||||
border-radius: $semantic-border-radius-md;
|
||||
border: 1px solid $semantic-color-border-primary;
|
||||
box-shadow: $semantic-shadow-elevation-1;
|
||||
color: $semantic-color-text-primary;
|
||||
text-align: center;
|
||||
|
||||
font-family: map-get($semantic-typography-body-medium, font-family);
|
||||
font-size: map-get($semantic-typography-body-medium, font-size);
|
||||
font-weight: map-get($semantic-typography-body-medium, font-weight);
|
||||
line-height: map-get($semantic-typography-body-medium, line-height);
|
||||
}
|
||||
|
||||
.demo-content-small {
|
||||
background: $semantic-color-primary;
|
||||
color: $semantic-color-on-primary;
|
||||
padding: $semantic-spacing-component-xs;
|
||||
border-radius: $semantic-border-radius-sm;
|
||||
font-size: $semantic-typography-font-size-sm;
|
||||
font-weight: $semantic-typography-font-weight-medium;
|
||||
}
|
||||
|
||||
.demo-inline {
|
||||
margin: 0 $semantic-spacing-component-xs;
|
||||
}
|
||||
|
||||
.demo-card {
|
||||
background: $semantic-color-surface-primary;
|
||||
padding: $semantic-spacing-component-xl;
|
||||
border-radius: $semantic-border-radius-lg;
|
||||
box-shadow: $semantic-shadow-elevation-2;
|
||||
border: 1px solid $semantic-color-border-subtle;
|
||||
text-align: center;
|
||||
max-width: 400px;
|
||||
|
||||
h3 {
|
||||
font-family: map-get($semantic-typography-heading-h3, font-family);
|
||||
font-size: map-get($semantic-typography-heading-h3, font-size);
|
||||
font-weight: map-get($semantic-typography-heading-h3, font-weight);
|
||||
line-height: map-get($semantic-typography-heading-h3, line-height);
|
||||
color: $semantic-color-text-primary;
|
||||
margin-bottom: $semantic-spacing-content-paragraph;
|
||||
}
|
||||
|
||||
p {
|
||||
font-family: map-get($semantic-typography-body-medium, font-family);
|
||||
font-size: map-get($semantic-typography-body-medium, font-size);
|
||||
font-weight: map-get($semantic-typography-body-medium, font-weight);
|
||||
line-height: map-get($semantic-typography-body-medium, line-height);
|
||||
color: $semantic-color-text-secondary;
|
||||
margin-bottom: $semantic-spacing-component-lg;
|
||||
}
|
||||
}
|
||||
|
||||
.demo-loading {
|
||||
text-align: center;
|
||||
|
||||
.demo-spinner {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border: 4px solid $semantic-color-border-subtle;
|
||||
border-top: 4px solid $semantic-color-primary;
|
||||
border-radius: $semantic-border-radius-full;
|
||||
animation: spin 1s linear infinite;
|
||||
margin: 0 auto $semantic-spacing-component-md auto;
|
||||
}
|
||||
|
||||
p {
|
||||
font-family: map-get($semantic-typography-body-medium, font-family);
|
||||
font-size: map-get($semantic-typography-body-medium, font-size);
|
||||
font-weight: map-get($semantic-typography-body-medium, font-weight);
|
||||
line-height: map-get($semantic-typography-body-medium, line-height);
|
||||
color: $semantic-color-text-secondary;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% { transform: rotate(0deg); }
|
||||
100% { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
.demo-hero {
|
||||
text-align: center;
|
||||
|
||||
h2 {
|
||||
font-family: map-get($semantic-typography-heading-h2, font-family);
|
||||
font-size: map-get($semantic-typography-heading-h2, font-size);
|
||||
font-weight: map-get($semantic-typography-heading-h2, font-weight);
|
||||
line-height: map-get($semantic-typography-heading-h2, line-height);
|
||||
color: $semantic-color-text-primary;
|
||||
margin-bottom: $semantic-spacing-content-heading;
|
||||
}
|
||||
|
||||
p {
|
||||
font-family: map-get($semantic-typography-body-large, font-family);
|
||||
font-size: map-get($semantic-typography-body-large, font-size);
|
||||
font-weight: map-get($semantic-typography-body-large, font-weight);
|
||||
line-height: map-get($semantic-typography-body-large, line-height);
|
||||
color: $semantic-color-text-secondary;
|
||||
margin-bottom: $semantic-spacing-component-xl;
|
||||
}
|
||||
}
|
||||
|
||||
.demo-button {
|
||||
background: $semantic-color-surface-secondary;
|
||||
color: $semantic-color-text-primary;
|
||||
border: 1px solid $semantic-color-border-primary;
|
||||
padding: $semantic-spacing-interactive-button-padding-y $semantic-spacing-interactive-button-padding-x;
|
||||
border-radius: $semantic-border-button-radius;
|
||||
|
||||
font-family: map-get($semantic-typography-button-medium, font-family);
|
||||
font-size: map-get($semantic-typography-button-medium, font-size);
|
||||
font-weight: map-get($semantic-typography-button-medium, font-weight);
|
||||
line-height: map-get($semantic-typography-button-medium, line-height);
|
||||
|
||||
cursor: pointer;
|
||||
transition: all $semantic-motion-duration-fast $semantic-motion-easing-ease;
|
||||
|
||||
&:hover {
|
||||
background: $semantic-color-surface-elevated;
|
||||
box-shadow: $semantic-shadow-button-hover;
|
||||
}
|
||||
|
||||
&--primary {
|
||||
background: $semantic-color-primary;
|
||||
color: $semantic-color-on-primary;
|
||||
border-color: $semantic-color-primary;
|
||||
|
||||
&:hover {
|
||||
opacity: $semantic-opacity-hover;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.demo-row {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.demo-example {
|
||||
min-width: auto;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { CenterComponent } from '../../../../../ui-essentials/src/lib/components/layout/center';
|
||||
|
||||
@Component({
|
||||
selector: 'ui-center-demo',
|
||||
standalone: true,
|
||||
imports: [CommonModule, CenterComponent],
|
||||
template: `
|
||||
<div class="demo-container">
|
||||
<h2>Center Demo</h2>
|
||||
|
||||
<!-- Axis Variants -->
|
||||
<section class="demo-section">
|
||||
<h3>Center Axis</h3>
|
||||
<div class="demo-row">
|
||||
<div class="demo-example">
|
||||
<h4>Both Axes (Default)</h4>
|
||||
<ui-center [customMinHeight]="'200px'" class="demo-boundary">
|
||||
<div class="demo-content">Centered Both Ways</div>
|
||||
</ui-center>
|
||||
</div>
|
||||
|
||||
<div class="demo-example">
|
||||
<h4>Horizontal Only</h4>
|
||||
<ui-center axis="horizontal" [customMinHeight]="'200px'" class="demo-boundary">
|
||||
<div class="demo-content">Centered Horizontally</div>
|
||||
</ui-center>
|
||||
</div>
|
||||
|
||||
<div class="demo-example">
|
||||
<h4>Vertical Only</h4>
|
||||
<ui-center axis="vertical" [customMinHeight]="'200px'" class="demo-boundary">
|
||||
<div class="demo-content">Centered Vertically</div>
|
||||
</ui-center>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Max Width Constraints -->
|
||||
<section class="demo-section">
|
||||
<h3>Max Width Constraints</h3>
|
||||
<div class="demo-column">
|
||||
<div class="demo-example">
|
||||
<h4>Small (640px)</h4>
|
||||
<ui-center maxWidth="sm" padding="md" class="demo-boundary">
|
||||
<div class="demo-content">
|
||||
This content is constrained to a maximum width of 640px and will be centered within its container.
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore.
|
||||
</div>
|
||||
</ui-center>
|
||||
</div>
|
||||
|
||||
<div class="demo-example">
|
||||
<h4>Medium (768px)</h4>
|
||||
<ui-center maxWidth="md" padding="md" class="demo-boundary">
|
||||
<div class="demo-content">
|
||||
This content is constrained to a maximum width of 768px and will be centered within its container.
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
||||
</div>
|
||||
</ui-center>
|
||||
</div>
|
||||
|
||||
<div class="demo-example">
|
||||
<h4>Large (1024px)</h4>
|
||||
<ui-center maxWidth="lg" padding="md" class="demo-boundary">
|
||||
<div class="demo-content">
|
||||
This content is constrained to a maximum width of 1024px and will be centered within its container.
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
||||
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.
|
||||
</div>
|
||||
</ui-center>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Spacing Variants -->
|
||||
<section class="demo-section">
|
||||
<h3>Spacing</h3>
|
||||
<div class="demo-row">
|
||||
<div class="demo-example">
|
||||
<h4>Small Padding</h4>
|
||||
<ui-center padding="sm" class="demo-boundary">
|
||||
<div class="demo-content">Small Padding</div>
|
||||
</ui-center>
|
||||
</div>
|
||||
|
||||
<div class="demo-example">
|
||||
<h4>Medium Padding</h4>
|
||||
<ui-center padding="md" class="demo-boundary">
|
||||
<div class="demo-content">Medium Padding</div>
|
||||
</ui-center>
|
||||
</div>
|
||||
|
||||
<div class="demo-example">
|
||||
<h4>Large Padding</h4>
|
||||
<ui-center padding="lg" class="demo-boundary">
|
||||
<div class="demo-content">Large Padding</div>
|
||||
</ui-center>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Inline Variant -->
|
||||
<section class="demo-section">
|
||||
<h3>Inline Center</h3>
|
||||
<div class="demo-example">
|
||||
<p>
|
||||
Here is some text with an
|
||||
<ui-center [inline]="true" class="demo-inline">
|
||||
<span class="demo-content-small">inline centered element</span>
|
||||
</ui-center>
|
||||
in the middle of the paragraph.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Practical Examples -->
|
||||
<section class="demo-section">
|
||||
<h3>Practical Examples</h3>
|
||||
|
||||
<div class="demo-example">
|
||||
<h4>Card Layout</h4>
|
||||
<ui-center maxWidth="md" padding="lg">
|
||||
<div class="demo-card">
|
||||
<h3>Welcome Message</h3>
|
||||
<p>This card is centered with constrained width for better readability.</p>
|
||||
<button class="demo-button">Get Started</button>
|
||||
</div>
|
||||
</ui-center>
|
||||
</div>
|
||||
|
||||
<div class="demo-example">
|
||||
<h4>Loading State</h4>
|
||||
<ui-center [customMinHeight]="'300px'">
|
||||
<div class="demo-loading">
|
||||
<div class="demo-spinner"></div>
|
||||
<p>Loading...</p>
|
||||
</div>
|
||||
</ui-center>
|
||||
</div>
|
||||
|
||||
<div class="demo-example">
|
||||
<h4>Hero Section</h4>
|
||||
<ui-center [customMinHeight]="'400px'" maxWidth="lg" padding="xl">
|
||||
<div class="demo-hero">
|
||||
<h2>Hero Title</h2>
|
||||
<p>A compelling hero message that's perfectly centered and constrained for optimal reading.</p>
|
||||
<button class="demo-button demo-button--primary">Call to Action</button>
|
||||
</div>
|
||||
</ui-center>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
`,
|
||||
styleUrl: './center-demo.component.scss'
|
||||
})
|
||||
export class CenterDemoComponent {}
|
||||
Reference in New Issue
Block a user