@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,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: angular-components-breadcrumbs
|
|
3
|
+
description: Breadcrumbs component for @smartsoft001/pro-angular. Two layouts (bar, simple) with options for contained card style or chevron/slash/arrow separator.
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Breadcrumbs Component (Pro)
|
|
8
|
+
|
|
9
|
+
Renders an `<ol>` of breadcrumb items as links and emits `itemClick`. Use the main wrapper `<smartpro-breadcrumbs>` and pick a layout via `options.layout`.
|
|
10
|
+
|
|
11
|
+
## Layouts
|
|
12
|
+
|
|
13
|
+
| `options.layout` | Selector | Description |
|
|
14
|
+
| -------------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------ |
|
|
15
|
+
| `'simple'` (default) | `smartpro-breadcrumbs-simple` | Inline trail with a separator icon between items. Separator is configurable: `chevron` (default) or `slash`. |
|
|
16
|
+
| `'bar'` | `smartpro-breadcrumbs-bar` | Horizontal bar layout. Set `contained: true` for a card-style box; otherwise the bar spans the page width. |
|
|
17
|
+
|
|
18
|
+
The first item renders as an icon-only home link (use `iconTpl` + `srOnlyLabel`). Subsequent items render as text links separated by the layout's separator.
|
|
19
|
+
|
|
20
|
+
## API
|
|
21
|
+
|
|
22
|
+
### IBreadcrumbsOptionsPro (`breadcrumbs.types.ts`)
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
type SmartBreadcrumbsLayoutPro = 'bar' | 'simple';
|
|
26
|
+
|
|
27
|
+
interface IBreadcrumbsOptionsPro {
|
|
28
|
+
layout?: SmartBreadcrumbsLayoutPro; // 'simple' (default) | 'bar'
|
|
29
|
+
contained?: boolean; // bar: true => contained card, false => full-width
|
|
30
|
+
separator?: SmartBreadcrumbsSeparator; // simple: 'chevron' (default) | 'slash' | 'arrow'
|
|
31
|
+
ariaLabel?: string;
|
|
32
|
+
items: IBreadcrumbItem[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface IBreadcrumbItem {
|
|
36
|
+
id: string;
|
|
37
|
+
label?: string;
|
|
38
|
+
href?: string;
|
|
39
|
+
iconTpl?: TemplateRef<unknown>;
|
|
40
|
+
srOnlyLabel?: string;
|
|
41
|
+
current?: boolean;
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Outputs
|
|
46
|
+
|
|
47
|
+
- `itemClick: { itemId: string }` — emitted on link click. The wrapper calls `event.preventDefault()` automatically when an item has no `href`.
|
|
48
|
+
|
|
49
|
+
## Usage
|
|
50
|
+
|
|
51
|
+
### Simple with chevrons (default)
|
|
52
|
+
|
|
53
|
+
```html
|
|
54
|
+
<smartpro-breadcrumbs
|
|
55
|
+
[options]="{
|
|
56
|
+
items: [
|
|
57
|
+
{ id: 'home', srOnlyLabel: 'Home', href: '/', iconTpl: homeIcon },
|
|
58
|
+
{ id: 'projects', label: 'Projects', href: '/projects' },
|
|
59
|
+
{ id: 'nero', label: 'Project Nero', href: '/projects/nero', current: true }
|
|
60
|
+
]
|
|
61
|
+
}"
|
|
62
|
+
(itemClick)="onItem($event)"
|
|
63
|
+
/>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Simple with slashes
|
|
67
|
+
|
|
68
|
+
```html
|
|
69
|
+
<smartpro-breadcrumbs
|
|
70
|
+
[options]="{ layout: 'simple', separator: 'slash', items }"
|
|
71
|
+
/>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Full-width bar
|
|
75
|
+
|
|
76
|
+
```html
|
|
77
|
+
<smartpro-breadcrumbs [options]="{ layout: 'bar', items }" />
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Contained (card-style bar)
|
|
81
|
+
|
|
82
|
+
```html
|
|
83
|
+
<smartpro-breadcrumbs [options]="{ layout: 'bar', contained: true, items }" />
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## File Locations
|
|
87
|
+
|
|
88
|
+
- Wrapper: `packages/shared/angular/src/lib/components/breadcrumbs/breadcrumbs.component.ts`
|
|
89
|
+
- Types: `packages/shared/angular/src/lib/components/breadcrumbs/breadcrumbs.types.ts`
|
|
90
|
+
- Layouts: `packages/shared/angular/src/lib/components/breadcrumbs/{bar,simple}/<name>.component.ts`
|
|
91
|
+
- Stories: `packages/shared/angular/src/lib/components/breadcrumbs/breadcrumbs.component.stories.ts`
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: angular-components-button
|
|
3
|
+
description: Button component for @smartsoft001/pro-angular. Three shapes (standard, rounded, circular) with optional leading/trailing icon position, configurable variant/color (primary/secondary/soft × 22 Tailwind colors), dark/light mode, loading and confirm states.
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Button Component (Pro)
|
|
8
|
+
|
|
9
|
+
Use the wrapper `<smartpro-button>` and pick a shape via the `shape` input. Color style (primary / secondary / soft), color palette (22 Tailwind colors), icon position, and confirm/loading states are driven by `IButtonOptions`. All shapes extend `ButtonBaseComponent` from `@smartsoft001/angular` and support dark/light mode.
|
|
10
|
+
|
|
11
|
+
## Shapes
|
|
12
|
+
|
|
13
|
+
| `shape` value (default `standard`) | Selector | Description |
|
|
14
|
+
| ---------------------------------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
15
|
+
| `'standard'` | `smartpro-button-standard` | Rectangular button. Optional icon slot via `<span icon>...</span>`; position controlled by `options.iconPosition` (`'leading'` or `'trailing'`). |
|
|
16
|
+
| `'rounded'` | `smartpro-button-rounded` | Pill shape (`rounded-full`). |
|
|
17
|
+
| `'circular'` | `smartpro-button-circular` | Circular icon-only button (no text, no confirm mode). |
|
|
18
|
+
|
|
19
|
+
## Color & Variant Configuration
|
|
20
|
+
|
|
21
|
+
`options.variant` picks the color style:
|
|
22
|
+
|
|
23
|
+
- **`primary`** — colored background (`smart:bg-{color}-600`), white text — default
|
|
24
|
+
- **`secondary`** — white background, gray border (`smart:inset-ring`), gray text
|
|
25
|
+
- **`soft`** — light colored background (`smart:bg-{color}-50`), colored text
|
|
26
|
+
|
|
27
|
+
`options.color` picks one of 22 Tailwind palettes (default: `indigo`): `slate`, `gray`, `zinc`, `neutral`, `stone`, `red`, `orange`, `amber`, `yellow`, `lime`, `green`, `emerald`, `teal`, `cyan`, `sky`, `blue`, `indigo`, `violet`, `purple`, `fuchsia`, `pink`, `rose`.
|
|
28
|
+
|
|
29
|
+
Color resolution uses `COMPONENT_COLORS` from `@smartsoft001/angular`.
|
|
30
|
+
|
|
31
|
+
## Icon Position
|
|
32
|
+
|
|
33
|
+
For shape `'standard'`, project an icon via the `[icon]` content attribute and set `options.iconPosition`:
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<smartpro-button [options]="{ click: onClick, iconPosition: 'leading' }">
|
|
37
|
+
<span icon><svg>...</svg></span>
|
|
38
|
+
Button text
|
|
39
|
+
</smartpro-button>
|
|
40
|
+
|
|
41
|
+
<smartpro-button [options]="{ click: onClick, iconPosition: 'trailing' }">
|
|
42
|
+
Button text
|
|
43
|
+
<span icon><svg>...</svg></span>
|
|
44
|
+
</smartpro-button>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
When `iconPosition` is unset, `<smartpro-button>` renders text only and ignores any `[icon]` slot. Icon position is not used by `'rounded'` or `'circular'`.
|
|
48
|
+
|
|
49
|
+
## Confirm Mode
|
|
50
|
+
|
|
51
|
+
When `options.confirm === true`, clicking the button swaps in a `cancel`/`confirm` button pair. Both respect `options.color`: confirm uses `COMPONENT_COLORS[color].primary`, cancel uses `.secondary`. Available for `standard` and `rounded`. `circular` has no confirm mode.
|
|
52
|
+
|
|
53
|
+
## Loading
|
|
54
|
+
|
|
55
|
+
Pass a `Signal<boolean>` as `options.loading`. When true, the button content is replaced by a spinner and the button becomes disabled.
|
|
56
|
+
|
|
57
|
+
## API
|
|
58
|
+
|
|
59
|
+
### IButtonOptions (re-exported from `@smartsoft001/angular`)
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
interface IButtonOptions {
|
|
63
|
+
click: () => void;
|
|
64
|
+
type?: 'submit' | 'button';
|
|
65
|
+
confirm?: boolean;
|
|
66
|
+
loading?: Signal<boolean>;
|
|
67
|
+
variant?: 'primary' | 'secondary' | 'soft';
|
|
68
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
69
|
+
color?: SmartColor; // 22 Tailwind colors, default 'indigo'
|
|
70
|
+
iconPosition?: 'leading' | 'trailing'; // standard shape only
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Wrapper Inputs
|
|
75
|
+
|
|
76
|
+
| Input | Type | Default | Description |
|
|
77
|
+
| ---------- | --------------------------------------- | ------------ | -------------------- |
|
|
78
|
+
| `shape` | `'standard' \| 'rounded' \| 'circular'` | `'standard'` | Visual shape |
|
|
79
|
+
| `options` | `IButtonOptions` | required | Button configuration |
|
|
80
|
+
| `disabled` | `boolean` | `false` | Disabled state |
|
|
81
|
+
| `class` | `string` | `''` | External CSS classes |
|
|
82
|
+
|
|
83
|
+
## Usage Examples
|
|
84
|
+
|
|
85
|
+
```html
|
|
86
|
+
<!-- Standard primary -->
|
|
87
|
+
<smartpro-button [options]="{ click: onClick, variant: 'primary', size: 'md' }">
|
|
88
|
+
Save
|
|
89
|
+
</smartpro-button>
|
|
90
|
+
|
|
91
|
+
<!-- Standard secondary -->
|
|
92
|
+
<smartpro-button [options]="{ click: onClick, variant: 'secondary' }">
|
|
93
|
+
Cancel
|
|
94
|
+
</smartpro-button>
|
|
95
|
+
|
|
96
|
+
<!-- Standard soft with custom color -->
|
|
97
|
+
<smartpro-button
|
|
98
|
+
[options]="{ click: onClick, variant: 'soft', color: 'green' }"
|
|
99
|
+
>
|
|
100
|
+
Active
|
|
101
|
+
</smartpro-button>
|
|
102
|
+
|
|
103
|
+
<!-- Rounded -->
|
|
104
|
+
<smartpro-button
|
|
105
|
+
shape="rounded"
|
|
106
|
+
[options]="{ click: onClick, variant: 'soft', color: 'purple' }"
|
|
107
|
+
>
|
|
108
|
+
Rounded Soft
|
|
109
|
+
</smartpro-button>
|
|
110
|
+
|
|
111
|
+
<!-- Circular icon-only -->
|
|
112
|
+
<smartpro-button shape="circular" [options]="{ click: onClick }">
|
|
113
|
+
<svg>...</svg>
|
|
114
|
+
</smartpro-button>
|
|
115
|
+
|
|
116
|
+
<!-- Leading icon -->
|
|
117
|
+
<smartpro-button [options]="{ click: onClick, iconPosition: 'leading' }">
|
|
118
|
+
<span icon><svg>...</svg></span>
|
|
119
|
+
Button text
|
|
120
|
+
</smartpro-button>
|
|
121
|
+
|
|
122
|
+
<!-- Trailing icon -->
|
|
123
|
+
<smartpro-button [options]="{ click: onClick, iconPosition: 'trailing' }">
|
|
124
|
+
Button text
|
|
125
|
+
<span icon><svg>...</svg></span>
|
|
126
|
+
</smartpro-button>
|
|
127
|
+
|
|
128
|
+
<!-- Confirm mode — confirm button respects options.color -->
|
|
129
|
+
<smartpro-button [options]="{ click: onDelete, confirm: true, color: 'red' }">
|
|
130
|
+
Delete
|
|
131
|
+
</smartpro-button>
|
|
132
|
+
|
|
133
|
+
<!-- Loading -->
|
|
134
|
+
<smartpro-button [options]="{ click: onClick, loading: loadingSignal }">
|
|
135
|
+
Save
|
|
136
|
+
</smartpro-button>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## File Locations
|
|
140
|
+
|
|
141
|
+
- Wrapper: `packages/shared/angular/src/lib/components/button/button.component.ts`
|
|
142
|
+
- Standard: `packages/shared/angular/src/lib/components/button/standard/standard.component.ts`
|
|
143
|
+
- Rounded: `packages/shared/angular/src/lib/components/button/rounded/rounded.component.ts`
|
|
144
|
+
- Circular: `packages/shared/angular/src/lib/components/button/circular/circular.component.ts`
|
|
145
|
+
- Shared class utilities: `packages/shared/angular/src/lib/components/button/button-classes.util.ts`
|
|
146
|
+
- Stories: `packages/shared/angular/src/lib/components/button/button.component.stories.ts`
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: angular-components-button-group
|
|
3
|
+
description: Segmented button group for @smartsoft001/pro-angular. Two layouts (default, with-stat), 5 source variants via composable options (iconOnly, withDropdown, selectionMode). Single + multi-select.
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Button Group Component (Pro)
|
|
8
|
+
|
|
9
|
+
Use `<smartpro-button-group>`. Buttons render side-by-side with shared borders. The wrapper picks one of two child layouts based on `layout` input or whether any button has a `count`.
|
|
10
|
+
|
|
11
|
+
## Layouts
|
|
12
|
+
|
|
13
|
+
| `layout` (auto-detected) | Selector | Description |
|
|
14
|
+
| ------------------------ | --------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
|
15
|
+
| `'default'` (default) | `smartpro-button-group-default` | Flat segmented buttons. Covers Basic / Icon-only / With dropdown / With checkbox select. |
|
|
16
|
+
| `'with-stat'` | `smartpro-button-group-with-stat` | Same as default plus a count pill inside each button. Triggered automatically when any `button.count != null`. |
|
|
17
|
+
|
|
18
|
+
## Source variant mapping
|
|
19
|
+
|
|
20
|
+
| Tailwind UI variant | Pro options |
|
|
21
|
+
| -------------------- | ------------------------------------------------------------------------------------ |
|
|
22
|
+
| Basic | (defaults) |
|
|
23
|
+
| Icon-only | `iconOnly: true` + `button.icon` (SVG path d) |
|
|
24
|
+
| With stat | `button.count: number` (auto-selects `with-stat` layout) |
|
|
25
|
+
| With dropdown | `withDropdown: true` (trailing chevron emits `buttonClick` with id `'__dropdown__'`) |
|
|
26
|
+
| With checkbox select | `selectionMode: 'multi'` (toggles internal Set per click) |
|
|
27
|
+
|
|
28
|
+
## API
|
|
29
|
+
|
|
30
|
+
### Types (`button-group.types.ts`)
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
type SmartButtonGroupLayoutPro = 'default' | 'with-stat';
|
|
34
|
+
type SmartButtonGroupSelectionMode = 'single' | 'multi';
|
|
35
|
+
|
|
36
|
+
interface IButtonGroupOptionsPro extends IButtonGroupOptions {
|
|
37
|
+
layout?: SmartButtonGroupLayoutPro;
|
|
38
|
+
iconOnly?: boolean;
|
|
39
|
+
withDropdown?: boolean;
|
|
40
|
+
selectionMode?: SmartButtonGroupSelectionMode;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const DROPDOWN_BUTTON_ID = '__dropdown__';
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`IButtonGroupButton` (re-exported from `@smartsoft001/angular`): `{ id, label?, icon?, disabled?, count? }`.
|
|
47
|
+
|
|
48
|
+
### Wrapper inputs
|
|
49
|
+
|
|
50
|
+
| Input | Type | Default | Description |
|
|
51
|
+
| ---------- | ---------------------------------------- | ----------- | ---------------------------------------------------------------- |
|
|
52
|
+
| `buttons` | `IButtonGroupButton[]` | `[]` | Segments to render. |
|
|
53
|
+
| `selected` | `string \| undefined` (model — two-way) | `undefined` | Bind with `[(selected)]`. Drives single-select state. |
|
|
54
|
+
| `layout` | `SmartButtonGroupLayoutPro \| undefined` | `undefined` | Force a layout; otherwise auto-detected from `buttons[*].count`. |
|
|
55
|
+
| `options` | `IButtonGroupOptionsPro \| undefined` | `undefined` | Icon-only, dropdown chevron, selection mode. |
|
|
56
|
+
| `class` | `string` | `''` | Forwarded to the host `[role="group"]` element. |
|
|
57
|
+
|
|
58
|
+
### Outputs
|
|
59
|
+
|
|
60
|
+
| Output | Payload | When |
|
|
61
|
+
| ------------- | ---------------------- | ------------------------------------------------------------------------------------------ |
|
|
62
|
+
| `buttonClick` | `{ buttonId: string }` | Multi-select: every click. Single-select: only the dropdown chevron (id `'__dropdown__'`). |
|
|
63
|
+
|
|
64
|
+
## Usage examples
|
|
65
|
+
|
|
66
|
+
```html
|
|
67
|
+
<!-- Basic single-select -->
|
|
68
|
+
<smartpro-button-group [buttons]="periods" [(selected)]="period" />
|
|
69
|
+
|
|
70
|
+
<!-- Icon-only -->
|
|
71
|
+
<smartpro-button-group
|
|
72
|
+
[buttons]="alignButtons"
|
|
73
|
+
[(selected)]="alignment"
|
|
74
|
+
[options]="{ iconOnly: true }"
|
|
75
|
+
/>
|
|
76
|
+
|
|
77
|
+
<!-- With stat (counts) -->
|
|
78
|
+
<smartpro-button-group
|
|
79
|
+
[buttons]="[
|
|
80
|
+
{ id: 'open', label: 'Open', count: 12 },
|
|
81
|
+
{ id: 'resolved', label: 'Resolved', count: 3 }
|
|
82
|
+
]"
|
|
83
|
+
[(selected)]="status"
|
|
84
|
+
/>
|
|
85
|
+
|
|
86
|
+
<!-- With dropdown chevron -->
|
|
87
|
+
<smartpro-button-group
|
|
88
|
+
[buttons]="periods"
|
|
89
|
+
[(selected)]="period"
|
|
90
|
+
[options]="{ withDropdown: true }"
|
|
91
|
+
(buttonClick)="$event.buttonId === '__dropdown__' && openMenu()"
|
|
92
|
+
/>
|
|
93
|
+
|
|
94
|
+
<!-- Multi-select -->
|
|
95
|
+
<smartpro-button-group
|
|
96
|
+
[buttons]="filters"
|
|
97
|
+
[options]="{ selectionMode: 'multi' }"
|
|
98
|
+
(buttonClick)="toggleFilter($event.buttonId)"
|
|
99
|
+
/>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Accessibility
|
|
103
|
+
|
|
104
|
+
- Outer container uses `role="group"`.
|
|
105
|
+
- Each button has `aria-pressed` bound to its selection state.
|
|
106
|
+
- Disabled buttons are skipped on click and visually muted (opacity 50).
|
|
107
|
+
- Dropdown chevron button has `aria-label="More options"`.
|
|
108
|
+
|
|
109
|
+
## File Locations
|
|
110
|
+
|
|
111
|
+
- Wrapper: `packages/shared/angular/src/lib/components/button-group/button-group.component.ts`
|
|
112
|
+
- Types: `packages/shared/angular/src/lib/components/button-group/button-group.types.ts`
|
|
113
|
+
- Classes utility: `packages/shared/angular/src/lib/components/button-group/button-group-classes.util.ts`
|
|
114
|
+
- Layouts: `packages/shared/angular/src/lib/components/button-group/{default,with-stat}/<name>.component.ts`
|
|
115
|
+
- Stories: `packages/shared/angular/src/lib/components/button-group/button-group.component.stories.ts`
|
|
116
|
+
- Module entry: `packages/shared/angular/src/lib/components/components.module.ts` (`BUTTON_GROUP_COMPONENTS`)
|
|
117
|
+
|
|
118
|
+
## Peer dependency
|
|
119
|
+
|
|
120
|
+
- `@smartsoft001/angular@^2.123.0` — provides `ButtonGroupBaseComponent`, `IButtonGroupButton`, `IButtonGroupOptions`.
|
|
121
|
+
- No `@tailwindplus/elements` dep required.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: angular-components-calendar
|
|
3
|
+
description: Calendar components — 8 Tailwind UI calendar variants for @smartsoft001/pro-angular extending CalendarBaseComponent. Bind `referenceDate`, `events`, `value` to render month/week/day/year/sidebar/double/borderless views.
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Calendar Components (Pro)
|
|
8
|
+
|
|
9
|
+
Eight standalone calendar variants extending `CalendarBaseComponent` from `@smartsoft001/angular`. Each binds the same input surface (`referenceDate`, `events`, `value`, optional `options`) and renders a different layout. `CUSTOM_ELEMENTS_SCHEMA` is set on each so `el-dropdown` / `el-menu` from `@tailwindplus/elements` work verbatim.
|
|
10
|
+
|
|
11
|
+
## Variants
|
|
12
|
+
|
|
13
|
+
| Component | Selector | Layout |
|
|
14
|
+
| --------------------------------------- | ------------------------------------------- | --------------------------------------------------------------------- |
|
|
15
|
+
| `CalendarSmallWithMeetingsComponent` | `smartpro-calendar-small-with-meetings` | Compact month grid + sidebar list of upcoming meetings |
|
|
16
|
+
| `CalendarMonthViewComponent` | `smartpro-calendar-month-view` | Full month grid (7×N) with events per day |
|
|
17
|
+
| `CalendarWeekViewComponent` | `smartpro-calendar-week-view` | 7-day × 24-hour grid with absolutely positioned events |
|
|
18
|
+
| `CalendarDayViewComponent` | `smartpro-calendar-day-view` | Single-day hour list with event details |
|
|
19
|
+
| `CalendarYearViewComponent` | `smartpro-calendar-year-view` | 12 mini-month grids |
|
|
20
|
+
| `CalendarDoubleComponent` | `smartpro-calendar-double` | Two adjacent month grids side-by-side + upcoming events list |
|
|
21
|
+
| `CalendarBorderlessStackedComponent` | `smartpro-calendar-borderless-stacked` | Borderless single month + schedule list stacked below |
|
|
22
|
+
| `CalendarBorderlessSideBySideComponent` | `smartpro-calendar-borderless-side-by-side` | Borderless single month + schedule list side-by-side (md:grid-cols-2) |
|
|
23
|
+
|
|
24
|
+
## API
|
|
25
|
+
|
|
26
|
+
### CalendarBaseComponent inputs (re-exported from `@smartsoft001/angular`)
|
|
27
|
+
|
|
28
|
+
| Input | Type | Notes |
|
|
29
|
+
| --------------- | ------------------------------- | -------------------------------------------------------------------- |
|
|
30
|
+
| `referenceDate` | `Date \| undefined` | The visible month/week/day/year anchor |
|
|
31
|
+
| `value` | `Date \| null` (model) | Currently-selected day, two-way bindable via `[(value)]` |
|
|
32
|
+
| `events` | `ICalendarEvent[]` | All events; the base provides `eventsForDay(d)` |
|
|
33
|
+
| `options` | `ICalendarOptions \| undefined` | `view`, `monthsCount`, `weekStart`, `showToolbar`, content templates |
|
|
34
|
+
| `class` | `string` | Extra css classes via `[class]` |
|
|
35
|
+
|
|
36
|
+
### ICalendarEvent
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
interface ICalendarEvent {
|
|
40
|
+
id: string | number;
|
|
41
|
+
start: Date;
|
|
42
|
+
end?: Date;
|
|
43
|
+
title?: string;
|
|
44
|
+
meta?: Record<string, unknown>;
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### ICalendarOptions
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
interface ICalendarOptions {
|
|
52
|
+
view?: 'month' | 'week' | 'day' | 'year';
|
|
53
|
+
monthsCount?: 1 | 2 | 12;
|
|
54
|
+
weekStart?: 0 | 1;
|
|
55
|
+
showToolbar?: boolean;
|
|
56
|
+
toolbarActionsTpl?: TemplateRef<unknown>;
|
|
57
|
+
eventListTpl?: TemplateRef<unknown>;
|
|
58
|
+
sidePanelTpl?: TemplateRef<unknown>;
|
|
59
|
+
dayCellTpl?: TemplateRef<unknown>;
|
|
60
|
+
eventTpl?: TemplateRef<unknown>;
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Usage
|
|
65
|
+
|
|
66
|
+
```html
|
|
67
|
+
<smartpro-calendar-month-view
|
|
68
|
+
[referenceDate]="reference"
|
|
69
|
+
[events]="events"
|
|
70
|
+
[(value)]="selected"
|
|
71
|
+
/>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## File Locations
|
|
75
|
+
|
|
76
|
+
- Variants: `packages/shared/angular/src/lib/components/calendar/<variant>/<variant>.component.ts`
|
|
77
|
+
- Helpers: `calendar-classes.util.ts`, `calendar-grid.util.ts`
|
|
78
|
+
- Stories: `packages/shared/angular/src/lib/components/calendar/calendar.component.stories.ts`
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: angular-components-card
|
|
3
|
+
description: Card component for @smartsoft001/pro-angular. Two layouts (basic, well) with optional `edgeToEdge` (drop mobile rounding) and `onGray` (well only, darker background). Header / body / footer sections via template refs and `hasHeader` / `hasFooter` flags; gray section tints via `ICardOptions.grayBody` / `grayFooter`.
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Card Component (Pro)
|
|
8
|
+
|
|
9
|
+
Use `<smartpro-card>` and pick a layout via the `variant` input (`'basic'` default, or `'well'`). Surface tweaks are driven by `ICardOptionsPro` flags (`edgeToEdge`, `onGray`); section visibility is controlled by `hasHeader` / `hasFooter` plus the `headerTpl` / `bodyTpl` / `footerTpl` template inputs. Section tinting (`grayBody`, `grayFooter`) is driven by the peer `ICardOptions`.
|
|
10
|
+
|
|
11
|
+
## Layouts
|
|
12
|
+
|
|
13
|
+
| `variant` (default `'basic'`) | Selector | Description |
|
|
14
|
+
| ----------------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
15
|
+
| `'basic'` | `smartpro-card-basic` | White card with rounded corners and a subtle shadow. Set `options.edgeToEdge: true` to drop the rounding on mobile (`sm:rounded-lg` only). |
|
|
16
|
+
| `'well'` | `smartpro-card-well` | Soft gray card without shadow. Set `options.onGray: true` to switch the body to `bg-gray-200` (use against a gray app background). Set `options.edgeToEdge: true` to drop the rounding on mobile. |
|
|
17
|
+
|
|
18
|
+
## Section Behaviors
|
|
19
|
+
|
|
20
|
+
| Desired behavior | How to achieve it |
|
|
21
|
+
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
22
|
+
| Show optional header section | `[hasHeader]="true"` + `[headerTpl]="..."` |
|
|
23
|
+
| Show optional footer section | `[hasFooter]="true"` + `[footerTpl]="..."` |
|
|
24
|
+
| Tint body gray | `[options]="{ grayBody: true }"` |
|
|
25
|
+
| Tint footer gray | `[options]="{ grayFooter: true }"` (combine with `hasFooter=true`) |
|
|
26
|
+
| `divide-y` between sections | Automatic whenever `hasHeader` or `hasFooter` is true AND neither gray tint is set (handled by `CardBaseComponent.sharedContainerClasses`) |
|
|
27
|
+
|
|
28
|
+
## API
|
|
29
|
+
|
|
30
|
+
### ICardOptionsPro (`card.types.ts`, extends `ICardOptions`)
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
type SmartCardLayoutPro = 'basic' | 'well';
|
|
34
|
+
|
|
35
|
+
interface ICardOptionsPro {
|
|
36
|
+
title?: string;
|
|
37
|
+
buttons?: Array<IIconButtonOptions>;
|
|
38
|
+
grayBody?: boolean;
|
|
39
|
+
grayFooter?: boolean;
|
|
40
|
+
/** Drop rounded corners on mobile (only `sm:rounded-lg`). Applies to both layouts. */
|
|
41
|
+
edgeToEdge?: boolean;
|
|
42
|
+
/** Well layout only — switch body bg from `gray-50` to `gray-200`. */
|
|
43
|
+
onGray?: boolean;
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Wrapper Inputs
|
|
48
|
+
|
|
49
|
+
| Input | Type | Required | Description |
|
|
50
|
+
| ----------- | ---------------------- | -------- | ------------------------------------------ |
|
|
51
|
+
| `variant` | `'basic' \| 'well'` | no | Card layout. Default `'basic'`. |
|
|
52
|
+
| `options` | `ICardOptionsPro` | no | Title, gray tints, `edgeToEdge`, `onGray`. |
|
|
53
|
+
| `hasHeader` | `boolean` | no | Toggle optional header slot. |
|
|
54
|
+
| `hasFooter` | `boolean` | no | Toggle optional footer slot. |
|
|
55
|
+
| `class` | `string` | no | Extra CSS classes on the container. |
|
|
56
|
+
| `headerTpl` | `TemplateRef<unknown>` | no | Header template. |
|
|
57
|
+
| `bodyTpl` | `TemplateRef<unknown>` | yes | Body template. |
|
|
58
|
+
| `footerTpl` | `TemplateRef<unknown>` | no | Footer template. |
|
|
59
|
+
|
|
60
|
+
## Usage Examples
|
|
61
|
+
|
|
62
|
+
```html
|
|
63
|
+
<ng-template #header>...</ng-template>
|
|
64
|
+
<ng-template #body>...</ng-template>
|
|
65
|
+
<ng-template #footer>...</ng-template>
|
|
66
|
+
|
|
67
|
+
<!-- Basic card -->
|
|
68
|
+
<smartpro-card [bodyTpl]="body" />
|
|
69
|
+
|
|
70
|
+
<!-- Edge-to-edge basic on mobile -->
|
|
71
|
+
<smartpro-card [options]="{ edgeToEdge: true }" [bodyTpl]="body" />
|
|
72
|
+
|
|
73
|
+
<!-- Basic with header -->
|
|
74
|
+
<smartpro-card [hasHeader]="true" [headerTpl]="header" [bodyTpl]="body" />
|
|
75
|
+
|
|
76
|
+
<!-- Basic with header + footer + gray footer -->
|
|
77
|
+
<smartpro-card
|
|
78
|
+
[options]="{ grayFooter: true }"
|
|
79
|
+
[hasHeader]="true"
|
|
80
|
+
[hasFooter]="true"
|
|
81
|
+
[headerTpl]="header"
|
|
82
|
+
[bodyTpl]="body"
|
|
83
|
+
[footerTpl]="footer"
|
|
84
|
+
/>
|
|
85
|
+
|
|
86
|
+
<!-- Well -->
|
|
87
|
+
<smartpro-card variant="well" [bodyTpl]="body" />
|
|
88
|
+
|
|
89
|
+
<!-- Well on darker gray (use against a gray app background) -->
|
|
90
|
+
<smartpro-card variant="well" [options]="{ onGray: true }" [bodyTpl]="body" />
|
|
91
|
+
|
|
92
|
+
<!-- Well edge-to-edge -->
|
|
93
|
+
<smartpro-card
|
|
94
|
+
variant="well"
|
|
95
|
+
[options]="{ edgeToEdge: true }"
|
|
96
|
+
[bodyTpl]="body"
|
|
97
|
+
/>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Dark/Light Mode
|
|
101
|
+
|
|
102
|
+
Every layout uses the `smart:` Tailwind prefix with paired `smart:dark:*` classes. Storybook exposes a global theme toolbar (`light` / `dark`) defined in `.storybook/preview.ts`.
|
|
103
|
+
|
|
104
|
+
## File Locations
|
|
105
|
+
|
|
106
|
+
- Wrapper: `packages/shared/angular/src/lib/components/card/card.component.ts`
|
|
107
|
+
- Types: `packages/shared/angular/src/lib/components/card/card.types.ts`
|
|
108
|
+
- Layouts: `packages/shared/angular/src/lib/components/card/{basic,well}/<name>.component.ts`
|
|
109
|
+
- Stories: `packages/shared/angular/src/lib/components/card/card.component.stories.ts`
|
|
110
|
+
- Module registration: `packages/shared/angular/src/lib/components/components.module.ts` (`CARD_COMPONENTS`)
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: angular-components-card-heading
|
|
3
|
+
description: Card heading component for @smartsoft001/pro-angular. One default variant whose layout adapts to the slots provided in `options` (title, description, avatar, meta, actions) plus an optional `compact` flag for the dropdown-style header.
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Card Heading Component (Pro)
|
|
8
|
+
|
|
9
|
+
Use `<smartpro-card-heading>`. The component reads `ICardHeadingOptionsPro` and chooses one of three layout shapes automatically based on which template slots are provided:
|
|
10
|
+
|
|
11
|
+
| Provided options | Resulting layout |
|
|
12
|
+
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
13
|
+
| `title` (no description, actions, or avatar) | Simple bordered header — just the title. |
|
|
14
|
+
| `title` + `description` (no actions) | Title + description stacked under each other inside a bordered header. |
|
|
15
|
+
| `title` + `actionsTpl` (with or without `description`) | Bordered row — title (and optional description) on the left, action button(s) on the right. |
|
|
16
|
+
| `title` + `avatarTpl` (with or without `actionsTpl`) | Bordered row — avatar + title + optional `metaTpl` block on the left, optional actions on the right. |
|
|
17
|
+
| `compact: true` (with `avatarTpl`, `metaTpl`, `actionsTpl`) | Borderless flat row — avatar + title (`text-sm`) + meta on the left, actions on the right. Used for cards where the heading sits above lighter content (e.g., the “avatar + meta + dropdown” pattern). |
|
|
18
|
+
|
|
19
|
+
`CUSTOM_ELEMENTS_SCHEMA` is set on the default variant so consumers can drop `el-dropdown` / `el-menu` from `@tailwindplus/elements` directly into `actionsTpl`.
|
|
20
|
+
|
|
21
|
+
## API
|
|
22
|
+
|
|
23
|
+
### ICardHeadingOptionsPro (`card-heading.types.ts`, extends `ICardHeadingOptions`)
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
interface ICardHeadingOptionsPro {
|
|
27
|
+
title?: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
avatarTpl?: TemplateRef<unknown>;
|
|
30
|
+
actionsTpl?: TemplateRef<unknown>;
|
|
31
|
+
metaTpl?: TemplateRef<unknown>;
|
|
32
|
+
/**
|
|
33
|
+
* Compact header — no border-bottom, smaller title, flat `flex space-x-3`
|
|
34
|
+
* row. Use when the heading sits inside a card without its own bordered
|
|
35
|
+
* top section (e.g., dropdown-style avatar + meta header).
|
|
36
|
+
*/
|
|
37
|
+
compact?: boolean;
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Wrapper Inputs
|
|
42
|
+
|
|
43
|
+
| Input | Type | Default | Description |
|
|
44
|
+
| --------- | ------------------------------------- | ----------- | -------------------------------------------------- |
|
|
45
|
+
| `options` | `ICardHeadingOptionsPro \| undefined` | `undefined` | Title, description, slot template refs, `compact`. |
|
|
46
|
+
| `class` | `string` | `''` | Extra CSS classes appended to the outer container. |
|
|
47
|
+
|
|
48
|
+
## Usage Examples
|
|
49
|
+
|
|
50
|
+
```html
|
|
51
|
+
<ng-template #avatar>
|
|
52
|
+
<div class="smart:size-12 smart:rounded-full smart:bg-gray-200"></div>
|
|
53
|
+
</ng-template>
|
|
54
|
+
<ng-template #meta>
|
|
55
|
+
<span class="smart:text-sm smart:text-gray-500">Updated 3 days ago</span>
|
|
56
|
+
</ng-template>
|
|
57
|
+
<ng-template #actions>
|
|
58
|
+
<button
|
|
59
|
+
class="smart:rounded-md smart:bg-indigo-600 smart:px-3 smart:py-2 smart:text-white"
|
|
60
|
+
>
|
|
61
|
+
Create new job
|
|
62
|
+
</button>
|
|
63
|
+
</ng-template>
|
|
64
|
+
|
|
65
|
+
<!-- Just a title -->
|
|
66
|
+
<smartpro-card-heading [options]="{ title: 'Job Postings' }" />
|
|
67
|
+
|
|
68
|
+
<!-- Title + description -->
|
|
69
|
+
<smartpro-card-heading
|
|
70
|
+
[options]="{ title: 'Job Postings', description: 'Lorem ipsum...' }"
|
|
71
|
+
/>
|
|
72
|
+
|
|
73
|
+
<!-- Title + description + action -->
|
|
74
|
+
<smartpro-card-heading
|
|
75
|
+
[options]="{
|
|
76
|
+
title: 'Job Postings',
|
|
77
|
+
description: 'Lorem ipsum...',
|
|
78
|
+
actionsTpl: actions
|
|
79
|
+
}"
|
|
80
|
+
/>
|
|
81
|
+
|
|
82
|
+
<!-- Avatar + title + actions -->
|
|
83
|
+
<smartpro-card-heading
|
|
84
|
+
[options]="{ title: 'Project Nero', avatarTpl: avatar, actionsTpl: actions }"
|
|
85
|
+
/>
|
|
86
|
+
|
|
87
|
+
<!-- Compact dropdown-style header -->
|
|
88
|
+
<smartpro-card-heading
|
|
89
|
+
[options]="{
|
|
90
|
+
title: 'Project Nero',
|
|
91
|
+
avatarTpl: avatar,
|
|
92
|
+
metaTpl: meta,
|
|
93
|
+
actionsTpl: actions,
|
|
94
|
+
compact: true
|
|
95
|
+
}"
|
|
96
|
+
/>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## File Locations
|
|
100
|
+
|
|
101
|
+
- Wrapper: `packages/shared/angular/src/lib/components/card-heading/card-heading.component.ts`
|
|
102
|
+
- Types: `packages/shared/angular/src/lib/components/card-heading/card-heading.types.ts`
|
|
103
|
+
- Layout: `packages/shared/angular/src/lib/components/card-heading/default/default.component.ts`
|
|
104
|
+
- Shared class utilities: `packages/shared/angular/src/lib/components/card-heading/card-heading-classes.util.ts`
|
|
105
|
+
- Stories: `packages/shared/angular/src/lib/components/card-heading/card-heading.component.stories.ts`
|