@smartsoft001/claude-plugins 2.119.0 → 2.121.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/package.json +1 -1
- package/plugins/smart/.claude-plugin/plugin.json +1 -1
- package/plugins/smart/agents/angular-components/AGENT.md +212 -11
- package/plugins/smart/skills/angular-components-accordion/SKILL.md +86 -0
- package/plugins/smart/skills/angular-components-action-panel/SKILL.md +195 -0
- package/plugins/smart/skills/angular-components-breadcrumbs/SKILL.md +152 -0
- package/plugins/smart/skills/angular-components-button/SKILL.md +81 -54
- package/plugins/smart/skills/angular-components-calendar/SKILL.md +222 -0
- package/plugins/smart/skills/angular-components-card/SKILL.md +112 -0
- package/plugins/smart/skills/angular-components-card-heading/SKILL.md +156 -0
- package/plugins/smart/skills/angular-components-date-edit/SKILL.md +107 -0
- package/plugins/smart/skills/angular-components-date-range/SKILL.md +149 -0
- package/plugins/smart/skills/angular-components-description-list/SKILL.md +205 -0
- package/plugins/smart/skills/angular-components-detail/SKILL.md +146 -0
- package/plugins/smart/skills/angular-components-details/SKILL.md +123 -0
- package/plugins/smart/skills/angular-components-empty-state/SKILL.md +198 -0
- package/plugins/smart/skills/angular-components-feed/SKILL.md +199 -0
- package/plugins/smart/skills/angular-components-form/SKILL.md +160 -0
- package/plugins/smart/skills/angular-components-grid-list/SKILL.md +215 -0
- package/plugins/smart/skills/angular-components-info/SKILL.md +160 -0
- package/plugins/smart/skills/angular-components-input/SKILL.md +196 -0
- package/plugins/smart/skills/angular-components-list/SKILL.md +265 -0
- package/plugins/smart/skills/angular-components-multi-column-layout/SKILL.md +174 -0
- package/plugins/smart/skills/angular-components-navbar/SKILL.md +192 -0
- package/plugins/smart/skills/angular-components-page/SKILL.md +230 -0
- package/plugins/smart/skills/angular-components-page-heading/SKILL.md +183 -0
- package/plugins/smart/skills/angular-components-paging/SKILL.md +132 -0
- package/plugins/smart/skills/angular-components-password-strength/SKILL.md +172 -0
- package/plugins/smart/skills/angular-components-progress-bars/SKILL.md +187 -0
- package/plugins/smart/skills/angular-components-searchbar/SKILL.md +167 -0
- package/plugins/smart/skills/angular-components-section-heading/SKILL.md +177 -0
- package/plugins/smart/skills/angular-components-select-menu/SKILL.md +211 -0
- package/plugins/smart/skills/angular-components-sidebar-layout/SKILL.md +176 -0
- package/plugins/smart/skills/angular-components-sidebar-navigation/SKILL.md +225 -0
- package/plugins/smart/skills/angular-components-sign-in-form/SKILL.md +202 -0
- package/plugins/smart/skills/angular-components-stacked-layout/SKILL.md +169 -0
- package/plugins/smart/skills/angular-components-stacked-list/SKILL.md +213 -0
- package/plugins/smart/skills/angular-components-stats/SKILL.md +213 -0
- package/plugins/smart/skills/angular-components-table/SKILL.md +216 -0
- package/plugins/smart/skills/angular-components-tabs/SKILL.md +181 -0
- package/plugins/smart/skills/angular-components-textarea/SKILL.md +168 -0
- package/plugins/smart/skills/angular-components-toggle/SKILL.md +155 -0
- package/plugins/smart/skills/angular-components-vertical-navigation/SKILL.md +158 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: angular-components-sidebar-navigation
|
|
3
|
+
description: Sidebar navigation component API with logo, expandable sections and profile footer using InjectionToken pattern.
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Sidebar Navigation Component
|
|
8
|
+
|
|
9
|
+
The `<smart-sidebar-navigation>` component renders a full-height application sidebar with optional logo, vertical navigation groups, expandable sub-sections, and a profile footer. It follows the Base + Standard + Wrapper pattern with an InjectionToken-based extension mechanism. The abstract `SidebarNavigationBaseComponent` defines the shared API — `options` (`ISidebarNavOptions`), `cssClass` (alias `class`), and outputs `itemClick` and `itemToggle`. `SidebarNavigationStandardComponent` is a barebones placeholder using native `<nav>`, `<ul>`, `<li>`, `<a>`, `<button>` elements and `<img>` for logo/avatar. `SidebarNavigationComponent` is the public wrapper that renders `SidebarNavigationStandardComponent` by default and accepts a custom replacement via `SIDEBAR_NAVIGATION_STANDARD_COMPONENT_TOKEN`.
|
|
10
|
+
|
|
11
|
+
## When to Use This Skill
|
|
12
|
+
|
|
13
|
+
- Developer wants to use or customize the application sidebar (with logo, expandable sub-menus, profile footer)
|
|
14
|
+
- Developer asks about `<smart-sidebar-navigation>`, `SidebarNavigationComponent`, `SidebarNavigationStandardComponent`, or `SidebarNavigationBaseComponent`
|
|
15
|
+
|
|
16
|
+
## Components
|
|
17
|
+
|
|
18
|
+
### SidebarNavigationComponent (`<smart-sidebar-navigation>`)
|
|
19
|
+
|
|
20
|
+
Main wrapper. Delegates to `SidebarNavigationStandardComponent` by default. When `SIDEBAR_NAVIGATION_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet`. Re-emits `itemClick` and `itemToggle`.
|
|
21
|
+
|
|
22
|
+
### SidebarNavigationStandardComponent (`<smart-sidebar-navigation-standard>`)
|
|
23
|
+
|
|
24
|
+
Barebones placeholder using native HTML. Renders an outer wrapper with `cssClass`, an optional `<div class="sidebar-logo">` (with `<img>` plus optional dark variant `<img>` and optional `<a>` link), a `<nav class="sidebar-navigation">` (with `aria-label` from `options.ariaLabel` or default `"Sidebar"`), and a `<ul>` of groups. Each group renders an optional `<div class="group-title">` and a `<ul>` of items.
|
|
25
|
+
|
|
26
|
+
Items render in three forms:
|
|
27
|
+
|
|
28
|
+
- `<a class="item-link">` (when `href` provided)
|
|
29
|
+
- `<button class="item-button">` (when no `href`, emits `itemClick`)
|
|
30
|
+
- `<button class="item-toggle">` followed by `<ul class="children">` (when `expandable === true`, emits `itemToggle`)
|
|
31
|
+
|
|
32
|
+
Items get `current` class and `aria-current="page"` when `item.current === true`. The toggle button manages local expanded state (initial value taken from `item.expanded`). Supports `iconTpl`, `initial` (e.g. team letter), `label`, and `badge`.
|
|
33
|
+
|
|
34
|
+
When `options.profile` is present, renders a `<li class="profile">` at the bottom containing `<a class="profile-link">` with `<img class="profile-avatar">`, optional `.sr-only` text, and `.profile-name`.
|
|
35
|
+
|
|
36
|
+
### SidebarNavigationBaseComponent (abstract)
|
|
37
|
+
|
|
38
|
+
Abstract base directive. Exposes:
|
|
39
|
+
|
|
40
|
+
- `options: InputSignal<ISidebarNavOptions | undefined>`
|
|
41
|
+
- `cssClass: InputSignal<string>` (alias `class`)
|
|
42
|
+
- `itemClick: OutputEmitterRef<ISidebarNavItemClick>`
|
|
43
|
+
- `itemToggle: OutputEmitterRef<ISidebarNavItemToggle>`
|
|
44
|
+
- protected `resolvedGroups: Signal<ISidebarNavGroup[]>` — normalizes `options.items` into a single-group structure alongside `options.groups`
|
|
45
|
+
- protected `expandedOverrides: WritableSignal<Record<string, boolean>>` — internal toggle state per item id
|
|
46
|
+
- protected `isExpanded(item)` / `toggleExpanded(item)` — helpers for managing expandable items
|
|
47
|
+
|
|
48
|
+
`ISidebarNavItemClick = { itemId: string }`.
|
|
49
|
+
`ISidebarNavItemToggle = { itemId: string; expanded: boolean }`.
|
|
50
|
+
|
|
51
|
+
## API
|
|
52
|
+
|
|
53
|
+
### Inputs
|
|
54
|
+
|
|
55
|
+
| Input | Type | Default | Description |
|
|
56
|
+
| --------- | ---------------------------------------------- | ------- | ------------------------------------------- |
|
|
57
|
+
| `options` | `InputSignal<ISidebarNavOptions \| undefined>` | - | Sidebar navigation configuration |
|
|
58
|
+
| `class` | `InputSignal<string>` | `''` | External CSS classes (alias for `cssClass`) |
|
|
59
|
+
|
|
60
|
+
### Outputs
|
|
61
|
+
|
|
62
|
+
| Output | Type | Description |
|
|
63
|
+
| ------------ | ----------------------------------------- | ------------------------------------------------------- |
|
|
64
|
+
| `itemClick` | `OutputEmitterRef<ISidebarNavItemClick>` | Emitted when a button-type nav item or child is clicked |
|
|
65
|
+
| `itemToggle` | `OutputEmitterRef<ISidebarNavItemToggle>` | Emitted when an expandable item is toggled |
|
|
66
|
+
|
|
67
|
+
### ISidebarNavOptions
|
|
68
|
+
|
|
69
|
+
```typescript
|
|
70
|
+
type SmartSidebarNavLayout =
|
|
71
|
+
| 'light'
|
|
72
|
+
| 'dark'
|
|
73
|
+
| 'with-expandable-sections'
|
|
74
|
+
| 'with-secondary-navigation'
|
|
75
|
+
| 'brand';
|
|
76
|
+
|
|
77
|
+
interface ISidebarNavOptions {
|
|
78
|
+
layout?: SmartSidebarNavLayout;
|
|
79
|
+
ariaLabel?: string;
|
|
80
|
+
logo?: ISidebarNavLogo;
|
|
81
|
+
items?: ISidebarNavItem[];
|
|
82
|
+
groups?: ISidebarNavGroup[];
|
|
83
|
+
profile?: ISidebarNavProfile;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
interface ISidebarNavLogo {
|
|
87
|
+
url?: string;
|
|
88
|
+
urlDark?: string;
|
|
89
|
+
alt?: string;
|
|
90
|
+
href?: string;
|
|
91
|
+
tpl?: TemplateRef<unknown>;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
interface ISidebarNavGroup {
|
|
95
|
+
id?: string;
|
|
96
|
+
title?: string;
|
|
97
|
+
items: ISidebarNavItem[];
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
interface ISidebarNavItem {
|
|
101
|
+
id: string;
|
|
102
|
+
label?: string;
|
|
103
|
+
href?: string;
|
|
104
|
+
current?: boolean;
|
|
105
|
+
badge?: string | number;
|
|
106
|
+
iconTpl?: TemplateRef<unknown>;
|
|
107
|
+
initial?: string;
|
|
108
|
+
expandable?: boolean;
|
|
109
|
+
expanded?: boolean;
|
|
110
|
+
children?: ISidebarNavItem[];
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
interface ISidebarNavProfile {
|
|
114
|
+
name?: string;
|
|
115
|
+
avatarUrl?: string;
|
|
116
|
+
avatarAlt?: string;
|
|
117
|
+
href?: string;
|
|
118
|
+
srOnlyText?: string;
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
When both `items` and `groups` are provided, `items` is rendered first as a leading single-group section.
|
|
123
|
+
|
|
124
|
+
## SIDEBAR_NAVIGATION_STANDARD_COMPONENT_TOKEN
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
import { SIDEBAR_NAVIGATION_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
128
|
+
|
|
129
|
+
providers: [
|
|
130
|
+
{
|
|
131
|
+
provide: SIDEBAR_NAVIGATION_STANDARD_COMPONENT_TOKEN,
|
|
132
|
+
useValue: MyCustomSidebarNavigationComponent,
|
|
133
|
+
},
|
|
134
|
+
];
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Extending the Base Class
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
import {
|
|
141
|
+
ChangeDetectionStrategy,
|
|
142
|
+
Component,
|
|
143
|
+
input,
|
|
144
|
+
ViewEncapsulation,
|
|
145
|
+
} from '@angular/core';
|
|
146
|
+
|
|
147
|
+
import { SidebarNavigationBaseComponent } from '@smartsoft001/angular';
|
|
148
|
+
|
|
149
|
+
@Component({
|
|
150
|
+
selector: 'my-custom-sidebar-navigation',
|
|
151
|
+
template: `…`,
|
|
152
|
+
encapsulation: ViewEncapsulation.None,
|
|
153
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
154
|
+
})
|
|
155
|
+
export class MyCustomSidebarNavigationComponent extends SidebarNavigationBaseComponent {
|
|
156
|
+
// NgComponentOutlet passes 'cssClass' by canonical name, not the 'class' alias.
|
|
157
|
+
override cssClass = input<string>('');
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Usage Examples
|
|
162
|
+
|
|
163
|
+
```html
|
|
164
|
+
<!-- Flat list with logo and profile -->
|
|
165
|
+
<smart-sidebar-navigation
|
|
166
|
+
[options]="{
|
|
167
|
+
logo: { url: '/logo.svg', alt: 'Acme' },
|
|
168
|
+
items: [
|
|
169
|
+
{ id: 'dashboard', label: 'Dashboard', href: '/', current: true, badge: 5 },
|
|
170
|
+
{ id: 'team', label: 'Team', href: '/team' },
|
|
171
|
+
{ id: 'projects', label: 'Projects', href: '/projects', badge: 12 },
|
|
172
|
+
],
|
|
173
|
+
profile: {
|
|
174
|
+
name: 'Tom Cook',
|
|
175
|
+
avatarUrl: '/avatar.jpg',
|
|
176
|
+
href: '/me',
|
|
177
|
+
srOnlyText: 'Your profile',
|
|
178
|
+
},
|
|
179
|
+
}"
|
|
180
|
+
/>
|
|
181
|
+
|
|
182
|
+
<!-- With teams group (initials) -->
|
|
183
|
+
<smart-sidebar-navigation
|
|
184
|
+
[options]="{
|
|
185
|
+
items: mainItems,
|
|
186
|
+
groups: [
|
|
187
|
+
{
|
|
188
|
+
title: 'Your teams',
|
|
189
|
+
items: [
|
|
190
|
+
{ id: 'h', label: 'Heroicons', initial: 'H', href: '/h' },
|
|
191
|
+
{ id: 't', label: 'Tailwind Labs', initial: 'T', href: '/t' },
|
|
192
|
+
],
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
}"
|
|
196
|
+
(itemClick)="onItem($event)"
|
|
197
|
+
/>
|
|
198
|
+
|
|
199
|
+
<!-- With expandable sections -->
|
|
200
|
+
<smart-sidebar-navigation
|
|
201
|
+
[options]="{
|
|
202
|
+
items: [
|
|
203
|
+
{ id: 'dashboard', label: 'Dashboard', href: '/' },
|
|
204
|
+
{
|
|
205
|
+
id: 'teams',
|
|
206
|
+
label: 'Teams',
|
|
207
|
+
expandable: true,
|
|
208
|
+
children: [
|
|
209
|
+
{ id: 'eng', label: 'Engineering', href: '/eng' },
|
|
210
|
+
{ id: 'hr', label: 'Human Resources', href: '/hr' },
|
|
211
|
+
],
|
|
212
|
+
},
|
|
213
|
+
],
|
|
214
|
+
}"
|
|
215
|
+
(itemToggle)="onToggle($event)"
|
|
216
|
+
/>
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## File Locations
|
|
220
|
+
|
|
221
|
+
- Wrapper: `packages/shared/angular/src/lib/components/sidebar-navigation/sidebar-navigation.component.ts`
|
|
222
|
+
- Standard: `packages/shared/angular/src/lib/components/sidebar-navigation/standard/standard.component.ts`
|
|
223
|
+
- Base class: `packages/shared/angular/src/lib/components/sidebar-navigation/base/base.component.ts`
|
|
224
|
+
- Token: `packages/shared/angular/src/lib/shared.inectors.ts` (`SIDEBAR_NAVIGATION_STANDARD_COMPONENT_TOKEN`)
|
|
225
|
+
- Interfaces: `packages/shared/angular/src/lib/models/interfaces.ts` (`ISidebarNavOptions`, `ISidebarNavGroup`, `ISidebarNavItem`, `ISidebarNavLogo`, `ISidebarNavProfile`, `SmartSidebarNavLayout`)
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: angular-components-sign-in-form
|
|
3
|
+
description: Sign-in / sign-up form component API with InjectionToken pattern for custom implementations.
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Sign-in Form Component
|
|
8
|
+
|
|
9
|
+
The `<smart-sign-in-form>` component renders a single form that supports both **sign-in** and **sign-up** flows via the `mode` input. It exposes `submit` and `socialClick` outputs, optional social provider buttons, optional forgot/sign-in/sign-up links, an optional extra slot, and standard form fields. It follows the Base + Standard + Wrapper pattern with an InjectionToken-based extension mechanism. The abstract `SignInFormBaseComponent` defines the shared API — `mode` (`'sign-in' | 'sign-up'`), `disabled`, optional `ISignInFormOptions`, `cssClass` (alias `class`), and the `submit` / `socialClick` outputs. `SignInFormStandardComponent` is a barebones placeholder concrete implementation using a native `<form>` with `<input type="email">` and `<input type="password">`. `SignInFormComponent` is the public wrapper that renders `SignInFormStandardComponent` by default and accepts a custom replacement via `SIGN_IN_FORM_STANDARD_COMPONENT_TOKEN`.
|
|
10
|
+
|
|
11
|
+
## When to Use This Skill
|
|
12
|
+
|
|
13
|
+
- Developer wants to use or customize the sign-in / sign-up form component
|
|
14
|
+
- Developer asks about `<smart-sign-in-form>`, `SignInFormComponent`, `SignInFormStandardComponent`, or `SignInFormBaseComponent`
|
|
15
|
+
|
|
16
|
+
## Components
|
|
17
|
+
|
|
18
|
+
### SignInFormComponent (`<smart-sign-in-form>`)
|
|
19
|
+
|
|
20
|
+
Main wrapper component. Renders `SignInFormStandardComponent` by default. When `SIGN_IN_FORM_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet`. The wrapper re-emits `submit` and `socialClick` from the standard child.
|
|
21
|
+
|
|
22
|
+
### SignInFormStandardComponent (`<smart-sign-in-form-standard>`)
|
|
23
|
+
|
|
24
|
+
Barebones placeholder concrete implementation using a native `<form>`. Renders an outer wrapper, the form with optional `<label>`s (toggle via `options.showLabels`), `<input type="email">`, `<input type="password">` (with `autocomplete="new-password"` in `sign-up` mode), an optional forgot-password link (sign-in mode only), an optional submit-label override, optional social provider buttons, optional alt-link (sign-up href in sign-in mode, sign-in href in sign-up mode), and an optional `extraTpl` slot. The submit handler emits `{ email, password, mode }` via the inherited `submit` output unless `disabled` is `true`. Each social provider button emits `{ providerId, mode }` via `socialClick`.
|
|
25
|
+
|
|
26
|
+
### SignInFormBaseComponent (abstract)
|
|
27
|
+
|
|
28
|
+
Abstract base directive. Exposes:
|
|
29
|
+
|
|
30
|
+
- `mode: InputSignal<SmartSignInFormMode>` (default `'sign-in'`)
|
|
31
|
+
- `disabled: InputSignal<boolean>` (default `false`)
|
|
32
|
+
- `options: InputSignal<ISignInFormOptions | undefined>`
|
|
33
|
+
- `cssClass: InputSignal<string>` (alias `class`)
|
|
34
|
+
- `submit: OutputEmitterRef<ISignInFormSubmit>`
|
|
35
|
+
- `socialClick: OutputEmitterRef<ISignInFormSocialClick>`
|
|
36
|
+
|
|
37
|
+
## API
|
|
38
|
+
|
|
39
|
+
### Inputs
|
|
40
|
+
|
|
41
|
+
| Input | Type | Default | Description |
|
|
42
|
+
| ---------- | ---------------------------------------------- | ----------- | ------------------------------------------------------------- |
|
|
43
|
+
| `mode` | `InputSignal<SmartSignInFormMode>` | `'sign-in'` | `'sign-in'` or `'sign-up'` |
|
|
44
|
+
| `disabled` | `InputSignal<boolean>` | `false` | Disables inputs and prevents emit |
|
|
45
|
+
| `options` | `InputSignal<ISignInFormOptions \| undefined>` | - | Optional configuration (social providers, layout, slots etc.) |
|
|
46
|
+
| `class` | `InputSignal<string>` | `''` | External CSS classes (alias for `cssClass`) |
|
|
47
|
+
|
|
48
|
+
### Outputs
|
|
49
|
+
|
|
50
|
+
| Output | Type | Description |
|
|
51
|
+
| ------------- | ------------------------------------------ | ----------------------------------------------------------------------- |
|
|
52
|
+
| `submit` | `OutputEmitterRef<ISignInFormSubmit>` | Emitted on form submit (when not disabled): `{ email, password, mode }` |
|
|
53
|
+
| `socialClick` | `OutputEmitterRef<ISignInFormSocialClick>` | Emitted on social provider button click: `{ providerId, mode }` |
|
|
54
|
+
|
|
55
|
+
### ISignInFormOptions
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
type SmartSignInFormMode = 'sign-in' | 'sign-up';
|
|
59
|
+
type SmartSignInFormLayout =
|
|
60
|
+
| 'simple'
|
|
61
|
+
| 'simple-no-labels'
|
|
62
|
+
| 'split-screen'
|
|
63
|
+
| 'card';
|
|
64
|
+
|
|
65
|
+
interface ISignInFormOptions {
|
|
66
|
+
socialProviders?: ISocialProvider[];
|
|
67
|
+
layout?: SmartSignInFormLayout;
|
|
68
|
+
showLabels?: boolean;
|
|
69
|
+
heroImageUrl?: string;
|
|
70
|
+
forgotPasswordHref?: string;
|
|
71
|
+
signUpHref?: string;
|
|
72
|
+
signInHref?: string;
|
|
73
|
+
submitLabel?: string;
|
|
74
|
+
emailPlaceholder?: string;
|
|
75
|
+
passwordPlaceholder?: string;
|
|
76
|
+
extraTpl?: TemplateRef<unknown>;
|
|
77
|
+
ariaLabel?: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
interface ISocialProvider {
|
|
81
|
+
id: string;
|
|
82
|
+
label: string;
|
|
83
|
+
iconTpl?: TemplateRef<unknown>;
|
|
84
|
+
iconUrl?: string;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
interface ISignInFormSubmit {
|
|
88
|
+
email: string;
|
|
89
|
+
password: string;
|
|
90
|
+
mode: SmartSignInFormMode;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
interface ISignInFormSocialClick {
|
|
94
|
+
providerId: string;
|
|
95
|
+
mode: SmartSignInFormMode;
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The default `SignInFormStandardComponent` consumes `socialProviders`, `showLabels`, `forgotPasswordHref`, `signUpHref`, `signInHref`, `submitLabel`, `emailPlaceholder`, `passwordPlaceholder`, `extraTpl`, and `ariaLabel`. `layout` and `heroImageUrl` are hints for custom implementations registered via the token.
|
|
100
|
+
|
|
101
|
+
## SIGN_IN_FORM_STANDARD_COMPONENT_TOKEN
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
import { SIGN_IN_FORM_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
105
|
+
|
|
106
|
+
providers: [
|
|
107
|
+
{
|
|
108
|
+
provide: SIGN_IN_FORM_STANDARD_COMPONENT_TOKEN,
|
|
109
|
+
useValue: MyCustomSignInFormComponent,
|
|
110
|
+
},
|
|
111
|
+
];
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Extending the Base Class
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
import {
|
|
118
|
+
ChangeDetectionStrategy,
|
|
119
|
+
Component,
|
|
120
|
+
computed,
|
|
121
|
+
input,
|
|
122
|
+
signal,
|
|
123
|
+
ViewEncapsulation,
|
|
124
|
+
} from '@angular/core';
|
|
125
|
+
|
|
126
|
+
import { SignInFormBaseComponent } from '@smartsoft001/angular';
|
|
127
|
+
|
|
128
|
+
@Component({
|
|
129
|
+
selector: 'my-custom-sign-in-form',
|
|
130
|
+
template: `
|
|
131
|
+
<form (submit)="onSubmit($event)">
|
|
132
|
+
<input
|
|
133
|
+
type="email"
|
|
134
|
+
[value]="email()"
|
|
135
|
+
(input)="email.set($any($event.target).value)"
|
|
136
|
+
/>
|
|
137
|
+
<input
|
|
138
|
+
type="password"
|
|
139
|
+
[value]="password()"
|
|
140
|
+
(input)="password.set($any($event.target).value)"
|
|
141
|
+
/>
|
|
142
|
+
<button type="submit" [disabled]="disabled()">
|
|
143
|
+
{{ mode() === 'sign-up' ? 'Create account' : 'Sign in' }}
|
|
144
|
+
</button>
|
|
145
|
+
</form>
|
|
146
|
+
`,
|
|
147
|
+
encapsulation: ViewEncapsulation.None,
|
|
148
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
149
|
+
})
|
|
150
|
+
export class MyCustomSignInFormComponent extends SignInFormBaseComponent {
|
|
151
|
+
// NgComponentOutlet passes 'cssClass' by canonical name, not the 'class' alias.
|
|
152
|
+
override cssClass = input<string>('');
|
|
153
|
+
|
|
154
|
+
email = signal('');
|
|
155
|
+
password = signal('');
|
|
156
|
+
|
|
157
|
+
onSubmit(event: Event): void {
|
|
158
|
+
event.preventDefault();
|
|
159
|
+
if (this.disabled()) return;
|
|
160
|
+
this.submit.emit({
|
|
161
|
+
email: this.email(),
|
|
162
|
+
password: this.password(),
|
|
163
|
+
mode: this.mode(),
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Usage Examples
|
|
170
|
+
|
|
171
|
+
```html
|
|
172
|
+
<!-- Simple sign-in -->
|
|
173
|
+
<smart-sign-in-form (submit)="onSignIn($event)" />
|
|
174
|
+
|
|
175
|
+
<!-- Sign-up mode -->
|
|
176
|
+
<smart-sign-in-form mode="sign-up" (submit)="onSignUp($event)" />
|
|
177
|
+
|
|
178
|
+
<!-- With social providers and forgot-password -->
|
|
179
|
+
<smart-sign-in-form
|
|
180
|
+
[options]="{
|
|
181
|
+
forgotPasswordHref: '/forgot',
|
|
182
|
+
signUpHref: '/signup',
|
|
183
|
+
socialProviders: [
|
|
184
|
+
{ id: 'google', label: 'Google', iconUrl: '/icons/google.svg' },
|
|
185
|
+
{ id: 'github', label: 'GitHub', iconUrl: '/icons/github.svg' },
|
|
186
|
+
],
|
|
187
|
+
}"
|
|
188
|
+
(submit)="onSignIn($event)"
|
|
189
|
+
(socialClick)="onSocial($event)"
|
|
190
|
+
/>
|
|
191
|
+
|
|
192
|
+
<!-- Disabled state -->
|
|
193
|
+
<smart-sign-in-form [disabled]="loading()" (submit)="onSignIn($event)" />
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## File Locations
|
|
197
|
+
|
|
198
|
+
- Wrapper: `packages/shared/angular/src/lib/components/sign-in-form/sign-in-form.component.ts`
|
|
199
|
+
- Standard: `packages/shared/angular/src/lib/components/sign-in-form/standard/standard.component.ts`
|
|
200
|
+
- Base class: `packages/shared/angular/src/lib/components/sign-in-form/base/base.component.ts`
|
|
201
|
+
- Token: `packages/shared/angular/src/lib/shared.inectors.ts` (`SIGN_IN_FORM_STANDARD_COMPONENT_TOKEN`)
|
|
202
|
+
- Interfaces: `packages/shared/angular/src/lib/models/interfaces.ts` (`ISignInFormOptions`, `ISocialProvider`, `ISignInFormSubmit`, `ISignInFormSocialClick`, `SmartSignInFormMode`, `SmartSignInFormLayout`)
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: angular-components-stacked-layout
|
|
3
|
+
description: Stacked layout component API with InjectionToken pattern for custom implementations.
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Stacked Layout Component
|
|
8
|
+
|
|
9
|
+
The `<smart-stacked-layout>` component provides a top-to-bottom application shell with a top navigation bar, an optional page header section, and a main content region. It follows the Base + Standard + Wrapper pattern with an InjectionToken-based extension mechanism. The abstract `StackedLayoutBaseComponent` defines the shared API — optional `IStackedLayoutOptions` and `cssClass` (alias `class`). `StackedLayoutStandardComponent` is a barebones placeholder concrete implementation. `StackedLayoutComponent` is the public wrapper that renders `StackedLayoutStandardComponent` by default and accepts a custom replacement via `STACKED_LAYOUT_STANDARD_COMPONENT_TOKEN`.
|
|
10
|
+
|
|
11
|
+
## When to Use This Skill
|
|
12
|
+
|
|
13
|
+
- Developer wants to use or customize the stacked layout component
|
|
14
|
+
- Developer asks about `<smart-stacked-layout>`, `StackedLayoutComponent`, `StackedLayoutStandardComponent`, or `StackedLayoutBaseComponent`
|
|
15
|
+
|
|
16
|
+
## Components
|
|
17
|
+
|
|
18
|
+
### StackedLayoutComponent (`<smart-stacked-layout>`)
|
|
19
|
+
|
|
20
|
+
Main wrapper component. Renders `StackedLayoutStandardComponent` by default. When `STACKED_LAYOUT_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet`. Accepts main content via projected `<ng-content>`.
|
|
21
|
+
|
|
22
|
+
### StackedLayoutStandardComponent (`<smart-stacked-layout-standard>`)
|
|
23
|
+
|
|
24
|
+
Barebones placeholder concrete implementation. Renders a wrapper `<div>` with a top `<header>` containing a `<nav>`, an optional second `<header>` for the page heading section (rendered when `options.headerTpl` is provided), and a `<main>` element that projects `<ng-content>`. The external `cssClass` is applied to the wrapper. It does not include Tailwind UI styling — it exists solely as the default structural placeholder until a custom implementation is registered through the token.
|
|
25
|
+
|
|
26
|
+
### StackedLayoutBaseComponent (abstract)
|
|
27
|
+
|
|
28
|
+
Abstract base directive for extending custom stacked-layout implementations. Exposes `options` as an `InputSignal<IStackedLayoutOptions | undefined>` and `cssClass` as an `InputSignal<string>` (with alias `class`).
|
|
29
|
+
|
|
30
|
+
## API
|
|
31
|
+
|
|
32
|
+
### Inputs
|
|
33
|
+
|
|
34
|
+
| Input | Type | Default | Description |
|
|
35
|
+
| --------- | ------------------------------------------------- | ------- | ------------------------------------------------------------ |
|
|
36
|
+
| `options` | `InputSignal<IStackedLayoutOptions \| undefined>` | - | Optional configuration (title, navTpl, headerTpl, container) |
|
|
37
|
+
| `class` | `InputSignal<string>` | `''` | External CSS classes (alias for `cssClass`) |
|
|
38
|
+
|
|
39
|
+
### IStackedLayoutOptions
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
type SmartStackedLayoutContainerWidth = 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
43
|
+
|
|
44
|
+
interface IStackedLayoutOptions {
|
|
45
|
+
title?: string;
|
|
46
|
+
navTpl?: TemplateRef<unknown>;
|
|
47
|
+
headerTpl?: TemplateRef<unknown>;
|
|
48
|
+
containerWidth?: SmartStackedLayoutContainerWidth;
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The default `StackedLayoutStandardComponent` consumes `navTpl` (rendered inside the top `<nav>`) and `headerTpl` (rendered as a secondary `<header>` block beneath the navigation). `title` and `containerWidth` are reserved for custom implementations registered via `STACKED_LAYOUT_STANDARD_COMPONENT_TOKEN` and are ignored by `StackedLayoutStandardComponent`.
|
|
53
|
+
|
|
54
|
+
## STACKED_LAYOUT_STANDARD_COMPONENT_TOKEN
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
import { STACKED_LAYOUT_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
InjectionToken that allows replacing the default `StackedLayoutStandardComponent` with a custom implementation. Provide a `Type<StackedLayoutBaseComponent>` to override.
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
// In your app module or component providers:
|
|
64
|
+
providers: [
|
|
65
|
+
{
|
|
66
|
+
provide: STACKED_LAYOUT_STANDARD_COMPONENT_TOKEN,
|
|
67
|
+
useValue: MyCustomStackedLayoutComponent,
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Extending the Base Class
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
import {
|
|
76
|
+
ChangeDetectionStrategy,
|
|
77
|
+
Component,
|
|
78
|
+
computed,
|
|
79
|
+
input,
|
|
80
|
+
ViewEncapsulation,
|
|
81
|
+
} from '@angular/core';
|
|
82
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
83
|
+
|
|
84
|
+
import { StackedLayoutBaseComponent } from '@smartsoft001/angular';
|
|
85
|
+
|
|
86
|
+
@Component({
|
|
87
|
+
selector: 'my-custom-stacked-layout',
|
|
88
|
+
template: `
|
|
89
|
+
<div [class]="containerClasses()">
|
|
90
|
+
<header class="top-bar">
|
|
91
|
+
<nav>
|
|
92
|
+
@if (options()?.navTpl) {
|
|
93
|
+
<ng-container [ngTemplateOutlet]="options()!.navTpl!" />
|
|
94
|
+
}
|
|
95
|
+
</nav>
|
|
96
|
+
</header>
|
|
97
|
+
@if (options()?.headerTpl) {
|
|
98
|
+
<header class="page-header">
|
|
99
|
+
<ng-container [ngTemplateOutlet]="options()!.headerTpl!" />
|
|
100
|
+
</header>
|
|
101
|
+
}
|
|
102
|
+
<main>
|
|
103
|
+
<ng-content />
|
|
104
|
+
</main>
|
|
105
|
+
</div>
|
|
106
|
+
`,
|
|
107
|
+
imports: [NgTemplateOutlet],
|
|
108
|
+
encapsulation: ViewEncapsulation.None,
|
|
109
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
110
|
+
})
|
|
111
|
+
export class MyCustomStackedLayoutComponent extends StackedLayoutBaseComponent {
|
|
112
|
+
// NgComponentOutlet passes 'cssClass' by canonical name, not the 'class' alias.
|
|
113
|
+
override cssClass = input<string>('');
|
|
114
|
+
|
|
115
|
+
containerClasses = computed(() => {
|
|
116
|
+
const classes = ['my-stacked-layout'];
|
|
117
|
+
const extra = this.cssClass();
|
|
118
|
+
if (extra) classes.push(extra);
|
|
119
|
+
return classes.join(' ');
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
When extending the base directly, remember to:
|
|
125
|
+
|
|
126
|
+
- declare `cssClass = input<string>('')` explicitly (no `class` alias) if the component is used via `NgComponentOutlet` through `STACKED_LAYOUT_STANDARD_COMPONENT_TOKEN`, because `NgComponentOutlet` passes inputs by canonical name (not by alias),
|
|
127
|
+
- accept main content via `<ng-content>` so consumers can project arbitrary page content,
|
|
128
|
+
- use `[ngTemplateOutlet]` to render `options().navTpl` and `options().headerTpl`.
|
|
129
|
+
|
|
130
|
+
## Usage Examples
|
|
131
|
+
|
|
132
|
+
```html
|
|
133
|
+
<!-- Basic with main content -->
|
|
134
|
+
<smart-stacked-layout>
|
|
135
|
+
<h1>Hello</h1>
|
|
136
|
+
</smart-stacked-layout>
|
|
137
|
+
|
|
138
|
+
<!-- With navigation template -->
|
|
139
|
+
<ng-template #nav>
|
|
140
|
+
<a routerLink="/">Dashboard</a>
|
|
141
|
+
<a routerLink="/team">Team</a>
|
|
142
|
+
</ng-template>
|
|
143
|
+
|
|
144
|
+
<smart-stacked-layout [options]="{ navTpl: nav }">
|
|
145
|
+
<p>Main content</p>
|
|
146
|
+
</smart-stacked-layout>
|
|
147
|
+
|
|
148
|
+
<!-- With page header -->
|
|
149
|
+
<ng-template #header>
|
|
150
|
+
<h1>Dashboard</h1>
|
|
151
|
+
</ng-template>
|
|
152
|
+
|
|
153
|
+
<smart-stacked-layout [options]="{ navTpl: nav, headerTpl: header }">
|
|
154
|
+
<p>Main content</p>
|
|
155
|
+
</smart-stacked-layout>
|
|
156
|
+
|
|
157
|
+
<!-- With external class -->
|
|
158
|
+
<smart-stacked-layout class="smart:bg-gray-50">
|
|
159
|
+
<p>Main content</p>
|
|
160
|
+
</smart-stacked-layout>
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## File Locations
|
|
164
|
+
|
|
165
|
+
- Wrapper: `packages/shared/angular/src/lib/components/stacked-layout/stacked-layout.component.ts`
|
|
166
|
+
- Standard: `packages/shared/angular/src/lib/components/stacked-layout/standard/standard.component.ts`
|
|
167
|
+
- Base class: `packages/shared/angular/src/lib/components/stacked-layout/base/base.component.ts`
|
|
168
|
+
- Token: `packages/shared/angular/src/lib/shared.inectors.ts` (`STACKED_LAYOUT_STANDARD_COMPONENT_TOKEN`)
|
|
169
|
+
- Interface: `packages/shared/angular/src/lib/models/interfaces.ts` (`IStackedLayoutOptions`)
|