@smartsoft001/claude-plugins 2.200.0 → 2.202.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-angular/.claude-plugin/plugin.json +1 -1
- package/plugins/smart-angular/skills/angular-components-accordion/SKILL.md +84 -80
- package/plugins/smart-angular/skills/angular-components-action-panel/SKILL.md +35 -60
- package/plugins/smart-angular/skills/angular-components-alert/SKILL.md +24 -29
- package/plugins/smart-angular/skills/angular-components-avatar/SKILL.md +30 -30
- package/plugins/smart-angular/skills/angular-components-badge/SKILL.md +18 -12
- package/plugins/smart-angular/skills/angular-components-breadcrumbs/SKILL.md +27 -10
- package/plugins/smart-angular/skills/angular-components-button/SKILL.md +43 -17
- package/plugins/smart-angular/skills/angular-components-button-group/SKILL.md +26 -14
- package/plugins/smart-angular/skills/angular-components-calendar/SKILL.md +47 -28
- package/plugins/smart-angular/skills/angular-components-card/SKILL.md +29 -22
- package/plugins/smart-angular/skills/angular-components-card-heading/SKILL.md +24 -18
- package/plugins/smart-angular/skills/angular-components-command-palette/SKILL.md +41 -32
- package/plugins/smart-angular/skills/angular-components-container/SKILL.md +21 -20
- package/plugins/smart-angular/skills/angular-components-date-edit/SKILL.md +48 -45
- package/plugins/smart-angular/skills/angular-components-date-range/SKILL.md +72 -82
- package/plugins/smart-angular/skills/angular-components-description-list/SKILL.md +23 -10
- package/plugins/smart-angular/skills/angular-components-detail/SKILL.md +20 -8
- package/plugins/smart-angular/skills/angular-components-details/SKILL.md +35 -12
- package/plugins/smart-angular/skills/angular-components-divider/SKILL.md +36 -18
- package/plugins/smart-angular/skills/angular-components-drawer/SKILL.md +28 -23
- package/plugins/smart-angular/skills/angular-components-dropdown/SKILL.md +35 -16
- package/plugins/smart-angular/skills/angular-components-empty-state/SKILL.md +49 -11
- package/plugins/smart-angular/skills/angular-components-feed/SKILL.md +45 -12
- package/plugins/smart-angular/skills/angular-components-form/SKILL.md +53 -25
- package/plugins/smart-angular/skills/angular-components-grid-list/SKILL.md +37 -13
- package/plugins/smart-angular/skills/angular-components-icon/SKILL.md +8 -8
- package/plugins/smart-angular/skills/angular-components-info/SKILL.md +19 -15
- package/plugins/smart-angular/skills/angular-components-input/SKILL.md +78 -49
- package/plugins/smart-angular/skills/angular-components-list/SKILL.md +85 -78
- package/plugins/smart-angular/skills/angular-components-list-container/SKILL.md +24 -32
- package/plugins/smart-angular/skills/angular-components-media-object/SKILL.md +19 -17
- package/plugins/smart-angular/skills/angular-components-modal/SKILL.md +23 -16
- package/plugins/smart-angular/skills/angular-components-multi-column-layout/SKILL.md +19 -16
- package/plugins/smart-angular/skills/angular-components-navbar/SKILL.md +38 -21
- package/plugins/smart-angular/skills/angular-components-notification/SKILL.md +32 -33
- package/plugins/smart-angular/skills/angular-components-page/SKILL.md +46 -52
- package/plugins/smart-angular/skills/angular-components-page-heading/SKILL.md +42 -25
- package/plugins/smart-angular/skills/angular-components-paging/SKILL.md +17 -15
- package/plugins/smart-angular/skills/angular-components-password-strength/SKILL.md +21 -19
- package/plugins/smart-angular/skills/angular-components-progress-bars/SKILL.md +61 -24
- package/plugins/smart-angular/skills/angular-components-searchbar/SKILL.md +30 -37
- package/plugins/smart-angular/skills/angular-components-section-heading/SKILL.md +38 -27
- package/plugins/smart-angular/skills/angular-components-select-menu/SKILL.md +33 -17
- package/plugins/smart-angular/skills/angular-components-sidebar-layout/SKILL.md +30 -26
- package/plugins/smart-angular/skills/angular-components-sidebar-navigation/SKILL.md +79 -16
- package/plugins/smart-angular/skills/angular-components-sign-in-form/SKILL.md +64 -24
- package/plugins/smart-angular/skills/angular-components-stacked-layout/SKILL.md +24 -23
- package/plugins/smart-angular/skills/angular-components-stacked-list/SKILL.md +40 -21
- package/plugins/smart-angular/skills/angular-components-stats/SKILL.md +28 -15
- package/plugins/smart-angular/skills/angular-components-table/SKILL.md +42 -22
- package/plugins/smart-angular/skills/angular-components-tabs/SKILL.md +37 -13
- package/plugins/smart-angular/skills/angular-components-textarea/SKILL.md +48 -46
- package/plugins/smart-angular/skills/angular-components-toggle/SKILL.md +21 -28
- package/plugins/smart-angular/skills/angular-components-vertical-navigation/SKILL.md +66 -24
- package/plugins/smart-core/.claude-plugin/plugin.json +1 -1
- package/plugins/smart-react/.claude-plugin/plugin.json +1 -1
- package/plugins/smart-react/skills/react-components-action-panel/SKILL.md +13 -13
- package/plugins/smart-react/skills/react-components-alert/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-avatar/SKILL.md +11 -11
- package/plugins/smart-react/skills/react-components-badge/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-breadcrumbs/SKILL.md +7 -7
- package/plugins/smart-react/skills/react-components-button/SKILL.md +20 -20
- package/plugins/smart-react/skills/react-components-button-group/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-calendar/SKILL.md +13 -13
- package/plugins/smart-react/skills/react-components-card/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-card-heading/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-command-palette/SKILL.md +3 -3
- package/plugins/smart-react/skills/react-components-container/SKILL.md +6 -6
- package/plugins/smart-react/skills/react-components-date-edit/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-date-range/SKILL.md +4 -4
- package/plugins/smart-react/skills/react-components-description-list/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-detail/SKILL.md +25 -16
- package/plugins/smart-react/skills/react-components-details/SKILL.md +10 -10
- package/plugins/smart-react/skills/react-components-divider/SKILL.md +6 -6
- package/plugins/smart-react/skills/react-components-drawer/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-dropdown/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-empty-state/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-feed/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-grid-list/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-info/SKILL.md +3 -1
- package/plugins/smart-react/skills/react-components-input/SKILL.md +41 -17
- package/plugins/smart-react/skills/react-components-list/SKILL.md +34 -31
- package/plugins/smart-react/skills/react-components-list-container/SKILL.md +6 -6
- package/plugins/smart-react/skills/react-components-loader/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-media-object/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-modal/SKILL.md +8 -8
- package/plugins/smart-react/skills/react-components-multi-column-layout/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-navbar/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-notification/SKILL.md +9 -9
- package/plugins/smart-react/skills/react-components-page-heading/SKILL.md +6 -6
- package/plugins/smart-react/skills/react-components-paging/SKILL.md +28 -28
- package/plugins/smart-react/skills/react-components-password-strength/SKILL.md +4 -4
- package/plugins/smart-react/skills/react-components-progress-bars/SKILL.md +19 -19
- package/plugins/smart-react/skills/react-components-searchbar/SKILL.md +10 -10
- package/plugins/smart-react/skills/react-components-section-heading/SKILL.md +13 -13
- package/plugins/smart-react/skills/react-components-select-menu/SKILL.md +19 -19
- package/plugins/smart-react/skills/react-components-sidebar-layout/SKILL.md +9 -9
- package/plugins/smart-react/skills/react-components-sidebar-navigation/SKILL.md +29 -29
- package/plugins/smart-react/skills/react-components-sign-in-form/SKILL.md +3 -3
- package/plugins/smart-react/skills/react-components-stacked-layout/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-stacked-list/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-stats/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-table/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-tabs/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-textarea/SKILL.md +8 -8
- package/plugins/smart-react/skills/react-components-toggle/SKILL.md +3 -2
- package/plugins/smart-react/skills/react-components-vertical-navigation/SKILL.md +7 -7
|
@@ -45,6 +45,14 @@ The wrapper projects body content via `<ng-content />` into the `.smart-media-ob
|
|
|
45
45
|
|
|
46
46
|
### IMediaObjectOptions
|
|
47
47
|
|
|
48
|
+
| Field | Type | Default | Description |
|
|
49
|
+
| ------------ | ---------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
|
|
50
|
+
| `alignment` | `'top' \| 'center' \| 'bottom' \| 'stretched'` | - | Vertical alignment of the image against the body; the standard exposes it as `data-alignment` (only when set), the preset aligns the row. |
|
|
51
|
+
| `position` | `'left' \| 'right'` | `'left'` | Side of the image; the standard exposes it as `data-position`, the preset reverses the row for `'right'`. |
|
|
52
|
+
| `responsive` | `boolean` | `false` | Preset only: stacks the image above the body on small screens. |
|
|
53
|
+
| `nested` | `boolean` | `false` | Preset only: the spacing of a media object nested in another one. |
|
|
54
|
+
| `wide` | `boolean` | `false` | Preset only: a wider image (`w-32`). |
|
|
55
|
+
|
|
48
56
|
```typescript
|
|
49
57
|
interface IMediaObjectOptions {
|
|
50
58
|
alignment?: 'top' | 'center' | 'bottom' | 'stretched';
|
|
@@ -55,21 +63,13 @@ interface IMediaObjectOptions {
|
|
|
55
63
|
}
|
|
56
64
|
```
|
|
57
65
|
|
|
58
|
-
The standard renders:
|
|
59
|
-
|
|
60
|
-
- `data-position` attribute: defaults to `'left'` when not provided
|
|
61
|
-
- `data-alignment` attribute: only set when `options.alignment` is provided
|
|
62
|
-
|
|
63
66
|
### MEDIA_OBJECT_STANDARD_COMPONENT_TOKEN
|
|
64
67
|
|
|
68
|
+
InjectionToken from `@smartsoft001/angular` that allows replacing the default `MediaObjectStandardComponent` with a custom implementation. Provide a `Type<MediaObjectBaseComponent>` in your application or component providers; `provideSmartPresets()` provides `MediaObjectPresetComponent` for it together with every other preset.
|
|
69
|
+
|
|
65
70
|
```typescript
|
|
66
71
|
import { MEDIA_OBJECT_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
InjectionToken that allows replacing the default `MediaObjectStandardComponent` with a custom implementation. Provide a `Type<MediaObjectBaseComponent>` to override.
|
|
70
72
|
|
|
71
|
-
```typescript
|
|
72
|
-
// In your app module or component providers:
|
|
73
73
|
providers: [
|
|
74
74
|
{
|
|
75
75
|
provide: MEDIA_OBJECT_STANDARD_COMPONENT_TOKEN,
|
|
@@ -97,6 +97,8 @@ import { MediaObjectBaseComponent } from '@smartsoft001/angular';
|
|
|
97
97
|
export class MyCustomMediaObjectComponent extends MediaObjectBaseComponent {}
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
+
The wrapper forwards `mediaUrl`, `mediaAlt`, `options` and the `class` (into the inherited `cssClass`), and projects its content into the implementation's default `<ng-content />`.
|
|
101
|
+
|
|
100
102
|
## Usage Examples
|
|
101
103
|
|
|
102
104
|
```html
|
|
@@ -142,9 +144,11 @@ export class MyCustomMediaObjectComponent extends MediaObjectBaseComponent {}
|
|
|
142
144
|
|
|
143
145
|
`MediaObjectPresetComponent` (selector `smart-media-object-preset`) is a styled,
|
|
144
146
|
drop-in replacement for the standard component. It extends
|
|
145
|
-
`MediaObjectStandardComponent` and reuses
|
|
146
|
-
(
|
|
147
|
-
|
|
147
|
+
`MediaObjectStandardComponent` and reuses its inputs, so registering it through
|
|
148
|
+
the token (or with `provideSmartPresets()`) restyles every `<smart-media-object>`.
|
|
149
|
+
It declares `cssClass` without the `class` alias: on the
|
|
150
|
+
`<smart-media-object-preset>` selector bind `[cssClass]`; on
|
|
151
|
+
`<smart-media-object>` pass `class` as usual.
|
|
148
152
|
|
|
149
153
|
Look: a flex row (`smart:flex smart:gap-4`) with a rounded, cover-fitted
|
|
150
154
|
thumbnail (`smart:size-16 smart:rounded-lg smart:object-cover smart:shrink-0`)
|
|
@@ -170,7 +174,7 @@ aware.
|
|
|
170
174
|
`smart-media-object-body` marker class is preserved for content projection
|
|
171
175
|
parity with the standard component.
|
|
172
176
|
|
|
173
|
-
Register it as the standard replacement
|
|
177
|
+
Register it as the standard replacement by providing it for `MEDIA_OBJECT_STANDARD_COMPONENT_TOKEN`.
|
|
174
178
|
|
|
175
179
|
```ts
|
|
176
180
|
import { MEDIA_OBJECT_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
@@ -184,9 +188,7 @@ providers: [
|
|
|
184
188
|
],
|
|
185
189
|
```
|
|
186
190
|
|
|
187
|
-
|
|
188
|
-
(`getMediaObjectRootClasses`, `getMediaObjectMediaClasses`,
|
|
189
|
-
`getMediaObjectBodyClasses`).
|
|
191
|
+
The class recipes are internal to the preset (not exported).
|
|
190
192
|
|
|
191
193
|
Gaps: the media is always an `<img>` (no icon/video slot), and `wide` uses a
|
|
192
194
|
fixed `w-32`/`h-16` footprint rather than an intrinsic aspect ratio.
|
|
@@ -17,7 +17,7 @@ The `<smart-modal>` component provides a dialog overlay with title, description,
|
|
|
17
17
|
|
|
18
18
|
### ModalComponent (`<smart-modal>`)
|
|
19
19
|
|
|
20
|
-
Main wrapper component. Renders `ModalStandardComponent` by default. When `MODAL_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet
|
|
20
|
+
Main wrapper component. Renders `ModalStandardComponent` by default. When `MODAL_STANDARD_COMPONENT_TOKEN` is provided (or `provideSmartPresets()` registers the preset), renders the injected component via `NgComponentOutlet` and forwards its inputs, its projected content, the `actionClick` and `closed` outputs and the `open` model changes. A footer action **keeps the modal open**: set `open` to `false` in the `(actionClick)` handler.
|
|
21
21
|
|
|
22
22
|
### ModalStandardComponent (`<smart-modal-standard>`)
|
|
23
23
|
|
|
@@ -25,11 +25,11 @@ Barebones placeholder concrete implementation. Renders a native `<dialog [open]
|
|
|
25
25
|
|
|
26
26
|
### ModalPresetComponent (`<smart-modal-preset>`)
|
|
27
27
|
|
|
28
|
-
Styled variation that extends `ModalBaseComponent` and is a drop-in replacement for `ModalStandardComponent`. Register it via `MODAL_STANDARD_COMPONENT_TOKEN` to restyle every `<smart-modal>`, or use the `<smart-modal-preset>` selector directly. It renders a translated Preline overlay — a full-screen scrollable backdrop hosting a `rounded-xl` card with a header (`title` + optional dismiss `×`), a body (`description` + projected content), and a footer of action buttons. The look is selected through `options.variant` (default `'centered'`): `centered`/`alert` are vertically centered (`alert` is narrower), `wide` is a top-aligned large dialog, and `left-aligned-buttons` left-aligns the footer. `options.footerStyle: 'gray'` tints the footer, and action buttons are styled by their `variant` (`primary`/`secondary`/`danger`). All classes are `smart:`-prefixed Tailwind with explicit `dark:` variants
|
|
28
|
+
Styled variation that extends `ModalBaseComponent` and is a drop-in replacement for `ModalStandardComponent`. Register it via `MODAL_STANDARD_COMPONENT_TOKEN` (or with `provideSmartPresets()`) to restyle every `<smart-modal>`, or use the `<smart-modal-preset>` selector directly. It renders a translated Preline overlay — a full-screen scrollable backdrop hosting a `rounded-xl` card with a header (`title` + optional dismiss `×`), a body (`description` + projected content), and a footer of action buttons. The look is selected through `options.variant` (default `'centered'`): `centered`/`alert` are vertically centered (`alert` is narrower), `wide` is a top-aligned large dialog, and `left-aligned-buttons` left-aligns the footer. `options.footerStyle: 'gray'` tints the footer, and action buttons are styled by their `variant` (`primary`/`secondary`/`danger`). All classes are `smart:`-prefixed Tailwind with explicit `dark:` variants; the class recipes are internal to the preset (not exported).
|
|
29
29
|
|
|
30
30
|
> **Preline JS is NOT used.** Open/close is driven entirely by the existing `open` model signal + `@if` (no `HSOverlay`, no `data-hs-*`). The component binds its own dismiss UX: clicking the backdrop and pressing `Escape` both call `close()` (which sets `open` to `false` and emits `closed`). The dialog ARIA contract is preserved (`role="dialog"`, `aria-modal="true"`, `aria-labelledby` when `title` is set, else `aria-label` from `options.ariaLabel`). The header dismiss `×` button is only shown when `options.withDismiss` is `true`.
|
|
31
31
|
>
|
|
32
|
-
>
|
|
32
|
+
> `ModalPresetComponent` declares `cssClass` without the `class` alias (applied to the centering wrapper): bind it as `[cssClass]` on the `<smart-modal-preset>` selector, or pass `class` on `<smart-modal>` (the wrapper forwards it).
|
|
33
33
|
|
|
34
34
|
### ModalBaseComponent (abstract)
|
|
35
35
|
|
|
@@ -57,6 +57,12 @@ Abstract base directive for extending custom modal implementations. Exposes `ope
|
|
|
57
57
|
|
|
58
58
|
### IModalAction
|
|
59
59
|
|
|
60
|
+
| Field | Type | Default | Description |
|
|
61
|
+
| --------- | -------------------------------------- | ----------- | -------------------------------------------------------------------------------------------- |
|
|
62
|
+
| `id` | `string` | required | Reported as `actionId` by `actionClick`. |
|
|
63
|
+
| `label` | `string` | required | Button text. |
|
|
64
|
+
| `variant` | `'primary' \| 'secondary' \| 'danger'` | `'primary'` | The standard exposes it as `data-variant` on the button; the preset styles the button by it. |
|
|
65
|
+
|
|
60
66
|
```typescript
|
|
61
67
|
interface IModalAction {
|
|
62
68
|
id: string;
|
|
@@ -67,6 +73,13 @@ interface IModalAction {
|
|
|
67
73
|
|
|
68
74
|
### IModalOptions
|
|
69
75
|
|
|
76
|
+
| Field | Type | Default | Description |
|
|
77
|
+
| ------------- | ----------------------------------------------------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
78
|
+
| `variant` | `'centered' \| 'wide' \| 'alert' \| 'left-aligned-buttons'` | `'centered'` | Preset only: `centered` and `alert` (narrower) are vertically centred, `wide` is a top-aligned large dialog, `left-aligned-buttons` left-aligns the footer. |
|
|
79
|
+
| `withDismiss` | `boolean` | `false` | Renders a close (×) button that calls `close()`. |
|
|
80
|
+
| `footerStyle` | `'default' \| 'gray'` | `'default'` | Preset only: `gray` gives the footer a gray background. |
|
|
81
|
+
| `ariaLabel` | `string` | - | The `aria-label` of the dialog when there is no `title`. |
|
|
82
|
+
|
|
70
83
|
```typescript
|
|
71
84
|
interface IModalOptions {
|
|
72
85
|
variant?: 'centered' | 'wide' | 'alert' | 'left-aligned-buttons';
|
|
@@ -76,17 +89,15 @@ interface IModalOptions {
|
|
|
76
89
|
}
|
|
77
90
|
```
|
|
78
91
|
|
|
79
|
-
The default `ModalStandardComponent` consumes `withDismiss`
|
|
92
|
+
The default `ModalStandardComponent` consumes `withDismiss` and `ariaLabel`; `variant` and `footerStyle` are read by `ModalPresetComponent` (and are available to a custom implementation).
|
|
80
93
|
|
|
81
94
|
## MODAL_STANDARD_COMPONENT_TOKEN
|
|
82
95
|
|
|
96
|
+
InjectionToken from `@smartsoft001/angular` that allows replacing the default `ModalStandardComponent` with a custom implementation. Provide a `Type<ModalBaseComponent>` in your application or component providers; `provideSmartPresets()` provides `ModalPresetComponent` for it together with every other preset.
|
|
97
|
+
|
|
83
98
|
```typescript
|
|
84
99
|
import { MODAL_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
85
|
-
```
|
|
86
100
|
|
|
87
|
-
InjectionToken that allows replacing the default `ModalStandardComponent` with a custom implementation. Provide a `Type<ModalBaseComponent>` to override.
|
|
88
|
-
|
|
89
|
-
```typescript
|
|
90
101
|
providers: [
|
|
91
102
|
{
|
|
92
103
|
provide: MODAL_STANDARD_COMPONENT_TOKEN,
|
|
@@ -105,7 +116,6 @@ providers: [
|
|
|
105
116
|
import {
|
|
106
117
|
ChangeDetectionStrategy,
|
|
107
118
|
Component,
|
|
108
|
-
input,
|
|
109
119
|
ViewEncapsulation,
|
|
110
120
|
} from '@angular/core';
|
|
111
121
|
|
|
@@ -126,6 +136,7 @@ import { ModalBaseComponent } from '@smartsoft001/angular';
|
|
|
126
136
|
@if (description()) {
|
|
127
137
|
<p>{{ description() }}</p>
|
|
128
138
|
}
|
|
139
|
+
<ng-content />
|
|
129
140
|
<footer>
|
|
130
141
|
@for (action of actions(); track action.id) {
|
|
131
142
|
<button (click)="invokeAction(action.id)">{{ action.label }}</button>
|
|
@@ -136,15 +147,11 @@ import { ModalBaseComponent } from '@smartsoft001/angular';
|
|
|
136
147
|
encapsulation: ViewEncapsulation.None,
|
|
137
148
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
138
149
|
})
|
|
139
|
-
export class MyCustomModalComponent extends ModalBaseComponent {
|
|
140
|
-
// NgComponentOutlet passes 'cssClass' by canonical name, not the 'class' alias.
|
|
141
|
-
override cssClass = input<string>('');
|
|
142
|
-
}
|
|
150
|
+
export class MyCustomModalComponent extends ModalBaseComponent {}
|
|
143
151
|
```
|
|
144
152
|
|
|
145
|
-
When extending the base directly, remember to:
|
|
153
|
+
The inherited `cssClass` (input alias `class`) receives the class passed to `<smart-modal>`. When extending the base directly, remember to:
|
|
146
154
|
|
|
147
|
-
- declare `cssClass = input<string>('')` explicitly (no `class` alias) when the component is used via `NgComponentOutlet` through `MODAL_STANDARD_COMPONENT_TOKEN`,
|
|
148
155
|
- call `invokeAction(id)` to emit `actionClick`, and `close()` to emit `closed` and set `open.set(false)`,
|
|
149
156
|
- implement `Escape` key handling and backdrop click yourself if you want native UX — the base does not bind any keyboard or backdrop listeners.
|
|
150
157
|
|
|
@@ -179,7 +186,7 @@ When extending the base directly, remember to:
|
|
|
179
186
|
- Wrapper: `packages/shared/angular/src/lib/components/modal/modal.component.ts`
|
|
180
187
|
- Standard: `packages/shared/angular/src/lib/components/modal/standard/standard.component.ts`
|
|
181
188
|
- Preset variation: `packages/shared/angular/src/lib/components/modal/preset/preset.component.ts`
|
|
182
|
-
- Preset class recipes: `packages/shared/angular/src/lib/components/modal/preset/preset-classes.util.ts`
|
|
189
|
+
- Preset class recipes (internal, not exported): `packages/shared/angular/src/lib/components/modal/preset/preset-classes.util.ts`
|
|
183
190
|
- Base class: `packages/shared/angular/src/lib/components/modal/base/base.component.ts`
|
|
184
191
|
- Stories: `packages/shared/angular/src/lib/components/modal/modal.component.stories.ts`
|
|
185
192
|
- Token: `packages/shared/angular/src/lib/shared.inectors.ts` (`MODAL_STANDARD_COMPONENT_TOKEN`)
|
|
@@ -17,7 +17,7 @@ The `<smart-multi-column-layout>` component provides a three-column application
|
|
|
17
17
|
|
|
18
18
|
### MultiColumnLayoutComponent (`<smart-multi-column-layout>`)
|
|
19
19
|
|
|
20
|
-
Main wrapper component. Renders `MultiColumnLayoutStandardComponent` by default. When `MULTI_COLUMN_LAYOUT_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet`. Accepts main content via projected `<ng-content
|
|
20
|
+
Main wrapper component. Renders `MultiColumnLayoutStandardComponent` by default. When `MULTI_COLUMN_LAYOUT_STANDARD_COMPONENT_TOKEN` is provided (or `provideSmartPresets()` registers the preset), renders the injected component via `NgComponentOutlet`, forwarding `options` and the `class`. Accepts main content via projected `<ng-content>`, which reaches the injected component's default `<ng-content />` as well.
|
|
21
21
|
|
|
22
22
|
### MultiColumnLayoutStandardComponent (`<smart-multi-column-layout-standard>`)
|
|
23
23
|
|
|
@@ -31,13 +31,22 @@ Abstract base directive for extending custom multi-column-layout implementations
|
|
|
31
31
|
|
|
32
32
|
### Inputs
|
|
33
33
|
|
|
34
|
-
| Input | Type | Default | Description
|
|
35
|
-
| --------- | ----------------------------------------------------- | ------- |
|
|
36
|
-
| `options` | `InputSignal<IMultiColumnLayoutOptions \| undefined>` | - | Optional configuration (
|
|
37
|
-
| `class` | `InputSignal<string>` | `''` | External CSS classes (alias for `cssClass`)
|
|
34
|
+
| Input | Type | Default | Description |
|
|
35
|
+
| --------- | ----------------------------------------------------- | ------- | ----------------------------------------------------------------------- |
|
|
36
|
+
| `options` | `InputSignal<IMultiColumnLayoutOptions \| undefined>` | - | Optional configuration (header, nav and secondary slots, title, widths) |
|
|
37
|
+
| `class` | `InputSignal<string>` | `''` | External CSS classes (alias for `cssClass`) |
|
|
38
38
|
|
|
39
39
|
### IMultiColumnLayoutOptions
|
|
40
40
|
|
|
41
|
+
| Field | Type | Default | Description |
|
|
42
|
+
| ---------------- | ------------------------- | -------- | ----------------------------------------------------------------------------------- |
|
|
43
|
+
| `headerTpl` | `TemplateRef<unknown>` | - | The header zone (`<header>`); wins over `title` in the preset. |
|
|
44
|
+
| `navTpl` | `TemplateRef<unknown>` | - | The navigation column (`<aside class="nav">`). |
|
|
45
|
+
| `secondaryTpl` | `TemplateRef<unknown>` | - | The secondary column (`<aside class="secondary">`), e.g. details or activity. |
|
|
46
|
+
| `title` | `string` | - | Preset only: an `<h1>` in the header zone when `headerTpl` is not set. |
|
|
47
|
+
| `width` | `'full' \| 'constrained'` | `'full'` | Preset only: `constrained` caps the main content container at `max-w-7xl`, centred. |
|
|
48
|
+
| `secondaryWidth` | `'sm' \| 'md' \| 'lg'` | `'sm'` | Preset only: the width of the secondary column (`w-64`, `w-80`, `w-96`). |
|
|
49
|
+
|
|
41
50
|
```typescript
|
|
42
51
|
type SmartMultiColumnLayoutWidth = 'full' | 'constrained';
|
|
43
52
|
type SmartMultiColumnLayoutSecondaryWidth = 'sm' | 'md' | 'lg';
|
|
@@ -52,17 +61,15 @@ interface IMultiColumnLayoutOptions {
|
|
|
52
61
|
}
|
|
53
62
|
```
|
|
54
63
|
|
|
55
|
-
The default `MultiColumnLayoutStandardComponent` consumes `navTpl`, `secondaryTpl
|
|
64
|
+
The default `MultiColumnLayoutStandardComponent` consumes `navTpl`, `secondaryTpl` and `headerTpl`; `title`, `width` and `secondaryWidth` are read by `MultiColumnLayoutPresetComponent` (and are available to a custom implementation).
|
|
56
65
|
|
|
57
66
|
## MULTI_COLUMN_LAYOUT_STANDARD_COMPONENT_TOKEN
|
|
58
67
|
|
|
68
|
+
InjectionToken from `@smartsoft001/angular` that allows replacing the default `MultiColumnLayoutStandardComponent` with a custom implementation. Provide a `Type<MultiColumnLayoutBaseComponent>` in your application or component providers; `provideSmartPresets()` provides `MultiColumnLayoutPresetComponent` for it together with every other preset.
|
|
69
|
+
|
|
59
70
|
```typescript
|
|
60
71
|
import { MULTI_COLUMN_LAYOUT_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
61
|
-
```
|
|
62
72
|
|
|
63
|
-
InjectionToken that allows replacing the default `MultiColumnLayoutStandardComponent` with a custom implementation. Provide a `Type<MultiColumnLayoutBaseComponent>` to override.
|
|
64
|
-
|
|
65
|
-
```typescript
|
|
66
73
|
providers: [
|
|
67
74
|
{
|
|
68
75
|
provide: MULTI_COLUMN_LAYOUT_STANDARD_COMPONENT_TOKEN,
|
|
@@ -78,7 +85,6 @@ import {
|
|
|
78
85
|
ChangeDetectionStrategy,
|
|
79
86
|
Component,
|
|
80
87
|
computed,
|
|
81
|
-
input,
|
|
82
88
|
ViewEncapsulation,
|
|
83
89
|
} from '@angular/core';
|
|
84
90
|
import { NgTemplateOutlet } from '@angular/common';
|
|
@@ -114,9 +120,6 @@ import { MultiColumnLayoutBaseComponent } from '@smartsoft001/angular';
|
|
|
114
120
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
115
121
|
})
|
|
116
122
|
export class MyCustomMultiColumnLayoutComponent extends MultiColumnLayoutBaseComponent {
|
|
117
|
-
// NgComponentOutlet passes 'cssClass' by canonical name, not the 'class' alias.
|
|
118
|
-
override cssClass = input<string>('');
|
|
119
|
-
|
|
120
123
|
containerClasses = computed(() => {
|
|
121
124
|
const classes = ['my-multi-column-layout'];
|
|
122
125
|
const extra = this.cssClass();
|
|
@@ -194,7 +197,7 @@ The preset consumes the full `IMultiColumnLayoutOptions` surface (the standard c
|
|
|
194
197
|
- `secondaryWidth` — `'sm'` → `w-64` (default), `'md'` → `w-80`, `'lg'` → `w-96`.
|
|
195
198
|
- `headerTpl` / `title`, `navTpl`, `secondaryTpl` — as above.
|
|
196
199
|
|
|
197
|
-
|
|
200
|
+
The class recipes are internal to the preset (not exported).
|
|
198
201
|
|
|
199
202
|
### Token registration
|
|
200
203
|
|
|
@@ -210,7 +213,7 @@ providers: [
|
|
|
210
213
|
];
|
|
211
214
|
```
|
|
212
215
|
|
|
213
|
-
|
|
216
|
+
Provide it for `MULTI_COLUMN_LAYOUT_STANDARD_COMPONENT_TOKEN` as above, or use `provideSmartPresets()`. The preset declares `cssClass` without the `class` alias: on the `<smart-multi-column-layout-preset>` selector bind `[cssClass]`; on `<smart-multi-column-layout>` pass `class` as usual.
|
|
214
217
|
|
|
215
218
|
### Gaps
|
|
216
219
|
|
|
@@ -17,17 +17,17 @@ The `<smart-navbar>` component renders a top navigation bar with a logo, primary
|
|
|
17
17
|
|
|
18
18
|
### NavbarComponent (`<smart-navbar>`)
|
|
19
19
|
|
|
20
|
-
Main wrapper. Delegates to `NavbarStandardComponent` by default. When `NAVBAR_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet`.
|
|
20
|
+
Main wrapper. Delegates to `NavbarStandardComponent` by default. When `NAVBAR_STANDARD_COMPONENT_TOKEN` is provided (or `provideSmartPresets()` registers the preset), renders the injected component via `NgComponentOutlet`. In both cases it forwards `options` and the `class`, re-emits `itemClick` and keeps the two-way `mobileMenuOpen` in sync. Items with an `href` render as plain `<a [href]>` links (no `routerLink`, so a click loads the URL); items without `href` are buttons reported through `itemClick`.
|
|
21
21
|
|
|
22
22
|
### NavbarStandardComponent (`<smart-navbar-standard>`)
|
|
23
23
|
|
|
24
|
-
Barebones placeholder using native HTML. Renders an outer wrapper with `cssClass`, a `<nav class="navbar">` containing a mobile menu toggle button, optional logo (`logoTpl` or `<img>` from `logoUrl`/`logoAlt`, wrapped in `<a>` when `logoHref` provided), a primary `<ul>` of items (each rendered as `<a class="item-link">` when `href` is provided, otherwise `<button class="item-button">` emitting `itemClick`; gets `current` class when `item.current === true`), and template-ref slots `searchTpl` / `actionTpl` / `notificationTpl` / `userMenuTpl`. Optionally renders a `<nav class="navbar-secondary">` row when `options.secondaryItems` is non-empty, and a `.mobile-menu` panel when `mobileMenuOpen()` is `true`.
|
|
24
|
+
Barebones placeholder using native HTML. Renders an outer wrapper with `cssClass`, a `<nav class="navbar">` containing a mobile menu toggle button, optional logo (`logoTpl` as is, or an `<img>` from `logoUrl`/`logoAlt`, wrapped in `<a>` when `logoHref` is provided), a primary `<ul>` of items (each rendered as `<a class="item-link">` when `href` is provided, otherwise `<button class="item-button">` emitting `itemClick`; gets `current` class when `item.current === true`; `iconTpl` before the label), and template-ref slots `searchTpl` / `actionTpl` / `notificationTpl` / `userMenuTpl`. Optionally renders a `<nav class="navbar-secondary">` row when `options.secondaryItems` is non-empty, and a `.mobile-menu` panel when `mobileMenuOpen()` is `true`.
|
|
25
25
|
|
|
26
26
|
### NavbarPresetComponent (`<smart-navbar-preset>`)
|
|
27
27
|
|
|
28
|
-
Fully-styled, drop-in concrete implementation extending `NavbarBaseComponent`, translating the Preline collapsible navbar look to `smart:`-prefixed Tailwind classes with explicit `dark:` variants. Renders a `<header>` with a brand/logo slot (`logoTpl`, or `<img>` from `logoUrl`/`logoAlt`, wrapped in `<a>` when `logoHref` is set), a responsive primary link row (anchors for items with `href`, otherwise buttons emitting `itemClick`; `current` items get the active/`aria-current="page"` styling), the `searchTpl` / `actionTpl` / `notificationTpl` / `userMenuTpl` slots, an optional secondary link row from `secondaryItems`, and a mobile menu toggle. The mobile collapse is driven entirely by the two-way `mobileMenuOpen` signal (`@if` + `(click)`), so no Preline JS runtime is needed. `options.dark` switches to the solid dark color variant and `options.menuButtonOnLeft` moves the toggle ahead of the brand.
|
|
28
|
+
Fully-styled, drop-in concrete implementation extending `NavbarBaseComponent`, translating the Preline collapsible navbar look to `smart:`-prefixed Tailwind classes with explicit `dark:` variants. Renders a `<header>` with a brand/logo slot (`logoTpl`, or `<img>` from `logoUrl`/`logoAlt`, either wrapped in `<a>` when `logoHref` is set), a responsive primary link row (anchors for items with `href`, otherwise buttons emitting `itemClick`; `current` items get the active/`aria-current="page"` styling), the `searchTpl` / `actionTpl` / `notificationTpl` / `userMenuTpl` slots, an optional secondary link row from `secondaryItems`, and a mobile menu toggle. The mobile collapse is driven entirely by the two-way `mobileMenuOpen` signal (`@if` + `(click)`), so no Preline JS runtime is needed. `options.dark` switches to the solid dark color variant and `options.menuButtonOnLeft` moves the toggle ahead of the brand.
|
|
29
29
|
|
|
30
|
-
Register it via `NAVBAR_STANDARD_COMPONENT_TOKEN` to restyle every `<smart-navbar>`, or use the `<smart-navbar-preset>` selector directly.
|
|
30
|
+
Register it via `NAVBAR_STANDARD_COMPONENT_TOKEN` (or with `provideSmartPresets()`) to restyle every `<smart-navbar>`, or use the `<smart-navbar-preset>` selector directly. The preset declares `cssClass` without the `class` alias: on the `<smart-navbar-preset>` selector bind `[cssClass]`; on `<smart-navbar>` pass `class` as usual.
|
|
31
31
|
|
|
32
32
|
```typescript
|
|
33
33
|
import {
|
|
@@ -72,16 +72,35 @@ Abstract base directive. Exposes:
|
|
|
72
72
|
|
|
73
73
|
### INavbarOptions
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
75
|
+
| Field | Type | Default | Description |
|
|
76
|
+
| ------------------ | ---------------------- | ------- | ------------------------------------------------------------------------------------- |
|
|
77
|
+
| `logoTpl` | `TemplateRef<unknown>` | - | The brand as a template; wins over the logo image. |
|
|
78
|
+
| `logoUrl` | `string` | - | Logo image URL. |
|
|
79
|
+
| `logoAlt` | `string` | `''` | Alt text of the logo image. |
|
|
80
|
+
| `logoHref` | `string` | - | Link of the logo (the standard links the image only, the preset links `logoTpl` too). |
|
|
81
|
+
| `items` | `INavbarItem[]` | `[]` | The primary links (also listed in the mobile menu of the standard). |
|
|
82
|
+
| `secondaryItems` | `INavbarItem[]` | `[]` | A second row of links. |
|
|
83
|
+
| `searchTpl` | `TemplateRef<unknown>` | - | Search slot. |
|
|
84
|
+
| `actionTpl` | `TemplateRef<unknown>` | - | Quick-action slot (e.g. a "New" button). |
|
|
85
|
+
| `notificationTpl` | `TemplateRef<unknown>` | - | Notifications slot. |
|
|
86
|
+
| `userMenuTpl` | `TemplateRef<unknown>` | - | User menu slot (e.g. an avatar dropdown). |
|
|
87
|
+
| `dark` | `boolean` | `false` | Preset only: the solid dark colour variant. |
|
|
88
|
+
| `menuButtonOnLeft` | `boolean` | `false` | Preset only: places the mobile menu button before the brand. |
|
|
89
|
+
| `layout` | `SmartNavbarLayout` | - | Not read by the built-in implementations; available to a custom implementation. |
|
|
90
|
+
|
|
91
|
+
`SmartNavbarLayout` is `'simple' | 'simple-with-menu-on-left' | 'with-quick-action' | 'with-search' | 'with-centered-search' | 'with-secondary-links' | 'with-column-layout'`.
|
|
92
|
+
|
|
93
|
+
### INavbarItem
|
|
94
|
+
|
|
95
|
+
| Field | Type | Default | Description |
|
|
96
|
+
| --------- | ---------------------- | -------- | ------------------------------------------------------------------------------ |
|
|
97
|
+
| `id` | `string` | required | Reported as `itemId` by `itemClick`. |
|
|
98
|
+
| `label` | `string` | - | Link text. |
|
|
99
|
+
| `href` | `string` | - | Renders a plain `<a [href]>`; without it the item is a button (`itemClick`). |
|
|
100
|
+
| `current` | `boolean` | - | Marks the current page (`current` class; `aria-current="page"` in the preset). |
|
|
101
|
+
| `iconTpl` | `TemplateRef<unknown>` | - | Icon before the label (primary row only). |
|
|
84
102
|
|
|
103
|
+
```typescript
|
|
85
104
|
interface INavbarOptions {
|
|
86
105
|
layout?: SmartNavbarLayout;
|
|
87
106
|
dark?: boolean;
|
|
@@ -107,8 +126,12 @@ interface INavbarItem {
|
|
|
107
126
|
}
|
|
108
127
|
```
|
|
109
128
|
|
|
129
|
+
The wrapper does not move `current` itself: to highlight the clicked item, keep the current id in your component and rebuild `items` with `current: item.id === activeId` in the `(itemClick)` handler.
|
|
130
|
+
|
|
110
131
|
## NAVBAR_STANDARD_COMPONENT_TOKEN
|
|
111
132
|
|
|
133
|
+
InjectionToken from `@smartsoft001/angular` that allows replacing the default `NavbarStandardComponent` with a custom implementation. Provide a `Type<NavbarBaseComponent>` in your application or component providers; `provideSmartPresets()` provides `NavbarPresetComponent` for it together with every other preset.
|
|
134
|
+
|
|
112
135
|
```typescript
|
|
113
136
|
import { NAVBAR_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
114
137
|
|
|
@@ -126,7 +149,6 @@ providers: [
|
|
|
126
149
|
import {
|
|
127
150
|
ChangeDetectionStrategy,
|
|
128
151
|
Component,
|
|
129
|
-
input,
|
|
130
152
|
ViewEncapsulation,
|
|
131
153
|
} from '@angular/core';
|
|
132
154
|
|
|
@@ -150,10 +172,7 @@ import { NavbarBaseComponent } from '@smartsoft001/angular';
|
|
|
150
172
|
encapsulation: ViewEncapsulation.None,
|
|
151
173
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
152
174
|
})
|
|
153
|
-
export class MyCustomNavbarComponent extends NavbarBaseComponent {
|
|
154
|
-
// NgComponentOutlet passes 'cssClass' by canonical name, not the 'class' alias.
|
|
155
|
-
override cssClass = input<string>('');
|
|
156
|
-
}
|
|
175
|
+
export class MyCustomNavbarComponent extends NavbarBaseComponent {}
|
|
157
176
|
```
|
|
158
177
|
|
|
159
178
|
## Usage Examples
|
|
@@ -162,7 +181,7 @@ export class MyCustomNavbarComponent extends NavbarBaseComponent {
|
|
|
162
181
|
<!-- Simple navbar -->
|
|
163
182
|
<smart-navbar
|
|
164
183
|
[options]="{
|
|
165
|
-
logoUrl: '/
|
|
184
|
+
logoUrl: 'https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=600',
|
|
166
185
|
logoAlt: 'Acme',
|
|
167
186
|
logoHref: '/',
|
|
168
187
|
items: [
|
|
@@ -183,7 +202,6 @@ export class MyCustomNavbarComponent extends NavbarBaseComponent {
|
|
|
183
202
|
|
|
184
203
|
<smart-navbar
|
|
185
204
|
[options]="{
|
|
186
|
-
layout: 'with-search',
|
|
187
205
|
items: items,
|
|
188
206
|
searchTpl: search,
|
|
189
207
|
userMenuTpl: userMenu,
|
|
@@ -196,7 +214,6 @@ export class MyCustomNavbarComponent extends NavbarBaseComponent {
|
|
|
196
214
|
[(mobileMenuOpen)]="open"
|
|
197
215
|
[options]="{
|
|
198
216
|
dark: true,
|
|
199
|
-
layout: 'with-secondary-links',
|
|
200
217
|
items: primary,
|
|
201
218
|
secondaryItems: secondary,
|
|
202
219
|
}"
|
|
@@ -17,24 +17,24 @@ The `<smart-notification>` component displays a transient or persistent message
|
|
|
17
17
|
|
|
18
18
|
### NotificationComponent (`<smart-notification>`)
|
|
19
19
|
|
|
20
|
-
Main wrapper component. Renders `NotificationStandardComponent` by default. When `NOTIFICATION_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet`.
|
|
20
|
+
Main wrapper component. Renders `NotificationStandardComponent` by default. When `NOTIFICATION_STANDARD_COMPONENT_TOKEN` is provided (or `provideSmartPresets()` registers the preset), renders the injected component via `NgComponentOutlet`, forwarding its inputs and re-emitting its `dismissed` and `actionClick` outputs. It has no open state: render it while the notification should be visible and remove it on `(dismissed)`.
|
|
21
21
|
|
|
22
22
|
### NotificationStandardComponent (`<smart-notification-standard>`)
|
|
23
23
|
|
|
24
|
-
Barebones placeholder concrete implementation. Renders a `<div role="status">` with `aria-live` (defaulting to `polite`, overridable via `options.ariaLive`), an `<h3>` for the title, an optional `<p>` for the description, an optional close button when `dismissible` is `true`, and one `<button>` per action with a `data-variant` attribute. It does not include Tailwind UI styling — it exists solely as the default structural placeholder until a custom implementation is registered through the token.
|
|
24
|
+
Barebones placeholder concrete implementation. Renders a `<div role="status">` with `aria-live` (defaulting to `polite`, overridable via `options.ariaLive`), an `<h3>` for the title, an optional `<p>` for the description, an optional close button when `dismissible` is `true`, and one `<button>` per action with a `data-variant` attribute. It does not render `iconName` or `avatarUrl`. 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
25
|
|
|
26
26
|
### NotificationPresetComponent (`<smart-notification-preset>`)
|
|
27
27
|
|
|
28
|
-
Styled toast variation that extends `NotificationBaseComponent` and is a drop-in replacement for `NotificationStandardComponent`. Register it via `NOTIFICATION_STANDARD_COMPONENT_TOKEN` to restyle every `<smart-notification>`, or use the `<smart-notification-preset>` selector directly. It renders the translated Preline toast looks as a card (`bg-white`/`dark:bg-gray-800`, border, `rounded-xl`, `shadow-lg`), with the layout selected through `options.variant` (default `'simple'`):
|
|
28
|
+
Styled toast variation that extends `NotificationBaseComponent` and is a drop-in replacement for `NotificationStandardComponent`. Register it via `NOTIFICATION_STANDARD_COMPONENT_TOKEN` (or with `provideSmartPresets()`) to restyle every `<smart-notification>`, or use the `<smart-notification-preset>` selector directly. It renders the translated Preline toast looks as a card (`bg-white`/`dark:bg-gray-800`, border, `rounded-xl`, `shadow-lg`), with the layout selected through `options.variant` (default `'simple'`):
|
|
29
29
|
|
|
30
|
-
- `simple` — leading icon glyph (when `iconName` is set) plus the `title` message and optional `description`.
|
|
31
|
-
- `condensed` — inline single-row
|
|
30
|
+
- `simple` — leading icon glyph (when `iconName` is set) plus the `title` message and optional `description`; it does **not** render `actions`.
|
|
31
|
+
- `condensed` — inline single-row `title` with the action links and close button pushed to the end (`ms-auto`); no description or icon.
|
|
32
32
|
- `with-actions-below` / `with-avatar` — icon (or avatar image for `with-avatar`) + heading + description, with text-link styled actions below; the close button is absolutely positioned.
|
|
33
33
|
- `with-buttons-below` / `with-split-buttons` — same layout but actions render as solid/bordered buttons (per `action.variant`); `with-split-buttons` makes each button `grow` to fill the row.
|
|
34
34
|
|
|
35
|
-
`dismissible` renders a close button that calls `dismiss()`; each action calls `invokeAction(action.id)`. Open/close visibility is Angular-driven via the `dismissed` output — no Preline JS runtime is used. All classes are `smart:`-prefixed Tailwind with explicit `dark:` variants
|
|
35
|
+
`dismissible` renders a close button that calls `dismiss()`; each action calls `invokeAction(action.id)`. Open/close visibility is Angular-driven via the `dismissed` output — no Preline JS runtime is used. All classes are `smart:`-prefixed Tailwind with explicit `dark:` variants; the class recipes are internal to the preset (not exported).
|
|
36
36
|
|
|
37
|
-
>
|
|
37
|
+
> `NotificationPresetComponent` declares `cssClass` without the `class` alias: bind it as `[cssClass]` on the `<smart-notification-preset>` selector, or pass `class` on `<smart-notification>` (the wrapper forwards it).
|
|
38
38
|
|
|
39
39
|
### NotificationBaseComponent (abstract)
|
|
40
40
|
|
|
@@ -44,16 +44,16 @@ Abstract base directive for extending custom notification implementations. Expos
|
|
|
44
44
|
|
|
45
45
|
### Inputs
|
|
46
46
|
|
|
47
|
-
| Input | Type | Default | Description
|
|
48
|
-
| ------------- | ------------------------------------------------ | ------- |
|
|
49
|
-
| `title` | `InputSignal<string>` (required) | - | Headline text
|
|
50
|
-
| `description` | `InputSignal<string \| undefined>` | - | Optional supporting text
|
|
51
|
-
| `iconName` | `InputSignal<string \| undefined>` | - |
|
|
52
|
-
| `avatarUrl` | `InputSignal<string \| undefined>` | - |
|
|
53
|
-
| `actions` | `InputSignal<INotificationAction[]>` | `[]` | Action buttons
|
|
54
|
-
| `dismissible` | `InputSignal<boolean>` | `false` | When `true`, renders a close button
|
|
55
|
-
| `options` | `InputSignal<INotificationOptions \| undefined>` | - | Optional configuration (variant, ariaLive)
|
|
56
|
-
| `class` | `InputSignal<string>` | `''` | External CSS classes (alias for `cssClass`)
|
|
47
|
+
| Input | Type | Default | Description |
|
|
48
|
+
| ------------- | ------------------------------------------------ | ------- | ----------------------------------------------------------------------------------------------------------- |
|
|
49
|
+
| `title` | `InputSignal<string>` (required) | - | Headline text |
|
|
50
|
+
| `description` | `InputSignal<string \| undefined>` | - | Optional supporting text |
|
|
51
|
+
| `iconName` | `InputSignal<string \| undefined>` | - | Preset only: a glyph (text, e.g. an emoji) before the text (not in the `condensed` and `with-avatar` looks) |
|
|
52
|
+
| `avatarUrl` | `InputSignal<string \| undefined>` | - | Preset only: the image of the `with-avatar` look |
|
|
53
|
+
| `actions` | `InputSignal<INotificationAction[]>` | `[]` | Action buttons (not rendered by the preset's `simple` look) |
|
|
54
|
+
| `dismissible` | `InputSignal<boolean>` | `false` | When `true`, renders a close button |
|
|
55
|
+
| `options` | `InputSignal<INotificationOptions \| undefined>` | - | Optional configuration (variant, ariaLive) |
|
|
56
|
+
| `class` | `InputSignal<string>` | `''` | External CSS classes (alias for `cssClass`) |
|
|
57
57
|
|
|
58
58
|
### Outputs
|
|
59
59
|
|
|
@@ -64,6 +64,12 @@ Abstract base directive for extending custom notification implementations. Expos
|
|
|
64
64
|
|
|
65
65
|
### INotificationAction
|
|
66
66
|
|
|
67
|
+
| Field | Type | Default | Description |
|
|
68
|
+
| --------- | -------------------------- | ----------- | ------------------------------------------------------------------------------ |
|
|
69
|
+
| `id` | `string` | required | Echoed back as `actionId` in the `actionClick` payload. |
|
|
70
|
+
| `label` | `string` | required | Button text. |
|
|
71
|
+
| `variant` | `'primary' \| 'secondary'` | `'primary'` | The standard exposes it as `data-variant`; the preset styles the action by it. |
|
|
72
|
+
|
|
67
73
|
```typescript
|
|
68
74
|
interface INotificationAction {
|
|
69
75
|
id: string;
|
|
@@ -72,10 +78,13 @@ interface INotificationAction {
|
|
|
72
78
|
}
|
|
73
79
|
```
|
|
74
80
|
|
|
75
|
-
`id` is echoed back in the `actionClick` payload so the host can route handling. `variant` controls the placeholder's `data-variant` attribute and is intended as a styling hook for custom implementations.
|
|
76
|
-
|
|
77
81
|
### INotificationOptions
|
|
78
82
|
|
|
83
|
+
| Field | Type | Default | Description |
|
|
84
|
+
| ---------- | -------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
85
|
+
| `variant` | `SmartNotificationVariant` | `'simple'` | Preset only: the toast look (`simple`, `condensed`, `with-actions-below`, `with-avatar`, `with-split-buttons`, `with-buttons-below`). |
|
|
86
|
+
| `ariaLive` | `'polite' \| 'assertive'` | `'polite'` | The `aria-live` of the `role="status"` container; `assertive` for errors. |
|
|
87
|
+
|
|
79
88
|
```typescript
|
|
80
89
|
type SmartNotificationVariant =
|
|
81
90
|
| 'simple'
|
|
@@ -91,18 +100,13 @@ interface INotificationOptions {
|
|
|
91
100
|
}
|
|
92
101
|
```
|
|
93
102
|
|
|
94
|
-
The standard component only consumes `ariaLive` (placeholder behavior — applied directly as the `aria-live` attribute on the `role="status"` container; defaults to `'polite'`). The `variant` property is ignored by `NotificationStandardComponent` but **fully consumed by `NotificationPresetComponent`** (default `'simple'`) to pick the toast layout.
|
|
95
|
-
|
|
96
103
|
## NOTIFICATION_STANDARD_COMPONENT_TOKEN
|
|
97
104
|
|
|
105
|
+
InjectionToken from `@smartsoft001/angular` that allows replacing the default `NotificationStandardComponent` with a custom implementation. Provide a `Type<NotificationBaseComponent>` in your application or component providers; `provideSmartPresets()` provides `NotificationPresetComponent` for it together with every other preset.
|
|
106
|
+
|
|
98
107
|
```typescript
|
|
99
108
|
import { NOTIFICATION_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
InjectionToken that allows replacing the default `NotificationStandardComponent` with a custom implementation. Provide a `Type<NotificationBaseComponent>` to override.
|
|
103
109
|
|
|
104
|
-
```typescript
|
|
105
|
-
// In your app module or component providers:
|
|
106
110
|
providers: [
|
|
107
111
|
{
|
|
108
112
|
provide: NOTIFICATION_STANDARD_COMPONENT_TOKEN,
|
|
@@ -118,7 +122,6 @@ import {
|
|
|
118
122
|
ChangeDetectionStrategy,
|
|
119
123
|
Component,
|
|
120
124
|
computed,
|
|
121
|
-
input,
|
|
122
125
|
ViewEncapsulation,
|
|
123
126
|
} from '@angular/core';
|
|
124
127
|
|
|
@@ -161,9 +164,6 @@ import { NotificationBaseComponent } from '@smartsoft001/angular';
|
|
|
161
164
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
162
165
|
})
|
|
163
166
|
export class MyCustomNotificationComponent extends NotificationBaseComponent {
|
|
164
|
-
// NgComponentOutlet passes 'cssClass' by canonical name, not the 'class' alias.
|
|
165
|
-
override cssClass = input<string>('');
|
|
166
|
-
|
|
167
167
|
containerClasses = computed(() => {
|
|
168
168
|
const classes = ['my-notification-container'];
|
|
169
169
|
const extra = this.cssClass();
|
|
@@ -173,9 +173,8 @@ export class MyCustomNotificationComponent extends NotificationBaseComponent {
|
|
|
173
173
|
}
|
|
174
174
|
```
|
|
175
175
|
|
|
176
|
-
When extending the base directly, remember to:
|
|
176
|
+
The inherited `cssClass` (input alias `class`) receives the class passed to `<smart-notification>`, and the wrapper re-emits the outputs. When extending the base directly, remember to:
|
|
177
177
|
|
|
178
|
-
- declare `cssClass = input<string>('')` explicitly (no `class` alias) if the component is used via `NgComponentOutlet` through `NOTIFICATION_STANDARD_COMPONENT_TOKEN`, because `NgComponentOutlet` passes inputs by canonical name (not by alias),
|
|
179
178
|
- call `this.dismiss()` from your close handler — it already emits the `dismissed` output,
|
|
180
179
|
- call `this.invokeAction(action.id)` from each action button — it already emits the `actionClick` output with `{ actionId }`.
|
|
181
180
|
|
|
@@ -228,7 +227,7 @@ When extending the base directly, remember to:
|
|
|
228
227
|
- Wrapper: `packages/shared/angular/src/lib/components/notification/notification.component.ts`
|
|
229
228
|
- Standard: `packages/shared/angular/src/lib/components/notification/standard/standard.component.ts`
|
|
230
229
|
- Preset variation: `packages/shared/angular/src/lib/components/notification/preset/preset.component.ts`
|
|
231
|
-
- Preset class recipes: `packages/shared/angular/src/lib/components/notification/preset/preset-classes.util.ts`
|
|
230
|
+
- Preset class recipes (internal, not exported): `packages/shared/angular/src/lib/components/notification/preset/preset-classes.util.ts`
|
|
232
231
|
- Base class: `packages/shared/angular/src/lib/components/notification/base/base.component.ts`
|
|
233
232
|
- Token: `packages/shared/angular/src/lib/shared.inectors.ts` (`NOTIFICATION_STANDARD_COMPONENT_TOKEN`)
|
|
234
233
|
- Interfaces: `packages/shared/angular/src/lib/models/interfaces.ts` (`INotificationAction`, `INotificationOptions`, `SmartNotificationVariant`)
|