@smartsoft001/pro-claude-plugins 0.2.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/.claude-plugin/marketplace.json +26 -0
- package/README.md +56 -0
- package/package.json +14 -0
- package/plugins/flow/.claude-plugin/README.md +91 -0
- package/plugins/flow/.claude-plugin/merge-permissions.js +115 -0
- package/plugins/flow/.claude-plugin/plugin.json +5 -0
- package/plugins/flow/.claude-plugin/settings.template.json +86 -0
- package/plugins/flow/agents/angular-component-scaffolder.md +176 -0
- package/plugins/flow/agents/angular-directive-builder.md +154 -0
- package/plugins/flow/agents/angular-guard-builder.md +244 -0
- package/plugins/flow/agents/angular-jest-test-writer.md +475 -0
- package/plugins/flow/agents/angular-pipe-builder.md +170 -0
- package/plugins/flow/agents/angular-resolver-builder.md +287 -0
- package/plugins/flow/agents/angular-service-builder.md +162 -0
- package/plugins/flow/agents/angular-signal-state-builder.md +340 -0
- package/plugins/flow/agents/angular-test-diagnostician.md +279 -0
- package/plugins/flow/agents/angular-testbed-configurator.md +315 -0
- package/plugins/flow/agents/arch-scaffolder.md +278 -0
- package/plugins/flow/agents/e2e-data-testid-injector.md +195 -0
- package/plugins/flow/agents/e2e-project-scaffolder.md +194 -0
- package/plugins/flow/agents/e2e-test-writer.md +357 -0
- package/plugins/flow/agents/shared-agent-evolver.md +294 -0
- package/plugins/flow/agents/shared-build-verifier.md +160 -0
- package/plugins/flow/agents/shared-config-updater.md +310 -0
- package/plugins/flow/agents/shared-coverage-enforcer.md +184 -0
- package/plugins/flow/agents/shared-error-handler.md +217 -0
- package/plugins/flow/agents/shared-file-creator.md +344 -0
- package/plugins/flow/agents/shared-impl-orchestrator.md +312 -0
- package/plugins/flow/agents/shared-impl-reporter.md +368 -0
- package/plugins/flow/agents/shared-impl-teammate.md +201 -0
- package/plugins/flow/agents/shared-linear-subtask-iterator.md +337 -0
- package/plugins/flow/agents/shared-logic-implementer.md +244 -0
- package/plugins/flow/agents/shared-maia-api.md +26 -0
- package/plugins/flow/agents/shared-parallelization-analyzer.md +343 -0
- package/plugins/flow/agents/shared-performance-validator.md +168 -0
- package/plugins/flow/agents/shared-plan-perspective.md +271 -0
- package/plugins/flow/agents/shared-project-standardizer.md +205 -0
- package/plugins/flow/agents/shared-report-synthesizer.md +188 -0
- package/plugins/flow/agents/shared-review-teammate.md +189 -0
- package/plugins/flow/agents/shared-security-scanner.md +186 -0
- package/plugins/flow/agents/shared-style-enforcer.md +230 -0
- package/plugins/flow/agents/shared-subtask-dependency-analyzer.md +189 -0
- package/plugins/flow/agents/shared-tdd-developer.md +350 -0
- package/plugins/flow/agents/shared-team-coordinator.md +192 -0
- package/plugins/flow/agents/shared-test-fixer.md +186 -0
- package/plugins/flow/agents/shared-test-runner.md +191 -0
- package/plugins/flow/agents/shared-ui-classifier.md +263 -0
- package/plugins/flow/agents/shared-verification-orchestrator.md +194 -0
- package/plugins/flow/agents/shared-verification-runner.md +140 -0
- package/plugins/flow/agents/ui-a11y-validator.md +305 -0
- package/plugins/flow/agents/ui-screenshot-reporter.md +329 -0
- package/plugins/flow/agents/ui-web-designer.md +214 -0
- package/plugins/flow/scripts/compute-session-tokens.sh +39 -0
- package/plugins/flow/skills/a11y-audit/SKILL.md +214 -0
- package/plugins/flow/skills/angular-patterns/SKILL.md +191 -0
- package/plugins/flow/skills/browser-capture/SKILL.md +238 -0
- package/plugins/flow/skills/commit/SKILL.md +259 -0
- package/plugins/flow/skills/debug-helper/SKILL.md +375 -0
- package/plugins/flow/skills/impl/SKILL.md +992 -0
- package/plugins/flow/skills/karpathy-guidelines/SKILL.md +72 -0
- package/plugins/flow/skills/linear-suggestion/SKILL.md +132 -0
- package/plugins/flow/skills/maia-files-delete/SKILL.md +59 -0
- package/plugins/flow/skills/maia-files-upload/SKILL.md +57 -0
- package/plugins/flow/skills/nx-conventions/SKILL.md +326 -0
- package/plugins/flow/skills/plan/SKILL.md +1033 -0
- package/plugins/flow/skills/push/SKILL.md +759 -0
- package/plugins/flow/skills/review/SKILL.md +443 -0
- package/plugins/flow/skills/test-e2e/SKILL.md +164 -0
- package/plugins/flow/skills/test-unit/SKILL.md +456 -0
- package/plugins/flow-external/.claude-plugin/README.md +146 -0
- package/plugins/flow-external/.claude-plugin/merge-permissions.js +94 -0
- package/plugins/flow-external/.claude-plugin/plugin.json +5 -0
- package/plugins/flow-external/.claude-plugin/settings.template.json +78 -0
- package/plugins/flow-external/agents/angular-component-scaffolder.md +271 -0
- package/plugins/flow-external/agents/angular-directive-builder.md +134 -0
- package/plugins/flow-external/agents/angular-guard-builder.md +73 -0
- package/plugins/flow-external/agents/angular-pipe-builder.md +90 -0
- package/plugins/flow-external/agents/angular-resolver-builder.md +79 -0
- package/plugins/flow-external/agents/angular-service-builder.md +168 -0
- package/plugins/flow-external/agents/angular-state-builder.md +263 -0
- package/plugins/flow-external/agents/shared-build-verifier.md +67 -0
- package/plugins/flow-external/agents/shared-impl-orchestrator.md +90 -0
- package/plugins/flow-external/agents/shared-impl-reporter.md +135 -0
- package/plugins/flow-external/agents/shared-linear-subtask-iterator.md +70 -0
- package/plugins/flow-external/agents/shared-ui-classifier.md +38 -0
- package/plugins/flow-external/agents/ui-web-designer.md +203 -0
- package/plugins/flow-external/scripts/compute-session-tokens.sh +39 -0
- package/plugins/flow-external/skills/a11y-audit/SKILL.md +97 -0
- package/plugins/flow-external/skills/angular-cli-conventions/SKILL.md +268 -0
- package/plugins/flow-external/skills/angular-patterns/SKILL.md +182 -0
- package/plugins/flow-external/skills/browser-capture/SKILL.md +74 -0
- package/plugins/flow-external/skills/commit/SKILL.md +114 -0
- package/plugins/flow-external/skills/debug-helper/SKILL.md +135 -0
- package/plugins/flow-external/skills/impl/SKILL.md +218 -0
- package/plugins/flow-external/skills/karpathy-guidelines/SKILL.md +72 -0
- package/plugins/flow-external/skills/linear-suggestion/SKILL.md +62 -0
- package/plugins/flow-external/skills/maia-files-delete/SKILL.md +34 -0
- package/plugins/flow-external/skills/maia-files-upload/SKILL.md +41 -0
- package/plugins/flow-external/skills/plan/SKILL.md +334 -0
- package/plugins/flow-external/skills/push/SKILL.md +232 -0
- package/plugins/flow-legacy/.claude-plugin/README.md +143 -0
- package/plugins/flow-legacy/.claude-plugin/merge-permissions.js +94 -0
- package/plugins/flow-legacy/.claude-plugin/plugin.json +5 -0
- package/plugins/flow-legacy/.claude-plugin/settings.template.json +79 -0
- package/plugins/flow-legacy/agents/angular-component-scaffolder.md +327 -0
- package/plugins/flow-legacy/agents/angular-directive-builder.md +253 -0
- package/plugins/flow-legacy/agents/angular-guard-builder.md +326 -0
- package/plugins/flow-legacy/agents/angular-pipe-builder.md +238 -0
- package/plugins/flow-legacy/agents/angular-resolver-builder.md +339 -0
- package/plugins/flow-legacy/agents/angular-service-builder.md +271 -0
- package/plugins/flow-legacy/agents/angular-state-builder.md +480 -0
- package/plugins/flow-legacy/agents/shared-impl-orchestrator.md +174 -0
- package/plugins/flow-legacy/agents/shared-impl-reporter.md +232 -0
- package/plugins/flow-legacy/agents/shared-linear-subtask-iterator.md +198 -0
- package/plugins/flow-legacy/agents/shared-tdd-developer.md +307 -0
- package/plugins/flow-legacy/agents/shared-test-runner.md +133 -0
- package/plugins/flow-legacy/agents/shared-ui-classifier.md +145 -0
- package/plugins/flow-legacy/scripts/compute-session-tokens.sh +39 -0
- package/plugins/flow-legacy/skills/a11y-audit/SKILL.md +214 -0
- package/plugins/flow-legacy/skills/angular-patterns/SKILL.md +346 -0
- package/plugins/flow-legacy/skills/browser-capture/SKILL.md +238 -0
- package/plugins/flow-legacy/skills/commit/SKILL.md +215 -0
- package/plugins/flow-legacy/skills/debug-helper/SKILL.md +395 -0
- package/plugins/flow-legacy/skills/impl/SKILL.md +710 -0
- package/plugins/flow-legacy/skills/karpathy-guidelines/SKILL.md +72 -0
- package/plugins/flow-legacy/skills/linear-suggestion/SKILL.md +132 -0
- package/plugins/flow-legacy/skills/maia-files-delete/SKILL.md +59 -0
- package/plugins/flow-legacy/skills/maia-files-upload/SKILL.md +57 -0
- package/plugins/flow-legacy/skills/nx-conventions/SKILL.md +368 -0
- package/plugins/flow-legacy/skills/plan/SKILL.md +742 -0
- package/plugins/flow-legacy/skills/push/SKILL.md +645 -0
- package/plugins/flow-legacy/skills/test-unit/SKILL.md +500 -0
- package/plugins/smart-pro/.claude-plugin/README.md +115 -0
- package/plugins/smart-pro/.claude-plugin/merge-permissions.js +129 -0
- package/plugins/smart-pro/.claude-plugin/plugin.json +5 -0
- package/plugins/smart-pro/.claude-plugin/settings.template.json +94 -0
- package/plugins/smart-pro/agents/angular-components/AGENT.md +214 -0
- package/plugins/smart-pro/hooks/CONFIG.md +198 -0
- package/plugins/smart-pro/hooks/README.md +139 -0
- package/plugins/smart-pro/hooks/audit_logger.py +107 -0
- package/plugins/smart-pro/hooks/auto_format.sh +11 -0
- package/plugins/smart-pro/hooks/hooks.json +79 -0
- package/plugins/smart-pro/hooks/safety_validator.py +129 -0
- package/plugins/smart-pro/hooks/sensitive_file_blocker.py +58 -0
- package/plugins/smart-pro/hooks/skill_validator.py +220 -0
- package/plugins/smart-pro/skills/angular-components-action-panel/SKILL.md +159 -0
- package/plugins/smart-pro/skills/angular-components-avatar/SKILL.md +142 -0
- package/plugins/smart-pro/skills/angular-components-badge/SKILL.md +110 -0
- package/plugins/smart-pro/skills/angular-components-breadcrumbs/SKILL.md +91 -0
- package/plugins/smart-pro/skills/angular-components-button/SKILL.md +146 -0
- package/plugins/smart-pro/skills/angular-components-button-group/SKILL.md +121 -0
- package/plugins/smart-pro/skills/angular-components-calendar/SKILL.md +78 -0
- package/plugins/smart-pro/skills/angular-components-card/SKILL.md +110 -0
- package/plugins/smart-pro/skills/angular-components-card-heading/SKILL.md +105 -0
- package/plugins/smart-pro/skills/angular-components-command-palette/SKILL.md +168 -0
- package/plugins/smart-pro/skills/angular-components-container/SKILL.md +93 -0
- package/plugins/smart-pro/skills/angular-components-description-list/SKILL.md +102 -0
- package/plugins/smart-pro/skills/angular-components-details/SKILL.md +70 -0
- package/plugins/smart-pro/skills/angular-components-divider/SKILL.md +110 -0
- package/plugins/smart-pro/skills/angular-components-drawer/SKILL.md +136 -0
- package/plugins/smart-pro/skills/angular-components-dropdown/SKILL.md +131 -0
- package/plugins/smart-pro/skills/angular-components-empty-state/SKILL.md +103 -0
- package/plugins/smart-pro/skills/angular-components-feed/SKILL.md +110 -0
- package/plugins/smart-pro/skills/angular-components-form/SKILL.md +77 -0
- package/plugins/smart-pro/skills/angular-components-grid-list/SKILL.md +91 -0
- package/plugins/smart-pro/skills/angular-components-input/SKILL.md +118 -0
- package/plugins/smart-pro/skills/angular-components-list/SKILL.md +75 -0
- package/plugins/smart-pro/skills/angular-components-list-container/SKILL.md +106 -0
- package/plugins/smart-pro/skills/angular-components-media-object/SKILL.md +133 -0
- package/plugins/smart-pro/skills/angular-components-modal/SKILL.md +159 -0
- package/plugins/smart-pro/skills/angular-components-multi-column-layout/SKILL.md +84 -0
- package/plugins/smart-pro/skills/angular-components-navbar/SKILL.md +93 -0
- package/plugins/smart-pro/skills/angular-components-notification/SKILL.md +147 -0
- package/plugins/smart-pro/skills/angular-components-page/SKILL.md +162 -0
- package/plugins/smart-pro/skills/angular-components-page-heading/SKILL.md +96 -0
- package/plugins/smart-pro/skills/angular-components-paging/SKILL.md +86 -0
- package/plugins/smart-pro/skills/angular-components-progress-bars/SKILL.md +94 -0
- package/plugins/smart-pro/skills/angular-components-searchbar/SKILL.md +113 -0
- package/plugins/smart-pro/skills/angular-components-section-heading/SKILL.md +156 -0
- package/plugins/smart-pro/skills/angular-components-select-menu/SKILL.md +101 -0
- package/plugins/smart-pro/skills/angular-components-sidebar-layout/SKILL.md +121 -0
- package/plugins/smart-pro/skills/angular-components-sidebar-navigation/SKILL.md +80 -0
- package/plugins/smart-pro/skills/angular-components-sign-in-form/SKILL.md +91 -0
- package/plugins/smart-pro/skills/angular-components-stacked-layout/SKILL.md +114 -0
- package/plugins/smart-pro/skills/angular-components-stacked-list/SKILL.md +93 -0
- package/plugins/smart-pro/skills/angular-components-stats/SKILL.md +87 -0
- package/plugins/smart-pro/skills/angular-components-table/SKILL.md +98 -0
- package/plugins/smart-pro/skills/angular-components-tabs/SKILL.md +99 -0
- package/plugins/smart-pro/skills/angular-components-textarea/SKILL.md +111 -0
- package/plugins/smart-pro/skills/angular-components-toggle/SKILL.md +109 -0
- package/plugins/smart-pro/skills/angular-components-vertical-navigation/SKILL.md +139 -0
- package/plugins/smart-pro/skills/audit-log/SKILL.md +82 -0
- package/plugins/smart-pro/skills/format-code/SKILL.md +46 -0
- package/plugins/smart-pro/skills/project-conventions/SKILL.md +90 -0
- package/plugins/smart-pro/skills/safety-check/SKILL.md +0 -0
- package/src/index.d.ts +6 -0
- package/src/index.js +7 -0
- package/src/index.js.map +1 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: angular-components-input
|
|
3
|
+
description: Input field variants for @smartsoft001/pro-angular — 33 Tailwind UI templates pluggable into the fork's <smartpro-input> via INPUT_FIELD_COMPONENTS_TOKEN.
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Input Variants (pro)
|
|
8
|
+
|
|
9
|
+
This package provides 33 input-field variants derived from Tailwind UI. Each variant extends `InputBaseComponent<T>` (or `InputPossibilitiesBaseComponent<T>`) from `@smartsoft001/angular` and is meant to replace the fork's default input sub-components by providing `INPUT_FIELD_COMPONENTS_TOKEN`.
|
|
10
|
+
|
|
11
|
+
## When to Use This Skill
|
|
12
|
+
|
|
13
|
+
- Developer wants a specific input look → pick the matching variant and register it via the DI token
|
|
14
|
+
- Developer asks which input variants exist → list the tables below
|
|
15
|
+
- Developer wants to see all variants → open the `Components / Input` Storybook entry (33 stories, dark/light toggle via global theme toolbar)
|
|
16
|
+
|
|
17
|
+
## Categories
|
|
18
|
+
|
|
19
|
+
### Input-like "Primary" variants (12) — Tailwind Plus "Input with leading icon and trailing button"
|
|
20
|
+
|
|
21
|
+
Single shared template. Each maps 1:1 to a `FieldType`.
|
|
22
|
+
|
|
23
|
+
| Component | Selector | FieldType | HTML input type |
|
|
24
|
+
| ---------------------------------- | ------------------------------------- | ------------- | -------------------------- |
|
|
25
|
+
| `InputTextPrimaryComponent` | `smartpro-input-text-primary` | `text` | `text` |
|
|
26
|
+
| `InputPasswordPrimaryComponent` | `smartpro-input-password-primary` | `password` | `password` |
|
|
27
|
+
| `InputEmailPrimaryComponent` | `smartpro-input-email-primary` | `email` | `email` |
|
|
28
|
+
| `InputNipPrimaryComponent` | `smartpro-input-nip-primary` | `nip` | `text` + NIP validator |
|
|
29
|
+
| `InputPeselPrimaryComponent` | `smartpro-input-pesel-primary` | `pesel` | `text` |
|
|
30
|
+
| `InputIntPrimaryComponent` | `smartpro-input-int-primary` | `int` | `number step="1"` |
|
|
31
|
+
| `InputFloatPrimaryComponent` | `smartpro-input-float-primary` | `float` | `number step="0.01"` |
|
|
32
|
+
| `InputPhoneNumberPrimaryComponent` | `smartpro-input-phone-number-primary` | `phoneNumber` | `tel` |
|
|
33
|
+
| `InputCurrencyPrimaryComponent` | `smartpro-input-currency-primary` | `currency` | `number step="0.01"` |
|
|
34
|
+
| `InputEnumPrimaryComponent` | `smartpro-input-enum-primary` | `enum` | fieldset of checkboxes |
|
|
35
|
+
| `InputLongTextPrimaryComponent` | `smartpro-input-long-text-primary` | `longText` | `ngx-editor` |
|
|
36
|
+
| `InputDatePrimaryComponent` | `smartpro-input-date-primary` | `date` | `date` + trailing calendar |
|
|
37
|
+
|
|
38
|
+
### Phone Number PL (1) — Tailwind Plus "Input with add-on"
|
|
39
|
+
|
|
40
|
+
| Component | Selector | FieldType | Template |
|
|
41
|
+
| ---------------------------------- | --------------------------------------- | --------------- | ------------------------- |
|
|
42
|
+
| `InputPhoneNumberPlAddOnComponent` | `smartpro-input-phone-number-pl-add-on` | `phoneNumberPl` | `+48` prefix + `type=tel` |
|
|
43
|
+
|
|
44
|
+
### Flag (boolean) variants (4)
|
|
45
|
+
|
|
46
|
+
| Component | Selector | Template |
|
|
47
|
+
| ----------------------------------------- | --------------------------------------------- | -------------------------------------- |
|
|
48
|
+
| `InputFlagListDescriptionComponent` | `smartpro-input-flag-list-description` | Checkbox + title + description stacked |
|
|
49
|
+
| `InputFlagListInlineDescriptionComponent` | `smartpro-input-flag-list-inline-description` | Checkbox + inline description |
|
|
50
|
+
| `InputFlagListCheckboxRightComponent` | `smartpro-input-flag-list-checkbox-right` | Title+description left, checkbox right |
|
|
51
|
+
| `InputFlagSimpleListHeadingComponent` | `smartpro-input-flag-simple-list-heading` | Heading above, simple checkbox |
|
|
52
|
+
|
|
53
|
+
### Check (multi-select) variants (4) — same templates as flag
|
|
54
|
+
|
|
55
|
+
| Component | Selector |
|
|
56
|
+
| ------------------------------------------ | ---------------------------------------------- |
|
|
57
|
+
| `InputCheckListDescriptionComponent` | `smartpro-input-check-list-description` |
|
|
58
|
+
| `InputCheckListInlineDescriptionComponent` | `smartpro-input-check-list-inline-description` |
|
|
59
|
+
| `InputCheckListCheckboxRightComponent` | `smartpro-input-check-list-checkbox-right` |
|
|
60
|
+
| `InputCheckSimpleListHeadingComponent` | `smartpro-input-check-simple-list-heading` |
|
|
61
|
+
|
|
62
|
+
### Radio variants (12)
|
|
63
|
+
|
|
64
|
+
| Component | Selector | Template |
|
|
65
|
+
| ------------------------------------------ | ---------------------------------------------- | ------------------------------------------ |
|
|
66
|
+
| `InputRadioSimpleListComponent` | `smartpro-input-radio-simple-list` | Simple vertical list |
|
|
67
|
+
| `InputRadioSimpleInlineListComponent` | `smartpro-input-radio-simple-inline-list` | Horizontal wrap of radios |
|
|
68
|
+
| `InputRadioListDescriptionComponent` | `smartpro-input-radio-list-description` | Radio + title + description stacked |
|
|
69
|
+
| `InputRadioListInlineDescriptionComponent` | `smartpro-input-radio-list-inline-description` | Radio + inline description |
|
|
70
|
+
| `InputRadioListRadioRightComponent` | `smartpro-input-radio-list-radio-right` | Title+description left, radio right |
|
|
71
|
+
| `InputRadioSimpleListRadioRightComponent` | `smartpro-input-radio-simple-list-radio-right` | Title left, radio right (no description) |
|
|
72
|
+
| `InputRadioSimpleTableComponent` | `smartpro-input-radio-simple-table` | `<table>` with header + rows |
|
|
73
|
+
| `InputRadioListDescriptionsPanelComponent` | `smartpro-input-radio-list-descriptions-panel` | Bordered panel per option |
|
|
74
|
+
| `InputRadioColorPickerComponent` | `smartpro-input-radio-color-picker` | Color swatches (uses `item.text` as color) |
|
|
75
|
+
| `InputRadioCardsComponent` | `smartpro-input-radio-cards` | Radios as cards (grid) |
|
|
76
|
+
| `InputRadioSmallCardsComponent` | `smartpro-input-radio-small-cards` | Compact radio cards |
|
|
77
|
+
| `InputRadioStackedCardsComponent` | `smartpro-input-radio-stacked-cards` | Vertically stacked large cards |
|
|
78
|
+
|
|
79
|
+
## Registering Variants
|
|
80
|
+
|
|
81
|
+
End-application registers chosen variants via `INPUT_FIELD_COMPONENTS_TOKEN`:
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
import { INPUT_FIELD_COMPONENTS_TOKEN } from '@smartsoft001/angular';
|
|
85
|
+
import { FieldType } from '@smartsoft001/models';
|
|
86
|
+
import {
|
|
87
|
+
InputTextPrimaryComponent,
|
|
88
|
+
InputEmailPrimaryComponent,
|
|
89
|
+
InputRadioCardsComponent,
|
|
90
|
+
InputFlagListDescriptionComponent,
|
|
91
|
+
} from '@smartsoft001/pro-angular';
|
|
92
|
+
|
|
93
|
+
providers: [
|
|
94
|
+
{
|
|
95
|
+
provide: INPUT_FIELD_COMPONENTS_TOKEN,
|
|
96
|
+
useValue: {
|
|
97
|
+
[FieldType.text]: InputTextPrimaryComponent,
|
|
98
|
+
[FieldType.email]: InputEmailPrimaryComponent,
|
|
99
|
+
[FieldType.radio]: InputRadioCardsComponent,
|
|
100
|
+
[FieldType.flag]: InputFlagListDescriptionComponent,
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
];
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The fork's `<smartpro-input>` will then use the pro variant for each mapped `FieldType`; unmapped types fall back to the fork's default sub-component.
|
|
107
|
+
|
|
108
|
+
## Styling
|
|
109
|
+
|
|
110
|
+
- Tailwind CSS v4 with `smart:` prefix
|
|
111
|
+
- Dark mode via `smart:dark:` (automatic via global storybook theme toolbar)
|
|
112
|
+
- External classes via `cssClass` input (alias `class`), merged into the outer container
|
|
113
|
+
|
|
114
|
+
## File Locations
|
|
115
|
+
|
|
116
|
+
- Variants: `packages/shared/angular/src/lib/components/input/<type>/<variant>/<variant>.component.ts`
|
|
117
|
+
- Index: `packages/shared/angular/src/lib/components/input/index.ts`
|
|
118
|
+
- Stories: `packages/shared/angular/src/lib/components/input/input.component.stories.ts`
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: angular-components-list
|
|
3
|
+
description: List component for @smartsoft001/pro-angular. Five variants (table, stacked, directory, grid-card, grid-contact) driven by `IListOptionsPro` (extends `IListInternalOptions`). Table feature flags (density, sortable, striped, selectable, avatar) compose on the table variant.
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# List Component (Pro)
|
|
8
|
+
|
|
9
|
+
Use `<smartpro-list>` and pick a variant via `variant`. The component reads `IListOptionsPro` (which extends the base `IListInternalOptions` from `@smartsoft001/angular`) and renders entity collections via the configured provider, fields, and model type. The `table` variant accepts a set of feature flags that compose cleanly.
|
|
10
|
+
|
|
11
|
+
## Variants
|
|
12
|
+
|
|
13
|
+
| `variant` (default `'stacked'`) | Selector | Description |
|
|
14
|
+
| ------------------------------- | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
15
|
+
| `'stacked'` | `smartpro-list-stacked` | Vertical list of stacked-text rows, one cell per field. |
|
|
16
|
+
| `'directory'` | `smartpro-list-directory` | Sticky-letter directory grouping items by first letter of the first field. |
|
|
17
|
+
| `'grid-card'` | `smartpro-list-grid-card` | Card-grid showing the first field as a heading and remaining fields as body content. |
|
|
18
|
+
| `'grid-contact'` | `smartpro-list-grid-contact` | Card-grid with a circular avatar placeholder per item. |
|
|
19
|
+
| `'table'` | `smartpro-list-table` | CDK table with composable flags. `density: 'condensed'` shrinks padding and uses `text-xs`; `sortable: true` shows sort affordances on each header; `striped: true` alternates row backgrounds; `selectable: true` prepends a checkbox column; `avatar: true` renders the first column with an avatar placeholder + value. |
|
|
20
|
+
|
|
21
|
+
## API
|
|
22
|
+
|
|
23
|
+
### IListOptionsPro (`list.types.ts`, extends `IListInternalOptions<T>`)
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
type SmartListVariantPro =
|
|
27
|
+
| 'stacked'
|
|
28
|
+
| 'directory'
|
|
29
|
+
| 'grid-card'
|
|
30
|
+
| 'grid-contact'
|
|
31
|
+
| 'table';
|
|
32
|
+
|
|
33
|
+
interface IListOptionsPro<T extends IEntity<string>>
|
|
34
|
+
extends IListInternalOptions<T> {
|
|
35
|
+
density?: 'normal' | 'condensed';
|
|
36
|
+
sortable?: boolean;
|
|
37
|
+
striped?: boolean;
|
|
38
|
+
selectable?: boolean;
|
|
39
|
+
avatar?: boolean;
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Wrapper Inputs
|
|
44
|
+
|
|
45
|
+
| Input | Type | Default | Description |
|
|
46
|
+
| --------- | ---------------------------------------------------------------------- | ----------- | --------------------------------------- |
|
|
47
|
+
| `variant` | `'stacked' \| 'directory' \| 'grid-card' \| 'grid-contact' \| 'table'` | `'stacked'` | Variant family. |
|
|
48
|
+
| `options` | `IListOptionsPro<T>` (required) | — | Provider, type, fields, optional flags. |
|
|
49
|
+
| `class` | `string` | `''` | Extra CSS classes. |
|
|
50
|
+
|
|
51
|
+
## Usage Example
|
|
52
|
+
|
|
53
|
+
```html
|
|
54
|
+
<!-- Stacked list -->
|
|
55
|
+
<smartpro-list [options]="opts"></smartpro-list>
|
|
56
|
+
|
|
57
|
+
<!-- Table -->
|
|
58
|
+
<smartpro-list variant="table" [options]="opts"></smartpro-list>
|
|
59
|
+
|
|
60
|
+
<!-- Selectable + condensed table -->
|
|
61
|
+
<smartpro-list
|
|
62
|
+
variant="table"
|
|
63
|
+
[options]="{ ...opts, selectable: true, density: 'condensed' }"
|
|
64
|
+
></smartpro-list>
|
|
65
|
+
|
|
66
|
+
<!-- Grid card layout -->
|
|
67
|
+
<smartpro-list variant="grid-card" [options]="opts"></smartpro-list>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## File Locations
|
|
71
|
+
|
|
72
|
+
- Wrapper: `packages/shared/angular/src/lib/components/list/list.component.ts`
|
|
73
|
+
- Types: `packages/shared/angular/src/lib/components/list/list.types.ts`
|
|
74
|
+
- Variants: `packages/shared/angular/src/lib/components/list/{stacked,directory,grid-card,grid-contact,table}/<name>.component.ts`
|
|
75
|
+
- Stories: `packages/shared/angular/src/lib/components/list/list.component.stories.ts`
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: angular-components-list-container
|
|
3
|
+
description: List container wrapper for @smartsoft001/pro-angular. Single `default` layout, 4 source variants via `options.variant` plus `fullWidthOnMobile` permutation. Sets `role="list"` and projects `<ng-content>`.
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# List Container Component (Pro)
|
|
8
|
+
|
|
9
|
+
Use `<smartpro-list-container>`. Wraps a list of items with a chosen surface style (dividers / cards / separated cards). Single `default` layout.
|
|
10
|
+
|
|
11
|
+
## Variants
|
|
12
|
+
|
|
13
|
+
| `variant` | Surface |
|
|
14
|
+
| ----------------------------- | ------------------------------------------------------------------------- |
|
|
15
|
+
| `'simple-dividers'` (default) | Flat list with `divide-y` separators. |
|
|
16
|
+
| `'card-dividers'` | White card with shadow, rounded corners, `divide-y` separators inside. |
|
|
17
|
+
| `'separate-cards'` | `space-y-3` between items; the consumer styles each item as its own card. |
|
|
18
|
+
| `'flat-card-dividers'` | Like `card-dividers` but without shadow. |
|
|
19
|
+
|
|
20
|
+
| `fullWidthOnMobile` | Effect |
|
|
21
|
+
| ------------------- | ------------------------------------------------------------------ |
|
|
22
|
+
| `true` | Adds `rounded-none sm:rounded-lg` (only applied to card variants). |
|
|
23
|
+
|
|
24
|
+
## Source variant mapping
|
|
25
|
+
|
|
26
|
+
| Tailwind UI variant | Pro options |
|
|
27
|
+
| ----------------------------- | ---------------------------------------------------------- |
|
|
28
|
+
| Simple dividers | `variant: 'simple-dividers'` |
|
|
29
|
+
| Card dividers | `variant: 'card-dividers'` |
|
|
30
|
+
| Separate cards | `variant: 'separate-cards'` |
|
|
31
|
+
| Flat card dividers | `variant: 'flat-card-dividers'` |
|
|
32
|
+
| Card dividers full-width | `variant: 'card-dividers'`, `fullWidthOnMobile: true` |
|
|
33
|
+
| Flat card dividers full-width | `variant: 'flat-card-dividers'`, `fullWidthOnMobile: true` |
|
|
34
|
+
|
|
35
|
+
## API
|
|
36
|
+
|
|
37
|
+
### Types (`list-container.types.ts`)
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
type IListContainerOptionsPro = IListContainerOptions;
|
|
41
|
+
type SmartListContainerVariantPro = SmartListContainerVariant;
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
`IListContainerOptions` (re-exported): `{ variant?, fullWidthOnMobile? }`.
|
|
45
|
+
|
|
46
|
+
### Wrapper inputs
|
|
47
|
+
|
|
48
|
+
| Input | Type | Default | Description |
|
|
49
|
+
| --------- | --------------------------------------- | ----------- | -------------------------------------- |
|
|
50
|
+
| `options` | `IListContainerOptionsPro \| undefined` | `undefined` | Variant + full-width-on-mobile flag. |
|
|
51
|
+
| `class` | `string` | `''` | Forwarded to the host `[role="list"]`. |
|
|
52
|
+
|
|
53
|
+
### Outputs / Slots
|
|
54
|
+
|
|
55
|
+
No outputs. `<ng-content>` projects list items (consumer marks each item with `role="listitem"`).
|
|
56
|
+
|
|
57
|
+
## Usage examples
|
|
58
|
+
|
|
59
|
+
```html
|
|
60
|
+
<!-- Simple dividers (default) -->
|
|
61
|
+
<smartpro-list-container>
|
|
62
|
+
<div role="listitem" class="smart:py-4">…</div>
|
|
63
|
+
<div role="listitem" class="smart:py-4">…</div>
|
|
64
|
+
</smartpro-list-container>
|
|
65
|
+
|
|
66
|
+
<!-- Card dividers with mobile full-bleed -->
|
|
67
|
+
<smartpro-list-container
|
|
68
|
+
[options]="{ variant: 'card-dividers', fullWidthOnMobile: true }"
|
|
69
|
+
>
|
|
70
|
+
<div role="listitem" class="smart:px-4 smart:py-4 smart:sm:px-6">…</div>
|
|
71
|
+
</smartpro-list-container>
|
|
72
|
+
|
|
73
|
+
<!-- Separate cards — consumer styles each item -->
|
|
74
|
+
<smartpro-list-container [options]="{ variant: 'separate-cards' }">
|
|
75
|
+
<div
|
|
76
|
+
role="listitem"
|
|
77
|
+
class="smart:bg-white smart:shadow smart:rounded-lg smart:p-4"
|
|
78
|
+
>
|
|
79
|
+
…
|
|
80
|
+
</div>
|
|
81
|
+
<div
|
|
82
|
+
role="listitem"
|
|
83
|
+
class="smart:bg-white smart:shadow smart:rounded-lg smart:p-4"
|
|
84
|
+
>
|
|
85
|
+
…
|
|
86
|
+
</div>
|
|
87
|
+
</smartpro-list-container>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Accessibility
|
|
91
|
+
|
|
92
|
+
- Host has `role="list"`. Consumers set `role="listitem"` on each child.
|
|
93
|
+
|
|
94
|
+
## File Locations
|
|
95
|
+
|
|
96
|
+
- Wrapper: `packages/shared/angular/src/lib/components/list-container/list-container.component.ts`
|
|
97
|
+
- Types: `packages/shared/angular/src/lib/components/list-container/list-container.types.ts`
|
|
98
|
+
- Classes utility: `packages/shared/angular/src/lib/components/list-container/list-container-classes.util.ts`
|
|
99
|
+
- Layout: `packages/shared/angular/src/lib/components/list-container/default/default.component.ts`
|
|
100
|
+
- Stories: `packages/shared/angular/src/lib/components/list-container/list-container.component.stories.ts`
|
|
101
|
+
- Module entry: `packages/shared/angular/src/lib/components/components.module.ts` (`LIST_CONTAINER_COMPONENTS`)
|
|
102
|
+
|
|
103
|
+
## Peer dependency
|
|
104
|
+
|
|
105
|
+
- `@smartsoft001/angular@^2.123.0` — provides `ListContainerBaseComponent`, `IListContainerOptions`, `SmartListContainerVariant`.
|
|
106
|
+
- No `@tailwindplus/elements` dep required.
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: angular-components-media-object
|
|
3
|
+
description: Media-object layout (image + body) for @smartsoft001/pro-angular. Single `default` layout, 8 source variants via composable options (alignment, position, responsive, nested, wide).
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Media Object Component (Pro)
|
|
8
|
+
|
|
9
|
+
Use `<smartpro-media-object>`. Lays out an image on one side and projected body content on the other.
|
|
10
|
+
|
|
11
|
+
## Variants matrix
|
|
12
|
+
|
|
13
|
+
| Option | Values |
|
|
14
|
+
| ------------ | -------------------------------------------------------------------------------------- |
|
|
15
|
+
| `alignment` | `'top'` (default) / `'center'` / `'bottom'` / `'stretched'` |
|
|
16
|
+
| `position` | `'left'` (default — media on left) / `'right'` (media on right via `flex-row-reverse`) |
|
|
17
|
+
| `responsive` | `true` — stacked on mobile, side-by-side at `sm+` (`flex-col sm:flex-row`) |
|
|
18
|
+
| `nested` | `true` — adds `pl-8` for indented sub-items |
|
|
19
|
+
| `wide` | `true` — wider media slot (`sm:w-48`) + larger image (`size-32`) |
|
|
20
|
+
|
|
21
|
+
## Source variant mapping
|
|
22
|
+
|
|
23
|
+
| Tailwind UI variant | Pro options |
|
|
24
|
+
| ------------------- | -------------------------------- |
|
|
25
|
+
| Basic | (defaults) |
|
|
26
|
+
| Center aligned | `alignment: 'center'` |
|
|
27
|
+
| Bottom aligned | `alignment: 'bottom'` |
|
|
28
|
+
| Stretched | `alignment: 'stretched'` |
|
|
29
|
+
| Media on right | `position: 'right'` |
|
|
30
|
+
| Basic responsive | `responsive: true` |
|
|
31
|
+
| Wide responsive | `responsive: true`, `wide: true` |
|
|
32
|
+
| Nested | `nested: true` |
|
|
33
|
+
|
|
34
|
+
## API
|
|
35
|
+
|
|
36
|
+
### Types (`media-object.types.ts`)
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
type SmartMediaObjectAlignment = 'top' | 'center' | 'bottom' | 'stretched';
|
|
40
|
+
type SmartMediaObjectPosition = 'left' | 'right';
|
|
41
|
+
|
|
42
|
+
type IMediaObjectOptionsPro = IMediaObjectOptions;
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
`IMediaObjectOptions` (re-exported): `{ alignment?, position?, responsive?, nested?, wide? }`.
|
|
46
|
+
|
|
47
|
+
### Wrapper inputs
|
|
48
|
+
|
|
49
|
+
| Input | Type | Default | Description |
|
|
50
|
+
| ---------- | ------------------------------------- | ----------- | -------------------------------------------------- |
|
|
51
|
+
| `mediaUrl` | `string` (required) | — | Image URL. |
|
|
52
|
+
| `mediaAlt` | `string` (required) | — | Alt text. Pass empty string for decorative images. |
|
|
53
|
+
| `options` | `IMediaObjectOptionsPro \| undefined` | `undefined` | Alignment, position, responsive, nested, wide. |
|
|
54
|
+
| `class` | `string` | `''` | Forwarded to the inner layout host. |
|
|
55
|
+
|
|
56
|
+
### Outputs / Slots
|
|
57
|
+
|
|
58
|
+
No outputs. `<ng-content>` projects the body content.
|
|
59
|
+
|
|
60
|
+
## Usage examples
|
|
61
|
+
|
|
62
|
+
```html
|
|
63
|
+
<!-- Basic -->
|
|
64
|
+
<smartpro-media-object mediaUrl="/img/a.png" mediaAlt="A">
|
|
65
|
+
<h4>Title</h4>
|
|
66
|
+
<p>Description…</p>
|
|
67
|
+
</smartpro-media-object>
|
|
68
|
+
|
|
69
|
+
<!-- Center aligned -->
|
|
70
|
+
<smartpro-media-object
|
|
71
|
+
mediaUrl="/img/a.png"
|
|
72
|
+
mediaAlt="A"
|
|
73
|
+
[options]="{ alignment: 'center' }"
|
|
74
|
+
>
|
|
75
|
+
<h4>Title</h4>
|
|
76
|
+
<p>Description…</p>
|
|
77
|
+
</smartpro-media-object>
|
|
78
|
+
|
|
79
|
+
<!-- Media on right -->
|
|
80
|
+
<smartpro-media-object
|
|
81
|
+
mediaUrl="/img/a.png"
|
|
82
|
+
mediaAlt="A"
|
|
83
|
+
[options]="{ position: 'right' }"
|
|
84
|
+
>
|
|
85
|
+
<h4>Title</h4>
|
|
86
|
+
<p>Description…</p>
|
|
87
|
+
</smartpro-media-object>
|
|
88
|
+
|
|
89
|
+
<!-- Responsive (stack on mobile) -->
|
|
90
|
+
<smartpro-media-object
|
|
91
|
+
mediaUrl="/img/a.png"
|
|
92
|
+
mediaAlt="A"
|
|
93
|
+
[options]="{ responsive: true }"
|
|
94
|
+
>
|
|
95
|
+
<h4>Title</h4>
|
|
96
|
+
</smartpro-media-object>
|
|
97
|
+
|
|
98
|
+
<!-- Wide responsive -->
|
|
99
|
+
<smartpro-media-object
|
|
100
|
+
mediaUrl="/img/a.png"
|
|
101
|
+
mediaAlt="A"
|
|
102
|
+
[options]="{ responsive: true, wide: true }"
|
|
103
|
+
>
|
|
104
|
+
<h4>Title</h4>
|
|
105
|
+
</smartpro-media-object>
|
|
106
|
+
|
|
107
|
+
<!-- Nested -->
|
|
108
|
+
<smartpro-media-object
|
|
109
|
+
mediaUrl="/img/a.png"
|
|
110
|
+
mediaAlt="A"
|
|
111
|
+
[options]="{ nested: true }"
|
|
112
|
+
>
|
|
113
|
+
<h4>Reply</h4>
|
|
114
|
+
</smartpro-media-object>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Accessibility
|
|
118
|
+
|
|
119
|
+
- `<img>` uses the required `alt` attribute. Pass an empty string `mediaAlt=""` to declare the image as decorative — this still satisfies the required input.
|
|
120
|
+
|
|
121
|
+
## File Locations
|
|
122
|
+
|
|
123
|
+
- Wrapper: `packages/shared/angular/src/lib/components/media-object/media-object.component.ts`
|
|
124
|
+
- Types: `packages/shared/angular/src/lib/components/media-object/media-object.types.ts`
|
|
125
|
+
- Classes utility: `packages/shared/angular/src/lib/components/media-object/media-object-classes.util.ts`
|
|
126
|
+
- Layout: `packages/shared/angular/src/lib/components/media-object/default/default.component.ts`
|
|
127
|
+
- Stories: `packages/shared/angular/src/lib/components/media-object/media-object.component.stories.ts`
|
|
128
|
+
- Module entry: `packages/shared/angular/src/lib/components/components.module.ts` (`MEDIA_OBJECT_COMPONENTS`)
|
|
129
|
+
|
|
130
|
+
## Peer dependency
|
|
131
|
+
|
|
132
|
+
- `@smartsoft001/angular@^2.123.0` — provides `MediaObjectBaseComponent`, `IMediaObjectOptions`.
|
|
133
|
+
- No `@tailwindplus/elements` dep required.
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: angular-components-modal
|
|
3
|
+
description: Modal component for @smartsoft001/pro-angular. Two layouts (centered, alert), auto-detected from options. Covers Centered / Wide / Alert / Left-aligned buttons / With dismiss / Gray footer source variants via composable options. Uses @tailwindplus/elements <el-dialog>.
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Modal Component (Pro)
|
|
8
|
+
|
|
9
|
+
Use `<smartpro-modal>`. The wrapper picks one of two child layouts based on the `layout` input or the shape of `options`. Slot custom body via `<ng-content>` between the description and the actions footer.
|
|
10
|
+
|
|
11
|
+
## Layouts
|
|
12
|
+
|
|
13
|
+
| `layout` value (auto-detected) | Selector | Description |
|
|
14
|
+
| ------------------------------ | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
|
15
|
+
| `'centered'` (default) | `smartpro-modal-centered` | Title + description + projected body + action footer. `width`, `actionsAlignment`, `withDismiss`, `footerStylePro` modulate appearance. |
|
|
16
|
+
| `'alert'` | `smartpro-modal-alert` | Icon-led layout (`grid` with circular icon left, body right) for confirmation/destructive prompts. Uses `role="alertdialog"`. |
|
|
17
|
+
|
|
18
|
+
Auto-detection: `options.iconName` or `options.iconStyle` → `alert`; otherwise `centered`. Pass `layout` explicitly to force.
|
|
19
|
+
|
|
20
|
+
## Source variant mapping
|
|
21
|
+
|
|
22
|
+
| Tailwind UI variant | Pro options |
|
|
23
|
+
| ---------------------- | ----------------------------------------------------------------- |
|
|
24
|
+
| Centered single action | (defaults) |
|
|
25
|
+
| Wide | `width: 'wide'` |
|
|
26
|
+
| Alert | `iconStyle: 'warning' \| 'danger' \| ...` (+ optional `iconName`) |
|
|
27
|
+
| Left-aligned buttons | `actionsAlignment: 'left'` |
|
|
28
|
+
| With dismiss | `withDismiss: true` |
|
|
29
|
+
| Gray footer | `footerStylePro: 'gray'` |
|
|
30
|
+
|
|
31
|
+
## API
|
|
32
|
+
|
|
33
|
+
### Types (`modal.types.ts`)
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
type SmartModalLayoutPro = 'centered' | 'alert';
|
|
37
|
+
type SmartModalWidth = 'default' | 'wide';
|
|
38
|
+
type SmartModalActionsAlignment = 'right' | 'left';
|
|
39
|
+
type SmartModalFooterStylePro = 'default' | 'gray';
|
|
40
|
+
type SmartModalIconStyle = 'info' | 'success' | 'warning' | 'danger';
|
|
41
|
+
|
|
42
|
+
interface IModalOptionsPro extends IModalOptions {
|
|
43
|
+
layout?: SmartModalLayoutPro;
|
|
44
|
+
width?: SmartModalWidth;
|
|
45
|
+
actionsAlignment?: SmartModalActionsAlignment;
|
|
46
|
+
footerStylePro?: SmartModalFooterStylePro;
|
|
47
|
+
iconName?: string; // SVG path `d` attribute (alert only)
|
|
48
|
+
iconStyle?: SmartModalIconStyle;
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
`IModalOptions` (re-exported from `@smartsoft001/angular`) provides `withDismiss`, `ariaLabel`, plus the original `variant`/`footerStyle` types (kept for typing compatibility — prefer the `Pro` variants above).
|
|
53
|
+
|
|
54
|
+
`IModalAction` (re-exported): `{ id, label, variant?: 'primary' | 'secondary' | 'danger' }`.
|
|
55
|
+
|
|
56
|
+
### Wrapper inputs
|
|
57
|
+
|
|
58
|
+
| Input | Type | Default | Description |
|
|
59
|
+
| ------------- | ---------------------------------- | ----------- | -------------------------------------------------------------------- |
|
|
60
|
+
| `open` | `boolean` (model — two-way) | `false` | Bind with `[(open)]`. When `false`, layouts render nothing. |
|
|
61
|
+
| `title` | `string \| undefined` | `undefined` | Optional heading; sets `aria-labelledby` when present. |
|
|
62
|
+
| `description` | `string \| undefined` | `undefined` | Optional muted paragraph under the title. |
|
|
63
|
+
| `actions` | `IModalAction[]` | `[]` | Footer buttons; click emits `actionClick`. |
|
|
64
|
+
| `layout` | `SmartModalLayoutPro \| undefined` | `undefined` | Force a layout; otherwise auto-detected from `options`. |
|
|
65
|
+
| `options` | `IModalOptionsPro \| undefined` | `undefined` | All pro options. |
|
|
66
|
+
| `class` | `string` | `''` | Forwarded to the host of the chosen layout (lands on `<el-dialog>`). |
|
|
67
|
+
|
|
68
|
+
### Outputs
|
|
69
|
+
|
|
70
|
+
| Output | Payload | When |
|
|
71
|
+
| ------------- | ---------------------- | ----------------------------------------------------------------------- |
|
|
72
|
+
| `actionClick` | `{ actionId: string }` | A footer button is clicked. Consumers decide whether to call `close()`. |
|
|
73
|
+
| `closed` | `void` | The dismiss `×` button is clicked (when `withDismiss: true`). |
|
|
74
|
+
|
|
75
|
+
### Slots
|
|
76
|
+
|
|
77
|
+
`<ng-content>` projects custom body between `description` and the footer.
|
|
78
|
+
|
|
79
|
+
## Usage examples
|
|
80
|
+
|
|
81
|
+
```html
|
|
82
|
+
<!-- Centered single action -->
|
|
83
|
+
<smartpro-modal
|
|
84
|
+
[(open)]="confirmOpen"
|
|
85
|
+
title="Deactivate account"
|
|
86
|
+
description="Are you sure you want to deactivate your account?"
|
|
87
|
+
[actions]="[{ id: 'deactivate', label: 'Deactivate', variant: 'primary' }]"
|
|
88
|
+
(actionClick)="onAction($event.actionId)"
|
|
89
|
+
/>
|
|
90
|
+
|
|
91
|
+
<!-- Wide with custom body -->
|
|
92
|
+
<smartpro-modal
|
|
93
|
+
[(open)]="editOpen"
|
|
94
|
+
title="Edit project"
|
|
95
|
+
[actions]="[
|
|
96
|
+
{ id: 'save', label: 'Save', variant: 'primary' },
|
|
97
|
+
{ id: 'cancel', label: 'Cancel', variant: 'secondary' }
|
|
98
|
+
]"
|
|
99
|
+
[options]="{ width: 'wide' }"
|
|
100
|
+
>
|
|
101
|
+
<form>
|
|
102
|
+
<!-- custom fields -->
|
|
103
|
+
</form>
|
|
104
|
+
</smartpro-modal>
|
|
105
|
+
|
|
106
|
+
<!-- Alert -->
|
|
107
|
+
<smartpro-modal
|
|
108
|
+
[(open)]="deleteOpen"
|
|
109
|
+
title="Delete account"
|
|
110
|
+
description="This action cannot be undone."
|
|
111
|
+
[actions]="[
|
|
112
|
+
{ id: 'delete', label: 'Delete', variant: 'danger' },
|
|
113
|
+
{ id: 'cancel', label: 'Cancel', variant: 'secondary' }
|
|
114
|
+
]"
|
|
115
|
+
[options]="{ iconStyle: 'danger' }"
|
|
116
|
+
/>
|
|
117
|
+
|
|
118
|
+
<!-- With dismiss -->
|
|
119
|
+
<smartpro-modal
|
|
120
|
+
[(open)]="successOpen"
|
|
121
|
+
title="Payment successful"
|
|
122
|
+
description="Your payment has been processed."
|
|
123
|
+
[actions]="[{ id: 'ok', label: 'Go to dashboard', variant: 'primary' }]"
|
|
124
|
+
[options]="{ withDismiss: true }"
|
|
125
|
+
(closed)="onDismiss()"
|
|
126
|
+
/>
|
|
127
|
+
|
|
128
|
+
<!-- Gray footer + left-aligned actions -->
|
|
129
|
+
<smartpro-modal
|
|
130
|
+
[(open)]="settingsOpen"
|
|
131
|
+
title="Settings"
|
|
132
|
+
[actions]="[
|
|
133
|
+
{ id: 'save', label: 'Save', variant: 'primary' },
|
|
134
|
+
{ id: 'cancel', label: 'Cancel', variant: 'secondary' }
|
|
135
|
+
]"
|
|
136
|
+
[options]="{ footerStylePro: 'gray', actionsAlignment: 'left' }"
|
|
137
|
+
/>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Accessibility
|
|
141
|
+
|
|
142
|
+
- Centered: `role="dialog"` + `aria-modal="true"`; `aria-labelledby` when `title` is set, otherwise `aria-label` from `options.ariaLabel`.
|
|
143
|
+
- Alert: `role="alertdialog"` for screen-reader urgency semantics.
|
|
144
|
+
- Focus trap + ESC handling come from `<el-dialog>` (@tailwindplus/elements).
|
|
145
|
+
- Dismiss button has `aria-label="Close"`.
|
|
146
|
+
|
|
147
|
+
## File Locations
|
|
148
|
+
|
|
149
|
+
- Wrapper: `packages/shared/angular/src/lib/components/modal/modal.component.ts`
|
|
150
|
+
- Types: `packages/shared/angular/src/lib/components/modal/modal.types.ts`
|
|
151
|
+
- Classes utility: `packages/shared/angular/src/lib/components/modal/modal-classes.util.ts`
|
|
152
|
+
- Layouts: `packages/shared/angular/src/lib/components/modal/{centered,alert}/<name>.component.ts`
|
|
153
|
+
- Stories: `packages/shared/angular/src/lib/components/modal/modal.component.stories.ts`
|
|
154
|
+
- Module entry: `packages/shared/angular/src/lib/components/components.module.ts` (`MODAL_COMPONENTS`)
|
|
155
|
+
|
|
156
|
+
## Peer dependency
|
|
157
|
+
|
|
158
|
+
- `@smartsoft001/angular@^2.123.0` — provides `ModalBaseComponent`, `IModalAction`, `IModalOptions`.
|
|
159
|
+
- `@tailwindplus/elements@^1.0.0` — runtime element bundle for `<el-dialog>`.
|