@dnd-mapp/shared-ui 0.1.0 โ 1.1.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.
- package/README.md +44 -64
- package/assets/images/404.png +0 -0
- package/assets/images/apple-touch-icon.png +0 -0
- package/assets/images/favicon-16.png +0 -0
- package/assets/images/favicon-32.png +0 -0
- package/assets/images/favicon-512.png +0 -0
- package/assets/images/favicon.ico +0 -0
- package/assets/styles/main.css +6 -0
- package/fesm2022/dnd-mapp-shared-ui.mjs +389 -8
- package/fesm2022/dnd-mapp-shared-ui.mjs.map +1 -1
- package/package.json +22 -16
- package/src/lib/button/README.md +131 -0
- package/src/lib/dropdown/README.md +127 -0
- package/src/lib/forms/input/README.md +105 -0
- package/src/lib/nav/active-marker/README.md +102 -0
- package/src/lib/nav/app-top-bar/README.md +113 -0
- package/src/lib/nav/navbar/README.md +98 -0
- package/src/lib/nav/navbar-brand/README.md +77 -0
- package/src/lib/nav/navbar-link/README.md +65 -0
- package/src/lib/nav/navbar-menu/README.md +125 -0
- package/src/lib/vertical-rule/README.md +97 -0
- package/types/dnd-mapp-shared-ui.d.ts +150 -4
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
[โ Back to Library Overview](../../../../README.md#-component-library)
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# App Top Bar `dma-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 container that leverages Tailwind CSS for layout and provides a specific slot for `AppTopBarSectionComponent` instances. This allows developers to easily group elements at the start or end of the bar.
|
|
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 position="start"><span>Logo</span></dma-app-top-bar-section>
|
|
30
|
+
<dma-app-top-bar-section position="end"><button>Profile</button></dma-app-top-bar-section>
|
|
31
|
+
</dma-app-top-bar>
|
|
32
|
+
`,
|
|
33
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
34
|
+
imports: [AppTopBarComponent, AppTopBarSectionComponent],
|
|
35
|
+
})
|
|
36
|
+
export class RootComponent {}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## ๐จ API Reference
|
|
42
|
+
|
|
43
|
+
### AppTopBarComponent
|
|
44
|
+
|
|
45
|
+
#### Content Projection
|
|
46
|
+
|
|
47
|
+
| Slot | Description |
|
|
48
|
+
|:--------------------------|:----------------------------------------------------|
|
|
49
|
+
| `dma-app-top-bar-section` | Used to define alignment groups within the top bar. |
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
### AppTopBarSectionComponent
|
|
54
|
+
|
|
55
|
+
#### Inputs
|
|
56
|
+
|
|
57
|
+
| Name | Type | Default | Description |
|
|
58
|
+
|--------------|--------------------|-----------|-----------------------------------------------------------------------------------------------|
|
|
59
|
+
| `[position]` | `'start' \| 'end'` | `'start'` | Determines the alignment. `'start'` sections will grow to fill available space if applicable. |
|
|
60
|
+
|
|
61
|
+
#### Content Projection
|
|
62
|
+
|
|
63
|
+
| Slot | Description |
|
|
64
|
+
|--------------|------------------------------------------------------------------------|
|
|
65
|
+
| `ng-content` | The elements (links, buttons, text) to be rendered within the section. |
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## ๐งช Examples
|
|
70
|
+
|
|
71
|
+
### Basic Branding and Navigation
|
|
72
|
+
|
|
73
|
+
A standard layout with a title on the left and a single action on the right.
|
|
74
|
+
|
|
75
|
+
```html
|
|
76
|
+
<dma-app-top-bar>
|
|
77
|
+
<dma-app-top-bar-section position="start">
|
|
78
|
+
<img src="logo.png" alt="Logo" class="h-6" />
|
|
79
|
+
<h1 class="text-lg font-bold">D&D Mapp</h1>
|
|
80
|
+
</dma-app-top-bar-section>
|
|
81
|
+
|
|
82
|
+
<dma-app-top-bar-section position="end">
|
|
83
|
+
<button class="btn-primary">Logout</button>
|
|
84
|
+
</dma-app-top-bar-section>
|
|
85
|
+
</dma-app-top-bar>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Complex Action Bar
|
|
89
|
+
|
|
90
|
+
Using multiple items within the sections to create a rich interface.
|
|
91
|
+
|
|
92
|
+
```html
|
|
93
|
+
<dma-app-top-bar>
|
|
94
|
+
<dma-app-top-bar-section position="start">
|
|
95
|
+
<dma-icon dma-bars-icon />
|
|
96
|
+
<nav>
|
|
97
|
+
<a href="#">Dashboard</a>
|
|
98
|
+
<a href="#">Campaigns</a>
|
|
99
|
+
</nav>
|
|
100
|
+
</dma-app-top-bar-section>
|
|
101
|
+
|
|
102
|
+
<dma-app-top-bar-section position="end">
|
|
103
|
+
<dma-search-input />
|
|
104
|
+
<dma-avatar user="Oscar" />
|
|
105
|
+
</dma-app-top-bar-section>
|
|
106
|
+
</dma-app-top-bar>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## ๐ License
|
|
112
|
+
|
|
113
|
+
Internal Proprietary Library โ All Rights Reserved.
|
|
@@ -0,0 +1,98 @@
|
|
|
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 Tailwind CSS for a flexible, horizontal flexbox layout with standardized spacing.
|
|
12
|
+
|
|
13
|
+
| Feature | Details |
|
|
14
|
+
|----------------------|----------------------------------------|
|
|
15
|
+
| **Selector** | `nav[dma-navbar]` |
|
|
16
|
+
| **Format** | Standalone Component (Attribute-based) |
|
|
17
|
+
| **Change Detection** | `ChangeDetectionStrategy.OnPush` |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## ๐ Usage
|
|
22
|
+
|
|
23
|
+
Apply the `dma-navbar` attribute to a `<nav>` element. Use content projection to include your navigation links or branding elements.
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
27
|
+
import { NavbarComponent } from '@dnd-mapp/shared-ui';
|
|
28
|
+
|
|
29
|
+
@Component({
|
|
30
|
+
selector: 'app-root',
|
|
31
|
+
template: `<nav dma-navbar><!-- Content is projected here --></nav>`,
|
|
32
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
33
|
+
imports: [NavbarComponent],
|
|
34
|
+
})
|
|
35
|
+
export class RootComponent {
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## ๐จ API Reference
|
|
42
|
+
|
|
43
|
+
### Content Projection
|
|
44
|
+
|
|
45
|
+
| Slot | Description |
|
|
46
|
+
|----------------|--------------------------------------------------------------|
|
|
47
|
+
| `<ng-content>` | Default slot for navigation links, logos, or action buttons. |
|
|
48
|
+
|
|
49
|
+
### Host Bindings
|
|
50
|
+
|
|
51
|
+
| Property | Value | Description |
|
|
52
|
+
|----------|---------------------------|---------------------------------------------------|
|
|
53
|
+
| `class` | `flex items-center gap-4` | Applies horizontal alignment and default spacing. |
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## ๐งช Examples
|
|
58
|
+
|
|
59
|
+
### Basic Navigation
|
|
60
|
+
|
|
61
|
+
A simple implementation featuring a logo and primary navigation links.
|
|
62
|
+
|
|
63
|
+
```html
|
|
64
|
+
<nav dma-navbar>
|
|
65
|
+
<img src="logo.svg" alt="App Logo" class="h-8" />
|
|
66
|
+
<a href="/dashboard">Dashboard</a>
|
|
67
|
+
<a href="/settings">Settings</a>
|
|
68
|
+
</nav>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Navbar with Action Buttons
|
|
72
|
+
|
|
73
|
+
Using the flex layout to separate navigation items from a call-to-action button.
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
77
|
+
import { NavbarComponent } from '@dnd-mapp/shared-ui';
|
|
78
|
+
|
|
79
|
+
@Component({
|
|
80
|
+
selector: 'app-header',
|
|
81
|
+
template: `
|
|
82
|
+
<nav dma-navbar>
|
|
83
|
+
<span class="font-bold">D&D Mapp</span>
|
|
84
|
+
<div class="flex-1"></div>
|
|
85
|
+
<button class="btn-primary">Logout</button>
|
|
86
|
+
</nav>
|
|
87
|
+
`,
|
|
88
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
89
|
+
imports: [NavbarComponent],
|
|
90
|
+
})
|
|
91
|
+
export class HeaderComponent {}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## ๐ License
|
|
97
|
+
|
|
98
|
+
This component is part of the `@dnd-mapp/shared-ui` internal library. All rights reserved. Proprietary and confidential.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
[โ Back to Library Overview](../../../../README.md#-component-library)
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Navbar Brand Component (`dma-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 { NavbarBrandComponent } from '@dnd-mapp/shared-ui';
|
|
25
|
+
|
|
26
|
+
@Component({
|
|
27
|
+
selector: 'app-layout',
|
|
28
|
+
template: `<dma-navbar-brand imgSrc="assets/logo.svg" brandName="D&D Mapp" />`,
|
|
29
|
+
imports: [NavbarBrandComponent],
|
|
30
|
+
})
|
|
31
|
+
export class LayoutComponent {}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## ๐จ API Reference
|
|
37
|
+
|
|
38
|
+
### Inputs
|
|
39
|
+
|
|
40
|
+
| Name | Type | Required | Description |
|
|
41
|
+
|-------------|----------|----------|----------------------------------------------------|
|
|
42
|
+
| `imgSrc` | `string` | Yes | The source URL for the brand logo image. |
|
|
43
|
+
| `brandName` | `string` | Yes | The text string to be displayed as the brand name. |
|
|
44
|
+
|
|
45
|
+
### Routing
|
|
46
|
+
|
|
47
|
+
The component internally uses `RouterLink` and is hardcoded to navigate to the root path (`/`). Ensure that the `provideRouter` or `RouterModule` is configured in your application.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## ๐งช Examples
|
|
52
|
+
|
|
53
|
+
### Basic Branding
|
|
54
|
+
|
|
55
|
+
```html
|
|
56
|
+
<dma-navbar-brand
|
|
57
|
+
imgSrc="/favicon.ico"
|
|
58
|
+
brandName="My Application"
|
|
59
|
+
/>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Dynamic Branding
|
|
63
|
+
|
|
64
|
+
If your brand information comes from a configuration object or a signal:
|
|
65
|
+
|
|
66
|
+
```html
|
|
67
|
+
<dma-navbar-brand
|
|
68
|
+
[imgSrc]="config.logoPath"
|
|
69
|
+
[brandName]="config.appName"
|
|
70
|
+
/>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## ๐ License
|
|
76
|
+
|
|
77
|
+
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,65 @@
|
|
|
1
|
+
[โ Back to Library Overview](../../../../README.md#-component-library)
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# NavbarLink Component (`dma-navbar-link`)
|
|
6
|
+
|
|
7
|
+
A lightweight, navigation-aware component designed for use within navigation bars. It handles active state detection automatically, ensuring that the link is visually highlighted when the current route matches its destination.
|
|
8
|
+
|
|
9
|
+
The `NavbarLinkComponent` provides a wrapper around Angular's `RouterLink`. A key feature of this component is its layout stability: it uses a hidden "bold" placeholder to pre-calculate the space required for its active state. This prevents the "shaking" or layout shifting effect that often occurs when a font weight changes from normal to bold upon selection.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## ๐ฐ Overview
|
|
14
|
+
|
|
15
|
+
- **Selector:** `dma-navbar-link`
|
|
16
|
+
- **Format:** Angular Standalone Component
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## ๐ Usage
|
|
21
|
+
|
|
22
|
+
To use the `NavbarLinkComponent`, import it into your standalone component or Angular module and add it to your template.
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { NavbarLinkComponent } from '@dnd-mapp/shared-ui';
|
|
26
|
+
|
|
27
|
+
@Component({
|
|
28
|
+
selector: 'app-nav-container',
|
|
29
|
+
template: `
|
|
30
|
+
<nav>
|
|
31
|
+
<dma-navbar-link label="Dashboard" route="/dashboard" />
|
|
32
|
+
<dma-navbar-link label="Settings" route="/settings" />
|
|
33
|
+
</nav>
|
|
34
|
+
`,
|
|
35
|
+
imports: [NavbarLinkComponent],
|
|
36
|
+
})
|
|
37
|
+
export class NavContainerComponent {}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## ๐จ API Reference
|
|
43
|
+
|
|
44
|
+
### Inputs
|
|
45
|
+
|
|
46
|
+
| Name | Type | Required | Description |
|
|
47
|
+
|---------|----------|----------|-----------------------------------------------------------------------------|
|
|
48
|
+
| `label` | `string` | Yes | The text to be displayed inside the link. |
|
|
49
|
+
| `route` | `string` | Yes | The destination URL path (passed to `routerLink`). |
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## ๐งช Examples
|
|
54
|
+
|
|
55
|
+
### Basic Navigation
|
|
56
|
+
|
|
57
|
+
```html
|
|
58
|
+
<dma-navbar-link label="Home" route="/home" />
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## ๐ License
|
|
64
|
+
|
|
65
|
+
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,125 @@
|
|
|
1
|
+
[โ Back to Library Overview](../../../../README.md#-component-library)
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Navbar Menu `dma-navbar-menu`
|
|
6
|
+
|
|
7
|
+
The `Navbar Menu` is a specialized navigation component designed to trigger dropdown menus within a navigation bar. It integrates seamlessly with the library's dropdown system, supporting both click-based and hover-based interactions for improved user experience.
|
|
8
|
+
|
|
9
|
+
## ๐ฐ Overview
|
|
10
|
+
|
|
11
|
+
| Feature | Details |
|
|
12
|
+
|----------------------|----------------------|
|
|
13
|
+
| **Selector** | `dma-navbar-menu` |
|
|
14
|
+
| **Format** | Standalone Component |
|
|
15
|
+
| **Change Detection** | `OnPush` |
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## ๐ Usage
|
|
20
|
+
|
|
21
|
+
The component uses content projection to separate the trigger element from the dropdown content.
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
25
|
+
import { NavbarMenuComponent } from '@dnd-mapp/shared-ui';
|
|
26
|
+
|
|
27
|
+
@Component({
|
|
28
|
+
selector: 'app-nav',
|
|
29
|
+
template: `
|
|
30
|
+
<dma-navbar-menu [toggleOnHover]="true">
|
|
31
|
+
<ng-container ngProjectAs="dropdown-trigger">
|
|
32
|
+
<span>Products</span>
|
|
33
|
+
</ng-container>
|
|
34
|
+
<ng-container ngProjectAs="dropdown-menu">
|
|
35
|
+
<a href="/link-1">Feature A</a>
|
|
36
|
+
<a href="/link-2">Feature B</a>
|
|
37
|
+
</ng-container>
|
|
38
|
+
</dma-navbar-menu>
|
|
39
|
+
`,
|
|
40
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
41
|
+
imports: [NavbarMenuComponent],
|
|
42
|
+
})
|
|
43
|
+
export class NavComponent {
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## ๐จ API Reference
|
|
50
|
+
|
|
51
|
+
### Inputs
|
|
52
|
+
|
|
53
|
+
| Name | Type | Default | Description |
|
|
54
|
+
|-----------------|-----------|---------|------------------------------------------------------------------------------------------------------------|
|
|
55
|
+
| `toggleOnHover` | `boolean` | `false` | Whether the dropdown should open and close automatically when the mouse enters or leaves the trigger area. |
|
|
56
|
+
|
|
57
|
+
### Content Projection Slots
|
|
58
|
+
|
|
59
|
+
| Selector | Description |
|
|
60
|
+
|--------------------|-----------------------------------------------------------|
|
|
61
|
+
| `dropdown-trigger` | The element that acts as the button to toggle the menu. |
|
|
62
|
+
| `dropdown-menu` | The container holding the navigation links or menu items. |
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## ๐งช Examples
|
|
67
|
+
|
|
68
|
+
### Basic Click Toggle
|
|
69
|
+
|
|
70
|
+
By default, the menu requires a click interaction to open, which is ideal for mobile-responsive headers or complex navigation.
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
74
|
+
import { NavbarMenuComponent } from '@dnd-mapp/shared-ui';
|
|
75
|
+
|
|
76
|
+
@Component({
|
|
77
|
+
selector: 'app-basic-nav',
|
|
78
|
+
template: `
|
|
79
|
+
<dma-navbar-menu>
|
|
80
|
+
<dropdown-trigger>Settings</dropdown-trigger>
|
|
81
|
+
<dropdown-menu>
|
|
82
|
+
<ul>
|
|
83
|
+
<li>Profile</li>
|
|
84
|
+
<li>Security</li>
|
|
85
|
+
</ul>
|
|
86
|
+
</dropdown-menu>
|
|
87
|
+
</dma-navbar-menu>
|
|
88
|
+
`,
|
|
89
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
90
|
+
imports: [NavbarMenuComponent],
|
|
91
|
+
})
|
|
92
|
+
export class BasicNavComponent {
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Hover Activation
|
|
97
|
+
|
|
98
|
+
Use the `toggleOnHover` input to create a more fluid desktop navigation experience where menus appear instantly on mouseenter.
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
102
|
+
import { NavbarMenuComponent } from '@dnd-mapp/shared-ui';
|
|
103
|
+
|
|
104
|
+
@Component({
|
|
105
|
+
selector: 'app-hover-nav',
|
|
106
|
+
template: `
|
|
107
|
+
<dma-navbar-menu toggleOnHover>
|
|
108
|
+
<ng-container ngProjectAs="dropdown-trigger">Resources</ng-container>
|
|
109
|
+
<ng-container ngProjectAs="dropdown-menu">
|
|
110
|
+
<nav-item>Documentation</nav-item>
|
|
111
|
+
<nav-item>API Reference</nav-item>
|
|
112
|
+
</ng-container>
|
|
113
|
+
</dma-navbar-menu>
|
|
114
|
+
`,
|
|
115
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
116
|
+
imports: [NavbarMenuComponent],
|
|
117
|
+
})
|
|
118
|
+
export class HoverNavComponent {}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## ๐ License
|
|
124
|
+
|
|
125
|
+
This component is part of the `@dnd-mapp/shared-ui` internal library. All rights reserved. Proprietary and confidential.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
[โ Back to Library Overview](../../../README.md#-component-library)
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Vertical Rule Component (`dma-vr`)
|
|
6
|
+
|
|
7
|
+
The `VerticalRuleComponent` is a structural utility component designed to provide a consistent vertical divider for separating content within layouts, such as navigation bars, toolbars, or flex containers.
|
|
8
|
+
|
|
9
|
+
## ๐ฐ Overview
|
|
10
|
+
|
|
11
|
+
- **Selector**: `dma-vr`
|
|
12
|
+
- **Use Case**: Visual separation of inline elements.
|
|
13
|
+
- **Compatibility**: Designed for use within flexbox or grid containers.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## ๐ Usage
|
|
18
|
+
|
|
19
|
+
### 1. Import
|
|
20
|
+
|
|
21
|
+
Add `VerticalRuleComponent` to your standalone component's `imports` array:
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { Component } from '@angular/core';
|
|
25
|
+
import { VerticalRuleComponent } from '@dnd-mapp/shared-ui';
|
|
26
|
+
|
|
27
|
+
@Component({
|
|
28
|
+
selector: 'app-toolbar',
|
|
29
|
+
template: `
|
|
30
|
+
<div class="flex h-10 items-center gap-4">
|
|
31
|
+
<button dma-button>Save</button>
|
|
32
|
+
|
|
33
|
+
<!-- Vertical Divider -->
|
|
34
|
+
<dma-vr />
|
|
35
|
+
|
|
36
|
+
<button dma-button>Delete</button>
|
|
37
|
+
</div>
|
|
38
|
+
`,
|
|
39
|
+
imports: [VerticalRuleComponent]
|
|
40
|
+
})
|
|
41
|
+
export class ToolbarComponent {}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 2. Styles Requirement
|
|
45
|
+
|
|
46
|
+
For the divider to display correctly, the parent container should have a defined height or use a flex layout. The component is designed to automatically stretch to the height of its container.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## ๐จ API Reference
|
|
51
|
+
|
|
52
|
+
### Selector
|
|
53
|
+
|
|
54
|
+
`dma-vr`
|
|
55
|
+
|
|
56
|
+
### Visual Behavior
|
|
57
|
+
|
|
58
|
+
- **Orientation**: Vertical.
|
|
59
|
+
- **Color**: Preset to the design system's neutral palette.
|
|
60
|
+
- **Thickness**: Single-pixel border (start-aligned).
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## ๐งช Examples
|
|
65
|
+
|
|
66
|
+
### Navigation Header
|
|
67
|
+
|
|
68
|
+
The divider is ideal for separating text links or icons in a header navigation.
|
|
69
|
+
|
|
70
|
+
```html
|
|
71
|
+
<nav class="flex items-center gap-2 p-4">
|
|
72
|
+
<span>Character Sheet</span>
|
|
73
|
+
<dma-vr />
|
|
74
|
+
<span>Inventory</span>
|
|
75
|
+
<dma-vr />
|
|
76
|
+
<span>Spells</span>
|
|
77
|
+
</nav>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Action Group
|
|
81
|
+
|
|
82
|
+
Use it to group related actions within a toolbar while maintaining a clear visual distinction between different functional sets.
|
|
83
|
+
|
|
84
|
+
```html
|
|
85
|
+
<div class="flex h-8 items-center gap-3">
|
|
86
|
+
<dma-icon-button icon="edit" />
|
|
87
|
+
<dma-icon-button icon="copy" />
|
|
88
|
+
<dma-vr />
|
|
89
|
+
<dma-icon-button icon="trash" />
|
|
90
|
+
</div>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## ๐ License
|
|
96
|
+
|
|
97
|
+
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.
|