@smartsoft001/claude-plugins 2.194.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/scaffold-nx-workspace/SKILL.md +1 -1
  6. package/plugins/{smart → smart-angular}/skills/scaffold-nx-workspace/references/base-claude-config.md +13 -9
  7. package/plugins/{smart → smart-angular}/skills/scaffold-nx-workspace/references/patch-delta.md +1 -1
  8. package/plugins/{smart → smart-core}/.claude-plugin/README.md +31 -16
  9. package/plugins/{smart → smart-core}/.claude-plugin/merge-permissions.js +7 -6
  10. package/plugins/smart-core/.claude-plugin/plugin.json +5 -0
  11. package/plugins/{smart → smart-core}/.claude-plugin/settings.template.json +2 -2
  12. package/plugins/{smart → smart-core}/hooks/README.md +1 -1
  13. package/plugins/{smart → smart-core}/skills/audit-log/SKILL.md +2 -2
  14. package/plugins/{smart → smart-core}/skills/format-code/SKILL.md +1 -1
  15. package/plugins/smart-react/.claude-plugin/plugin.json +6 -0
  16. package/plugins/smart-react/agents/react-components.md +260 -0
  17. package/plugins/smart-react/skills/react-components-accordion/SKILL.md +204 -0
  18. package/plugins/smart-react/skills/react-components-action-panel/SKILL.md +191 -0
  19. package/plugins/smart-react/skills/react-components-alert/SKILL.md +244 -0
  20. package/plugins/smart-react/skills/react-components-app/SKILL.md +236 -0
  21. package/plugins/smart-react/skills/react-components-avatar/SKILL.md +176 -0
  22. package/plugins/smart-react/skills/react-components-badge/SKILL.md +165 -0
  23. package/plugins/smart-react/skills/react-components-breadcrumbs/SKILL.md +183 -0
  24. package/plugins/smart-react/skills/react-components-button/SKILL.md +239 -0
  25. package/plugins/smart-react/skills/react-components-button-group/SKILL.md +187 -0
  26. package/plugins/smart-react/skills/react-components-calendar/SKILL.md +270 -0
  27. package/plugins/smart-react/skills/react-components-card/SKILL.md +201 -0
  28. package/plugins/smart-react/skills/react-components-card-heading/SKILL.md +133 -0
  29. package/plugins/smart-react/skills/react-components-command-palette/SKILL.md +228 -0
  30. package/plugins/smart-react/skills/react-components-container/SKILL.md +134 -0
  31. package/plugins/smart-react/skills/react-components-date-edit/SKILL.md +186 -0
  32. package/plugins/smart-react/skills/react-components-date-range/SKILL.md +259 -0
  33. package/plugins/smart-react/skills/react-components-description-list/SKILL.md +144 -0
  34. package/plugins/smart-react/skills/react-components-detail/SKILL.md +272 -0
  35. package/plugins/smart-react/skills/react-components-details/SKILL.md +250 -0
  36. package/plugins/smart-react/skills/react-components-divider/SKILL.md +128 -0
  37. package/plugins/smart-react/skills/react-components-drawer/SKILL.md +165 -0
  38. package/plugins/smart-react/skills/react-components-dropdown/SKILL.md +194 -0
  39. package/plugins/smart-react/skills/react-components-empty-state/SKILL.md +202 -0
  40. package/plugins/smart-react/skills/react-components-export/SKILL.md +120 -0
  41. package/plugins/smart-react/skills/react-components-feed/SKILL.md +171 -0
  42. package/plugins/smart-react/skills/react-components-form/SKILL.md +319 -0
  43. package/plugins/smart-react/skills/react-components-grid-list/SKILL.md +172 -0
  44. package/plugins/smart-react/skills/react-components-icon/SKILL.md +117 -0
  45. package/plugins/smart-react/skills/react-components-import/SKILL.md +113 -0
  46. package/plugins/smart-react/skills/react-components-info/SKILL.md +147 -0
  47. package/plugins/smart-react/skills/react-components-input/SKILL.md +406 -0
  48. package/plugins/smart-react/skills/react-components-list/SKILL.md +384 -0
  49. package/plugins/smart-react/skills/react-components-list-container/SKILL.md +105 -0
  50. package/plugins/smart-react/skills/react-components-loader/SKILL.md +126 -0
  51. package/plugins/smart-react/skills/react-components-media-object/SKILL.md +130 -0
  52. package/plugins/smart-react/skills/react-components-modal/SKILL.md +266 -0
  53. package/plugins/smart-react/skills/react-components-multi-column-layout/SKILL.md +155 -0
  54. package/plugins/smart-react/skills/react-components-navbar/SKILL.md +211 -0
  55. package/plugins/smart-react/skills/react-components-notification/SKILL.md +223 -0
  56. package/plugins/smart-react/skills/react-components-overlays/SKILL.md +182 -0
  57. package/plugins/smart-react/skills/react-components-page/SKILL.md +224 -0
  58. package/plugins/smart-react/skills/react-components-page-heading/SKILL.md +155 -0
  59. package/plugins/smart-react/skills/react-components-paging/SKILL.md +183 -0
  60. package/plugins/smart-react/skills/react-components-password-strength/SKILL.md +149 -0
  61. package/plugins/smart-react/skills/react-components-progress-bars/SKILL.md +195 -0
  62. package/plugins/smart-react/skills/react-components-searchbar/SKILL.md +150 -0
  63. package/plugins/smart-react/skills/react-components-section-heading/SKILL.md +138 -0
  64. package/plugins/smart-react/skills/react-components-select-menu/SKILL.md +168 -0
  65. package/plugins/smart-react/skills/react-components-sidebar-layout/SKILL.md +155 -0
  66. package/plugins/smart-react/skills/react-components-sidebar-navigation/SKILL.md +277 -0
  67. package/plugins/smart-react/skills/react-components-sign-in-form/SKILL.md +228 -0
  68. package/plugins/smart-react/skills/react-components-stacked-layout/SKILL.md +146 -0
  69. package/plugins/smart-react/skills/react-components-stacked-list/SKILL.md +156 -0
  70. package/plugins/smart-react/skills/react-components-stats/SKILL.md +149 -0
  71. package/plugins/smart-react/skills/react-components-table/SKILL.md +222 -0
  72. package/plugins/smart-react/skills/react-components-tabs/SKILL.md +189 -0
  73. package/plugins/smart-react/skills/react-components-textarea/SKILL.md +202 -0
  74. package/plugins/smart-react/skills/react-components-toggle/SKILL.md +157 -0
  75. package/plugins/smart-react/skills/react-components-vertical-navigation/SKILL.md +212 -0
  76. package/plugins/smart-react/skills/react-forms/SKILL.md +272 -0
  77. package/plugins/smart-react/skills/react-provider/SKILL.md +368 -0
  78. package/plugins/smart-react/skills/smart-crud-react/SKILL.md +410 -0
  79. package/plugins/smart/.claude-plugin/plugin.json +0 -5
  80. /package/plugins/{smart/agents/angular-components/AGENT.md → smart-angular/agents/angular-components.md} +0 -0
  81. /package/plugins/{smart → smart-angular}/skills/angular-components-accordion/SKILL.md +0 -0
  82. /package/plugins/{smart → smart-angular}/skills/angular-components-action-panel/SKILL.md +0 -0
  83. /package/plugins/{smart → smart-angular}/skills/angular-components-alert/SKILL.md +0 -0
  84. /package/plugins/{smart → smart-angular}/skills/angular-components-avatar/SKILL.md +0 -0
  85. /package/plugins/{smart → smart-angular}/skills/angular-components-badge/SKILL.md +0 -0
  86. /package/plugins/{smart → smart-angular}/skills/angular-components-breadcrumbs/SKILL.md +0 -0
  87. /package/plugins/{smart → smart-angular}/skills/angular-components-button/SKILL.md +0 -0
  88. /package/plugins/{smart → smart-angular}/skills/angular-components-button-group/SKILL.md +0 -0
  89. /package/plugins/{smart → smart-angular}/skills/angular-components-calendar/SKILL.md +0 -0
  90. /package/plugins/{smart → smart-angular}/skills/angular-components-card/SKILL.md +0 -0
  91. /package/plugins/{smart → smart-angular}/skills/angular-components-card-heading/SKILL.md +0 -0
  92. /package/plugins/{smart → smart-angular}/skills/angular-components-command-palette/SKILL.md +0 -0
  93. /package/plugins/{smart → smart-angular}/skills/angular-components-container/SKILL.md +0 -0
  94. /package/plugins/{smart → smart-angular}/skills/angular-components-date-edit/SKILL.md +0 -0
  95. /package/plugins/{smart → smart-angular}/skills/angular-components-date-range/SKILL.md +0 -0
  96. /package/plugins/{smart → smart-angular}/skills/angular-components-description-list/SKILL.md +0 -0
  97. /package/plugins/{smart → smart-angular}/skills/angular-components-detail/SKILL.md +0 -0
  98. /package/plugins/{smart → smart-angular}/skills/angular-components-details/SKILL.md +0 -0
  99. /package/plugins/{smart → smart-angular}/skills/angular-components-divider/SKILL.md +0 -0
  100. /package/plugins/{smart → smart-angular}/skills/angular-components-drawer/SKILL.md +0 -0
  101. /package/plugins/{smart → smart-angular}/skills/angular-components-dropdown/SKILL.md +0 -0
  102. /package/plugins/{smart → smart-angular}/skills/angular-components-empty-state/SKILL.md +0 -0
  103. /package/plugins/{smart → smart-angular}/skills/angular-components-feed/SKILL.md +0 -0
  104. /package/plugins/{smart → smart-angular}/skills/angular-components-form/SKILL.md +0 -0
  105. /package/plugins/{smart → smart-angular}/skills/angular-components-grid-list/SKILL.md +0 -0
  106. /package/plugins/{smart → smart-angular}/skills/angular-components-icon/SKILL.md +0 -0
  107. /package/plugins/{smart → smart-angular}/skills/angular-components-info/SKILL.md +0 -0
  108. /package/plugins/{smart → smart-angular}/skills/angular-components-input/SKILL.md +0 -0
  109. /package/plugins/{smart → smart-angular}/skills/angular-components-list/SKILL.md +0 -0
  110. /package/plugins/{smart → smart-angular}/skills/angular-components-list-container/SKILL.md +0 -0
  111. /package/plugins/{smart → smart-angular}/skills/angular-components-media-object/SKILL.md +0 -0
  112. /package/plugins/{smart → smart-angular}/skills/angular-components-modal/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,130 @@
