@smartsoft001/claude-plugins 2.193.0 → 2.195.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.
Files changed (149) hide show
  1. package/.claude-plugin/marketplace.json +14 -3
  2. package/README.md +19 -4
  3. package/package.json +3 -3
  4. package/plugins/smart-angular/.claude-plugin/plugin.json +6 -0
  5. package/plugins/{smart → smart-angular}/skills/angular-components-button/SKILL.md +1 -1
  6. package/plugins/{smart → smart-angular}/skills/angular-components-container/SKILL.md +8 -8
  7. package/plugins/{smart → smart-angular}/skills/angular-components-drawer/SKILL.md +5 -9
  8. package/plugins/{smart → smart-angular}/skills/angular-components-list-container/SKILL.md +2 -5
  9. package/plugins/{smart → smart-angular}/skills/angular-components-media-object/SKILL.md +1 -1
  10. package/plugins/{smart → smart-angular}/skills/angular-components-modal/SKILL.md +1 -1
  11. package/plugins/{smart → smart-angular}/skills/scaffold-nx-workspace/SKILL.md +1 -1
  12. package/plugins/{smart → smart-angular}/skills/scaffold-nx-workspace/references/base-claude-config.md +13 -9
  13. package/plugins/{smart → smart-angular}/skills/scaffold-nx-workspace/references/patch-delta.md +1 -1
  14. package/plugins/{smart → smart-core}/.claude-plugin/README.md +31 -16
  15. package/plugins/{smart → smart-core}/.claude-plugin/merge-permissions.js +7 -6
  16. package/plugins/smart-core/.claude-plugin/plugin.json +5 -0
  17. package/plugins/{smart → smart-core}/.claude-plugin/settings.template.json +2 -2
  18. package/plugins/{smart → smart-core}/hooks/README.md +1 -1
  19. package/plugins/{smart → smart-core}/skills/audit-log/SKILL.md +2 -2
  20. package/plugins/{smart → smart-core}/skills/format-code/SKILL.md +1 -1
  21. package/plugins/smart-react/.claude-plugin/plugin.json +6 -0
  22. package/plugins/smart-react/agents/react-components.md +260 -0
  23. package/plugins/smart-react/skills/react-components-accordion/SKILL.md +204 -0
  24. package/plugins/smart-react/skills/react-components-action-panel/SKILL.md +191 -0
  25. package/plugins/smart-react/skills/react-components-alert/SKILL.md +244 -0
  26. package/plugins/smart-react/skills/react-components-app/SKILL.md +236 -0
  27. package/plugins/smart-react/skills/react-components-avatar/SKILL.md +176 -0
  28. package/plugins/smart-react/skills/react-components-badge/SKILL.md +165 -0
  29. package/plugins/smart-react/skills/react-components-breadcrumbs/SKILL.md +183 -0
  30. package/plugins/smart-react/skills/react-components-button/SKILL.md +239 -0
  31. package/plugins/smart-react/skills/react-components-button-group/SKILL.md +187 -0
  32. package/plugins/smart-react/skills/react-components-calendar/SKILL.md +270 -0
  33. package/plugins/smart-react/skills/react-components-card/SKILL.md +201 -0
  34. package/plugins/smart-react/skills/react-components-card-heading/SKILL.md +133 -0
  35. package/plugins/smart-react/skills/react-components-command-palette/SKILL.md +228 -0
  36. package/plugins/smart-react/skills/react-components-container/SKILL.md +134 -0
  37. package/plugins/smart-react/skills/react-components-date-edit/SKILL.md +186 -0
  38. package/plugins/smart-react/skills/react-components-date-range/SKILL.md +259 -0
  39. package/plugins/smart-react/skills/react-components-description-list/SKILL.md +144 -0
  40. package/plugins/smart-react/skills/react-components-detail/SKILL.md +272 -0
  41. package/plugins/smart-react/skills/react-components-details/SKILL.md +250 -0
  42. package/plugins/smart-react/skills/react-components-divider/SKILL.md +128 -0
  43. package/plugins/smart-react/skills/react-components-drawer/SKILL.md +165 -0
  44. package/plugins/smart-react/skills/react-components-dropdown/SKILL.md +194 -0
  45. package/plugins/smart-react/skills/react-components-empty-state/SKILL.md +202 -0
  46. package/plugins/smart-react/skills/react-components-export/SKILL.md +120 -0
  47. package/plugins/smart-react/skills/react-components-feed/SKILL.md +171 -0
  48. package/plugins/smart-react/skills/react-components-form/SKILL.md +319 -0
  49. package/plugins/smart-react/skills/react-components-grid-list/SKILL.md +172 -0
  50. package/plugins/smart-react/skills/react-components-icon/SKILL.md +117 -0
  51. package/plugins/smart-react/skills/react-components-import/SKILL.md +113 -0
  52. package/plugins/smart-react/skills/react-components-info/SKILL.md +147 -0
  53. package/plugins/smart-react/skills/react-components-input/SKILL.md +406 -0
  54. package/plugins/smart-react/skills/react-components-list/SKILL.md +384 -0
  55. package/plugins/smart-react/skills/react-components-list-container/SKILL.md +105 -0
  56. package/plugins/smart-react/skills/react-components-loader/SKILL.md +126 -0
  57. package/plugins/smart-react/skills/react-components-media-object/SKILL.md +130 -0
  58. package/plugins/smart-react/skills/react-components-modal/SKILL.md +266 -0
  59. package/plugins/smart-react/skills/react-components-multi-column-layout/SKILL.md +155 -0
  60. package/plugins/smart-react/skills/react-components-navbar/SKILL.md +211 -0
  61. package/plugins/smart-react/skills/react-components-notification/SKILL.md +223 -0
  62. package/plugins/smart-react/skills/react-components-overlays/SKILL.md +182 -0
  63. package/plugins/smart-react/skills/react-components-page/SKILL.md +224 -0
  64. package/plugins/smart-react/skills/react-components-page-heading/SKILL.md +155 -0
  65. package/plugins/smart-react/skills/react-components-paging/SKILL.md +183 -0
  66. package/plugins/smart-react/skills/react-components-password-strength/SKILL.md +149 -0
  67. package/plugins/smart-react/skills/react-components-progress-bars/SKILL.md +195 -0
  68. package/plugins/smart-react/skills/react-components-searchbar/SKILL.md +150 -0
  69. package/plugins/smart-react/skills/react-components-section-heading/SKILL.md +138 -0
  70. package/plugins/smart-react/skills/react-components-select-menu/SKILL.md +168 -0
  71. package/plugins/smart-react/skills/react-components-sidebar-layout/SKILL.md +155 -0
  72. package/plugins/smart-react/skills/react-components-sidebar-navigation/SKILL.md +277 -0
  73. package/plugins/smart-react/skills/react-components-sign-in-form/SKILL.md +228 -0
  74. package/plugins/smart-react/skills/react-components-stacked-layout/SKILL.md +146 -0
  75. package/plugins/smart-react/skills/react-components-stacked-list/SKILL.md +156 -0
  76. package/plugins/smart-react/skills/react-components-stats/SKILL.md +149 -0
  77. package/plugins/smart-react/skills/react-components-table/SKILL.md +222 -0
  78. package/plugins/smart-react/skills/react-components-tabs/SKILL.md +189 -0
  79. package/plugins/smart-react/skills/react-components-textarea/SKILL.md +202 -0
  80. package/plugins/smart-react/skills/react-components-toggle/SKILL.md +157 -0
  81. package/plugins/smart-react/skills/react-components-vertical-navigation/SKILL.md +212 -0
  82. package/plugins/smart-react/skills/react-forms/SKILL.md +272 -0
  83. package/plugins/smart-react/skills/react-provider/SKILL.md +368 -0
  84. package/plugins/smart-react/skills/smart-crud-react/SKILL.md +410 -0
  85. package/plugins/smart/.claude-plugin/plugin.json +0 -5
  86. /package/plugins/{smart/agents/angular-components/AGENT.md → smart-angular/agents/angular-components.md} +0 -0
  87. /package/plugins/{smart → smart-angular}/skills/angular-components-accordion/SKILL.md +0 -0
  88. /package/plugins/{smart → smart-angular}/skills/angular-components-action-panel/SKILL.md +0 -0
  89. /package/plugins/{smart → smart-angular}/skills/angular-components-alert/SKILL.md +0 -0
  90. /package/plugins/{smart → smart-angular}/skills/angular-components-avatar/SKILL.md +0 -0
  91. /package/plugins/{smart → smart-angular}/skills/angular-components-badge/SKILL.md +0 -0
  92. /package/plugins/{smart → smart-angular}/skills/angular-components-breadcrumbs/SKILL.md +0 -0
  93. /package/plugins/{smart → smart-angular}/skills/angular-components-button-group/SKILL.md +0 -0
  94. /package/plugins/{smart → smart-angular}/skills/angular-components-calendar/SKILL.md +0 -0
  95. /package/plugins/{smart → smart-angular}/skills/angular-components-card/SKILL.md +0 -0
  96. /package/plugins/{smart → smart-angular}/skills/angular-components-card-heading/SKILL.md +0 -0
  97. /package/plugins/{smart → smart-angular}/skills/angular-components-command-palette/SKILL.md +0 -0
  98. /package/plugins/{smart → smart-angular}/skills/angular-components-date-edit/SKILL.md +0 -0
  99. /package/plugins/{smart → smart-angular}/skills/angular-components-date-range/SKILL.md +0 -0
  100. /package/plugins/{smart → smart-angular}/skills/angular-components-description-list/SKILL.md +0 -0
  101. /package/plugins/{smart → smart-angular}/skills/angular-components-detail/SKILL.md +0 -0
  102. /package/plugins/{smart → smart-angular}/skills/angular-components-details/SKILL.md +0 -0
  103. /package/plugins/{smart → smart-angular}/skills/angular-components-divider/SKILL.md +0 -0
  104. /package/plugins/{smart → smart-angular}/skills/angular-components-dropdown/SKILL.md +0 -0
  105. /package/plugins/{smart → smart-angular}/skills/angular-components-empty-state/SKILL.md +0 -0
  106. /package/plugins/{smart → smart-angular}/skills/angular-components-feed/SKILL.md +0 -0
  107. /package/plugins/{smart → smart-angular}/skills/angular-components-form/SKILL.md +0 -0
  108. /package/plugins/{smart → smart-angular}/skills/angular-components-grid-list/SKILL.md +0 -0
  109. /package/plugins/{smart → smart-angular}/skills/angular-components-icon/SKILL.md +0 -0
  110. /package/plugins/{smart → smart-angular}/skills/angular-components-info/SKILL.md +0 -0
  111. /package/plugins/{smart → smart-angular}/skills/angular-components-input/SKILL.md +0 -0
  112. /package/plugins/{smart → smart-angular}/skills/angular-components-list/SKILL.md +0 -0
  113. /package/plugins/{smart → smart-angular}/skills/angular-components-multi-column-layout/SKILL.md +0 -0
  114. /package/plugins/{smart → smart-angular}/skills/angular-components-navbar/SKILL.md +0 -0
  115. /package/plugins/{smart → smart-angular}/skills/angular-components-notification/SKILL.md +0 -0
  116. /package/plugins/{smart → smart-angular}/skills/angular-components-page/SKILL.md +0 -0
  117. /package/plugins/{smart → smart-angular}/skills/angular-components-page-heading/SKILL.md +0 -0
  118. /package/plugins/{smart → smart-angular}/skills/angular-components-paging/SKILL.md +0 -0
  119. /package/plugins/{smart → smart-angular}/skills/angular-components-password-strength/SKILL.md +0 -0
  120. /package/plugins/{smart → smart-angular}/skills/angular-components-progress-bars/SKILL.md +0 -0
  121. /package/plugins/{smart → smart-angular}/skills/angular-components-searchbar/SKILL.md +0 -0
  122. /package/plugins/{smart → smart-angular}/skills/angular-components-section-heading/SKILL.md +0 -0
  123. /package/plugins/{smart → smart-angular}/skills/angular-components-select-menu/SKILL.md +0 -0
  124. /package/plugins/{smart → smart-angular}/skills/angular-components-sidebar-layout/SKILL.md +0 -0
  125. /package/plugins/{smart → smart-angular}/skills/angular-components-sidebar-navigation/SKILL.md +0 -0
  126. /package/plugins/{smart → smart-angular}/skills/angular-components-sign-in-form/SKILL.md +0 -0
  127. /package/plugins/{smart → smart-angular}/skills/angular-components-stacked-layout/SKILL.md +0 -0
  128. /package/plugins/{smart → smart-angular}/skills/angular-components-stacked-list/SKILL.md +0 -0
  129. /package/plugins/{smart → smart-angular}/skills/angular-components-stats/SKILL.md +0 -0
  130. /package/plugins/{smart → smart-angular}/skills/angular-components-table/SKILL.md +0 -0
  131. /package/plugins/{smart → smart-angular}/skills/angular-components-tabs/SKILL.md +0 -0
  132. /package/plugins/{smart → smart-angular}/skills/angular-components-textarea/SKILL.md +0 -0
  133. /package/plugins/{smart → smart-angular}/skills/angular-components-toggle/SKILL.md +0 -0
  134. /package/plugins/{smart → smart-angular}/skills/angular-components-vertical-navigation/SKILL.md +0 -0
  135. /package/plugins/{smart → smart-angular}/skills/scaffold-nx-workspace/references/base-app.md +0 -0
  136. /package/plugins/{smart → smart-angular}/skills/scaffold-nx-workspace/references/base-shared-lib.md +0 -0
  137. /package/plugins/{smart → smart-angular}/skills/scaffold-nx-workspace/references/version-resolution.md +0 -0
  138. /package/plugins/{smart → smart-angular}/skills/scaffold-nx-workspace/scripts/derive-prefix.sh +0 -0
  139. /package/plugins/{smart → smart-angular}/skills/scaffold-nx-workspace/scripts/verify-scaffold.sh +0 -0
  140. /package/plugins/{smart → smart-angular}/skills/smart-crud/SKILL.md +0 -0
  141. /package/plugins/{smart → smart-core}/hooks/CONFIG.md +0 -0
  142. /package/plugins/{smart → smart-core}/hooks/audit_logger.py +0 -0
  143. /package/plugins/{smart → smart-core}/hooks/auto_format.sh +0 -0
  144. /package/plugins/{smart → smart-core}/hooks/hooks.json +0 -0
  145. /package/plugins/{smart → smart-core}/hooks/safety_validator.py +0 -0
  146. /package/plugins/{smart → smart-core}/hooks/sensitive_file_blocker.py +0 -0
  147. /package/plugins/{smart → smart-core}/hooks/skill_validator.py +0 -0
  148. /package/plugins/{smart → smart-core}/skills/project-conventions/SKILL.md +0 -0
  149. /package/plugins/{smart → smart-core}/skills/safety-check/SKILL.md +0 -0
