@dnd-mapp/shared-ui 1.0.0 โ†’ 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/README.md +74 -69
  2. package/assets/fonts/KFO5CnqEu92Fr1Mu53ZEC9_Vu3r1gIhOszmkAnkaWzU.woff2 +0 -0
  3. package/assets/fonts/KFO5CnqEu92Fr1Mu53ZEC9_Vu3r1gIhOszmkBXkaWzU.woff2 +0 -0
  4. package/assets/fonts/KFO5CnqEu92Fr1Mu53ZEC9_Vu3r1gIhOszmkBnka.woff2 +0 -0
  5. package/assets/fonts/KFO5CnqEu92Fr1Mu53ZEC9_Vu3r1gIhOszmkC3kaWzU.woff2 +0 -0
  6. package/assets/fonts/KFO5CnqEu92Fr1Mu53ZEC9_Vu3r1gIhOszmkCHkaWzU.woff2 +0 -0
  7. package/assets/fonts/KFO5CnqEu92Fr1Mu53ZEC9_Vu3r1gIhOszmkCXkaWzU.woff2 +0 -0
  8. package/assets/fonts/KFO5CnqEu92Fr1Mu53ZEC9_Vu3r1gIhOszmkCnkaWzU.woff2 +0 -0
  9. package/assets/fonts/KFO5CnqEu92Fr1Mu53ZEC9_Vu3r1gIhOszmkaHkaWzU.woff2 +0 -0
  10. package/assets/fonts/KFO5CnqEu92Fr1Mu53ZEC9_Vu3r1gIhOszmkenkaWzU.woff2 +0 -0
  11. package/assets/fonts/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3-UBGEe.woff2 +0 -0
  12. package/assets/fonts/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3CUBGEe.woff2 +0 -0
  13. package/assets/fonts/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3GUBGEe.woff2 +0 -0
  14. package/assets/fonts/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3KUBGEe.woff2 +0 -0
  15. package/assets/fonts/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3OUBGEe.woff2 +0 -0
  16. package/assets/fonts/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3iUBGEe.woff2 +0 -0
  17. package/assets/fonts/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3yUBA.woff2 +0 -0
  18. package/assets/fonts/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMawCUBGEe.woff2 +0 -0
  19. package/assets/fonts/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMaxKUBGEe.woff2 +0 -0
  20. package/assets/fonts/L0x5DF4xlVMF-BfR8bXMIjhEq3-OXg.woff2 +0 -0
  21. package/assets/fonts/L0x5DF4xlVMF-BfR8bXMIjhFq3-OXg.woff2 +0 -0
  22. package/assets/fonts/L0x5DF4xlVMF-BfR8bXMIjhGq3-OXg.woff2 +0 -0
  23. package/assets/fonts/L0x5DF4xlVMF-BfR8bXMIjhIq3-OXg.woff2 +0 -0
  24. package/assets/fonts/L0x5DF4xlVMF-BfR8bXMIjhLq38.woff2 +0 -0
  25. package/assets/fonts/L0x5DF4xlVMF-BfR8bXMIjhPq3-OXg.woff2 +0 -0
  26. package/assets/fonts/L0x7DF4xlVMF-BfR8bXMIjhOm32WWg.woff2 +0 -0
  27. package/assets/fonts/L0x7DF4xlVMF-BfR8bXMIjhOm36WWoKC.woff2 +0 -0
  28. package/assets/fonts/L0x7DF4xlVMF-BfR8bXMIjhOm3CWWoKC.woff2 +0 -0
  29. package/assets/fonts/L0x7DF4xlVMF-BfR8bXMIjhOm3KWWoKC.woff2 +0 -0
  30. package/assets/fonts/L0x7DF4xlVMF-BfR8bXMIjhOm3OWWoKC.woff2 +0 -0
  31. package/assets/fonts/L0x7DF4xlVMF-BfR8bXMIjhOm3mWWoKC.woff2 +0 -0
  32. package/assets/images/404.png +0 -0
  33. package/assets/images/apple-touch-icon.png +0 -0
  34. package/assets/images/favicon-16.png +0 -0
  35. package/assets/images/favicon-32.png +0 -0
  36. package/assets/images/favicon-512.png +0 -0
  37. package/assets/images/favicon.ico +0 -0
  38. package/assets/styles/_normalize.scss +380 -0
  39. package/assets/styles/colors/_amber.scss +11 -0
  40. package/assets/styles/colors/_blue.scss +11 -0
  41. package/assets/styles/colors/_common.scss +2 -0
  42. package/assets/styles/colors/_cyan.scss +11 -0
  43. package/assets/styles/colors/_emerald.scss +11 -0
  44. package/assets/styles/colors/_fuchsia.scss +11 -0
  45. package/assets/styles/colors/_gray.scss +11 -0
  46. package/assets/styles/colors/_green.scss +11 -0
  47. package/assets/styles/colors/_indigo.scss +11 -0
  48. package/assets/styles/colors/_lime.scss +11 -0
  49. package/assets/styles/colors/_mauve.scss +11 -0
  50. package/assets/styles/colors/_mist.scss +11 -0
  51. package/assets/styles/colors/_neutral.scss +11 -0
  52. package/assets/styles/colors/_olive.scss +11 -0
  53. package/assets/styles/colors/_orange.scss +11 -0
  54. package/assets/styles/colors/_pink.scss +11 -0
  55. package/assets/styles/colors/_purple.scss +11 -0
  56. package/assets/styles/colors/_red.scss +11 -0
  57. package/assets/styles/colors/_rose.scss +11 -0
  58. package/assets/styles/colors/_sky.scss +11 -0
  59. package/assets/styles/colors/_slate.scss +11 -0
  60. package/assets/styles/colors/_stone.scss +11 -0
  61. package/assets/styles/colors/_taupe.scss +11 -0
  62. package/assets/styles/colors/_teal.scss +11 -0
  63. package/assets/styles/colors/_violet.scss +11 -0
  64. package/assets/styles/colors/_yellow.scss +11 -0
  65. package/assets/styles/colors/_zinc.scss +11 -0
  66. package/assets/styles/colors/index.scss +27 -0
  67. package/assets/styles/font.scss +387 -0
  68. package/assets/styles/main.scss +17 -0
  69. package/assets/styles/theme-variables/_layout.scss +8 -0
  70. package/assets/styles/theme-variables/_shadows.scss +37 -0
  71. package/assets/styles/theme-variables/_spacing.scss +23 -0
  72. package/assets/styles/theme-variables/_text.scss +81 -0
  73. package/assets/styles/theme-variables/index.scss +4 -0
  74. package/fesm2022/dnd-mapp-shared-ui.mjs +596 -21
  75. package/fesm2022/dnd-mapp-shared-ui.mjs.map +1 -1
  76. package/package.json +22 -18
  77. package/src/lib/button/README.md +69 -57
  78. package/src/lib/dropdown/README.md +131 -0
  79. package/src/lib/forms/input/README.md +129 -0
  80. package/src/lib/nav/active-marker/README.md +115 -0
  81. package/src/lib/nav/app-top-bar/README.md +96 -0
  82. package/src/lib/nav/navbar/README.md +93 -0
  83. package/src/lib/nav/navbar-brand/README.md +96 -0
  84. package/src/lib/nav/navbar-link/README.md +76 -0
  85. package/src/lib/nav/navbar-menu/README.md +99 -0
  86. package/src/lib/vertical-rule/README.md +99 -0
  87. package/types/dnd-mapp-shared-ui.d.ts +281 -8
