@smartsoft001/claude-plugins 2.194.0 → 2.196.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,172 @@
1
+ ---
2
+ name: react-components-grid-list
3
+ description: SmartGridList React component API (@smartsoft001/react) — responsive grid of cards (image or icon, title link, description, badge and action slots) with columns, gap and cards/horizontal/logos layouts, empty and footer slots, the 'grid-list' registry key and SmartGridListPreset.
4
+ user-invocable: false
5
+ ---
6
+
7
+ # Grid List (`SmartGridList`)
8
+
9
+ `SmartGridList` renders items as tiles: a media slot (`iconTpl`, else `imageUrl`), a title (a link when `href` is set) with an optional badge, a description and an action slot. `columns`, `gap` and `layout` (`cards`, `horizontal`, `logos`) shape the grid in `SmartGridListPreset`; the standard rendering is an unstyled list with class hooks. `emptyTpl` is shown when there are no items.
10
+
11
+ ## When to Use This Skill
12
+
13
+ - A gallery of projects, people, products or integrations as cards
14
+ - A logo wall (`layout: 'logos'`)
15
+ - Restyling every grid list (the `grid-list` registry key)
16
+
17
+ ## Exports
18
+
19
+ All from `@smartsoft001/react`.
20
+
21
+ | Export | Kind | What it is |
22
+ | ----------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
23
+ | `SmartGridList` | component | Renders the implementation registered as `components['grid-list']` on `SmartProvider`, `SmartGridListStandard` by default. |
24
+ | `SmartGridListPreset` | component | Styled grid-list variation (preset). |
25
+ | `SmartGridListStandard` | component | The default grid-list rendering: one `li.item` per item (icon template > image, title as a link when `href` is set, description, badge and action slots), the `emptyTpl` when there are no items, then the `footerTpl` slot. |
26
+
27
+ The preset's class helpers (`getGridListColumnsClasses`, `getGridListGapClasses`, `getGridListGridClasses`, `getGridListTileClasses`, `getGridListMediaClasses`, `GRID_LIST_CONTAINER`, `GRID_LIST_TILE`) are exported too, for a custom implementation that wants the preset look.
28
+
29
+ ## Props and Types
30
+
31
+ ### `SmartGridListProps`
32
+
33
+ | Prop | Type | Default | Description |
34
+ | ------------ | ------------------ | ------- | ------------------------------------ |
35
+ | `options?` | `IGridListOptions` | — | Header, items, grid shape and slots. |
36
+ | `className?` | `string` | — | Classes on the root element. |
37
+
38
+ ### `IGridListOptions`
39
+
40
+ | Field | Type | Default | Description |
41
+ | -------------- | ---------------------- | --------- | ------------------------------------------------------------------------------------------------ |
42
+ | `title?` | `string` | — | Heading above the grid. |
43
+ | `description?` | `string` | — | Text under the heading. |
44
+ | `items?` | `IGridListItem[]` | `[]` | The tiles. |
45
+ | `columns?` | `SmartGridListColumns` | — | Preset: one column on mobile, two from `sm`, the requested count from `lg`. |
46
+ | `gap?` | `'sm' \| 'md' \| 'lg'` | — | Preset: `sm`, `md` (default) or `lg` spacing. |
47
+ | `layout?` | `SmartGridListLayout` | `'cards'` | Preset: media on top (`cards`), an inline row (`horizontal`) or a centred logo (`logos`). |
48
+ | `emptyTpl?` | `ReactNode` | — | Shown when there are no items (the preset falls back to an untranslated "No items to display."). |
49
+ | `footerTpl?` | `ReactNode` | — | A slot below the grid. |
50
+
51
+ ### `IGridListItem`
52
+
53
+ | Field | Type | Default | Description |
54
+ | -------------- | ----------- | -------- | -------------------------------------- |
55
+ | `id?` | `string` | — | Key of the tile. |
56
+ | `title` | `string` | required | Tile title; a link when `href` is set. |
57
+ | `description?` | `string` | — | Tile text. |
58
+ | `imageUrl?` | `string` | — | Tile image. |
59
+ | `imageAlt?` | `string` | — | Alt text of the image. |
60
+ | `href?` | `string` | — | Makes the title a link. |
61
+ | `iconTpl?` | `ReactNode` | — | Media icon; wins over `imageUrl`. |
62
+ | `badgeTpl?` | `ReactNode` | — | Badge next to the title. |
63
+ | `actionTpl?` | `ReactNode` | — | Action slot in the tile footer. |
64
+ | `ariaLabel?` | `string` | — | Accessible name of the tile. |
65
+
66
+ ### Related types
67
+
68
+ - `SmartGridListColumns`: `1 \| 2 \| 3 \| 4 \| 5 \| 6`
69
+ - `SmartGridListLayout`: `'cards' \| 'horizontal' \| 'logos'`
70
+
71
+ ## Usage
72
+
73
+ ```tsx
74
+ import { SmartBadgePreset, SmartGridListPreset } from '@smartsoft001/react';
75
+
76
+ export function Integrations() {
77
+ return (
78
+ <SmartGridListPreset
79
+ options={{
80
+ title: 'Integrations',
81
+ columns: 3,
82
+ gap: 'lg',
83
+ layout: 'cards',
84
+ items: [
85
+ {
86
+ id: 'slack',
87
+ title: 'Slack',
88
+ description: 'Post updates to a channel.',
89
+ imageUrl: '/logos/slack.svg',
90
+ href: '/integrations/slack',
91
+ },
92
+ {
93
+ id: 'github',
94
+ title: 'GitHub',
95
+ description: 'Link commits to tickets.',
96
+ imageUrl: '/logos/github.svg',
97
+ badgeTpl: <SmartBadgePreset text="New" color="green" />,
98
+ },
99
+ ],
100
+ emptyTpl: <p>No integrations yet.</p>,
101
+ }}
102
+ />
103
+ );
104
+ }
105
+ ```
106
+
107
+ ## Replacing the Implementation
108
+
109
+ `SmartGridList` renders the component registered under the `'grid-list'` key of `SmartProvider`'s `components`, and `SmartGridListStandard` when nothing is registered there. Every `SmartGridList` below the provider then renders the registered component, which receives the same props.
110
+
111
+ ```tsx
112
+ import type { ReactNode } from 'react';
113
+
114
+ import { SmartProvider, SmartGridListPreset } from '@smartsoft001/react';
115
+
116
+ // A module constant: a new object on every render would change the context.
117
+ const components = { 'grid-list': SmartGridListPreset };
118
+
119
+ export function AppProviders({ children }: { children: ReactNode }) {
120
+ return <SmartProvider components={components}>{children}</SmartProvider>;
121
+ }
122
+ ```
123
+
124
+ `SmartGridListPreset` is the styled (preset) implementation: register it as above, render it directly in place of `SmartGridList`, 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.
125
+
126
+ ```tsx
127
+ import { SmartGridListProps } from '@smartsoft001/react';
128
+
129
+ export function SimpleGrid({ options, className }: SmartGridListProps) {
130
+ return (
131
+ <ul
132
+ className={className}
133
+ style={{
134
+ display: 'grid',
135
+ gridTemplateColumns: `repeat(${options?.columns ?? 3}, 1fr)`,
136
+ }}
137
+ >
138
+ {(options?.items ?? []).map((item, index) => (
139
+ <li key={item.id ?? index}>
140
+ {item.iconTpl ??
141
+ (item.imageUrl && (
142
+ <img src={item.imageUrl} alt={item.imageAlt ?? ''} />
143
+ ))}
144
+ {item.href ? (
145
+ <a href={item.href}>{item.title}</a>
146
+ ) : (
147
+ <span>{item.title}</span>
148
+ )}
149
+ {item.badgeTpl}
150
+ <p>{item.description}</p>
151
+ {item.actionTpl}
152
+ </li>
153
+ ))}
154
+ </ul>
155
+ );
156
+ }
157
+ ```
158
+
159
+ ## Styling
160
+
161
+ - `SmartGridListStandard` renders one `li.item` per item without layout styles: `columns`, `gap` and `layout` only take effect in `SmartGridListPreset` (or your own CSS).
162
+ - The preset tiles are bordered cards with `smart:dark:` variants.
163
+
164
+ ## File Locations
165
+
166
+ Source: `packages/shared/react/src/lib/components/grid-list/` in the smartsoft001 repository.
167
+
168
+ - `grid-list.tsx`: `SmartGridList`
169
+ - `grid-list.types.ts`: `SmartGridListProps`
170
+ - `preset/grid-list-preset.tsx`: `SmartGridListPreset`
171
+ - `standard/grid-list-standard.tsx`: `SmartGridListStandard`
172
+ - `grid-list.stories.tsx`: Storybook stories
@@ -0,0 +1,117 @@
1
+ ---
2
+ name: react-components-icon
3
+ description: SmartIcon React component API (@smartsoft001/react) — the library's glyphs (spinner, chevron-down, chevron-up) or a custom template node, plus SmartIconPreset with plain/contained/soft containers in sm/md/lg; no registry key.
4
+ user-invocable: false
5
+ ---
6
+
7
+ # Icon (`SmartIcon`)
8
+
9
+ `SmartIcon` renders one of the library's three glyphs by `name` (`spinner`, `chevron-down`, `chevron-up`) or, when `template` is given, that node instead. It renders nothing for an unknown name. The glyph components (`SmartIconSpinner`, `SmartIconChevronDown`, `SmartIconChevronUp`) are exported too. `SmartIconPreset` wraps the icon in a themed container (`plain`, `contained`, `soft`) in three sizes. The icon has **no registry key**: use `template` for your own icon, or the preset directly.
10
+
11
+ ## When to Use This Skill
12
+
13
+ - Showing a loading spinner or an expand / collapse chevron
14
+ - Rendering an icon of your own through the same API (`template`)
15
+ - Putting an icon in a coloured tile or circle (`SmartIconPreset`)
16
+
17
+ ## Exports
18
+
19
+ All from `@smartsoft001/react`.
20
+
21
+ | Export | Kind | What it is |
22
+ | ---------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
23
+ | `SmartIcon` | component | One of the library's glyphs, or a custom `template`. |
24
+ | `SmartIconSpinner` | component | The spinner glyph (an animated SVG). |
25
+ | `SmartIconChevronDown` | component | The chevron-down glyph. |
26
+ | `SmartIconChevronUp` | component | The chevron-up glyph. |
27
+ | `SmartIconPreset` | component | Styled icon variation (preset): `<SmartIcon>` inside a themed container, across a `plain` / `contained` / `soft` variant scale in `sm` / `md` / `lg`. |
28
+
29
+ The preset's class helpers (`getIconSizeClasses`, `getIconContainerClasses`) are exported too, for a custom implementation that wants the preset look.
30
+
31
+ ## Props and Types
32
+
33
+ ### `SmartIconProps`
34
+
35
+ | Prop | Type | Default | Description |
36
+ | ------------ | ----------- | ------- | ---------------------------------------------------------------------------------- |
37
+ | `name?` | `IconName` | — | The glyph; renders nothing without a `name` or `template`, or for an unknown name. |
38
+ | `className?` | `string` | — | Classes on the SVG of the glyph. |
39
+ | `template?` | `ReactNode` | — | Rendered instead of the named glyph. |
40
+
41
+ ### `SmartIconGlyphProps`
42
+
43
+ Props of the glyph components.
44
+
45
+ | Prop | Type | Default | Description |
46
+ | ------------ | -------- | ------- | ------------------- |
47
+ | `className?` | `string` | — | Classes on the SVG. |
48
+
49
+ ### `SmartIconPresetProps`
50
+
51
+ Props of `SmartIconPreset`.
52
+
53
+ | Prop | Type | Default | Description |
54
+ | ------------ | ------------------- | ----------- | ------------------------------------- |
55
+ | `name?` | `IconName` | `'spinner'` | The glyph inside the container. |
56
+ | `template?` | `ReactNode` | — | A node rendered instead of the glyph. |
57
+ | `variant?` | `IconPresetVariant` | `'plain'` | The container treatment. |
58
+ | `size?` | `IconPresetSize` | `'md'` | The container footprint. |
59
+ | `className?` | `string` | — | Classes on the container. |
60
+
61
+ ### Related types
62
+
63
+ - `IconName`: `'spinner' \| 'chevron-down' \| 'chevron-up'` — The glyph names.
64
+ - `IconPresetVariant`: `'plain' \| 'contained' \| 'soft'` — Visual treatment applied around the icon glyph.
65
+ - `IconPresetSize`: `'sm' \| 'md' \| 'lg'` — Icon footprint on the `size-*` scale.
66
+
67
+ ## Usage
68
+
69
+ ```tsx
70
+ import { SmartIcon, SmartIconPreset } from '@smartsoft001/react';
71
+
72
+ export function Icons({ open }: { open: boolean }) {
73
+ return (
74
+ <div className="flex items-center gap-4">
75
+ <SmartIcon name="spinner" />
76
+ <SmartIcon
77
+ name={open ? 'chevron-up' : 'chevron-down'}
78
+ className="size-4"
79
+ />
80
+ <SmartIconPreset name="spinner" variant="soft" size="lg" />
81
+ <SmartIconPreset
82
+ variant="contained"
83
+ template={
84
+ <svg
85
+ viewBox="0 0 24 24"
86
+ width="16"
87
+ height="16"
88
+ fill="currentColor"
89
+ aria-hidden="true"
90
+ >
91
+ <path d="M12 21s-7-4.35-7-10a4 4 0 0 1 7-2.65A4 4 0 0 1 19 11c0 5.65-7 10-7 10z" />
92
+ </svg>
93
+ }
94
+ />
95
+ </div>
96
+ );
97
+ }
98
+ ```
99
+
100
+ ## Replacing the Implementation
101
+
102
+ `SmartIcon` has no `SmartProvider` registry key, so it cannot be replaced application-wide. Pass your own node through `template` (it is rendered as is), use `SmartIconPreset` for a themed container, or render the glyph components directly. Components that show a spinner or a chevron (button, accordion, input loader) render `SmartIcon` themselves.
103
+
104
+ ## Styling
105
+
106
+ - The glyphs are inline SVGs that take `currentColor`, so they follow the text colour (and dark mode) of their parent.
107
+ - `SmartIconPreset` adds the container classes per `variant` and `size`, with `smart:dark:` variants.
108
+
109
+ ## File Locations
110
+
111
+ Source: `packages/shared/react/src/lib/components/icon/` in the smartsoft001 repository.
112
+
113
+ - `glyphs.tsx`: `SmartIconSpinner`, `SmartIconChevronDown`, `SmartIconChevronUp`
114
+ - `icon.tsx`: `SmartIcon`
115
+ - `icon.types.ts`: `IconName`, `SmartIconGlyphProps`, `SmartIconProps`
116
+ - `preset/icon-preset.tsx`: `SmartIconPreset`, `SmartIconPresetProps`
117
+ - `icon.stories.tsx`: Storybook stories
@@ -0,0 +1,113 @@
1
+ ---
2
+ name: react-components-import
3
+ description: SmartImport React component API (@smartsoft001/react) — upload-icon button that opens a hidden file input (accept, JSON by default) and passes the picked File to onSet, and the useImport hook.
4
+ user-invocable: false
5
+ ---
6
+
7
+ # Import (`SmartImport`)
8
+
9
+ `SmartImport` is an upload-icon button that opens a hidden `<input type="file">`; the picked `File` is passed to `onSet`, and the input is cleared so the same file can be picked again. `accept` limits the file types (`application/json` by default). Reading and parsing the file is up to you. It renders through `SmartButton`, so it follows the `button` registry key.
10
+
11
+ ## When to Use This Skill
12
+
13
+ - Letting the user load a JSON (or other) file the page will parse
14
+ - Pairing with `SmartExport` for a download / upload round trip
15
+
16
+ For file fields of a model-driven form (attachments, images, PDFs), use the input field components (`react-components-input`).
17
+
18
+ ## Exports
19
+
20
+ All from `@smartsoft001/react`.
21
+
22
+ | Export | Kind | What it is |
23
+ | ------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
24
+ | `SmartImport` | component | An upload-icon `SmartButton` that opens a hidden file input and passes the picked file to `onSet`. |
25
+ | `useImport` | hook | The import button's logic: `onFileSelected` hands the picked file to `onSet` and clears the input, so picking the same file again fires `change` again; `triggerFileInput` opens the picker of `inputEl`. |
26
+
27
+ ## Props and Types
28
+
29
+ ### `SmartImportProps`
30
+
31
+ | Prop | Type | Default | Description |
32
+ | ------------ | ---------------------- | -------------------- | ----------------------------------------------------------------- |
33
+ | `accept?` | `string` | `'application/json'` | The file types the picker offers (`application/json` by default). |
34
+ | `className?` | `string` | — | Extra CSS classes applied to the `<span>` around the button. |
35
+ | `onSet?` | `(file: File) => void` | — | Called with the picked file. |
36
+
37
+ ## Usage
38
+
39
+ ```tsx
40
+ import { SmartImport } from '@smartsoft001/react';
41
+
42
+ export function ImportNotes({
43
+ onNotes,
44
+ }: {
45
+ onNotes: (notes: unknown[]) => void;
46
+ }) {
47
+ const read = async (file: File) => {
48
+ const parsed: unknown = JSON.parse(await file.text());
49
+ if (Array.isArray(parsed)) onNotes(parsed);
50
+ };
51
+
52
+ return (
53
+ <SmartImport accept="application/json" onSet={(file) => void read(file)} />
54
+ );
55
+ }
56
+ ```
57
+
58
+ ## Replacing the Implementation
59
+
60
+ `SmartImport` has no registry key of its own: it renders a `SmartButton`, so registering a component under the `button` key restyles it too. For a different control, build one on `useImport`.
61
+
62
+ ### The `useImport` hook
63
+
64
+ The import button's logic: `onFileSelected` hands the picked file to `onSet` and clears the input, so picking the same file again fires `change` again; `triggerFileInput` opens the picker of `inputEl`.
65
+
66
+ ```ts
67
+ function useImport({ onSet }: Pick<SmartImportProps, 'onSet'>);
68
+ ```
69
+
70
+ | Returns | Type | Description |
71
+ | ------------------ | ------------------------------------------------ | ------------------------------------------------------------------------------------ |
72
+ | `inputRef` | `RefObject<HTMLInputElement \| null>` | Attach to the hidden file input. |
73
+ | `onFileSelected` | `(event: { target: HTMLInputElement; }) => void` | The input's `change` handler: passes the first file to `onSet` and clears the input. |
74
+ | `triggerFileInput` | `(inputEl: HTMLInputElement) => void` | Opens the file picker of an input element. |
75
+
76
+ ```tsx
77
+ import { SmartImportProps, useImport } from '@smartsoft001/react';
78
+
79
+ export function ImportLink(props: SmartImportProps) {
80
+ const { inputRef, onFileSelected, triggerFileInput } = useImport(props);
81
+
82
+ return (
83
+ <span className={props.className}>
84
+ <button
85
+ type="button"
86
+ onClick={() => inputRef.current && triggerFileInput(inputRef.current)}
87
+ >
88
+ Upload a file…
89
+ </button>
90
+ <input
91
+ ref={inputRef}
92
+ type="file"
93
+ accept={props.accept ?? 'application/json'}
94
+ hidden
95
+ onChange={onFileSelected}
96
+ />
97
+ </span>
98
+ );
99
+ }
100
+ ```
101
+
102
+ ## Styling
103
+
104
+ - `className` goes on the `<span>` around the button and the input.
105
+
106
+ ## File Locations
107
+
108
+ Source: `packages/shared/react/src/lib/components/import/` in the smartsoft001 repository.
109
+
110
+ - `import.tsx`: `SmartImport`
111
+ - `import.types.ts`: `SmartImportProps`
112
+ - `use-import.ts`: `useImport`
113
+ - `import.stories.tsx`: Storybook stories
@@ -0,0 +1,147 @@
1
+ ---
2
+ name: react-components-info
3
+ description: SmartInfo React component API (@smartsoft001/react) — info icon that shows a tooltip/popover with translated text (IInfoOptions.text), the 'info' registry key, SmartInfoPreset with top/bottom/left/right placement and useInfo.
4
+ user-invocable: false
5
+ ---
6
+
7
+ # Info (`SmartInfo`)
8
+
9
+ `SmartInfo` is a small info icon that reveals `options.text` in a popover. The standard rendering toggles the popover on click and closes it on a click anywhere else; the text goes through the provider's translations, so it may be a translation key. `SmartInfoPreset` is a hover / focus tooltip placed by `placement`. Form inputs and details show it automatically for fields with an `info` option.
10
+
11
+ ## When to Use This Skill
12
+
13
+ - Explaining a field or a value with a small "i" tooltip
14
+ - Changing how every info tooltip looks (the `info` registry key), including the ones inputs and details render
15
+
16
+ ## Exports
17
+
18
+ All from `@smartsoft001/react`.
19
+
20
+ | Export | Kind | What it is |
21
+ | ------------------- | --------- | -------------------------------------------------------------------------------------------------------------- |
22
+ | `SmartInfo` | component | Renders the implementation registered as `components.info` on `SmartProvider`, `SmartInfoStandard` by default. |
23
+ | `SmartInfoPreset` | component | Styled info / tooltip variation (preset). |
24
+ | `SmartInfoStandard` | component | The default info rendering: an info icon that toggles a popover with the translated `options.text`. |
25
+ | `useInfo` | hook | The behaviour every info variant shares: whether the text is shown, and the functions that show and hide it. |
26
+
27
+ The preset's class helpers (`getInfoContainerClasses`, `getInfoToggleClasses`, `getInfoTooltipClasses`) are exported too, for a custom implementation that wants the preset look.
28
+
29
+ ## Props and Types
30
+
31
+ ### `SmartInfoProps`
32
+
33
+ | Prop | Type | Default | Description |
34
+ | ------------ | -------------- | -------- | ---------------------------- |
35
+ | `options` | `IInfoOptions` | required | The text to show. |
36
+ | `className?` | `string` | — | Classes on the root element. |
37
+
38
+ ### `SmartInfoPresetProps`
39
+
40
+ Props of `SmartInfoPreset`. Extends `SmartInfoProps`.
41
+
42
+ | Prop | Type | Default | Description |
43
+ | ------------ | --------------------- | ------- | ---------------------------------------- |
44
+ | `placement?` | `InfoPresetPlacement` | `'top'` | Side of the toggle the tooltip opens on. |
45
+
46
+ ### `IInfoOptions`
47
+
48
+ | Field | Type | Default | Description |
49
+ | ------ | -------- | -------- | ------------------------------------------------ |
50
+ | `text` | `string` | required | The text (translated by the standard rendering). |
51
+
52
+ ### Related types
53
+
54
+ - `InfoPresetPlacement`: `'top' \| 'bottom' \| 'left' \| 'right'`
55
+
56
+ ## Usage
57
+
58
+ ```tsx
59
+ import { SmartInfo, SmartInfoPreset } from '@smartsoft001/react';
60
+
61
+ export function VatLabel() {
62
+ return (
63
+ <label className="flex items-center gap-2">
64
+ VAT number
65
+ <SmartInfo
66
+ options={{ text: 'Your EU VAT number, with the country prefix.' }}
67
+ />
68
+ <SmartInfoPreset
69
+ options={{ text: 'Shown on invoices.' }}
70
+ placement="right"
71
+ />
72
+ </label>
73
+ );
74
+ }
75
+ ```
76
+
77
+ ## Replacing the Implementation
78
+
79
+ `SmartInfo` renders the component registered under the `'info'` key of `SmartProvider`'s `components`, and `SmartInfoStandard` when nothing is registered there. Every `SmartInfo` 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, SmartInfoPreset } from '@smartsoft001/react';
85
+
86
+ // A module constant: a new object on every render would change the context.
87
+ const components = { info: SmartInfoPreset };
88
+
89
+ export function AppProviders({ children }: { children: ReactNode }) {
90
+ return <SmartProvider components={components}>{children}</SmartProvider>;
91
+ }
92
+ ```
93
+
94
+ `SmartInfoPreset` is the styled (preset) implementation: register it as above, render it directly in place of `SmartInfo`, 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
+ ### The `useInfo` hook
97
+
98
+ The behaviour every info variant shares: whether the text is shown, and the functions that show and hide it.
99
+
100
+ ```ts
101
+ function useInfo();
102
+ ```
103
+
104
+ | Returns | Type | Description |
105
+ | -------- | ------------ | -------------------------- |
106
+ | `isOpen` | `boolean` | Whether the text is shown. |
107
+ | `toggle` | `() => void` | Shows or hides the text. |
108
+ | `open` | `() => void` | Shows the text. |
109
+ | `close` | `() => void` | Hides the text. |
110
+
111
+ ```tsx
112
+ import { SmartInfoProps, useInfo, useTranslate } from '@smartsoft001/react';
113
+
114
+ export function InlineInfo({ options, className }: SmartInfoProps) {
115
+ const { isOpen, toggle } = useInfo();
116
+ const t = useTranslate();
117
+
118
+ return (
119
+ <span className={className}>
120
+ <button
121
+ type="button"
122
+ aria-expanded={isOpen}
123
+ aria-label="More information"
124
+ onClick={toggle}
125
+ >
126
+ ⓘ
127
+ </button>
128
+ {isOpen && <small role="note">{t(options.text)}</small>}
129
+ </span>
130
+ );
131
+ }
132
+ ```
133
+
134
+ ## Styling
135
+
136
+ - The preset tooltip carries `role="tooltip"` and sets `aria-describedby` on the toggle while shown; both renderings have `smart:dark:` variants.
137
+
138
+ ## File Locations
139
+
140
+ Source: `packages/shared/react/src/lib/components/info/` in the smartsoft001 repository.
141
+
142
+ - `info.tsx`: `SmartInfo`
143
+ - `info.types.ts`: `SmartInfoProps`
144
+ - `preset/info-preset.tsx`: `SmartInfoPreset`, `SmartInfoPresetProps`
145
+ - `standard/info-standard.tsx`: `SmartInfoStandard`
146
+ - `use-info.ts`: `useInfo`
147
+ - `info.stories.tsx`: Storybook stories