1
+ ---
2
+ name: react-components-media-object
3
+ description: SmartMediaObject React component API (@smartsoft001/react) — image beside a body (children) with left/right position, top/center/bottom/stretched alignment, responsive, nested and wide options, the 'media-object' registry key and SmartMediaObjectPreset.
4
+ user-invocable: false
5
+ ---
6
+
7
+ # Media Object (`SmartMediaObject`)
8
+
9
+ `SmartMediaObject` lays an image (`mediaUrl` / `mediaAlt`) beside a body (`children`), the classic comment / list-entry layout. `options.position` puts the image left (default) or right, `options.alignment` aligns it to the body, and `responsive`, `nested` and `wide` adjust the layout in the preset. The standard rendering exposes position and alignment as `data-*` attributes.
10
+
11
+ ## When to Use This Skill
12
+
13
+ - A comment, review or notification row with an avatar or thumbnail next to text
14
+ - Nested replies (`options.nested`)
15
+ - Restyling every media object (the `media-object` registry key)
16
+
17
+ ## Exports
18
+
19
+ All from `@smartsoft001/react`.
20
+
21
+ | Export | Kind | What it is |
22
+ | -------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------- |
23
+ | `SmartMediaObject` | component | Renders the implementation registered as `components['media-object']` on `SmartProvider`, `SmartMediaObjectStandard` by default. |
24
+ | `SmartMediaObjectPreset` | component | Styled media-object variation (preset). |
25
+ | `SmartMediaObjectStandard` | component | The default media-object rendering: the media `<img>` and a `.smart-media-object-body` holding `children`. |
26
+
27
+ The preset's class helpers (`getMediaObjectRootClasses`, `getMediaObjectMediaClasses`, `getMediaObjectBodyClasses`) are exported too, for a custom implementation that wants the preset look.
28
+
29
+ ## Props and Types
30
+
31
+ ### `SmartMediaObjectProps`
32
+
33
+ | Prop | Type | Default | Description |
34
+ | ------------ | --------------------- | -------- | ----------------------------------- |
35
+ | `mediaUrl` | `string` | required | Image URL. |
36
+ | `mediaAlt` | `string` | required | Image alt text. |
37
+ | `options?` | `IMediaObjectOptions` | — | Layout options. |
38
+ | `className?` | `string` | — | Classes on the root element. |
39
+ | `children?` | `ReactNode` | — | The body content, beside the media. |
40
+
41
+ ### `IMediaObjectOptions`
42
+
43
+ | Field | Type | Default | Description |
44
+ | ------------- | ---------------------------------------------- | -------- | -------------------------------------------------------------------- |
45
+ | `alignment?` | `'top' \| 'center' \| 'bottom' \| 'stretched'` | — | Vertical alignment of the image against the body (`data-alignment`). |
46
+ | `position?` | `'left' \| 'right'` | `'left'` | Side of the image (`data-position`). |
47
+ | `responsive?` | `boolean` | `false` | Preset: stacks the image above the body on small screens. |
48
+ | `nested?` | `boolean` | `false` | Preset: spacing for a media object nested in another one. |
49
+ | `wide?` | `boolean` | `false` | Preset: a larger image footprint. |
50
+
51
+ ## Usage
52
+
53
+ ```tsx
54
+ import { SmartMediaObject, SmartMediaObjectPreset } from '@smartsoft001/react';
55
+
56
+ export function Comment() {
57
+ return (
58
+ <SmartMediaObjectPreset
59
+ mediaUrl="/avatars/anna.jpg"
60
+ mediaAlt="Anna"
61
+ options={{ alignment: 'top' }}
62
+ >
63
+ <h4>Anna Kowalska</h4>
64
+ <p>Looks great, ship it.</p>
65
+ <SmartMediaObject
66
+ mediaUrl="/avatars/jan.jpg"
67
+ mediaAlt="Jan"
68
+ options={{ nested: true }}
69
+ >
70
+ <p>Thanks!</p>
71
+ </SmartMediaObject>
72
+ </SmartMediaObjectPreset>
73
+ );
74
+ }
75
+ ```
76
+
77
+ ## Replacing the Implementation
78
+
79
+ `SmartMediaObject` renders the component registered under the `'media-object'` key of `SmartProvider`'s `components`, and `SmartMediaObjectStandard` when nothing is registered there. Every `SmartMediaObject` below the provider then renders the registered component, which receives the same props.
80
+
81
+ ```tsx
82
+ import type { ReactNode } from 'react';
83
+
84
+ import { SmartProvider, SmartMediaObjectPreset } from '@smartsoft001/react';
85
+
86
+ // A module constant: a new object on every render would change the context.
87
+ const components = { 'media-object': SmartMediaObjectPreset };
88
+
89
+ export function AppProviders({ children }: { children: ReactNode }) {
90
+ return <SmartProvider components={components}>{children}</SmartProvider>;
91
+ }
92
+ ```
93
+
94
+ `SmartMediaObjectPreset` is the styled (preset) implementation: register it as above, render it directly in place of `SmartMediaObject`, 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.
95
+
96
+ ```tsx
97
+ import { SmartMediaObjectProps } from '@smartsoft001/react';
98
+
99
+ export function RowMediaObject({
100
+ mediaUrl,
101
+ mediaAlt,
102
+ options,
103
+ className,
104
+ children,
105
+ }: SmartMediaObjectProps) {
106
+ const image = <img src={mediaUrl} alt={mediaAlt} width={48} height={48} />;
107
+
108
+ return (
109
+ <div className={className} style={{ display: 'flex', gap: 12 }}>
110
+ {options?.position !== 'right' && image}
111
+ <div>{children}</div>
112
+ {options?.position === 'right' && image}
113
+ </div>
114
+ );
115
+ }
116
+ ```
117
+
118
+ ## Styling
119
+
120
+ - `SmartMediaObjectStandard` renders the `<img>` and a `.smart-media-object-body` with `data-position` / `data-alignment` and no layout styles; `SmartMediaObjectPreset` keeps those hooks and adds the flex layout and a rounded thumbnail.
121
+
122
+ ## File Locations
123
+
124
+ Source: `packages/shared/react/src/lib/components/media-object/` in the smartsoft001 repository.
125
+
126
+ - `media-object.tsx`: `SmartMediaObject`
127
+ - `media-object.types.ts`: `SmartMediaObjectProps`
128
+ - `preset/media-object-preset.tsx`: `SmartMediaObjectPreset`
129
+ - `standard/media-object-standard.tsx`: `SmartMediaObjectStandard`
130
+ - `media-object.stories.tsx`: Storybook stories
@@ -0,0 +1,266 @@
1
+ ---
2
+ name: react-components-modal
3
+ description: SmartModal React component API (@smartsoft001/react) — dialog with title, description, body (children) and footer actions, controlled open/onOpenChange or uncontrolled defaultOpen, onActionClick/onClosed, ModalService.show() for opening a component in a modal from code, the 'modal' registry key, SmartModalPreset and useModal.
4
+ user-invocable: false
5
+ ---
6
+
7
+ # Modal (`SmartModal`)
8
+
9
+ `SmartModal` is a dialog with a title, a description, a body (`children`) and footer buttons (`actions`). A footer button reports `onActionClick({ actionId })` and **keeps the modal open**: close it yourself (set `open` to `false`). The open state is controlled (`open` + `onOpenChange`) or kept inside (`defaultOpen`); closing through the dismiss button, the backdrop or Escape calls `onClosed`. `SmartModalStandard` is a native `<dialog>` shown through its `open` attribute; `SmartModalPreset` is a styled overlay with four variants. The modal host of `SmartProvider` renders `useModalService().show(...)` requests through the same `modal` key.
10
+
11
+ ## When to Use This Skill
12
+
13
+ - Asking for input or showing details in a dialog over the page
14
+ - A confirmation dialog with custom body content and footer actions
15
+ - Opening a component in a modal from code and awaiting its result (`ModalService.show`)
16
+ - Restyling every modal (the `modal` registry key) or building one on `useModal`
17
+
18
+ For a simple yes / no question from code, `AlertService.show` (`react-components-alert`) is shorter.
19
+
20
+ ## Exports
21
+
22
+ All from `@smartsoft001/react`.
23
+
24
+ | Export | Kind | What it is |
25
+ | -------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
26
+ | `SmartModal` | component | Renders the implementation registered as `components.modal` on `SmartProvider`, `SmartModalStandard` by default. |
27
+ | `SmartModalPreset` | component | Styled modal variation (preset). |
28
+ | `SmartModalStandard` | component | The default modal rendering: a native `<dialog>` always in the DOM, shown through its `open` attribute (not `showModal()`). |
29
+ | `useModal` | hook | The behaviour every modal variant shares: the `open` state, controlled through `open` / `onOpenChange` or kept internally from `defaultOpen`; `invokeAction(id)`, which reports `onActionClick` without closing, and `close()`, which hides the modal and reports `onClosed`. |
30
+
31
+ The preset's class helpers (`getModalWrapperClasses`, `getModalPanelClasses`, `getModalFooterClasses`, `getModalActionClasses`, `MODAL_BACKDROP`, `MODAL_HEADER`, `MODAL_TITLE`, `MODAL_DISMISS`, `MODAL_BODY`, `MODAL_DESCRIPTION`) are exported too, for a custom implementation that wants the preset look.
32
+
33
+ ## Props and Types
34
+
35
+ ### `SmartModalProps`
36
+
37
+ | Prop | Type | Default | Description |
38
+ | ---------------- | ------------------------------------ | ------- | ---------------------------------------------------------------------------------------------------------- |
39
+ | `open?` | `boolean` | — | Whether the modal is shown. Leave it `undefined` for an uncontrolled modal that starts from `defaultOpen`. |
40
+ | `defaultOpen?` | `boolean` | `false` | Initial `open` of an uncontrolled modal. |
41
+ | `onOpenChange?` | `(open: boolean) => void` | — | Called when the modal opens or closes. |
42
+ | `title?` | `string` | — | Heading of the dialog. |
43
+ | `description?` | `string` | — | Text under the heading. |
44
+ | `actions?` | `IModalAction[]` | `[]` | Footer buttons; a click reports `onActionClick` and keeps the modal open. |
45
+ | `options?` | `IModalOptions` | — | Variant, dismiss button, footer style and accessible name. |
46
+ | `className?` | `string` | — | Classes on the dialog (the wrapper in the preset). |
47
+ | `onActionClick?` | `(value: IModalActionClick) => void` | — | Called with the id of the clicked footer action; the modal stays open. |
48
+ | `onClosed?` | `() => void` | — | Called after the modal closed itself (dismiss button, backdrop, Escape, native close). |
49
+ | `children?` | `ReactNode` | — | The modal body. |
50
+
51
+ ### `IModalOptions`
52
+
53
+ | Field | Type | Default | Description |
54
+ | -------------- | ----------------------- | ------------ | --------------------------------------------------------------------- |
55
+ | `variant?` | `SmartModalVariant` | `'centered'` | Preset layout: `centered`, `wide`, `alert` or `left-aligned-buttons`. |
56
+ | `withDismiss?` | `boolean` | — | Shows a close (×) button that closes the modal. |
57
+ | `footerStyle?` | `SmartModalFooterStyle` | `'default'` | Preset: `gray` gives the footer a gray background. |
58
+ | `ariaLabel?` | `string` | — | Accessible name when there is no title. |
59
+
60
+ ### `IModalActionClick`
61
+
62
+ Payload of `onActionClick`.
63
+
64
+ | Field | Type | Default | Description |
65
+ | ---------- | -------- | -------- | ------------------------------- |
66
+ | `actionId` | `string` | required | The `id` of the clicked action. |
67
+
68
+ ### `IModalAction`
69
+
70
+ | Field | Type | Default | Description |
71
+ | ---------- | ------------------------- | ------------ | --------------------------------------------- |
72
+ | `id` | `string` | required | Reported as `actionId`. |
73
+ | `label` | `string` | required | Button text. |
74
+ | `variant?` | `SmartModalActionVariant` | `'centered'` | `primary` (default), `secondary` or `danger`. |
75
+
76
+ ### Related types
77
+
78
+ - `SmartModalActionVariant`: `'primary' \| 'secondary' \| 'danger'`
79
+ - `SmartModalVariant`: `'centered' \| 'wide' \| 'alert' \| 'left-aligned-buttons'`
80
+ - `SmartModalFooterStyle`: `'default' \| 'gray'`
81
+
82
+ ## Opening a component in a modal from code
83
+
84
+ `useModalService().show({ component, props })` opens `component` inside a `SmartModal` rendered by the modal host of `SmartProvider` (see `react-components-overlays`). The component receives its `props` and a `dismiss(data)` prop; `onDidDismiss()` resolves with `{ data }`. `useModalService().dismiss(data)` closes the modal opened last.
85
+
86
+ ```tsx
87
+ import { SmartButton, useModalService } from '@smartsoft001/react';
88
+
89
+ function RenameForm({
90
+ name,
91
+ dismiss,
92
+ }: {
93
+ name: string;
94
+ dismiss: (data?: unknown) => void;
95
+ }) {
96
+ return (
97
+ <form
98
+ onSubmit={(event) => {
99
+ event.preventDefault();
100
+ dismiss(new FormData(event.currentTarget).get('name'));
101
+ }}
102
+ >
103
+ <input name="name" defaultValue={name} />
104
+ <button type="submit">Save</button>
105
+ </form>
106
+ );
107
+ }
108
+
109
+ export function RenameButton({
110
+ name,
111
+ onRename,
112
+ }: {
113
+ name: string;
114
+ onRename: (next: string) => void;
115
+ }) {
116
+ const modals = useModalService();
117
+
118
+ const open = async () => {
119
+ const modal = await modals.show({ component: RenameForm, props: { name } });
120
+ const { data } = await modal.onDidDismiss();
121
+ if (typeof data === 'string') onRename(data);
122
+ };
123
+
124
+ return (
125
+ <SmartButton options={{ click: () => void open() }}>Rename</SmartButton>
126
+ );
127
+ }
128
+ ```
129
+
130
+ ## Usage
131
+
132
+ ```tsx
133
+ import { useState } from 'react';
134
+
135
+ import { SmartButton, SmartModal } from '@smartsoft001/react';
136
+
137
+ export function DeactivateAccount({
138
+ onDeactivate,
139
+ }: {
140
+ onDeactivate: () => void;
141
+ }) {
142
+ const [open, setOpen] = useState(false);
143
+
144
+ return (
145
+ <>
146
+ <SmartButton options={{ click: () => setOpen(true), color: 'red' }}>
147
+ Deactivate
148
+ </SmartButton>
149
+ <SmartModal
150
+ open={open}
151
+ onOpenChange={setOpen}
152
+ title="Deactivate account"
153
+ description="All of your data will be permanently removed."
154
+ options={{ variant: 'alert', withDismiss: true }}
155
+ actions={[
156
+ { id: 'cancel', label: 'Cancel', variant: 'secondary' },
157
+ { id: 'deactivate', label: 'Deactivate', variant: 'danger' },
158
+ ]}
159
+ onActionClick={({ actionId }) => {
160
+ if (actionId === 'deactivate') onDeactivate();
161
+ setOpen(false);
162
+ }}
163
+ >
164
+ <p>You will be signed out on every device.</p>
165
+ </SmartModal>
166
+ </>
167
+ );
168
+ }
169
+ ```
170
+
171
+ ## Replacing the Implementation
172
+
173
+ `SmartModal` renders the component registered under the `'modal'` key of `SmartProvider`'s `components`, and `SmartModalStandard` when nothing is registered there. Every `SmartModal` below the provider then renders the registered component, which receives the same props.
174
+
175
+ ```tsx
176
+ import type { ReactNode } from 'react';
177
+
178
+ import { SmartProvider, SmartModalPreset } from '@smartsoft001/react';
179
+
180
+ // A module constant: a new object on every render would change the context.
181
+ const components = { modal: SmartModalPreset };
182
+
183
+ export function AppProviders({ children }: { children: ReactNode }) {
184
+ return <SmartProvider components={components}>{children}</SmartProvider>;
185
+ }
186
+ ```
187
+
188
+ `SmartModalPreset` is the styled (preset) implementation: register it as above, render it directly in place of `SmartModal`, 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.
189
+
190
+ ### The `useModal` hook
191
+
192
+ The behaviour every modal variant shares: the `open` state, controlled through `open` / `onOpenChange` or kept internally from `defaultOpen`; `invokeAction(id)`, which reports `onActionClick` without closing, and `close()`, which hides the modal and reports `onClosed`.
193
+
194
+ ```ts
195
+ function useModal({
196
+ open: openProp,
197
+ defaultOpen = false,
198
+ onOpenChange,
199
+ onActionClick,
200
+ onClosed,
201
+ }: SmartModalProps);
202
+ ```
203
+
204
+ | Returns | Type | Description |
205
+ | -------------- | ----------------------------------------- | ------------------------------------------------------------- |
206
+ | `open` | `boolean` | The open state (controlled or internal). |
207
+ | `setOpen` | `(value: boolean) => void` | Sets the state and calls `onOpenChange`. |
208
+ | `invokeAction` | `(actionId: string) => void \| undefined` | Reports `onActionClick({ actionId })` without closing. |
209
+ | `close` | `() => void` | Closes the modal, calls `onOpenChange(false)` and `onClosed`. |
210
+
211
+ ```tsx
212
+ import { SmartModalProps, useModal } from '@smartsoft001/react';
213
+
214
+ export function SheetModal(props: SmartModalProps) {
215
+ const { open, close, invokeAction } = useModal(props);
216
+
217
+ if (!open) return null;
218
+
219
+ return (
220
+ <div
221
+ role="dialog"
222
+ aria-modal="true"
223
+ aria-label={props.title ?? props.options?.ariaLabel}
224
+ className={props.className}
225
+ >
226
+ <header>
227
+ <h2>{props.title}</h2>
228
+ <button type="button" aria-label="Close" onClick={close}>
229
+ ×
230
+ </button>
231
+ </header>
232
+ {props.description && <p>{props.description}</p>}
233
+ {props.children}
234
+ <footer>
235
+ {(props.actions ?? []).map((action) => (
236
+ <button
237
+ key={action.id}
238
+ type="button"
239
+ onClick={() => invokeAction(action.id)}
240
+ >
241
+ {action.label}
242
+ </button>
243
+ ))}
244
+ </footer>
245
+ </div>
246
+ );
247
+ }
248
+ ```
249
+
250
+ Registered as `components={{ modal: SheetModal }}`, it renders both the `SmartModal`s placed by hand and the modals of `ModalService.show` (which pass `open`, `className` from `cssClass`, `onClosed` and the component as `children`).
251
+
252
+ ## Styling
253
+
254
+ - `SmartModalStandard` is always in the DOM as a `<dialog>` and shown through its `open` attribute; its native `close` event closes the modal too. Action buttons carry `data-variant`.
255
+ - `SmartModalPreset` renders inline with a `fixed` backdrop over the viewport; a click on the backdrop itself or Escape closes it. It carries `smart:dark:` variants.
256
+
257
+ ## File Locations
258
+
259
+ Source: `packages/shared/react/src/lib/components/modal/` in the smartsoft001 repository.
260
+
261
+ - `modal.tsx`: `SmartModal`
262
+ - `modal.types.ts`: `IModalActionClick`, `SmartModalProps`
263
+ - `preset/modal-preset.tsx`: `SmartModalPreset`
264
+ - `standard/modal-standard.tsx`: `SmartModalStandard`
265
+ - `use-modal.ts`: `useModal`
266
+ - `modal.stories.tsx`: Storybook stories
@@ -0,0 +1,155 @@
1
+ ---
2
+ name: react-components-multi-column-layout
3
+ description: SmartMultiColumnLayout React component API (@smartsoft001/react) — app page layout with a header, a navigation column, the main content (children) and a secondary column, constrained or full width, the 'multi-column-layout' registry key and SmartMultiColumnLayoutPreset.
4
+ user-invocable: false
5
+ ---
6
+
7
+ # Multi-Column Layout (`SmartMultiColumnLayout`)
8
+
9
+ `SmartMultiColumnLayout` arranges a page in columns: an optional header (`headerTpl`, or `title`), a navigation column (`navTpl`), the main content (`children`) and a secondary column (`secondaryTpl`, e.g. details or activity). `options.width` makes the main region constrained or full width and `options.secondaryWidth` sizes the secondary column in the preset. The standard rendering is semantic markup (`header`, `aside.nav`, `main`, `aside.secondary`).
10
+
11
+ ## When to Use This Skill
12
+
13
+ - A three-column app screen: navigation, a list or content, and a details / activity panel
14
+ - A two-column screen with a navigation or secondary column
15
+ - Restyling every multi-column layout (the `multi-column-layout` registry key)
16
+
17
+ For a sidebar shell with a mobile drawer, see `react-components-sidebar-layout`; for a top-navigation shell, `react-components-stacked-layout`.
18
+
19
+ ## Exports
20
+
21
+ All from `@smartsoft001/react`.
22
+
23
+ | Export | Kind | What it is |
24
+ | -------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
25
+ | `SmartMultiColumnLayout` | component | Renders the implementation registered as `components['multi-column-layout']` on `SmartProvider`, `SmartMultiColumnLayoutStandard` by default. |
26
+ | `SmartMultiColumnLayoutPreset` | component | Styled multi-column-layout variation (preset). |
27
+ | `SmartMultiColumnLayoutStandard` | component | The default multi-column layout: an optional `<header>` (`options.headerTpl`), then `<aside class="nav">` (`options.navTpl`), `<main>` with `children` and `<aside class="secondary">` (`options.secondaryTpl`). |
28
+
29
+ The preset's class helpers (`getMultiColumnLayoutRootClasses`, `getMultiColumnLayoutHeaderClasses`, `getMultiColumnLayoutTitleClasses`, `getMultiColumnLayoutRowClasses`, `getMultiColumnLayoutNavClasses`, `getMultiColumnLayoutMainClasses`, `getMultiColumnLayoutContentContainerClasses`, `getMultiColumnLayoutSecondaryClasses`) are exported too, for a custom implementation that wants the preset look.
30
+
31
+ ## Props and Types
32
+
33
+ ### `SmartMultiColumnLayoutProps`
34
+
35
+ | Prop | Type | Default | Description |
36
+ | ------------ | --------------------------- | ------- | ---------------------------- |
37
+ | `options?` | `IMultiColumnLayoutOptions` | — | The columns and their sizes. |
38
+ | `className?` | `string` | — | Classes on the root element. |
39
+ | `children?` | `ReactNode` | — | The main content. |
40
+
41
+ ### `IMultiColumnLayoutOptions`
42
+
43
+ | Field | Type | Default | Description |
44
+ | ----------------- | -------------------------------------- | ------- | ----------------------------------------------------------------------------------------------- |
45
+ | `title?` | `string` | — | Heading in the header zone when `headerTpl` is not set (preset). |
46
+ | `navTpl?` | `ReactNode` | — | The navigation column. |
47
+ | `secondaryTpl?` | `ReactNode` | — | The secondary column. |
48
+ | `headerTpl?` | `ReactNode` | — | The header zone. |
49
+ | `width?` | `SmartMultiColumnLayoutWidth` | — | Preset: `constrained` caps the main container at `max-w-7xl`; `full` (default) spans the width. |
50
+ | `secondaryWidth?` | `SmartMultiColumnLayoutSecondaryWidth` | — | Preset: width of the secondary column (`sm` by default). |
51
+
52
+ ### Related types
53
+
54
+ - `SmartMultiColumnLayoutWidth`: `'full' \| 'constrained'`
55
+ - `SmartMultiColumnLayoutSecondaryWidth`: `'sm' \| 'md' \| 'lg'`
56
+
57
+ ## Usage
58
+
59
+ ```tsx
60
+ import type { ReactNode } from 'react';
61
+
62
+ import {
63
+ SmartMultiColumnLayoutPreset,
64
+ SmartVerticalNavigation,
65
+ } from '@smartsoft001/react';
66
+
67
+ export function InboxLayout({
68
+ children,
69
+ details,
70
+ }: {
71
+ children: ReactNode;
72
+ details: ReactNode;
73
+ }) {
74
+ return (
75
+ <SmartMultiColumnLayoutPreset
76
+ options={{
77
+ title: 'Inbox',
78
+ width: 'full',
79
+ secondaryWidth: 'md',
80
+ navTpl: (
81
+ <SmartVerticalNavigation
82
+ options={{
83
+ items: [
84
+ { id: 'inbox', label: 'Inbox', href: '/inbox', current: true },
85
+ { id: 'sent', label: 'Sent', href: '/sent' },
86
+ ],
87
+ }}
88
+ />
89
+ ),
90
+ secondaryTpl: details,
91
+ }}
92
+ >
93
+ {children}
94
+ </SmartMultiColumnLayoutPreset>
95
+ );
96
+ }
97
+ ```
98
+
99
+ ## Replacing the Implementation
100
+
101
+ `SmartMultiColumnLayout` renders the component registered under the `'multi-column-layout'` key of `SmartProvider`'s `components`, and `SmartMultiColumnLayoutStandard` when nothing is registered there. Every `SmartMultiColumnLayout` below the provider then renders the registered component, which receives the same props.
102
+
103
+ ```tsx
104
+ import type { ReactNode } from 'react';
105
+
106
+ import {
107
+ SmartProvider,
108
+ SmartMultiColumnLayoutPreset,
109
+ } from '@smartsoft001/react';
110
+
111
+ // A module constant: a new object on every render would change the context.
112
+ const components = { 'multi-column-layout': SmartMultiColumnLayoutPreset };
113
+
114
+ export function AppProviders({ children }: { children: ReactNode }) {
115
+ return <SmartProvider components={components}>{children}</SmartProvider>;
116
+ }
117
+ ```
118
+
119
+ `SmartMultiColumnLayoutPreset` is the styled (preset) implementation: register it as above, render it directly in place of `SmartMultiColumnLayout`, 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.
120
+
121
+ ```tsx
122
+ import { SmartMultiColumnLayoutProps } from '@smartsoft001/react';
123
+
124
+ export function GridColumns({
125
+ options,
126
+ className,
127
+ children,
128
+ }: SmartMultiColumnLayoutProps) {
129
+ return (
130
+ <div className={className}>
131
+ {options?.headerTpl ?? (options?.title && <h1>{options.title}</h1>)}
132
+ <div style={{ display: 'grid', gridTemplateColumns: '16rem 1fr 20rem' }}>
133
+ <aside>{options?.navTpl}</aside>
134
+ <main>{children}</main>
135
+ <aside>{options?.secondaryTpl}</aside>
136
+ </div>
137
+ </div>
138
+ );
139
+ }
140
+ ```
141
+
142
+ ## Styling
143
+
144
+ - The preset renders a full-height gray page, a white header zone, bordered side columns and a gray main region, with `smart:dark:` variants.
145
+ - The standard rendering has no layout styles of its own.
146
+
147
+ ## File Locations
148
+
149
+ Source: `packages/shared/react/src/lib/components/multi-column-layout/` in the smartsoft001 repository.
150
+
151
+ - `multi-column-layout.tsx`: `SmartMultiColumnLayout`
152
+ - `multi-column-layout.types.ts`: `SmartMultiColumnLayoutProps`
153
+ - `preset/multi-column-layout-preset.tsx`: `SmartMultiColumnLayoutPreset`
154
+ - `standard/multi-column-layout-standard.tsx`: `SmartMultiColumnLayoutStandard`
155
+ - `multi-column-layout.stories.tsx`: Storybook stories