@@ -0,0 +1,129 @@
1
+ [โ† Back to Library Overview](../../../../README.md#-component-library)
2
+
3
+ ---
4
+
5
+ # Input Component `dma-input`
6
+
7
+ A versatile, accessible text input component designed for the `@dnd-mapp` ecosystem. It features built-in support for Angular Forms (`ControlValueAccessor`), reactive validation styling, and an internal debounce mechanism to optimize performance.
8
+
9
+ ## ๐Ÿฐ Overview
10
+
11
+ The `InputComponent` provides a styled wrapper around the native HTML input element. It includes integrated label handling, status-based border coloring (valid/invalid/touched), and a **500ms debounce** on value changes to prevent excessive form updates during rapid typing.
12
+
13
+ - **Selector**: `dma-input`
14
+ - **Format**: Standalone Component
15
+ - **Change Detection**: `OnPush`
16
+ - **Form Support**: Full `ControlValueAccessor` integration
17
+
18
+ ---
19
+
20
+ ## ๐Ÿš€ Usage
21
+
22
+ ### Basic Usage with Signals
23
+
24
+ The component uses Angular's `model()` for the value, allowing for easy two-way binding.
25
+
26
+ ```ts
27
+ import { InputComponent } from '@dnd-mapp/shared-ui';
28
+ import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
29
+
30
+ @Component({
31
+ selector: 'app-root',
32
+ template: `<dma-input inputId="username-field" label="Username" placeholder="TheLegend27" [(value)]="username" />`,
33
+ changeDetection: ChangeDetectionStrategy.OnPush,
34
+ imports: [InputComponent],
35
+ })
36
+ export class RootComponent {
37
+ protected readonly username = signal('');
38
+ }
39
+ ```
40
+
41
+ ---
42
+
43
+ ## ๐ŸŽจ API Reference
44
+
45
+ ### Inputs
46
+
47
+ Controlled via Angular Signal inputs.
48
+
49
+ | Name | Type | Required | Default | Description |
50
+ |---------------|-----------|----------|---------|-----------------------------------------------------------------------------|
51
+ | `inputId` | `string` | Yes | - | The unique ID used to associate the label with the input. |
52
+ | `label` | `string` | Yes | - | The text label displayed above the input field. |
53
+ | `placeholder` | `string` | No | `''` | The hint text displayed when the input is empty. |
54
+ | `readonly` | `boolean` | No | `false` | If true, the input is present but non-editable (uses `booleanAttribute`). |
55
+
56
+ ### Models (Two-way Data Binding)
57
+
58
+ Controlled via Angular Signal models. These can be used with `[(value)]` or updated via Reactive Forms.
59
+
60
+ | Name | Type | Default | Description |
61
+ |------------|-----------|---------|-----------------------------------------------------------------------|
62
+ | `value` | `string` | `''` | The current text value. |
63
+ | `disabled` | `boolean` | `false` | Controls the disabled state. Automatically handled by Reactive Forms. |
64
+
65
+ ---
66
+
67
+ ## โš™๏ธ Technical Details
68
+
69
+ ### Debounce Logic
70
+
71
+ To improve performance and reduce unnecessary change detection cycles, the component uses an internal `Subject` and `debounceTime(500)`. When a user types:
72
+
73
+ 1. The internal `onInput` event triggers.
74
+ 2. The value is held for 500ms.
75
+ 3. After the timer clears, `onChange` is called, updating the model and notifying any parent Angular Form.
76
+
77
+ ### Validation States
78
+
79
+ The component automatically styles itself based on Angular Form CSS classes:
80
+
81
+ - **Valid & Touched**: Displays a green border.
82
+ - **Invalid & Touched**: Displays a red border and red text.
83
+ - **Disabled**: Applies a background tint, reduces opacity, and changes the cursor to `not-allowed`.
84
+
85
+ ---
86
+
87
+ ## ๐Ÿงช Examples
88
+
89
+ ### Reactive Forms Integration
90
+
91
+ Since the component implements `ControlValueAccessor`, it integrates seamlessly with `FormControl`. The `onTouched` event is triggered when the input receives focus.
92
+
93
+ ```ts
94
+ import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
95
+ import { FormBuilder, ReactiveFormsModule, Validators } from '@angular/forms';
96
+ import { InputComponent } from '@dnd-mapp/shared-ui';
97
+
98
+ @Component({
99
+ selector: 'app-profile-form',
100
+ template: `
101
+ <form [formGroup]="form">
102
+ <dma-input label="Username" inputId="username-field" formControlName="username" />
103
+ </form>
104
+ `,
105
+ changeDetection: ChangeDetectionStrategy.OnPush,
106
+ imports: [ReactiveFormsModule, InputComponent],
107
+ })
108
+ export class ProfileFormComponent {
109
+ private readonly formBuilder = inject(FormBuilder).nonNullable;
110
+
111
+ protected readonly form = this.formBuilder.group({
112
+ username: this.formBuilder.control('', [Validators.required, Validators.minLength(3)])
113
+ });
114
+ }
115
+ ```
116
+
117
+ ### Read-only State
118
+
119
+ The `readonly` attribute is transformed using `booleanAttribute`, allowing for easy usage in templates.
120
+
121
+ ```html
122
+ <dma-input readonly inputId="version-id" label="System Version" value="v1.0.4" />
123
+ ```
124
+
125
+ ---
126
+
127
+ ## ๐Ÿ“œ License
128
+
129
+ This component is part of the `@dnd-mapp/shared-ui` proprietary library. All rights reserved.
@@ -0,0 +1,115 @@
1
+ [โ† Back to Library Overview](../../../../README.md#-component-library)
2
+
3
+ ---
4
+
5
+ # Active Marker
6
+
7
+ A specialized text component designed to prevent layout shifts (CLS) when toggling between normal and bold font weights. It achieves this by using a CSS Grid-based "ghosting" technique: rendering an invisible, bold version of the label to reserve the maximum required space, ensuring the container dimensions remain constant regardless of the active state.
8
+
9
+ ## ๐Ÿฐ Overview
10
+
11
+ - **Selector**: `dma-active-marker`
12
+ - **Format**: Standalone Component
13
+ - **Change Detection**: `ChangeDetectionStrategy.OnPush`
14
+ - **Styling**: Scoped SCSS (BEM-less)
15
+
16
+ ---
17
+
18
+ ## ๐Ÿš€ Usage
19
+
20
+ ```ts
21
+ import { ChangeDetectionStrategy, Component } from '@angular/core';
22
+ import { ActiveMarkerComponent } from '@dnd-mapp/shared-ui';
23
+
24
+ @Component({
25
+ selector: 'app-root',
26
+ template: `<dma-active-marker label="Dashboard" active />`,
27
+ changeDetection: ChangeDetectionStrategy.OnPush,
28
+ imports: [ActiveMarkerComponent],
29
+ })
30
+ export class RootComponent {}
31
+ ```
32
+
33
+ ---
34
+
35
+ ## ๐ŸŽจ API Reference
36
+
37
+ ### Inputs
38
+
39
+ | Name | Type | Required | Default | Description |
40
+ |----------|-----------|----------|---------|------------------------------------------------------------------------------------------------------------------------|
41
+ | `label` | `string` | Yes | - | The text content to be displayed. |
42
+ | `active` | `boolean` | No | `false` | Controls the active state. Uses `booleanAttribute` for flexible template usage (e.g., `<dma-active-marker active />`). |
43
+
44
+ ### Host Classes
45
+
46
+ | Class | Condition | Result |
47
+ |-----------|--------------------|-----------------------------------------------------------------------------|
48
+ | `.active` | `active()` is true | Changes color to `$neutral-900` and font-weight to `$font-weight-semibold`. |
49
+
50
+ ---
51
+
52
+ ## ๐Ÿ› ๏ธ Implementation Details
53
+
54
+ ### Layout Shift Prevention
55
+
56
+ The component uses `display: grid` on the host. Both the visible label and the "spacer" label are assigned to `grid-column: 1` and `grid-row: 1`.
57
+
58
+ 1. **`.label-spacer`**: Always rendered with `visibility: hidden` and `font-weight: $font-weight-semibold`. This forces the grid cell to always be wide enough for the boldest version of the text.
59
+ 2. **Visible Span**: Layers directly on top of the spacer. Its weight and color toggle based on the `.active` host class.
60
+
61
+ ---
62
+
63
+ ## ๐Ÿงช Examples
64
+
65
+ ### Navigation Menu
66
+
67
+ Use the component in a sidebar or menu to highlight the current route without causing the menu width to "jitter" when the font weight increases.
68
+
69
+ ```ts
70
+ import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
71
+ import { ActiveMarkerComponent } from '@dnd-mapp/shared-ui';
72
+
73
+ @Component({
74
+ selector: 'app-nav-list',
75
+ template: `
76
+ <nav>
77
+ @for (item of menuItems; track item.id) {
78
+ <button (click)="selectedId.set(item.id)">
79
+ <dma-active-marker [label]="item.name" [active]="selectedId() === item.id" />
80
+ </button>
81
+ }
82
+ </nav>
83
+ `,
84
+ changeDetection: ChangeDetectionStrategy.OnPush,
85
+ imports: [ActiveMarkerComponent],
86
+ })
87
+ export class NavListComponent {
88
+ protected readonly selectedId = signal(1);
89
+
90
+ protected readonly menuItems = [
91
+ { id: 1, name: 'Overview' },
92
+ { id: 2, name: 'Analytics' },
93
+ { id: 3, name: 'Settings' }
94
+ ];
95
+ }
96
+ ```
97
+
98
+ ### Tab Indicators
99
+
100
+ Ideal for tab headers where centered text must remain perfectly centered regardless of its active state.
101
+
102
+ ```html
103
+ <div class="flex gap-4">
104
+ <dma-active-marker label="Profile" [active]="currentTab === 'profile'" />
105
+ <dma-active-marker label="Security" [active]="currentTab === 'security'" />
106
+ </div>
107
+ ```
108
+
109
+ ---
110
+
111
+ ## ๐Ÿ“œ License
112
+
113
+ Internal use only. Copyright ยฉ 2026 DnD Mapp. All rights reserved.
114
+
115
+ [โ† Back to Library Overview](../../../../README.md#-component-library)
@@ -0,0 +1,96 @@
1
+ [โ† Back to Library Overview](../../../../README.md#-component-library)
2
+
3
+ ---
4
+
5
+ # App Top Bar
6
+
7
+ A flexible and layout-oriented header component designed to host navigation, branding, and action elements. It uses a composition-based approach with dedicated sections to ensure consistent spacing and alignment across the application.
8
+
9
+ ## ๐Ÿฐ Overview
10
+
11
+ The `AppTopBarComponent` acts as a flexbox container that provides a specific slot for `AppTopBarSectionComponent` instances. It handles the top-level layout, background colors, and borders, while the sections handle internal alignment and spacing.
12
+
13
+ - **Selector**: `dma-app-top-bar`
14
+ - **Format**: Standalone Component
15
+ - **Change Detection**: `OnPush`
16
+
17
+ ---
18
+
19
+ ## ๐Ÿš€ Usage
20
+
21
+ ```ts
22
+ import { Component, ChangeDetectionStrategy } from '@angular/core';
23
+ import { AppTopBarComponent, AppTopBarSectionComponent } from '@dnd-mapp/shared-ui';
24
+
25
+ @Component({
26
+ selector: 'app-root',
27
+ template: `
28
+ <dma-app-top-bar>
29
+ <dma-app-top-bar-section>
30
+ <span>Logo</span>
31
+ </dma-app-top-bar-section>
32
+
33
+ <dma-app-top-bar-section position="end">
34
+ <button>Profile</button>
35
+ </dma-app-top-bar-section>
36
+ </dma-app-top-bar>
37
+ `,
38
+ changeDetection: ChangeDetectionStrategy.OnPush,
39
+ imports: [AppTopBarComponent, AppTopBarSectionComponent],
40
+ })
41
+ export class RootComponent {}
42
+ ```
43
+
44
+ ---
45
+
46
+ ## ๐ŸŽจ API Reference
47
+
48
+ ### AppTopBarComponent
49
+
50
+ #### Content Projection
51
+
52
+ | Slot | Description |
53
+ |---------------------------|----------------------------------------------------------------------------------|
54
+ | `dma-app-top-bar-section` | Selects components of type `dma-app-top-bar-section` to define alignment groups. |
55
+
56
+ ---
57
+
58
+ ### AppTopBarSectionComponent
59
+
60
+ #### Inputs
61
+
62
+ | Name | Type | Default | Description |
63
+ |--------------|--------------------|-----------|-------------------------------------------------------------------------------------------------------------------------------------------|
64
+ | `[position]` | `'start' \| 'end'` | `'start'` | Determines the alignment. Sections with `position="start"` will `flex-grow` to fill available space, pushing "end" sections to the right. |
65
+
66
+ #### Content Projection
67
+
68
+ | Slot | Description |
69
+ |--------------|------------------------------------------------------------------------|
70
+ | `ng-content` | The elements (links, buttons, text) to be rendered within the section. |
71
+
72
+ ---
73
+
74
+ ## ๐Ÿงช Examples
75
+
76
+ ### Basic Branding and Navigation
77
+
78
+ A standard layout with a title on the left and a single action on the right.
79
+
80
+ ```html
81
+ <dma-app-top-bar>
82
+ <dma-app-top-bar-section>
83
+ Start section
84
+ </dma-app-top-bar-section>
85
+
86
+ <dma-app-top-bar-section position="end">
87
+ End Section
88
+ </dma-app-top-bar-section>
89
+ </dma-app-top-bar>
90
+ ```
91
+
92
+ ---
93
+
94
+ ## ๐Ÿ“œ License
95
+
96
+ Internal Proprietary Library โ€“ All Rights Reserved.
@@ -0,0 +1,93 @@
1
+ [โ† Back to Library Overview](../../../../README.md#-component-library)
2
+
3
+ ---
4
+
5
+ # Navbar Component `nav[dma-navbar]`
6
+
7
+ ## ๐Ÿฐ Overview
8
+
9
+ The `NavbarComponent` serves as a semantic navigation container for the `@dnd-mapp/shared-ui` library. It uses an attribute selector on the standard HTML `<nav>` element to provide consistent layout styling while maintaining accessibility and SEO standards.
10
+
11
+ Designed for high-performance applications, it utilizes `OnPush` change detection and leverages a Scss-based flexible, horizontal flexbox layout with standardized spacing derived from the library's theme variables.
12
+
13
+ - **Selector**: `nav[dma-navbar]`
14
+ - **Format**: Standalone Component (Attribute-based)
15
+ - **Change Detection**: `ChangeDetectionStrategy.OnPush`
16
+
17
+ ---
18
+
19
+ ## ๐Ÿš€ Usage
20
+
21
+ Apply the `dma-navbar` attribute to a `<nav>` element. Use content projection to include your navigation links or branding elements.
22
+
23
+ ```ts
24
+ import { ChangeDetectionStrategy, Component } from '@angular/core';
25
+ import { NavbarComponent } from '@dnd-mapp/shared-ui';
26
+
27
+ @Component({
28
+ selector: 'app-root',
29
+ template: `
30
+ <nav dma-navbar>
31
+ <!-- Content is projected here -->
32
+ </nav>
33
+ `,
34
+ changeDetection: ChangeDetectionStrategy.OnPush,
35
+ imports: [NavbarComponent],
36
+ })
37
+ export class RootComponent {}
38
+ ```
39
+
40
+ ---
41
+
42
+ ## ๐ŸŽจ API Reference
43
+
44
+ ### Content Projection
45
+
46
+ | Slot | Description |
47
+ |----------------|--------------------------------------------------------------|
48
+ | `<ng-content>` | Default slot for navigation links, logos, or action buttons. |
49
+
50
+ ---
51
+
52
+ ## ๐Ÿงช Examples
53
+
54
+ ### Basic Navigation
55
+
56
+ A simple implementation featuring a logo and primary navigation links.
57
+
58
+ ```html
59
+ <nav dma-navbar>
60
+ <img src="logo.svg" alt="App Logo" />
61
+ <a href="/dashboard">Dashboard</a>
62
+ <a href="/settings">Settings</a>
63
+ </nav>
64
+ ```
65
+
66
+ ### Navbar with Action Buttons
67
+
68
+ Using the flex layout to separate navigation items from a call-to-action button.
69
+
70
+ ```ts
71
+ import { ChangeDetectionStrategy, Component } from '@angular/core';
72
+ import { NavbarComponent } from '@dnd-mapp/shared-ui';
73
+
74
+ @Component({
75
+ selector: 'app-header',
76
+ template: `
77
+ <nav dma-navbar>
78
+ <span class="font-bold">D&D Mapp</span>
79
+ <div style="flex: 1"></div>
80
+ <button>Logout</button>
81
+ </nav>
82
+ `,
83
+ changeDetection: ChangeDetectionStrategy.OnPush,
84
+ imports: [NavbarComponent],
85
+ })
86
+ export class HeaderComponent {}
87
+ ```
88
+
89
+ ---
90
+
91
+ ## ๐Ÿ“œ License
92
+
93
+ This component is part of the `@dnd-mapp/shared-ui` internal library. All rights reserved. Proprietary and confidential.
@@ -0,0 +1,96 @@
1
+ [โ† Back to Library Overview](../../../../README.md#-component-library)
2
+
3
+ ---
4
+
5
+ # Navbar Brand
6
+
7
+ The `NavbarBrandComponent` is a foundational UI element for application navigation bars. It provides a standardized way to display a brand logo alongside a brand name, automatically linking back to the application root.
8
+
9
+ ---
10
+
11
+ ## ๐Ÿฐ Overview
12
+
13
+ - **Selector:** `dma-navbar-brand`
14
+ - **Format:** Angular Standalone Component
15
+ - **Change Detection:** `OnPush`
16
+
17
+ ---
18
+
19
+ ## ๐Ÿš€ Usage
20
+
21
+ To use the `NavbarBrandComponent`, import it into your standalone component or Angular module, and then add it to your template.
22
+
23
+ ```ts
24
+ import { ChangeDetectionStrategy, Component } from '@angular/core';
25
+ import { NavbarBrandComponent } from '@dnd-mapp/shared-ui';
26
+
27
+ @Component({
28
+ selector: 'app-layout',
29
+ template: `<dma-navbar-brand imgSrc="assets/logo.svg" brandName="D&D Mapp" />`,
30
+ changeDetection: ChangeDetectionStrategy.OnPush,
31
+ imports: [NavbarBrandComponent],
32
+ })
33
+ export class LayoutComponent {}
34
+ ```
35
+
36
+ ---
37
+
38
+ ## ๐ŸŽจ API Reference
39
+
40
+ ### Inputs
41
+
42
+ The component uses Angular Signals for its input properties.
43
+
44
+ | Name | Type | Required | Description |
45
+ |-------------|----------|----------|----------------------------------------------------|
46
+ | `imgSrc` | `string` | Yes | The source URL for the brand logo image. |
47
+ | `brandName` | `string` | Yes | The text string to be displayed as the brand name. |
48
+
49
+ ### Routing
50
+
51
+ The component internally uses `RouterLink` and is hardcoded to navigate to the root path (`/`). Ensure that `provideRouter` is configured in your application bootstrap.
52
+
53
+ ---
54
+
55
+ ## ๐Ÿงช Examples
56
+
57
+ ### Basic Branding
58
+
59
+ ```ts
60
+ import { ChangeDetectionStrategy, Component } from '@angular/core';
61
+ import { NavbarBrandComponent } from '@dnd-mapp/shared-ui';
62
+
63
+ @Component({
64
+ selector: 'app-root',
65
+ template: '<dma-navbar-brand imgSrc="/favicon.ico" brandName="My Application" />',
66
+ changeDetection: ChangeDetectionStrategy.OnPush,
67
+ imports: [NavbarBrandComponent],
68
+ })
69
+ export class RootComponent {}
70
+ ```
71
+
72
+ ### Dynamic Branding
73
+
74
+ Since the component uses Signal inputs, you can pass values from other Signals or standard properties:
75
+
76
+ ```ts
77
+ import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
78
+ import { NavbarBrandComponent } from '@dnd-mapp/shared-ui';
79
+
80
+ @Component({
81
+ selector: 'app-root',
82
+ template: '<dma-navbar-brand [imgSrc]="logo()" [brandName]="name()" />',
83
+ changeDetection: ChangeDetectionStrategy.OnPush,
84
+ imports: [NavbarBrandComponent],
85
+ })
86
+ export class RootComponent {
87
+ protected readonly logo = signal('assets/dynamic-logo.svg');
88
+ protected readonly name = signal('Prototyping App');
89
+ }
90
+ ```
91
+
92
+ ---
93
+
94
+ ## ๐Ÿ“œ License
95
+
96
+ This component is part of the `@dnd-mapp/shared-ui` proprietary library. Refer to the root [LICENSE](https://github.com/dnd-mapp/shared-ui/blob/main/LICENSE) for usage restrictions.
@@ -0,0 +1,76 @@
1
+ [โ† Back to Library Overview](../../../../README.md#-component-library)
2
+
3
+ ---
4
+
5
+ # NavbarLink
6
+
7
+ A navigation-aware component designed for use within navigation bars. It handles active state detection using Angular's functional `isActive` utility and provides a consistent visual experience for routing.
8
+
9
+ The `NavbarLinkComponent` integrates with the Angular Router to automatically determine its active state. It manages navigation both through a standard `[routerLink]` directive for accessibility (allowing right-clicks/middle-clicks) and a programmatic `onClick` handler.
10
+
11
+ ---
12
+
13
+ ## ๐Ÿฐ Overview
14
+
15
+ - **Selector:** `dma-navbar-link`
16
+ - **Format:** Angular Standalone Component
17
+ - **Change Detection:** `OnPush`
18
+
19
+ ---
20
+
21
+ ## ๐Ÿš€ Usage
22
+
23
+ To use the `NavbarLinkComponent`, import it into your standalone component and add it to your template.
24
+
25
+ ```ts
26
+ import { ChangeDetectionStrategy, Component } from '@angular/core';
27
+ import { NavbarLinkComponent } from '@dnd-mapp/shared-ui';
28
+
29
+ @Component({
30
+ selector: 'app-nav-container',
31
+ template: `
32
+ <nav>
33
+ <dma-navbar-link label="Dashboard" route="/dashboard" />
34
+ <dma-navbar-link label="Settings" route="/settings" />
35
+ </nav>
36
+ `,
37
+ changeDetection: ChangeDetectionStrategy.OnPush,
38
+ imports: [NavbarLinkComponent],
39
+ })
40
+ export class NavContainerComponent {}
41
+ ```
42
+
43
+ ---
44
+
45
+ ## ๐ŸŽจ API Reference
46
+
47
+ ### Inputs
48
+
49
+ | Name | Type | Required | Description |
50
+ |---------|----------|----------|------------------------------------------------------------------------------|
51
+ | `label` | `string` | **Yes** | The text label passed to the internal active marker. |
52
+ | `route` | `string` | **Yes** | The destination URL path used for both navigation and active state matching. |
53
+
54
+ ### Active State Logic
55
+
56
+ The component uses a `Signal<boolean>` to track the active state. It is considered active if the current URL matches the `route` input based on the following criteria:
57
+
58
+ - **Paths:** `subset` (Matches if the route is a prefix of the current URL).
59
+ - **Query Params:** `subset`.
60
+ - **Fragments/Matrix Params:** `ignored`.
61
+
62
+ ---
63
+
64
+ ## ๐Ÿงช Examples
65
+
66
+ ### Basic Navigation
67
+
68
+ ```html
69
+ <dma-navbar-link label="Home" route="/home" />
70
+ ```
71
+
72
+ ---
73
+
74
+ ## ๐Ÿ“œ License
75
+
76
+ This component is part of the `@dnd-mapp/shared-ui` proprietary library. Refer to the root [LICENSE](https://github.com/dnd-mapp/shared-ui/blob/main/LICENSE) for usage restrictions.