diff --git a/projects/demo-ui-essentials/src/app/demos/bottom-navigation-demo/bottom-navigation-demo.component.scss b/projects/demo-ui-essentials/src/app/demos/bottom-navigation-demo/bottom-navigation-demo.component.scss new file mode 100644 index 0000000..8cf6955 --- /dev/null +++ b/projects/demo-ui-essentials/src/app/demos/bottom-navigation-demo/bottom-navigation-demo.component.scss @@ -0,0 +1,138 @@ +@use '../../../../../shared-ui/src/styles/semantic/index' as *; + +.demo-container { + padding-bottom: 120px; // Extra space to accommodate bottom navigation examples +} + +.demo-section { + margin-bottom: $semantic-spacing-layout-section-lg; +} + +.demo-row { + display: flex; + gap: $semantic-spacing-component-lg; + flex-wrap: wrap; + + &--vertical { + flex-direction: column; + gap: $semantic-spacing-component-md; + } +} + +.demo-item { + flex: 1; + min-width: 300px; + + h4 { + margin-bottom: $semantic-spacing-component-sm; + color: $semantic-color-text-primary; + 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); + } +} + +.demo-bottom-nav-container { + position: relative; + height: 80px; + background: $semantic-color-surface-secondary; + border: $semantic-border-width-1 solid $semantic-color-border-secondary; + border-radius: $semantic-border-radius-md; + overflow: hidden; + margin-bottom: $semantic-spacing-component-md; + + // Override the fixed positioning for demo purposes + :deep(.ui-bottom-navigation) { + position: absolute !important; + bottom: 0; + left: 0; + right: 0; + } +} + +.demo-info { + background: $semantic-color-surface-elevated; + border: $semantic-border-width-1 solid $semantic-color-border-subtle; + border-radius: $semantic-border-radius-sm; + padding: $semantic-spacing-component-md; + margin: $semantic-spacing-component-md 0; + + p { + margin: 0 0 $semantic-spacing-component-xs 0; + color: $semantic-color-text-primary; + 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); + + &:last-child { + margin-bottom: 0; + } + + strong { + font-weight: $semantic-typography-font-weight-semibold; + color: $semantic-color-text-primary; + } + } +} + +.demo-controls { + display: flex; + gap: $semantic-spacing-component-sm; + flex-wrap: wrap; +} + +.demo-button { + padding: $semantic-spacing-interactive-button-padding-y $semantic-spacing-interactive-button-padding-x; + background: $semantic-color-primary; + color: $semantic-color-on-primary; + border: none; + border-radius: $semantic-border-button-radius; + cursor: pointer; + transition: all $semantic-motion-duration-fast $semantic-motion-easing-ease; + + // Typography + 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); + + &:hover { + box-shadow: $semantic-shadow-button-hover; + } + + &:focus-visible { + outline: 2px solid $semantic-color-focus; + outline-offset: 2px; + } + + &:active { + box-shadow: $semantic-shadow-button-rest; + transform: translateY(1px); + } + + &.active { + background: $semantic-color-secondary; + color: $semantic-color-on-secondary; + } +} + +// Responsive adjustments +@media (max-width: $semantic-breakpoint-sm - 1) { + .demo-row { + flex-direction: column; + } + + .demo-item { + min-width: auto; + } + + .demo-controls { + flex-direction: column; + } + + .demo-button { + width: 100%; + } +} \ No newline at end of file diff --git a/projects/demo-ui-essentials/src/app/demos/bottom-navigation-demo/bottom-navigation-demo.component.ts b/projects/demo-ui-essentials/src/app/demos/bottom-navigation-demo/bottom-navigation-demo.component.ts new file mode 100644 index 0000000..8a7c81c --- /dev/null +++ b/projects/demo-ui-essentials/src/app/demos/bottom-navigation-demo/bottom-navigation-demo.component.ts @@ -0,0 +1,268 @@ +import { Component } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; +import { faHome, faSearch, faUser, faHeart, faCog, faShoppingCart, faBell, faBookmark } from '@fortawesome/free-solid-svg-icons'; +import { BottomNavigationComponent, BottomNavigationItem } from '../../../../../ui-essentials/src/lib/components/navigation/bottom-navigation'; + +@Component({ + selector: 'ui-bottom-navigation-demo', + standalone: true, + imports: [CommonModule, BottomNavigationComponent, FontAwesomeModule], + template: ` +
Active Item: {{ getActiveItemLabel() }}
+Click Count: {{ clickCount }}
+Last Clicked: {{ lastClickedItem || 'None' }}
++ A powerful command palette for quick navigation and actions. Press Ctrl+K (or ⌘K on Mac) to open. +
+Full keyboard support with arrow keys, Enter, and Escape
+Intelligent search with typo tolerance and keyword matching
+Execute commands instantly with global keyboard shortcuts
+Organize commands by category for better discoverability
+Track and show recently used commands for quick access
+Commands can be shown or hidden based on application state
+Enterprise-grade data table with virtual scrolling, column resizing/reordering, and advanced filtering.
+ + ++ Virtual scrolling efficiently handles large datasets by only rendering visible rows. + Performance metrics are displayed below the table. +
+ +<ui-enhanced-table
+ [data]="employees"
+ [columns]="columns"
+ variant="default"
+ [enableColumnResize]="true"
+ [enableColumnReorder]="true"
+ [showFilters]="true"
+ [height]="500"
+ (sort)="handleSort($event)"
+ (filter)="handleFilter($event)">
+</ui-enhanced-table>
+
+ <ui-enhanced-table
+ [data]="largeDataset"
+ [columns]="columns"
+ [virtualScrollConfig]="{{ '{' }}
+ enabled: true,
+ itemHeight: 48,
+ bufferSize: 10
+ {{ '}' }}"
+ [height]="600">
+</ui-enhanced-table>
+
+ columns: EnhancedTableColumn[] = [
+ {{ '{' }}
+ key: 'name',
+ label: 'Name',
+ width: 150,
+ sortable: true,
+ filterable: true,
+ filterType: 'text',
+ resizable: true,
+ draggable: true
+ {{ '}' }},
+ {{ '{' }}
+ key: 'salary',
+ label: 'Salary',
+ width: 120,
+ sortable: true,
+ filterable: true,
+ filterType: 'number',
+ resizable: true
+ {{ '}' }}
+];
+ An interactive floating action button menu that expands to reveal multiple action items.
+ + +These examples show fixed positioning variants (click to activate):
+No events yet. Interact with the FAB menus above.
+ } @else { + @for (event of eventLog.slice(-10); track $index) { ++ Select this text to see a text editing toolbar with cut, copy, paste, and formatting options. + The toolbar will appear automatically when you make a selection. +
+Right-click the image for image editing options
+This is an editable text area. Select text to see formatting options in the floating toolbar.
+Bold text, italic text, and underlined text are supported.
+| Name | +Status | +Actions | +|
|---|---|---|---|
| {{ user.name }} | +{{ user.email }} | +{{ user.status }} | ++ + | +
+ Star button pressed state: {{ isPressed ? 'ON' : 'OFF' }} +
++ Use outlined variant for destructive actions to reduce accidental clicks +
+Total clicks: {{ clickCount }}
+Last clicked: {{ lastClicked || 'None' }}
+Click buttons to see snackbars in different positions
+Active snackbars: {{ activeSnackbars.length }}
+Total shown: {{ totalShown }}
+Last action: {{ lastAction || 'None' }}
+Current Step: {{ getCurrentStepInfo() }}
+Completed Steps: {{ getCompletedStepsCount() }}
+Last Action: {{ lastAction }}
+<ui-tag-input
+ placeholder="Add tags..."
+ (tagAdd)="onTagAdd($event)"
+ (tagRemove)="onTagRemove($event)">
+</ui-tag-input>
+
+ <ui-tag-input
+ placeholder="Add up to 5 tags"
+ [maxTags]="5"
+ [maxTagLength]="20"
+ [allowDuplicates]="false"
+ helpText="Each tag can be up to 20 characters"
+ (maxTagsReached)="onMaxTags()"
+ (duplicateTag)="onDuplicate($event)">
+</ui-tag-input>
+
+ <form [formGroup]="myForm">
+ <ui-tag-input
+ formControlName="tags"
+ placeholder="Required tags"
+ [errorMessage]="getFieldError('tags')">
+ </ui-tag-input>
+</form>
+
+ <ui-tag-input
+ placeholder="Use space or dash to separate"
+ [separators]="[' ', '-']"
+ helpText="Tags separated by space or dash">
+</ui-tag-input>
+ + Select items from the source list and transfer them to the target list using the control buttons. +
++ Some items can be disabled and cannot be selected or transferred. +
++ Transfer list with a large number of items to test performance and search functionality. +
+No events logged yet. Interact with the transfer lists above to see events.
+ } @else { + @for (event of eventLog(); track $index) { +