@@ -0,0 +1,224 @@
1
+ ---
2
+ name: react-components-page
3
+ description: SmartPage React component API (@smartsoft001/react) — screen layout with a translated title, back button, search box and end buttons above the body (children or bodyTpl), page variants resolved by registry key ('page', 'page:<variant>'), SmartPagePreset with breadcrumbs/meta/stats/filters/sidebar slots, PAGE_PRESET_VARIANT_COMPONENTS and usePage.
4
+ user-invocable: false
5
+ ---
6
+
7
+ # Page (`SmartPage`)
8
+
9
+ `SmartPage` lays out a screen: a header with an optional back button, the **translated** `title`, an optional search input and the `endButtons`, followed by the body (`children`, or `options.bodyTpl`). Which component renders it depends on `options.variant`: the component registered under `getPageVariantKey(variant)` (`'page'` for `'standard'`, `'page:<variant>'` for the others), else `SmartPageStandard`. `SmartPagePreset` is a full application-shell layout that also renders the breadcrumbs, avatar / logo, subtitle, meta, stats, filters, banner and sidebar slots. CRUD list and item screens are built on `SmartPage`.
10
+
11
+ ## When to Use This Skill
12
+
13
+ - The frame of a screen: title, back button, search and action buttons above the content
14
+ - A richer page header with breadcrumbs, meta, stats, filters or a sidebar (`SmartPagePreset`)
15
+ - Several page looks in one application (`options.variant` + `'page:<variant>'` registrations)
16
+ - Restyling every page (the `page` key) or one variant
17
+
18
+ ## Exports
19
+
20
+ All from `@smartsoft001/react`.
21
+
22
+ | Export | Kind | What it is |
23
+ | -------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
24
+ | `SmartPage` | component | Renders the component registered for `options.variant` (`'standard'` when omitted) under `getPageVariantKey(variant)` on `SmartProvider`, `SmartPageStandard` when nothing is registered for it. |
25
+ | `SmartPagePreset` | component | Styled page variation (preset). |
26
+ | `SmartPageStandard` | component | The default page rendering: a header with the optional back button, the translated title, the search input and the end buttons, followed by `options.bodyTpl`. |
27
+ | `usePage` | hook | The page's logic: `back()` goes to the previous location, through the navigation adapter. |
28
+ | `getPageVariantKey` | function | The registry key of a page variant: `'page'` for `'standard'`, `'page:<variant>'` otherwise. |
29
+ | `getPageButtonOptions` | function | The `SmartButton` options of an end button (secondary, `md`, running its handler). |
30
+ | `PAGE_PRESET_VARIANT_COMPONENTS` | const | Styled page variant preset, keyed by `getPageVariantKey(variant)`. |
31
+
32
+ The preset's class helpers (`getPagePageClasses`, `getPageHeaderClasses`, `getPageContainerClasses`, `getPageTitleClasses`, `getPageBodyCardClasses`, `getPageIconButtonClasses`) are exported too, for a custom implementation that wants the preset look.
33
+
34
+ ## Props and Types
35
+
36
+ ### `SmartPageProps`
37
+
38
+ Extends `SmartPageVariantProps`.
39
+
40
+ | Prop | Type | Default | Description |
41
+ | ----------- | ----------- | ------- | ------------------------------------------------------ |
42
+ | `children?` | `ReactNode` | — | The page body, used when `options.bodyTpl` is not set. |
43
+
44
+ ### `SmartPageVariantProps`
45
+
46
+ The props of a page variant (what `<SmartPage>` hands to the resolved component): the options, with `bodyTpl` already merged with the wrapper's children, and the CSS class.
47
+
48
+ | Prop | Type | Default | Description |
49
+ | ------------ | ---------------------- | ------- | ----------------------------------------------------------------------------- |
50
+ | `options?` | `IPageOptions \| null` | — | The page options, with `bodyTpl` already set from `children`. |
51
+ | `className?` | `string` | — | Classes of the page root (the standard rendering has no root and ignores it). |
52
+
53
+ ### `IPageOptions`
54
+
55
+ | Field | Type | Default | Description |
56
+ | ----------------- | ---------------------------------------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
57
+ | `title` | `string` | required | The page title, passed through the translations (a key or text). |
58
+ | `hideHeader?` | `boolean` | — | Hides the header (title, buttons, search). |
59
+ | `hideMenuButton?` | `boolean` | — | Preset: hides the menu button (which has no action of its own). |
60
+ | `showBackButton?` | `boolean` | — | Shows a back button that calls `navigation.back()`. |
61
+ | `endButtons?` | `Array<IIconButtonOptions>` | `[]` | Buttons at the end of the header: each renders a `SmartButton` (secondary, `md`) running `handler`, labelled with the translated `text` and a `number` badge. `icon` is used as the React key, so keep it unique. |
62
+ | `search?` | `{ text: string; set: (txt: string) => void }` | — | A search input bound to `text` / `set` (the placeholder is the `search` translation). |
63
+ | `variant?` | `SmartPageVariant` | `'standard'` | Picks the registered component (`'page'` or `'page:<variant>'`). |
64
+ | `bodyTpl?` | `ReactNode` | `children` | The body; wins over `children`. |
65
+ | `breadcrumbsTpl?` | `ReactNode` | — | Preset: breadcrumbs above the title. |
66
+ | `metaTpl?` | `ReactNode` | — | Preset: meta row. |
67
+ | `avatarTpl?` | `ReactNode` | — | Preset: avatar next to the title. |
68
+ | `bannerTpl?` | `ReactNode` | — | Preset: banner strip above the header. |
69
+ | `filtersTpl?` | `ReactNode` | — | Preset: filters bar under the header. |
70
+ | `logoTpl?` | `ReactNode` | — | Preset: logo next to the title. |
71
+ | `statsTpl?` | `ReactNode` | — | Preset: stats row. |
72
+ | `subtitleTpl?` | `ReactNode` | — | Preset: subtitle under the title. |
73
+ | `navTpl?` | `ReactNode` | — | Declared; neither `SmartPageStandard` nor `SmartPagePreset` renders it. |
74
+ | `sidebarTpl?` | `ReactNode` | — | Preset: an `<aside>` next to the body card. |
75
+
76
+ ### `IIconButtonOptions`
77
+
78
+ A page button.
79
+
80
+ | Field | Type | Default | Description |
81
+ | ------------ | ------------------------ | -------- | ------------------------------------------------------------------- |
82
+ | `icon` | `string` | required | Identifier of the button (the React key of the standard rendering). |
83
+ | `text?` | `string` | — | Label (translated). |
84
+ | `handler?` | `() => void` | — | Click handler. |
85
+ | `component?` | `any` | — | For implementations of your own (e.g. a popover body). |
86
+ | `type?` | `'default' \| 'popover'` | — | For implementations of your own (`'popover'`). |
87
+ | `disabled?` | `boolean` | — | Disables the button. |
88
+ | `number?` | `number` | — | A count badge. |
89
+
90
+ ### Related types
91
+
92
+ - `SmartPageVariant`: `'standard' \| (string & {})` — `'standard'` or the name of a variant you register.
93
+
94
+ ## Usage
95
+
96
+ ```tsx
97
+ import { useState } from 'react';
98
+
99
+ import {
100
+ SmartPage,
101
+ SmartPagePreset,
102
+ SmartBreadcrumbs,
103
+ } from '@smartsoft001/react';
104
+
105
+ export function NotesScreen({
106
+ onAdd,
107
+ onExport,
108
+ }: {
109
+ onAdd: () => void;
110
+ onExport: () => void;
111
+ }) {
112
+ const [search, setSearch] = useState('');
113
+
114
+ return (
115
+ <SmartPage
116
+ options={{
117
+ title: 'Notes',
118
+ showBackButton: true,
119
+ search: { text: search, set: setSearch },
120
+ endButtons: [
121
+ { icon: 'add', text: 'Add', handler: onAdd },
122
+ { icon: 'export', text: 'Export', handler: onExport, number: 3 },
123
+ ],
124
+ }}
125
+ >
126
+ <p>Results for “{search}”…</p>
127
+ </SmartPage>
128
+ );
129
+ }
130
+
131
+ // The preset rendered directly: bodyTpl instead of children, and the extra slots.
132
+ export function ProjectScreen() {
133
+ return (
134
+ <SmartPagePreset
135
+ options={{
136
+ title: 'Project Alpha',
137
+ breadcrumbsTpl: (
138
+ <SmartBreadcrumbs
139
+ options={{
140
+ items: [
141
+ { id: 'projects', label: 'Projects', href: '/projects' },
142
+ { id: 'alpha', label: 'Alpha', current: true },
143
+ ],
144
+ }}
145
+ />
146
+ ),
147
+ metaTpl: <span>Updated 2 hours ago</span>,
148
+ bodyTpl: <p>Project content</p>,
149
+ }}
150
+ />
151
+ );
152
+ }
153
+ ```
154
+
155
+ ## Replacing the Implementation
156
+
157
+ `SmartPage` resolves its component per variant:
158
+
159
+ | `options.variant` | Registry key | Fallback |
160
+ | -------------------------- | ---------------------------------------- | ------------------- |
161
+ | `'standard'` (or unset) | `'page'` | `SmartPageStandard` |
162
+ | any other, e.g. `'preset'` | `'page:<variant>'`, e.g. `'page:preset'` | `SmartPageStandard` |
163
+
164
+ `PAGE_PRESET_VARIANT_COMPONENTS` registers `SmartPagePreset` under `'page:preset'` only, so pages opt in with `variant: 'preset'`. `SMART_PRESET_COMPONENTS` registers it under `'page'` too, so every page renders the preset.
165
+
166
+ ```tsx
167
+ import type { ReactNode } from 'react';
168
+
169
+ import {
170
+ PAGE_PRESET_VARIANT_COMPONENTS,
171
+ SmartPageVariantProps,
172
+ SmartProvider,
173
+ } from '@smartsoft001/react';
174
+
175
+ function CompactPage({ options, className }: SmartPageVariantProps) {
176
+ return (
177
+ <section className={className}>
178
+ <h1>{options?.title}</h1>
179
+ {options?.bodyTpl}
180
+ </section>
181
+ );
182
+ }
183
+
184
+ // 'preset' from the library, 'compact' of our own; 'standard' stays SmartPageStandard.
185
+ const components = {
186
+ ...PAGE_PRESET_VARIANT_COMPONENTS,
187
+ 'page:compact': CompactPage,
188
+ };
189
+
190
+ export function AppProviders({ children }: { children: ReactNode }) {
191
+ return <SmartProvider components={components}>{children}</SmartProvider>;
192
+ }
193
+ ```
194
+
195
+ A page variant receives `SmartPageVariantProps`: the options with `bodyTpl` already merged from `children`, and `className`. Translate `options.title` yourself (`useTranslate()`) if the variant should match the standard one.
196
+
197
+ ### The `usePage` hook
198
+
199
+ The page's logic: `back()` goes to the previous location, through the navigation adapter.
200
+
201
+ ```ts
202
+ function usePage();
203
+ ```
204
+
205
+ | Returns | Type | Description |
206
+ | ------- | ------------ | ------------------------------------------------------------- |
207
+ | `back` | `() => void` | Goes to the previous location through the navigation adapter. |
208
+
209
+ ## Styling
210
+
211
+ - `SmartPageStandard` renders no wrapper element (header and body are siblings) and does not apply `className`.
212
+ - `SmartPagePreset` appends `className` to its root and renders a gray page body with the content in a card, with `smart:dark:` variants.
213
+
214
+ ## File Locations
215
+
216
+ Source: `packages/shared/react/src/lib/components/page/` in the smartsoft001 repository.
217
+
218
+ - `page.tsx`: `getPageVariantKey`, `SmartPage`
219
+ - `page.types.ts`: `SmartPageVariantProps`, `SmartPageProps`
220
+ - `preset-variants.ts`: `PAGE_PRESET_VARIANT_COMPONENTS`
221
+ - `preset/page-preset.tsx`: `SmartPagePreset`
222
+ - `standard/page-standard.tsx`: `SmartPageStandard`
223
+ - `use-page.ts`: `usePage`, `getPageButtonOptions`
224
+ - `page.stories.tsx`: Storybook stories
@@ -0,0 +1,155 @@
1
+ ---
2
+ name: react-components-page-heading
3
+ description: SmartPageHeading React component API (@smartsoft001/react) — page header with title, subtitle and slots for breadcrumbs, banner, avatar, logo, meta, stats, actions, filters and navigation, links-left/center/right/user presentations, the 'page-heading' registry key and SmartPageHeadingPreset.
4
+ user-invocable: false
5
+ ---
6
+
7
+ # Page Heading (`SmartPageHeading`)
8
+
9
+ `SmartPageHeading` renders the heading of a page from `options`: a title and subtitle plus `ReactNode` slots (breadcrumbs, banner, avatar, logo, meta, stats, actions, filters, nav), each rendered only when given. The standard rendering is unstyled: breadcrumbs and banner above a `<header>` with the title and the other slots. `SmartPageHeadingPreset` renders a navbar-like `<header>` (logo or title, desktop nav, actions or avatar, a mobile toggle) laid out by `options.presentation.layout`; it reads only `title`, `logoTpl`, `navTpl`, `actionsTpl`, `avatarTpl` and `presentation`, so the subtitle, breadcrumbs, banner, meta, stats and filters slots are rendered by the standard heading only.
10
+
11
+ ## When to Use This Skill
12
+
13
+ - The top of a screen: title, subtitle, breadcrumbs, meta information and action buttons
14
+ - A profile header with an avatar and stats
15
+ - Restyling every page heading (the `page-heading` registry key)
16
+
17
+ `SmartPage` (`react-components-page`) already renders a heading for its title and buttons; use `SmartPageHeading` when you compose the header yourself.
18
+
19
+ ## Exports
20
+
21
+ All from `@smartsoft001/react`.
22
+
23
+ | Export | Kind | What it is |
24
+ | -------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
25
+ | `SmartPageHeading` | component | Renders the implementation registered as `components['page-heading']` on `SmartProvider`, `SmartPageHeadingStandard` by default. |
26
+ | `SmartPageHeadingPreset` | component | HyperUI-styled page heading variation (preset). |
27
+ | `SmartPageHeadingStandard` | component | The default page heading rendering: unstyled breadcrumbs and banner slots above a `<header>` holding the title, subtitle and the avatar / logo / meta / stats / actions / filters slots. |
28
+
29
+ The preset's class helpers (`getPageHeadingHeaderClasses`, `getPageHeadingBarClasses`) are exported too, for a custom implementation that wants the preset look.
30
+
31
+ ## Props and Types
32
+
33
+ ### `SmartPageHeadingProps`
34
+
35
+ | Prop | Type | Default | Description |
36
+ | ------------ | --------------------- | ------- | ---------------------------------------- |
37
+ | `options?` | `IPageHeadingOptions` | — | Title, subtitle, slots and presentation. |
38
+ | `className?` | `string` | — | Classes on the root element. |
39
+
40
+ ### `IPageHeadingOptions`
41
+
42
+ | Field | Type | Default | Description |
43
+ | ----------------- | ------------------------------------------------------------------------- | ------- | ---------------------------------------------------------------------------------------- |
44
+ | `title?` | `string` | — | The page title (the preset falls back to it when there is no logo). |
45
+ | `subtitle?` | `string` | — | Text under the title (standard). |
46
+ | `breadcrumbsTpl?` | `ReactNode` | — | Breadcrumbs above the header (standard). |
47
+ | `metaTpl?` | `ReactNode` | — | Meta information: dates, location, counts (standard). |
48
+ | `avatarTpl?` | `ReactNode` | — | An avatar (the preset's `user` layout shows it in place of the actions). |
49
+ | `bannerTpl?` | `ReactNode` | — | A banner image above the header (standard). |
50
+ | `actionsTpl?` | `ReactNode` | — | Action buttons. |
51
+ | `statsTpl?` | `ReactNode` | — | A stats row (standard). |
52
+ | `logoTpl?` | `ReactNode` | — | Brand / logo zone of the preset. |
53
+ | `filtersTpl?` | `ReactNode` | — | Filter controls (standard). |
54
+ | `navTpl?` | `ReactNode` | — | Navigation links (the preset's desktop nav zone and mobile panel). |
55
+ | `presentation?` | `{ layout?: 'links-left' \| 'links-center' \| 'links-right' \| 'user'; }` | — | `layout` of the preset: `links-left` (default), `links-center`, `links-right` or `user`. |
56
+
57
+ ## Usage
58
+
59
+ ```tsx
60
+ import {
61
+ SmartBreadcrumbs,
62
+ SmartButton,
63
+ SmartPageHeading,
64
+ } from '@smartsoft001/react';
65
+
66
+ export function ProjectHeader({
67
+ onEdit,
68
+ onPublish,
69
+ }: {
70
+ onEdit: () => void;
71
+ onPublish: () => void;
72
+ }) {
73
+ return (
74
+ <SmartPageHeading
75
+ options={{
76
+ title: 'Back End Developer',
77
+ subtitle: 'Engineering · Remote',
78
+ breadcrumbsTpl: (
79
+ <SmartBreadcrumbs
80
+ options={{
81
+ items: [
82
+ { id: 'jobs', label: 'Jobs', href: '/jobs' },
83
+ { id: 'job', label: 'Back End Developer', current: true },
84
+ ],
85
+ }}
86
+ />
87
+ ),
88
+ metaTpl: <span>Closing on January 9, 2027</span>,
89
+ actionsTpl: (
90
+ <>
91
+ <SmartButton options={{ click: onEdit, variant: 'secondary' }}>
92
+ Edit
93
+ </SmartButton>
94
+ <SmartButton options={{ click: onPublish }}>Publish</SmartButton>
95
+ </>
96
+ ),
97
+ }}
98
+ />
99
+ );
100
+ }
101
+ ```
102
+
103
+ ## Replacing the Implementation
104
+
105
+ `SmartPageHeading` renders the component registered under the `'page-heading'` key of `SmartProvider`'s `components`, and `SmartPageHeadingStandard` when nothing is registered there. Every `SmartPageHeading` below the provider then renders the registered component, which receives the same props.
106
+
107
+ ```tsx
108
+ import type { ReactNode } from 'react';
109
+
110
+ import { SmartProvider, SmartPageHeadingPreset } from '@smartsoft001/react';
111
+
112
+ // A module constant: a new object on every render would change the context.
113
+ const components = { 'page-heading': SmartPageHeadingPreset };
114
+
115
+ export function AppProviders({ children }: { children: ReactNode }) {
116
+ return <SmartProvider components={components}>{children}</SmartProvider>;
117
+ }
118
+ ```
119
+
120
+ `SmartPageHeadingPreset` is the styled (preset) implementation: register it as above, render it directly in place of `SmartPageHeading`, or spread `SMART_PRESET_COMPONENTS` on the provider to register every preset at once (see the `react-provider` skill). Pass `components` as a stable object (a module constant or a memoised value), or the context changes on every render.
121
+
122
+ ```tsx
123
+ import { SmartPageHeadingProps } from '@smartsoft001/react';
124
+
125
+ export function CompactPageHeading({
126
+ options,
127
+ className,
128
+ }: SmartPageHeadingProps) {
129
+ return (
130
+ <header className={className}>
131
+ {options?.breadcrumbsTpl}
132
+ <div>
133
+ <h1>{options?.title}</h1>
134
+ {options?.subtitle && <p>{options.subtitle}</p>}
135
+ {options?.metaTpl}
136
+ </div>
137
+ {options?.actionsTpl}
138
+ </header>
139
+ );
140
+ }
141
+ ```
142
+
143
+ ## Styling
144
+
145
+ - The standard rendering is unstyled; `SmartPageHeadingPreset` carries the header look with a collapsible mobile panel and `smart:dark:` variants.
146
+
147
+ ## File Locations
148
+
149
+ Source: `packages/shared/react/src/lib/components/page-heading/` in the smartsoft001 repository.
150
+
151
+ - `page-heading.tsx`: `SmartPageHeading`
152
+ - `page-heading.types.ts`: `SmartPageHeadingProps`
153
+ - `preset/page-heading-preset.tsx`: `SmartPageHeadingPreset`
154
+ - `standard/page-heading-standard.tsx`: `SmartPageHeadingStandard`
155
+ - `page-heading.stories.tsx`: Storybook stories
@@ -0,0 +1,183 @@
1
+ ---
2
+ name: react-components-paging
3
+ description: SmartPaging React component API (@smartsoft001/react) — pagination controls (prev/next, page list with ellipses, "showing x to y of z") where the parent owns currentPage and onPageChange reports the requested page, card-footer/centered/simple variants, the 'paging' registry key, SmartPagingPreset and usePaging.
4
+ user-invocable: false
5
+ ---
6
+
7
+ # Paging (`SmartPaging`)
8
+
9
+ `SmartPaging` renders pagination controls: previous / next buttons around a page list with `'...'` gaps (all pages up to 7, otherwise the first, the last and the neighbours of the current one), and, in the preset's `card-footer` variant, a "Showing x to y of z results" summary. The page is **owned by the parent**: pass `currentPage` and update it from `onPageChange(page)`. Navigation beyond the first or last page is ignored.
10
+
11
+ ## When to Use This Skill
12
+
13
+ - Paginating a table or list whose data the page loads itself
14
+ - Showing a results summary with the pager (`card-footer`)
15
+ - Restyling every pager (the `paging` registry key)
16
+
17
+ `SmartList` with a provider paginates itself (see `react-components-list`); CRUD screens configure paging through `CrudFullConfig.pagination`.
18
+
19
+ ## Exports
20
+
21
+ All from `@smartsoft001/react`.
22
+
23
+ | Export | Kind | What it is |
24
+ | --------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
25
+ | `SmartPaging` | component | Renders the implementation registered as `components.paging` on `SmartProvider`, `SmartPagingStandard` by default. |
26
+ | `SmartPagingPreset` | component | Styled paging variation (preset). |
27
+ | `SmartPagingStandard` | component | The default paging rendering: translated prev / next buttons around the page list. |
28
+ | `usePaging` | hook | The behaviour every paging variant shares: the "showing x to y" range, the page list with `'...'` gaps (all pages up to 7, otherwise the first, the last and the neighbours of the current one), and the guarded navigation that reports the requested page through `onPageChange`. |
29
+
30
+ The preset's class helpers (`getPagingContainerClasses`, `getPagingNavClasses`, `getPagingPageClasses`, `PAGING_ELLIPSIS_CLASSES`, `PAGING_RESULTS_CLASSES`, `PAGING_PAGE_LIST_CLASSES`, `PAGING_NAV_BUTTON_CLASSES`) are exported too, for a custom implementation that wants the preset look.
31
+
32
+ ## Props and Types
33
+
34
+ ### `SmartPagingProps`
35
+
36
+ | Prop | Type | Default | Description |
37
+ | --------------- | ------------------------ | --------------- | --------------------------------------------------------------- |
38
+ | `currentPage?` | `number` | `1` | The current page, 1-based. |
39
+ | `totalPages?` | `number` | `1` | Number of pages. |
40
+ | `pageSize?` | `number` | `10` | Items per page, for the summary. |
41
+ | `totalItems?` | `number` | `0` | Total number of items, for the summary. |
42
+ | `variant?` | `PagingVariant` | `'card-footer'` | The layout (preset); the standard exposes it as `data-variant`. |
43
+ | `className?` | `string` | — | Classes on the `<nav>`. |
44
+ | `onPageChange?` | `(page: number) => void` | — | Called with the requested page. |
45
+
46
+ ### Related types
47
+
48
+ - `PagingVariant`: `'card-footer' \| 'centered' \| 'simple'` — Layout variant: `'card-footer'` (results summary alongside the nav), `'centered'` or `'simple'`.
49
+
50
+ ## Usage
51
+
52
+ ```tsx
53
+ import { useState } from 'react';
54
+
55
+ import { SmartPaging, SmartPagingPreset } from '@smartsoft001/react';
56
+
57
+ export function OrdersPager({ totalItems }: { totalItems: number }) {
58
+ const [page, setPage] = useState(1);
59
+ const pageSize = 20;
60
+
61
+ return (
62
+ <>
63
+ <SmartPagingPreset
64
+ currentPage={page}
65
+ totalPages={Math.ceil(totalItems / pageSize)}
66
+ pageSize={pageSize}
67
+ totalItems={totalItems}
68
+ variant="card-footer"
69
+ onPageChange={setPage}
70
+ />
71
+
72
+ {/* Through the registry (translated prev / next in the standard rendering). */}
73
+ <SmartPaging
74
+ currentPage={page}
75
+ totalPages={Math.ceil(totalItems / pageSize)}
76
+ onPageChange={setPage}
77
+ />
78
+ </>
79
+ );
80
+ }
81
+ ```
82
+
83
+ ## Replacing the Implementation
84
+
85
+ `SmartPaging` renders the component registered under the `'paging'` key of `SmartProvider`'s `components`, and `SmartPagingStandard` when nothing is registered there. Every `SmartPaging` below the provider then renders the registered component, which receives the same props.
86
+
87
+ ```tsx
88
+ import type { ReactNode } from 'react';
89
+
90
+ import { SmartProvider, SmartPagingPreset } from '@smartsoft001/react';
91
+
92
+ // A module constant: a new object on every render would change the context.
93
+ const components = { paging: SmartPagingPreset };
94
+
95
+ export function AppProviders({ children }: { children: ReactNode }) {
96
+ return <SmartProvider components={components}>{children}</SmartProvider>;
97
+ }
98
+ ```
99
+
100
+ `SmartPagingPreset` is the styled (preset) implementation: register it as above, render it directly in place of `SmartPaging`, or spread `SMART_PRESET_COMPONENTS` on the provider to register every preset at once (see the `react-provider` skill). Pass `components` as a stable object (a module constant or a memoised value), or the context changes on every render.
101
+
102
+ ### The `usePaging` hook
103
+
104
+ The behaviour every paging variant shares: the "showing x to y" range, the page list with `'...'` gaps (all pages up to 7, otherwise the first, the last and the neighbours of the current one), and the guarded navigation that reports the requested page through `onPageChange`. The page itself stays owned by the parent (`currentPage`).
105
+
106
+ ```ts
107
+ function usePaging({
108
+ currentPage = 1,
109
+ totalPages = 1,
110
+ pageSize = 10,
111
+ totalItems = 0,
112
+ variant = 'card-footer',
113
+ onPageChange,
114
+ }: SmartPagingProps);
115
+ ```
116
+
117
+ | Returns | Type | Description |
118
+ | -------------- | ------------------------ | ----------------------------------------------------------------------------- |
119
+ | `currentPage` | `number` | `currentPage` with its default. |
120
+ | `totalPages` | `number` | `totalPages` with its default. |
121
+ | `pageSize` | `number` | `pageSize` with its default. |
122
+ | `totalItems` | `number` | `totalItems` with its default. |
123
+ | `variant` | `PagingVariant` | `variant` with its default. |
124
+ | `showingFrom` | `number` | First item number of the current page. |
125
+ | `showingTo` | `number` | Last item number of the current page. |
126
+ | `canGoBack` | `boolean` | `currentPage > 1`. |
127
+ | `canGoForward` | `boolean` | `currentPage < totalPages`. |
128
+ | `pages` | `(number \| "...")[]` | The page numbers to render, with `'...'` gaps. |
129
+ | `goToPage` | `(page: number) => void` | Reports a page through `onPageChange` (ignored when out of range or current). |
130
+ | `nextPage` | `() => void` | Reports the next page. |
131
+ | `previousPage` | `() => void` | Reports the previous page. |
132
+
133
+ ```tsx
134
+ import { SmartPagingProps, usePaging } from '@smartsoft001/react';
135
+
136
+ export function PageSelect(props: SmartPagingProps) {
137
+ const {
138
+ currentPage,
139
+ totalPages,
140
+ goToPage,
141
+ canGoBack,
142
+ canGoForward,
143
+ previousPage,
144
+ nextPage,
145
+ } = usePaging(props);
146
+
147
+ return (
148
+ <nav aria-label="Pagination" className={props.className}>
149
+ <button type="button" disabled={!canGoBack} onClick={previousPage}>
150
+ ‹
151
+ </button>
152
+ <select
153
+ value={currentPage}
154
+ onChange={(event) => goToPage(Number(event.target.value))}
155
+ >
156
+ {Array.from({ length: totalPages }, (_, index) => (
157
+ <option key={index + 1} value={index + 1}>
158
+ {index + 1}
159
+ </option>
160
+ ))}
161
+ </select>
162
+ <button type="button" disabled={!canGoForward} onClick={nextPage}>
163
+ ›
164
+ </button>
165
+ </nav>
166
+ );
167
+ }
168
+ ```
169
+
170
+ ## Styling
171
+
172
+ - `SmartPagingStandard` renders translated prev / next buttons and the page list; `SmartPagingPreset` renders the three layouts with `smart:dark:` variants, but its "Showing x to y of z results", "Previous" and "Next" texts are not translated.
173
+
174
+ ## File Locations
175
+
176
+ Source: `packages/shared/react/src/lib/components/paging/` in the smartsoft001 repository.
177
+
178
+ - `paging.tsx`: `SmartPaging`
179
+ - `paging.types.ts`: `PagingVariant`, `SmartPagingProps`
180
+ - `preset/paging-preset.tsx`: `SmartPagingPreset`
181
+ - `standard/paging-standard.tsx`: `SmartPagingStandard`
182
+ - `use-paging.ts`: `usePaging`
183
+ - `paging.stories.tsx`: Storybook stories