@astryxdesign/cli 0.1.4-canary.f0b9ca8 → 0.1.4-canary.f5fcc51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -2
- package/docs/getting-started.doc.mjs +0 -4
- package/docs/migration.doc.mjs +0 -134
- package/package.json +7 -12
- package/src/api/doctor.mjs +2 -13
- package/src/codemods/__tests__/runner.test.mjs +0 -38
- package/src/codemods/runner.mjs +0 -2
- package/src/commands/agent-docs.mjs +5 -7
- package/src/commands/agent-docs.test.mjs +0 -33
- package/src/commands/doctor.test.mjs +0 -34
- package/src/commands/init.mjs +1 -1
- package/templates/blocks/components/CodeBlock/CodeBlockTerminal.doc.mjs +1 -1
- package/templates/blocks/components/CommandPaletteGroup/CommandPaletteGroupShowcase.tsx +48 -27
- package/templates/blocks/components/CommandPaletteItem/CommandPaletteItemShowcase.tsx +54 -31
- package/templates/pages/table-page-chart/page.tsx +13 -3
- package/templates/pages/table-page-shoe-store-heatmap/page.tsx +18 -4
- package/templates/blocks/components/CommandPaletteInput/CommandPaletteInputBasic.doc.mjs +0 -15
- package/templates/blocks/components/CommandPaletteInput/CommandPaletteInputBasic.tsx +0 -39
- package/templates/blocks/components/CommandPaletteInput/CommandPaletteInputShowcase.doc.mjs +0 -15
- package/templates/blocks/components/CommandPaletteInput/CommandPaletteInputShowcase.tsx +0 -39
- package/templates/blocks/components/CommandPaletteList/CommandPaletteListBasic.doc.mjs +0 -15
- package/templates/blocks/components/CommandPaletteList/CommandPaletteListBasic.tsx +0 -27
- package/templates/blocks/components/CommandPaletteList/CommandPaletteListShowcase.doc.mjs +0 -15
- package/templates/blocks/components/CommandPaletteList/CommandPaletteListShowcase.tsx +0 -38
- package/templates/blocks/components/ContextMenuItem/ContextMenuItemBasic.doc.mjs +0 -14
- package/templates/blocks/components/ContextMenuItem/ContextMenuItemBasic.tsx +0 -44
- package/templates/blocks/components/ContextMenuItem/ContextMenuItemShowcase.doc.mjs +0 -15
- package/templates/blocks/components/ContextMenuItem/ContextMenuItemShowcase.tsx +0 -107
package/CHANGELOG.md
CHANGED
|
@@ -36,7 +36,7 @@ Thanks to everyone who contributed to this release:
|
|
|
36
36
|
- Strict config + integration v1 schema (integrations, issuesUrl, hooks.postCodemod) and new @astryxdesign/cli/integration export.
|
|
37
37
|
- File-based codemod API (createCodemod/createConfigCodemod) with the @astryxdesign/cli/codemod export and integration codemod discovery in upgrade.
|
|
38
38
|
- component, template, and upgrade now print a one-line non-blocking warning when a configured integration has validation issues, pointing to validate-integration.
|
|
39
|
-
- Add a Kanban Board page template: color-coded status columns, draggable task cards with priority tags, and board toolbar.
|
|
39
|
+
- Add a Kanban Board page template: color-coded status columns, draggable task cards with priority tags, and board toolbar.
|
|
40
40
|
- Add frame-first layout guidance: new `astryx docs layout` topic (shell choice, region budgets, app archetypes, cards-vs-rows policy, responsive contracts), layout rules in the generated agent cheat sheet, and layout anti-patterns in `docs principles`.
|
|
41
41
|
- Add a v0.1.3 config codemod that migrates astryx.config layout.components to experimental.xle.components.
|
|
42
42
|
- Add v0.1.0 codemods for migrating `declare module "@xds/core/..."` type augmentations and `.xds-*` / `[data-xds-theme]` / `@layer xds-theme` CSS surfaces to their `@astryxdesign`/`astryx-*` equivalents.
|
|
@@ -80,7 +80,6 @@ Thanks to everyone who contributed to this release:
|
|
|
80
80
|
Thanks to everyone who contributed to this release:
|
|
81
81
|
|
|
82
82
|
- @AKnassa
|
|
83
|
-
- @cg-hub18
|
|
84
83
|
- @ejhammond
|
|
85
84
|
- @ernestt
|
|
86
85
|
- @harshavardhan194
|
|
@@ -69,10 +69,6 @@ export const docs = {
|
|
|
69
69
|
type: 'prose',
|
|
70
70
|
text: 'Available themes: @astryxdesign/theme-neutral (muted minimal, a good starting point), @astryxdesign/theme-butter, @astryxdesign/theme-chocolate, @astryxdesign/theme-gothic (dark-only), @astryxdesign/theme-matcha, @astryxdesign/theme-stone, and @astryxdesign/theme-y2k. See `npx astryx docs theme` for the full theming guide.',
|
|
71
71
|
},
|
|
72
|
-
{
|
|
73
|
-
type: 'prose',
|
|
74
|
-
text: 'These stylesheets are cascade-layered: the reset loads in @layer reset and component styles in @layer astryx-base. If your project has existing global CSS, a legacy reset, or Tailwind, declare the layer order explicitly and assign every stylesheet to a layer deliberately: unlayered styles and later layers both override astryx-base regardless of specificity. See the Cascade Layer Safety section in `npx astryx docs migration` before building screens.',
|
|
75
|
-
},
|
|
76
72
|
],
|
|
77
73
|
},
|
|
78
74
|
{
|
package/docs/migration.doc.mjs
CHANGED
|
@@ -33,7 +33,6 @@ export const docs = {
|
|
|
33
33
|
'Install the design system and run init so the project has package scripts, theme CSS, and agent docs.',
|
|
34
34
|
'Wrap the app root with Theme and choose the initial light, dark, or system mode behavior.',
|
|
35
35
|
'Make Tailwind and design system CSS layer order explicit before replacing components.',
|
|
36
|
-
'Render the foundation smoke test page and confirm primitives keep their padding before migrating any surface.',
|
|
37
36
|
'Move the persistent frame first: AppShell, TopNav, SideNav, page content, and mobile navigation.',
|
|
38
37
|
'Replace shared primitives: Button, IconButton, TextInput, NumberInput, Switch, CheckboxInput, RadioList, Selector, Tabs, Dialog, AlertDialog, Banner, Toast, Badge, Card, Table, and ListItem.',
|
|
39
38
|
'Replace global workflows: command palette, settings popover, theme toggle, search, filters, create flows, and destructive confirmation dialogs.',
|
|
@@ -126,139 +125,6 @@ export function AppRoot({children}: {children: React.ReactNode}) {
|
|
|
126
125
|
@import "@astryxdesign/core/tailwind-theme.css";
|
|
127
126
|
@import "tailwindcss/utilities.css" layer(utilities);`,
|
|
128
127
|
},
|
|
129
|
-
{
|
|
130
|
-
type: 'prose',
|
|
131
|
-
text: 'On Tailwind v3 there is no preflight.css to import, so wrap the @tailwind base directive in a named layer instead. Keep utilities unlayered so existing app utility classes still win everywhere.',
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
type: 'code',
|
|
135
|
-
lang: 'css',
|
|
136
|
-
label: 'Tailwind v3 coexistence',
|
|
137
|
-
code: `@layer reset, tw-preflight, astryx-base, astryx-theme;
|
|
138
|
-
|
|
139
|
-
@import "@astryxdesign/core/reset.css";
|
|
140
|
-
@import "@astryxdesign/core/astryx.css";
|
|
141
|
-
@import "@astryxdesign/theme-neutral/theme.css";
|
|
142
|
-
|
|
143
|
-
@layer tw-preflight {
|
|
144
|
-
@tailwind base; /* layered: astryx-theme now wins over preflight */
|
|
145
|
-
}
|
|
146
|
-
@tailwind components;
|
|
147
|
-
@tailwind utilities; /* unlayered: legacy utility classes keep winning */`,
|
|
148
|
-
},
|
|
149
|
-
],
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
title: 'Cascade Layer Safety',
|
|
153
|
-
content: [
|
|
154
|
-
{
|
|
155
|
-
type: 'prose',
|
|
156
|
-
text: 'In a stylesheet with no layers at all, a zero-specificity reset like `* { padding: 0 }` loses to any class selector, so most developers treat resets as harmless. Layers change the rules twice: unlayered styles beat every named layer, and a later layer beats an earlier one, both regardless of specificity. The same reset therefore wins against every component style either by staying unlayered or by landing in a layer declared after astryx-base. Same CSS, opposite outcome, and no error or warning when it happens.',
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
type: 'prose',
|
|
160
|
-
text: 'This is the most common way an adoption breaks, through one of two @import mechanisms. A top-level @import without the layer() keyword keeps the legacy reset unlayered, where it overrides every design system layer. And an @import nested inside a file that was itself imported into a layer inherits that surrounding layer, so a reset can silently land in a consumer layer above astryx-base. Either way the fix is the same: import the legacy reset into the lowest layer explicitly.',
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
type: 'code',
|
|
164
|
-
lang: 'css',
|
|
165
|
-
label: 'Legacy reset, explicitly layered',
|
|
166
|
-
code: `/* was: @import "./legacy-reset.css"; (unlayered: beats every layer) */
|
|
167
|
-
@import "./legacy-reset.css" layer(reset);`,
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
type: 'prose',
|
|
171
|
-
text: 'Audit the layers around the design system with this checklist before building screens.',
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
type: 'list',
|
|
175
|
-
style: 'unordered',
|
|
176
|
-
items: [
|
|
177
|
-
'Declare the canonical @layer order once, before any @import. With webpack-based bundlers (including Next.js) the order declaration must live in its own CSS file imported first, such as layers.css, because webpack hoists @import content above the inline CSS that follows it.',
|
|
178
|
-
'Audit every pre-existing global or reset stylesheet and assign each one to a layer deliberately. Top-level imports without layer() stay unlayered and beat every layer; imports nested inside a layered file inherit that layer.',
|
|
179
|
-
'Remove or demote the app legacy reset. The design system ships its own :where() reset in the lowest layer, so any app reset belongs in that same reset layer and never in a layer above astryx-base.',
|
|
180
|
-
'Layer Tailwind preflight. On Tailwind v4, import preflight.css with layer(base). On Tailwind v3, wrap the @tailwind base directive in a named layer (see the snippet in Theme and CSS Setup). Unlayered preflight overrides theme CSS silently.',
|
|
181
|
-
'Set moduleResolution to bundler or node16 and newer so subpath imports like @astryxdesign/core/reset.css resolve.',
|
|
182
|
-
'Theme with defineTheme and the accent family API instead of hand-writing individual color tokens. Derived tokens like --color-on-accent are generated from the accent scale automatically; hand-writing only --color-accent leaves --color-on-accent at its stale white default with no contrast guarantee against the new accent.',
|
|
183
|
-
'Run the foundation smoke test below and view a few components in both light and dark mode before migrating any route.',
|
|
184
|
-
],
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
type: 'prose',
|
|
188
|
-
text: 'One more mental model shift: a className or utility class you write on a component still reaches the DOM either way, but whether it overrides the component is a layer question, not a source order question. Keep app utilities in the utilities layer so they keep winning.',
|
|
189
|
-
},
|
|
190
|
-
],
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
title: 'Foundation Smoke Test',
|
|
194
|
-
content: [
|
|
195
|
-
{
|
|
196
|
-
type: 'prose',
|
|
197
|
-
text: 'A broken layer order fails silently and identically on every page, so catch it before feature work instead of after N migrated screens. Render one throwaway page with a few primitives as the first migration step.',
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
type: 'code',
|
|
201
|
-
lang: 'tsx',
|
|
202
|
-
label: 'Foundation check page',
|
|
203
|
-
code: `import {useState} from 'react';
|
|
204
|
-
import {Button} from '@astryxdesign/core/Button';
|
|
205
|
-
import {Card} from '@astryxdesign/core/Card';
|
|
206
|
-
import {Table} from '@astryxdesign/core/Table';
|
|
207
|
-
import {TextInput} from '@astryxdesign/core/TextInput';
|
|
208
|
-
import {VStack} from '@astryxdesign/core/VStack';
|
|
209
|
-
|
|
210
|
-
export default function FoundationCheck() {
|
|
211
|
-
const [email, setEmail] = useState('');
|
|
212
|
-
|
|
213
|
-
return (
|
|
214
|
-
<div data-foundation-check>
|
|
215
|
-
<VStack gap={4}>
|
|
216
|
-
<Button label="Primary action" variant="primary" />
|
|
217
|
-
<TextInput
|
|
218
|
-
label="Email"
|
|
219
|
-
placeholder="you@example.com"
|
|
220
|
-
value={email}
|
|
221
|
-
onChange={setEmail}
|
|
222
|
-
/>
|
|
223
|
-
<Card>One card with default padding</Card>
|
|
224
|
-
<Table
|
|
225
|
-
data={[{name: 'Foundation', status: 'ok'}]}
|
|
226
|
-
columns={[
|
|
227
|
-
{key: 'name', header: 'Name'},
|
|
228
|
-
{key: 'status', header: 'Status'},
|
|
229
|
-
]}
|
|
230
|
-
/>
|
|
231
|
-
</VStack>
|
|
232
|
-
</div>
|
|
233
|
-
);
|
|
234
|
-
}`,
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
type: 'prose',
|
|
238
|
-
text: 'If the button renders with visible padding, a filled primary background, and the input and card have borders and internal spacing, the foundation is sound. For an assertion that can run in any test runner or a dev-only effect, check that a primitive keeps non-zero padding:',
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
type: 'code',
|
|
242
|
-
lang: 'ts',
|
|
243
|
-
label: 'Foundation assertion',
|
|
244
|
-
code: `const button = document.querySelector<HTMLButtonElement>(
|
|
245
|
-
'[data-foundation-check] button',
|
|
246
|
-
);
|
|
247
|
-
if (!button) {
|
|
248
|
-
throw new Error('Foundation check page did not render a button.');
|
|
249
|
-
}
|
|
250
|
-
if (getComputedStyle(button).paddingInline === '0px') {
|
|
251
|
-
throw new Error(
|
|
252
|
-
'Foundation broken: an unlayered reset or a later cascade layer is ' +
|
|
253
|
-
'overriding component styles. Check that no app reset sits outside ' +
|
|
254
|
-
'the reset layer.',
|
|
255
|
-
);
|
|
256
|
-
}`,
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
type: 'prose',
|
|
260
|
-
text: 'When this fails, the fix is almost always in the layer order: find the stylesheet that zeroes padding, and move it into the reset layer or delete it.',
|
|
261
|
-
},
|
|
262
128
|
],
|
|
263
129
|
},
|
|
264
130
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/cli",
|
|
3
|
-
"version": "0.1.4-canary.
|
|
3
|
+
"version": "0.1.4-canary.f5fcc51",
|
|
4
4
|
"displayName": "CLI",
|
|
5
5
|
"description": "Scaffold projects, browse templates, generate themes, and get agent-ready docs from the command line.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
@@ -75,16 +75,12 @@
|
|
|
75
75
|
"zod": "^4.4.3"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
|
-
"@astryxdesign/
|
|
79
|
-
"@astryxdesign/
|
|
80
|
-
"@astryxdesign/
|
|
81
|
-
"@astryxdesign/theme-neutral": "0.1.4-canary.f0b9ca8",
|
|
78
|
+
"@astryxdesign/core": "0.1.4-canary.f5fcc51",
|
|
79
|
+
"@astryxdesign/lab": "0.1.4-canary.f5fcc51",
|
|
80
|
+
"@astryxdesign/theme-neutral": "0.1.4-canary.f5fcc51",
|
|
82
81
|
"gpt-tokenizer": "^3.4.0"
|
|
83
82
|
},
|
|
84
83
|
"peerDependenciesMeta": {
|
|
85
|
-
"@astryxdesign/charts": {
|
|
86
|
-
"optional": true
|
|
87
|
-
},
|
|
88
84
|
"@astryxdesign/core": {
|
|
89
85
|
"optional": true
|
|
90
86
|
},
|
|
@@ -96,10 +92,9 @@
|
|
|
96
92
|
}
|
|
97
93
|
},
|
|
98
94
|
"devDependencies": {
|
|
99
|
-
"@astryxdesign/
|
|
100
|
-
"@astryxdesign/
|
|
101
|
-
"@astryxdesign/
|
|
102
|
-
"@astryxdesign/theme-neutral": "0.1.4-canary.f0b9ca8",
|
|
95
|
+
"@astryxdesign/core": "0.1.4-canary.f5fcc51",
|
|
96
|
+
"@astryxdesign/lab": "0.1.4-canary.f5fcc51",
|
|
97
|
+
"@astryxdesign/theme-neutral": "0.1.4-canary.f5fcc51",
|
|
103
98
|
"gpt-tokenizer": "^3.4.0"
|
|
104
99
|
},
|
|
105
100
|
"scripts": {
|
package/src/api/doctor.mjs
CHANGED
|
@@ -115,21 +115,10 @@ function findThemePackages(cwd) {
|
|
|
115
115
|
return found;
|
|
116
116
|
}
|
|
117
117
|
for (const entry of entries) {
|
|
118
|
+
if (!entry.isDirectory()) continue;
|
|
118
119
|
if (!entry.name.startsWith('theme-')) continue;
|
|
119
|
-
const dir = path.join(scopeDir, entry.name);
|
|
120
|
-
// pnpm installs packages as symlinks into node_modules/.pnpm, and a
|
|
121
|
-
// symlink dirent reports isDirectory() as false — stat the target instead.
|
|
122
|
-
let isDir = entry.isDirectory();
|
|
123
|
-
if (!isDir && entry.isSymbolicLink()) {
|
|
124
|
-
try {
|
|
125
|
-
isDir = fs.statSync(dir).isDirectory();
|
|
126
|
-
} catch {
|
|
127
|
-
isDir = false;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
if (!isDir) continue;
|
|
131
120
|
const name = `@astryxdesign/${entry.name}`;
|
|
132
|
-
found.push({name, version: pkgVersion(
|
|
121
|
+
found.push({name, version: pkgVersion(path.join(scopeDir, entry.name))});
|
|
133
122
|
}
|
|
134
123
|
return found;
|
|
135
124
|
}
|
|
@@ -99,43 +99,5 @@ describe('runCodemods — unified config codemod path', () => {
|
|
|
99
99
|
expect(fs.readFileSync(path.join(srcDir, 'a.ts'), 'utf-8')).toContain(
|
|
100
100
|
'const bar = 1',
|
|
101
101
|
);
|
|
102
|
-
// writtenFiles must be returned (consumed by upgrade.mjs to run the
|
|
103
|
-
// post-codemod formatting/lint hooks). Regression guard: it was previously
|
|
104
|
-
// built internally but omitted from the return object, so hooks received an
|
|
105
|
-
// empty file list and silently skipped, leaving codemod output unformatted.
|
|
106
|
-
expect(result.writtenFiles).toEqual([path.join(srcDir, 'a.ts')]);
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
it('returns writtenFiles for every changed file (post-codemod hook input)', async () => {
|
|
110
|
-
const srcDir = path.join(tmpDir, 'src');
|
|
111
|
-
fs.mkdirSync(srcDir);
|
|
112
|
-
fs.writeFileSync(path.join(srcDir, 'a.ts'), 'const foo = 1;\n');
|
|
113
|
-
fs.writeFileSync(path.join(srcDir, 'b.ts'), 'const foo = 2;\n');
|
|
114
|
-
fs.writeFileSync(path.join(srcDir, 'c.ts'), 'const untouched = 3;\n');
|
|
115
|
-
|
|
116
|
-
const versionManifests = [
|
|
117
|
-
{
|
|
118
|
-
version: '0.1.3',
|
|
119
|
-
transforms: [
|
|
120
|
-
{
|
|
121
|
-
name: 'synthetic-code-codemod',
|
|
122
|
-
meta: {title: 'Synthetic code codemod'},
|
|
123
|
-
transform: file => file.source.replace(/foo/g, 'bar'),
|
|
124
|
-
},
|
|
125
|
-
],
|
|
126
|
-
},
|
|
127
|
-
];
|
|
128
|
-
|
|
129
|
-
const result = await runCodemods(versionManifests, {
|
|
130
|
-
apply: true,
|
|
131
|
-
path: './src',
|
|
132
|
-
silent: true,
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
expect(result.totalFilesChanged).toBe(2);
|
|
136
|
-
// Only the two files that actually changed are reported (not c.ts).
|
|
137
|
-
expect([...result.writtenFiles].sort()).toEqual(
|
|
138
|
-
[path.join(srcDir, 'a.ts'), path.join(srcDir, 'b.ts')].sort(),
|
|
139
|
-
);
|
|
140
102
|
});
|
|
141
103
|
});
|
package/src/codemods/runner.mjs
CHANGED
|
@@ -178,7 +178,6 @@ function toUnifiedEntry(transformEntry, version) {
|
|
|
178
178
|
* @param {string|undefined} options.codemod - Run only this specific transform
|
|
179
179
|
* @param {Set<string>} [options.skipCodemods] - Transform names to exclude
|
|
180
180
|
* @param {boolean} [options.silent] - Suppress all human-facing output (for --json)
|
|
181
|
-
* @returns {{totalFilesChanged: number, totalTransformsApplied: number, totalValidationBlocked: number, writtenFiles: string[], errors: Array, skippedOptional: Array}}
|
|
182
181
|
*/
|
|
183
182
|
export async function runCodemods(
|
|
184
183
|
versionManifests,
|
|
@@ -406,7 +405,6 @@ export async function runCodemods(
|
|
|
406
405
|
totalFilesChanged,
|
|
407
406
|
totalTransformsApplied,
|
|
408
407
|
totalValidationBlocked,
|
|
409
|
-
writtenFiles,
|
|
410
408
|
errors,
|
|
411
409
|
skippedOptional,
|
|
412
410
|
};
|
|
@@ -9,12 +9,11 @@
|
|
|
9
9
|
* - Claude Code: CLAUDE.md (root) or .claude/CLAUDE.md
|
|
10
10
|
* - Cursor: .cursorrules
|
|
11
11
|
* - Codex/generic: AGENTS.md
|
|
12
|
-
* - Hermes Agent: .hermes.md or HERMES.md (existing), else AGENTS.md
|
|
13
12
|
*
|
|
14
13
|
* Auto-detect: discovers existing files and updates them in place.
|
|
15
14
|
* Default (no existing files): creates .claude/CLAUDE.md.
|
|
16
15
|
*
|
|
17
|
-
* --agent <tool>: target a specific tool preset (claude, cursor, codex,
|
|
16
|
+
* --agent <tool>: target a specific tool preset (claude, cursor, codex, all)
|
|
18
17
|
* --agent-docs-path <path>: explicit file path(s)
|
|
19
18
|
*/
|
|
20
19
|
|
|
@@ -47,7 +46,6 @@ const AGENT_PRESETS = {
|
|
|
47
46
|
claude: [CLAUDE_MD, CLAUDE_DIR_MD],
|
|
48
47
|
cursor: ['.cursorrules', AGENTS_MD],
|
|
49
48
|
codex: [AGENTS_MD],
|
|
50
|
-
hermes: ['.hermes.md', 'HERMES.md', AGENTS_MD],
|
|
51
49
|
};
|
|
52
50
|
|
|
53
51
|
/**
|
|
@@ -66,7 +64,7 @@ export function discoverAgentDocs(targetDir) {
|
|
|
66
64
|
* Searches for existing files first, falls back to default creation path.
|
|
67
65
|
*
|
|
68
66
|
* @param {string} targetDir
|
|
69
|
-
* @param {string} agent - Preset name: 'claude', 'cursor', 'codex', '
|
|
67
|
+
* @param {string} agent - Preset name: 'claude', 'cursor', 'codex', 'all'
|
|
70
68
|
* @returns {{inject: string[], create: string[]}} Files to inject into vs create fresh
|
|
71
69
|
*/
|
|
72
70
|
export function resolveAgentPaths(targetDir, agent) {
|
|
@@ -388,7 +386,7 @@ export function removeAgentDocs(targetDir) {
|
|
|
388
386
|
* @param {object} [options]
|
|
389
387
|
* @param {boolean} [options.zh]
|
|
390
388
|
* @param {string} [options.lang]
|
|
391
|
-
* @param {string} [options.agent] - Tool preset: 'claude', 'cursor', 'codex', '
|
|
389
|
+
* @param {string} [options.agent] - Tool preset: 'claude', 'cursor', 'codex', 'all'
|
|
392
390
|
* @param {string[]} [options.paths] - Explicit paths (overrides agent/auto-detect)
|
|
393
391
|
* @param {boolean} [options.onlyReplace] - Only update files that already have Astryx markers (for upgrades)
|
|
394
392
|
* @returns {string[]} List of files written
|
|
@@ -470,14 +468,14 @@ export function installAgentDocs(targetDir, {zh = false, lang, agent, paths, onl
|
|
|
470
468
|
return written;
|
|
471
469
|
}
|
|
472
470
|
|
|
473
|
-
const VALID_AGENTS = ['claude', 'cursor', 'codex', '
|
|
471
|
+
const VALID_AGENTS = ['claude', 'cursor', 'codex', 'all'];
|
|
474
472
|
|
|
475
473
|
export function registerAgentDocs(program) {
|
|
476
474
|
program
|
|
477
475
|
.command('agent-docs')
|
|
478
476
|
.description('Install/update the component index for AI coding agents')
|
|
479
477
|
.option('--remove', 'Remove the design system section from all agent doc files')
|
|
480
|
-
.option('--agent <tool>', 'Target tool: claude, cursor, codex,
|
|
478
|
+
.option('--agent <tool>', 'Target tool: claude, cursor, codex, all')
|
|
481
479
|
.option('--agent-docs-path <path...>', 'Explicit file path(s) to write to')
|
|
482
480
|
.action(options => {
|
|
483
481
|
const targetDir = process.cwd();
|
|
@@ -449,17 +449,6 @@ describe('installAgentDocs', () => {
|
|
|
449
449
|
expect(fs.existsSync(path.join(tmpDir, 'AGENTS.md'))).toBe(true);
|
|
450
450
|
});
|
|
451
451
|
|
|
452
|
-
it('respects --agent hermes preset: creates AGENTS.md', () => {
|
|
453
|
-
setupCorePackage(tmpDir);
|
|
454
|
-
|
|
455
|
-
const written = installAgentDocs(tmpDir, {agent: 'hermes'});
|
|
456
|
-
|
|
457
|
-
expect(written).toEqual(['AGENTS.md']);
|
|
458
|
-
const content = fs.readFileSync(path.join(tmpDir, 'AGENTS.md'), 'utf-8');
|
|
459
|
-
expect(content).toContain('<!-- ASTRYX:START -->');
|
|
460
|
-
expect(fs.existsSync(path.join(tmpDir, '.claude'))).toBe(false);
|
|
461
|
-
});
|
|
462
|
-
|
|
463
452
|
it('respects explicit --paths', () => {
|
|
464
453
|
setupCorePackage(tmpDir);
|
|
465
454
|
|
|
@@ -559,26 +548,4 @@ describe('resolveAgentPaths', () => {
|
|
|
559
548
|
expect(result.create).toContain('AGENTS.md');
|
|
560
549
|
expect(result.create).toContain('.claude/CLAUDE.md');
|
|
561
550
|
});
|
|
562
|
-
|
|
563
|
-
it('hermes preset creates AGENTS.md when nothing exists', () => {
|
|
564
|
-
const result = resolveAgentPaths(tmpDir, 'hermes');
|
|
565
|
-
expect(result).toEqual({inject: [], create: ['AGENTS.md']});
|
|
566
|
-
});
|
|
567
|
-
|
|
568
|
-
it('hermes preset finds existing .hermes.md', () => {
|
|
569
|
-
fs.writeFileSync(path.join(tmpDir, '.hermes.md'), '');
|
|
570
|
-
const result = resolveAgentPaths(tmpDir, 'hermes');
|
|
571
|
-
expect(result).toEqual({inject: ['.hermes.md'], create: []});
|
|
572
|
-
});
|
|
573
|
-
|
|
574
|
-
it('hermes preset finds existing HERMES.md when no .hermes.md', () => {
|
|
575
|
-
fs.writeFileSync(path.join(tmpDir, 'HERMES.md'), '');
|
|
576
|
-
const result = resolveAgentPaths(tmpDir, 'hermes');
|
|
577
|
-
expect(result).toEqual({inject: ['HERMES.md'], create: []});
|
|
578
|
-
});
|
|
579
|
-
|
|
580
|
-
it('claude preset still creates .claude/CLAUDE.md when nothing exists (hermes is additive)', () => {
|
|
581
|
-
const result = resolveAgentPaths(tmpDir, 'claude');
|
|
582
|
-
expect(result).toEqual({inject: [], create: ['.claude/CLAUDE.md']});
|
|
583
|
-
});
|
|
584
551
|
});
|
|
@@ -63,33 +63,6 @@ function installPkg(name, version = '1.0.0') {
|
|
|
63
63
|
return dir;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
/**
|
|
67
|
-
* Mirror pnpm's layout: the real package lives under node_modules/.pnpm and
|
|
68
|
-
* the entry in the scope directory is a symlink to it.
|
|
69
|
-
*/
|
|
70
|
-
function installPkgPnpmStyle(name, version = '1.0.0') {
|
|
71
|
-
const realDir = path.join(
|
|
72
|
-
tmpDir,
|
|
73
|
-
'node_modules',
|
|
74
|
-
'.pnpm',
|
|
75
|
-
`${name.replace('/', '+')}@${version}`,
|
|
76
|
-
'node_modules',
|
|
77
|
-
...name.split('/'),
|
|
78
|
-
);
|
|
79
|
-
fs.mkdirSync(realDir, {recursive: true});
|
|
80
|
-
fs.writeFileSync(
|
|
81
|
-
path.join(realDir, 'package.json'),
|
|
82
|
-
JSON.stringify({name, version, main: 'index.js'}),
|
|
83
|
-
);
|
|
84
|
-
fs.writeFileSync(path.join(realDir, 'index.js'), 'module.exports = {};');
|
|
85
|
-
const linkPath = path.join(tmpDir, 'node_modules', ...name.split('/'));
|
|
86
|
-
fs.mkdirSync(path.dirname(linkPath), {recursive: true});
|
|
87
|
-
// 'junction' keeps this working on Windows without elevated permissions;
|
|
88
|
-
// it is ignored on posix.
|
|
89
|
-
fs.symlinkSync(realDir, linkPath, 'junction');
|
|
90
|
-
return linkPath;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
66
|
function find(checks, id) {
|
|
94
67
|
return checks.find(c => c.id === id);
|
|
95
68
|
}
|
|
@@ -146,13 +119,6 @@ describe('doctor — individual checks', () => {
|
|
|
146
119
|
expect(res.status).toBe('pass');
|
|
147
120
|
});
|
|
148
121
|
|
|
149
|
-
it('themes: detects pnpm-style symlinked theme packages (#3530)', () => {
|
|
150
|
-
installPkgPnpmStyle('@astryxdesign/theme-neutral', '0.1.2');
|
|
151
|
-
const res = checkThemes({cwd: tmpDir, configTheme: 'default'});
|
|
152
|
-
expect(res.status).toBe('pass');
|
|
153
|
-
expect(res.message).toContain('@astryxdesign/theme-neutral');
|
|
154
|
-
});
|
|
155
|
-
|
|
156
122
|
it('config: INFO when no astryx.config.mjs', async () => {
|
|
157
123
|
const res = await checkConfig({cwd: tmpDir, configPath: null});
|
|
158
124
|
expect(res.status).toBe('info');
|
package/src/commands/init.mjs
CHANGED
|
@@ -198,7 +198,7 @@ export function registerInit(program) {
|
|
|
198
198
|
.option('--features <list>', 'Comma-separated features to install (agents, theme, template)')
|
|
199
199
|
.option('--all', 'Install all features, no prompts')
|
|
200
200
|
.option('--remove-agents', 'Remove AI agent docs from all agent doc files')
|
|
201
|
-
.option('--agent <tool>', 'Target AI tool for agent docs: claude, cursor, codex,
|
|
201
|
+
.option('--agent <tool>', 'Target AI tool for agent docs: claude, cursor, codex, all')
|
|
202
202
|
.option('--agent-docs-path <path...>', 'Explicit file path(s) for agent docs')
|
|
203
203
|
.action(async (options) => {
|
|
204
204
|
const targetDir = process.cwd();
|
|
@@ -7,7 +7,7 @@ export const doc = {
|
|
|
7
7
|
name: 'Code — Terminal',
|
|
8
8
|
displayName: 'Code — Terminal',
|
|
9
9
|
description:
|
|
10
|
-
'A dark terminal-style command block: a bash CodeBlock wrapped in SyntaxTheme with the GitHub Dark preset, copy button on, and no line numbers. Use for shell sessions or CLI output that should read as a terminal even on light pages
|
|
10
|
+
'A dark terminal-style command block: a bash CodeBlock wrapped in SyntaxTheme with the GitHub Dark preset, copy button on, and no line numbers. Use for shell sessions or CLI output that should read as a terminal even on light pages — reach for a dark syntax preset instead of hand-rolling a dark box with custom CSS.',
|
|
11
11
|
isReady: true,
|
|
12
12
|
aspectRatio: 16 / 9,
|
|
13
13
|
componentsUsed: ['CodeBlock', 'SyntaxTheme'],
|
|
@@ -3,45 +3,66 @@
|
|
|
3
3
|
'use client';
|
|
4
4
|
|
|
5
5
|
import {useMemo} from 'react';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
CommandPalette,
|
|
8
|
+
CommandPaletteList,
|
|
9
|
+
CommandPaletteGroup,
|
|
10
|
+
CommandPaletteItem,
|
|
11
|
+
} from '@astryxdesign/core/CommandPalette';
|
|
7
12
|
import {createStaticSource} from '@astryxdesign/core/Typeahead';
|
|
13
|
+
import {Stack} from '@astryxdesign/core/Layout';
|
|
14
|
+
import {Text} from '@astryxdesign/core/Text';
|
|
8
15
|
|
|
9
16
|
export default function CommandPaletteGroupShowcase() {
|
|
10
17
|
const source = useMemo(
|
|
11
18
|
() =>
|
|
12
19
|
createStaticSource([
|
|
13
|
-
{
|
|
14
|
-
id: 'index',
|
|
15
|
-
label: 'index.tsx',
|
|
16
|
-
auxiliaryData: {group: 'Recent Files'},
|
|
17
|
-
},
|
|
20
|
+
{id: 'index', label: 'index.tsx', auxiliaryData: {group: 'Recent Files'}},
|
|
18
21
|
{id: 'app', label: 'App.tsx', auxiliaryData: {group: 'Recent Files'}},
|
|
19
|
-
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
auxiliaryData: {group: 'Commands'},
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
id: 'terminal',
|
|
26
|
-
label: 'Toggle Terminal',
|
|
27
|
-
auxiliaryData: {group: 'Commands'},
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
id: 'theme',
|
|
31
|
-
label: 'Color Theme',
|
|
32
|
-
auxiliaryData: {group: 'Preferences'},
|
|
33
|
-
},
|
|
22
|
+
{id: 'settings', label: 'Open Settings', auxiliaryData: {group: 'Commands'}},
|
|
23
|
+
{id: 'terminal', label: 'Toggle Terminal', auxiliaryData: {group: 'Commands'}},
|
|
24
|
+
{id: 'theme', label: 'Color Theme', auxiliaryData: {group: 'Preferences'}},
|
|
34
25
|
{id: 'font', label: 'Font Size', auxiliaryData: {group: 'Preferences'}},
|
|
35
26
|
]),
|
|
36
27
|
[],
|
|
37
28
|
);
|
|
38
29
|
|
|
39
30
|
return (
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
31
|
+
<Stack direction="vertical" gap={4}>
|
|
32
|
+
<Stack direction="vertical" gap={1}>
|
|
33
|
+
<Text type="supporting" color="secondary">
|
|
34
|
+
Data-driven grouping (auxiliaryData.group)
|
|
35
|
+
</Text>
|
|
36
|
+
<CommandPalette
|
|
37
|
+
isOpen
|
|
38
|
+
isInline
|
|
39
|
+
onOpenChange={() => {}}
|
|
40
|
+
searchSource={source}
|
|
41
|
+
/>
|
|
42
|
+
</Stack>
|
|
43
|
+
<Stack direction="vertical" gap={1}>
|
|
44
|
+
<Text type="supporting" color="secondary">
|
|
45
|
+
Composed form (CommandPaletteGroup + CommandPaletteItem)
|
|
46
|
+
</Text>
|
|
47
|
+
<CommandPaletteList>
|
|
48
|
+
<CommandPaletteGroup heading="Navigation">
|
|
49
|
+
<CommandPaletteItem value="home" onSelect={() => {}}>
|
|
50
|
+
Home
|
|
51
|
+
</CommandPaletteItem>
|
|
52
|
+
<CommandPaletteItem value="dashboard" onSelect={() => {}}>
|
|
53
|
+
Dashboard
|
|
54
|
+
</CommandPaletteItem>
|
|
55
|
+
</CommandPaletteGroup>
|
|
56
|
+
<CommandPaletteGroup heading="Actions">
|
|
57
|
+
<CommandPaletteItem value="new-file" onSelect={() => {}}>
|
|
58
|
+
New File
|
|
59
|
+
</CommandPaletteItem>
|
|
60
|
+
<CommandPaletteItem value="save" onSelect={() => {}}>
|
|
61
|
+
Save All
|
|
62
|
+
</CommandPaletteItem>
|
|
63
|
+
</CommandPaletteGroup>
|
|
64
|
+
</CommandPaletteList>
|
|
65
|
+
</Stack>
|
|
66
|
+
</Stack>
|
|
46
67
|
);
|
|
47
68
|
}
|
|
@@ -3,10 +3,16 @@
|
|
|
3
3
|
'use client';
|
|
4
4
|
|
|
5
5
|
import {useMemo, type CSSProperties} from 'react';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
CommandPalette,
|
|
8
|
+
CommandPaletteList,
|
|
9
|
+
CommandPaletteItem,
|
|
10
|
+
} from '@astryxdesign/core/CommandPalette';
|
|
7
11
|
import {Text} from '@astryxdesign/core/Text';
|
|
8
12
|
import {Kbd} from '@astryxdesign/core/Kbd';
|
|
13
|
+
import {Icon} from '@astryxdesign/core/Icon';
|
|
9
14
|
import {createStaticSource} from '@astryxdesign/core/Typeahead';
|
|
15
|
+
import {Stack} from '@astryxdesign/core/Layout';
|
|
10
16
|
import type {SearchableItem} from '@astryxdesign/core/Typeahead';
|
|
11
17
|
|
|
12
18
|
const itemLabel: CSSProperties = {
|
|
@@ -17,21 +23,9 @@ type CommandItem = SearchableItem<{shortcut?: string}>;
|
|
|
17
23
|
|
|
18
24
|
const commands: CommandItem[] = [
|
|
19
25
|
{id: 'save', label: 'Save File', auxiliaryData: {shortcut: 'mod+s'}},
|
|
20
|
-
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
auxiliaryData: {shortcut: 'mod+shift+f'},
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
id: 'palette',
|
|
27
|
-
label: 'Command Palette',
|
|
28
|
-
auxiliaryData: {shortcut: 'mod+shift+p'},
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
id: 'terminal',
|
|
32
|
-
label: 'Toggle Terminal',
|
|
33
|
-
auxiliaryData: {shortcut: 'ctrl+`'},
|
|
34
|
-
},
|
|
26
|
+
{id: 'find', label: 'Find in Files', auxiliaryData: {shortcut: 'mod+shift+f'}},
|
|
27
|
+
{id: 'palette', label: 'Command Palette', auxiliaryData: {shortcut: 'mod+shift+p'}},
|
|
28
|
+
{id: 'terminal', label: 'Toggle Terminal', auxiliaryData: {shortcut: 'ctrl+`'}},
|
|
35
29
|
{id: 'sidebar', label: 'Toggle Sidebar', auxiliaryData: {shortcut: 'mod+b'}},
|
|
36
30
|
];
|
|
37
31
|
|
|
@@ -39,21 +33,50 @@ export default function CommandPaletteItemShowcase() {
|
|
|
39
33
|
const source = useMemo(() => createStaticSource(commands), []);
|
|
40
34
|
|
|
41
35
|
return (
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
{item
|
|
53
|
-
|
|
36
|
+
<Stack direction="vertical" gap={4}>
|
|
37
|
+
<Stack direction="vertical" gap={1}>
|
|
38
|
+
<Text type="supporting" color="secondary">
|
|
39
|
+
Custom renderItem with keyboard shortcuts
|
|
40
|
+
</Text>
|
|
41
|
+
<CommandPalette
|
|
42
|
+
isOpen
|
|
43
|
+
isInline
|
|
44
|
+
onOpenChange={() => {}}
|
|
45
|
+
searchSource={source}
|
|
46
|
+
renderItem={(item: CommandItem) => (
|
|
47
|
+
<>
|
|
48
|
+
<Text type="body" style={itemLabel}>
|
|
49
|
+
{item.label}
|
|
50
|
+
</Text>
|
|
51
|
+
{item.auxiliaryData?.shortcut && (
|
|
52
|
+
<Kbd keys={item.auxiliaryData.shortcut} />
|
|
53
|
+
)}
|
|
54
|
+
</>
|
|
54
55
|
)}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
/>
|
|
57
|
+
</Stack>
|
|
58
|
+
<Stack direction="vertical" gap={1}>
|
|
59
|
+
<Text type="supporting" color="secondary">
|
|
60
|
+
Composed items with icons and states
|
|
61
|
+
</Text>
|
|
62
|
+
<CommandPaletteList>
|
|
63
|
+
<CommandPaletteItem value="home" onSelect={() => {}}>
|
|
64
|
+
<Icon icon="externalLink" size="sm" />
|
|
65
|
+
<Text type="body" style={itemLabel}>Home</Text>
|
|
66
|
+
</CommandPaletteItem>
|
|
67
|
+
<CommandPaletteItem value="search" isHighlighted onSelect={() => {}}>
|
|
68
|
+
<Icon icon="search" size="sm" />
|
|
69
|
+
<Text type="body" style={itemLabel}>Search (highlighted)</Text>
|
|
70
|
+
</CommandPaletteItem>
|
|
71
|
+
<CommandPaletteItem value="selected" isSelected onSelect={() => {}}>
|
|
72
|
+
<Icon icon="check" size="sm" />
|
|
73
|
+
<Text type="body" style={itemLabel}>Selected item</Text>
|
|
74
|
+
</CommandPaletteItem>
|
|
75
|
+
<CommandPaletteItem value="disabled" isDisabled>
|
|
76
|
+
<Text type="body" style={itemLabel}>Disabled item</Text>
|
|
77
|
+
</CommandPaletteItem>
|
|
78
|
+
</CommandPaletteList>
|
|
79
|
+
</Stack>
|
|
80
|
+
</Stack>
|
|
58
81
|
);
|
|
59
82
|
}
|
|
@@ -19,7 +19,13 @@ import {Link} from '@astryxdesign/core/Link';
|
|
|
19
19
|
import {Thumbnail} from '@astryxdesign/core/Thumbnail';
|
|
20
20
|
import {Table, proportional, pixel} from '@astryxdesign/core/Table';
|
|
21
21
|
import type {TableColumn} from '@astryxdesign/core/Table';
|
|
22
|
-
import {
|
|
22
|
+
import {
|
|
23
|
+
ChartV2 as Chart,
|
|
24
|
+
ChartGrid,
|
|
25
|
+
ChartAxis,
|
|
26
|
+
area,
|
|
27
|
+
line,
|
|
28
|
+
} from '@astryxdesign/lab';
|
|
23
29
|
import {
|
|
24
30
|
FunnelIcon,
|
|
25
31
|
ArrowDownTrayIcon,
|
|
@@ -475,13 +481,17 @@ const columns: TableColumn<OrderRow>[] = [
|
|
|
475
481
|
key: 'amount',
|
|
476
482
|
header: 'Amount',
|
|
477
483
|
width: pixel(90),
|
|
478
|
-
renderCell: (item: OrderRow) =>
|
|
484
|
+
renderCell: (item: OrderRow) => (
|
|
485
|
+
<Text type="body">${item.amount}</Text>
|
|
486
|
+
),
|
|
479
487
|
},
|
|
480
488
|
{
|
|
481
489
|
key: 'customer',
|
|
482
490
|
header: 'Customer',
|
|
483
491
|
width: proportional(2),
|
|
484
|
-
renderCell: (item: OrderRow) =>
|
|
492
|
+
renderCell: (item: OrderRow) => (
|
|
493
|
+
<Text type="body">{item.customer}</Text>
|
|
494
|
+
),
|
|
485
495
|
},
|
|
486
496
|
{
|
|
487
497
|
key: 'email',
|
|
@@ -19,7 +19,13 @@ import {Link} from '@astryxdesign/core/Link';
|
|
|
19
19
|
import {Thumbnail} from '@astryxdesign/core/Thumbnail';
|
|
20
20
|
import {Table, proportional, pixel} from '@astryxdesign/core/Table';
|
|
21
21
|
import type {TableColumn} from '@astryxdesign/core/Table';
|
|
22
|
-
import {
|
|
22
|
+
import {
|
|
23
|
+
ChartV2 as Chart,
|
|
24
|
+
ChartGrid,
|
|
25
|
+
ChartAxis,
|
|
26
|
+
area,
|
|
27
|
+
line,
|
|
28
|
+
} from '@astryxdesign/lab';
|
|
23
29
|
import {
|
|
24
30
|
FunnelIcon,
|
|
25
31
|
ArrowDownTrayIcon,
|
|
@@ -29,7 +35,11 @@ import {
|
|
|
29
35
|
// ============= DATA =============
|
|
30
36
|
|
|
31
37
|
type ProductCategory =
|
|
32
|
-
|
|
38
|
+
| 'Running'
|
|
39
|
+
| 'Lifestyle'
|
|
40
|
+
| 'Basketball'
|
|
41
|
+
| 'Training'
|
|
42
|
+
| 'Skateboarding';
|
|
33
43
|
|
|
34
44
|
function shoeSvg(bg: string, accent: string) {
|
|
35
45
|
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect width="100" height="100" rx="12" fill="${bg}"/><g transform="translate(22.5, 22.5) scale(2.29)" fill="none" stroke="${accent}" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="m15 10.42 4.8-5.07"/><path d="M19 18h3"/><path d="M9.5 22 21.414 9.415A2 2 0 0 0 21.2 6.4l-5.61-4.208A1 1 0 0 0 14 3v2a2 2 0 0 1-1.394 1.906L8.677 8.053A1 1 0 0 0 8 9c-.155 6.393-2.082 9-4 9a2 2 0 0 0 0 4h14"/></g></svg>`;
|
|
@@ -829,13 +839,17 @@ const columns: TableColumn<OrderRow>[] = [
|
|
|
829
839
|
key: 'amount',
|
|
830
840
|
header: 'Amount',
|
|
831
841
|
width: pixel(90),
|
|
832
|
-
renderCell: (item: OrderRow) =>
|
|
842
|
+
renderCell: (item: OrderRow) => (
|
|
843
|
+
<Text type="body">${item.amount}</Text>
|
|
844
|
+
),
|
|
833
845
|
},
|
|
834
846
|
{
|
|
835
847
|
key: 'customer',
|
|
836
848
|
header: 'Customer',
|
|
837
849
|
width: proportional(2),
|
|
838
|
-
renderCell: (item: OrderRow) =>
|
|
850
|
+
renderCell: (item: OrderRow) => (
|
|
851
|
+
<Text type="body">{item.customer}</Text>
|
|
852
|
+
),
|
|
839
853
|
},
|
|
840
854
|
{
|
|
841
855
|
key: 'email',
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
|
|
4
|
-
export const doc = {
|
|
5
|
-
type: 'block',
|
|
6
|
-
exampleFor: 'CommandPaletteInput',
|
|
7
|
-
name: 'CommandPaletteInput — With End Content',
|
|
8
|
-
displayName: 'CommandPaletteInput — With End Content',
|
|
9
|
-
description:
|
|
10
|
-
'Custom placeholder and a keyboard shortcut badge in the trailing slot via endContent.',
|
|
11
|
-
isReady: true,
|
|
12
|
-
isShowcase: false,
|
|
13
|
-
aspectRatio: 4 / 3,
|
|
14
|
-
componentsUsed: ['CommandPalette', 'CommandPaletteInput', 'Kbd'],
|
|
15
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
'use client';
|
|
4
|
-
|
|
5
|
-
import {useMemo} from 'react';
|
|
6
|
-
import {
|
|
7
|
-
CommandPalette,
|
|
8
|
-
CommandPaletteInput,
|
|
9
|
-
} from '@astryxdesign/core/CommandPalette';
|
|
10
|
-
import {Kbd} from '@astryxdesign/core/Kbd';
|
|
11
|
-
import {createStaticSource} from '@astryxdesign/core/Typeahead';
|
|
12
|
-
|
|
13
|
-
export default function CommandPaletteInputBasic() {
|
|
14
|
-
const source = useMemo(
|
|
15
|
-
() =>
|
|
16
|
-
createStaticSource([
|
|
17
|
-
{id: 'home', label: 'Home'},
|
|
18
|
-
{id: 'settings', label: 'Settings'},
|
|
19
|
-
{id: 'profile', label: 'Profile'},
|
|
20
|
-
{id: 'help', label: 'Help'},
|
|
21
|
-
]),
|
|
22
|
-
[],
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<CommandPalette
|
|
27
|
-
isOpen
|
|
28
|
-
isInline
|
|
29
|
-
onOpenChange={() => {}}
|
|
30
|
-
searchSource={source}
|
|
31
|
-
input={
|
|
32
|
-
<CommandPaletteInput
|
|
33
|
-
placeholder="Search commands, files, or actions..."
|
|
34
|
-
endContent={<Kbd keys="mod+k" />}
|
|
35
|
-
/>
|
|
36
|
-
}
|
|
37
|
-
/>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
|
|
4
|
-
export const doc = {
|
|
5
|
-
type: 'block',
|
|
6
|
-
exampleFor: 'CommandPaletteInput',
|
|
7
|
-
name: 'CommandPaletteInput',
|
|
8
|
-
displayName: 'Command Palette Input',
|
|
9
|
-
description:
|
|
10
|
-
'Command palette search input with a custom placeholder and a keyboard shortcut hint in the endContent slot.',
|
|
11
|
-
isReady: true,
|
|
12
|
-
isShowcase: true,
|
|
13
|
-
aspectRatio: 4 / 3,
|
|
14
|
-
componentsUsed: ['CommandPalette', 'CommandPaletteInput', 'Kbd'],
|
|
15
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
'use client';
|
|
4
|
-
|
|
5
|
-
import {useMemo} from 'react';
|
|
6
|
-
import {
|
|
7
|
-
CommandPalette,
|
|
8
|
-
CommandPaletteInput,
|
|
9
|
-
} from '@astryxdesign/core/CommandPalette';
|
|
10
|
-
import {Kbd} from '@astryxdesign/core/Kbd';
|
|
11
|
-
import {createStaticSource} from '@astryxdesign/core/Typeahead';
|
|
12
|
-
|
|
13
|
-
export default function CommandPaletteInputShowcase() {
|
|
14
|
-
const source = useMemo(
|
|
15
|
-
() =>
|
|
16
|
-
createStaticSource([
|
|
17
|
-
{id: 'home', label: 'Home'},
|
|
18
|
-
{id: 'settings', label: 'Settings'},
|
|
19
|
-
{id: 'profile', label: 'Profile'},
|
|
20
|
-
{id: 'help', label: 'Help'},
|
|
21
|
-
]),
|
|
22
|
-
[],
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<CommandPalette
|
|
27
|
-
isOpen
|
|
28
|
-
isInline
|
|
29
|
-
onOpenChange={() => {}}
|
|
30
|
-
searchSource={source}
|
|
31
|
-
input={
|
|
32
|
-
<CommandPaletteInput
|
|
33
|
-
placeholder="Search commands, files, or actions..."
|
|
34
|
-
endContent={<Kbd keys="mod+k" />}
|
|
35
|
-
/>
|
|
36
|
-
}
|
|
37
|
-
/>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
|
|
4
|
-
export const doc = {
|
|
5
|
-
type: 'block',
|
|
6
|
-
exampleFor: 'CommandPaletteList',
|
|
7
|
-
name: 'CommandPaletteList — Item States',
|
|
8
|
-
displayName: 'CommandPaletteList — Item States',
|
|
9
|
-
description:
|
|
10
|
-
'Flat list showing the highlighted, selected, and disabled item states. Use CommandPaletteGroup to add section headings.',
|
|
11
|
-
isReady: true,
|
|
12
|
-
isShowcase: false,
|
|
13
|
-
aspectRatio: 4 / 3,
|
|
14
|
-
componentsUsed: ['CommandPaletteList', 'CommandPaletteItem'],
|
|
15
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
'use client';
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
CommandPaletteList,
|
|
7
|
-
CommandPaletteItem,
|
|
8
|
-
} from '@astryxdesign/core/CommandPalette';
|
|
9
|
-
|
|
10
|
-
export default function CommandPaletteListBasic() {
|
|
11
|
-
return (
|
|
12
|
-
<CommandPaletteList>
|
|
13
|
-
<CommandPaletteItem value="home" onSelect={() => {}}>
|
|
14
|
-
Go Home
|
|
15
|
-
</CommandPaletteItem>
|
|
16
|
-
<CommandPaletteItem value="settings" isHighlighted onSelect={() => {}}>
|
|
17
|
-
Open Settings
|
|
18
|
-
</CommandPaletteItem>
|
|
19
|
-
<CommandPaletteItem value="profile" isSelected onSelect={() => {}}>
|
|
20
|
-
View Profile
|
|
21
|
-
</CommandPaletteItem>
|
|
22
|
-
<CommandPaletteItem value="help" isDisabled onSelect={() => {}}>
|
|
23
|
-
Help (unavailable)
|
|
24
|
-
</CommandPaletteItem>
|
|
25
|
-
</CommandPaletteList>
|
|
26
|
-
);
|
|
27
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
|
|
4
|
-
export const doc = {
|
|
5
|
-
type: 'block',
|
|
6
|
-
exampleFor: 'CommandPaletteList',
|
|
7
|
-
name: 'CommandPaletteList',
|
|
8
|
-
displayName: 'Command Palette List',
|
|
9
|
-
description:
|
|
10
|
-
'Scrollable command palette list with grouped items, including a highlighted item, composed without a full CommandPalette.',
|
|
11
|
-
isReady: true,
|
|
12
|
-
isShowcase: true,
|
|
13
|
-
aspectRatio: 4 / 3,
|
|
14
|
-
componentsUsed: ['CommandPaletteList', 'CommandPaletteGroup', 'CommandPaletteItem'],
|
|
15
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
'use client';
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
CommandPaletteList,
|
|
7
|
-
CommandPaletteGroup,
|
|
8
|
-
CommandPaletteItem,
|
|
9
|
-
} from '@astryxdesign/core/CommandPalette';
|
|
10
|
-
|
|
11
|
-
export default function CommandPaletteListShowcase() {
|
|
12
|
-
return (
|
|
13
|
-
<CommandPaletteList>
|
|
14
|
-
<CommandPaletteGroup heading="Navigation">
|
|
15
|
-
<CommandPaletteItem value="home" onSelect={() => {}}>
|
|
16
|
-
Go Home
|
|
17
|
-
</CommandPaletteItem>
|
|
18
|
-
<CommandPaletteItem value="settings" onSelect={() => {}}>
|
|
19
|
-
Open Settings
|
|
20
|
-
</CommandPaletteItem>
|
|
21
|
-
<CommandPaletteItem value="profile" onSelect={() => {}}>
|
|
22
|
-
View Profile
|
|
23
|
-
</CommandPaletteItem>
|
|
24
|
-
</CommandPaletteGroup>
|
|
25
|
-
<CommandPaletteGroup heading="Actions">
|
|
26
|
-
<CommandPaletteItem value="new-file" onSelect={() => {}}>
|
|
27
|
-
New File
|
|
28
|
-
</CommandPaletteItem>
|
|
29
|
-
<CommandPaletteItem value="search" isHighlighted onSelect={() => {}}>
|
|
30
|
-
Search Files
|
|
31
|
-
</CommandPaletteItem>
|
|
32
|
-
<CommandPaletteItem value="save" onSelect={() => {}}>
|
|
33
|
-
Save All
|
|
34
|
-
</CommandPaletteItem>
|
|
35
|
-
</CommandPaletteGroup>
|
|
36
|
-
</CommandPaletteList>
|
|
37
|
-
);
|
|
38
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
|
|
4
|
-
export const doc = {
|
|
5
|
-
type: 'block',
|
|
6
|
-
exampleFor: 'ContextMenuItem',
|
|
7
|
-
name: 'ContextMenuItem — Basic',
|
|
8
|
-
displayName: 'ContextMenuItem — Basic',
|
|
9
|
-
description:
|
|
10
|
-
'Context menu items with labels and secondary descriptions. Use ContextMenuItem to render custom menu entries with consistent styling.',
|
|
11
|
-
isReady: true,
|
|
12
|
-
aspectRatio: 16 / 9,
|
|
13
|
-
componentsUsed: ['ContextMenu', 'ContextMenuItem'],
|
|
14
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
'use client';
|
|
4
|
-
|
|
5
|
-
import {ContextMenu, ContextMenuItem} from '@astryxdesign/core/ContextMenu';
|
|
6
|
-
|
|
7
|
-
export default function ContextMenuItemBasic() {
|
|
8
|
-
return (
|
|
9
|
-
<ContextMenu
|
|
10
|
-
menuContent={
|
|
11
|
-
<>
|
|
12
|
-
<ContextMenuItem
|
|
13
|
-
label="Edit"
|
|
14
|
-
description="Modify this item"
|
|
15
|
-
onClick={() => {}}
|
|
16
|
-
/>
|
|
17
|
-
<ContextMenuItem
|
|
18
|
-
label="Duplicate"
|
|
19
|
-
description="Create a copy"
|
|
20
|
-
onClick={() => {}}
|
|
21
|
-
/>
|
|
22
|
-
<ContextMenuItem
|
|
23
|
-
label="Delete"
|
|
24
|
-
description="This action cannot be undone"
|
|
25
|
-
onClick={() => {}}
|
|
26
|
-
/>
|
|
27
|
-
</>
|
|
28
|
-
}>
|
|
29
|
-
<div
|
|
30
|
-
style={{
|
|
31
|
-
padding: '48px',
|
|
32
|
-
borderWidth: '2px',
|
|
33
|
-
borderStyle: 'dashed',
|
|
34
|
-
borderColor: 'var(--color-border)',
|
|
35
|
-
borderRadius: '8px',
|
|
36
|
-
textAlign: 'center',
|
|
37
|
-
color: 'var(--color-text-secondary)',
|
|
38
|
-
userSelect: 'none',
|
|
39
|
-
}}>
|
|
40
|
-
Right-click this area
|
|
41
|
-
</div>
|
|
42
|
-
</ContextMenu>
|
|
43
|
-
);
|
|
44
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
|
|
4
|
-
export const doc = {
|
|
5
|
-
type: 'block',
|
|
6
|
-
exampleFor: 'ContextMenuItem',
|
|
7
|
-
name: 'ContextMenuItem',
|
|
8
|
-
displayName: 'Context Menu Item',
|
|
9
|
-
description:
|
|
10
|
-
'Context menu with custom-rendered items using ContextMenuItem for icons and descriptions.',
|
|
11
|
-
isReady: true,
|
|
12
|
-
isShowcase: true,
|
|
13
|
-
aspectRatio: 16 / 9,
|
|
14
|
-
componentsUsed: ['ContextMenu', 'ContextMenuItem'],
|
|
15
|
-
};
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
'use client';
|
|
4
|
-
|
|
5
|
-
import {ContextMenu, ContextMenuItem} from '@astryxdesign/core/ContextMenu';
|
|
6
|
-
|
|
7
|
-
const PencilIcon = (props: React.SVGProps<SVGSVGElement>) => (
|
|
8
|
-
<svg
|
|
9
|
-
viewBox="0 0 24 24"
|
|
10
|
-
fill="none"
|
|
11
|
-
stroke="currentColor"
|
|
12
|
-
strokeWidth={1.5}
|
|
13
|
-
strokeLinecap="round"
|
|
14
|
-
strokeLinejoin="round"
|
|
15
|
-
{...props}>
|
|
16
|
-
<path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" />
|
|
17
|
-
<path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" />
|
|
18
|
-
</svg>
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
const CopyIcon = (props: React.SVGProps<SVGSVGElement>) => (
|
|
22
|
-
<svg
|
|
23
|
-
viewBox="0 0 24 24"
|
|
24
|
-
fill="none"
|
|
25
|
-
stroke="currentColor"
|
|
26
|
-
strokeWidth={1.5}
|
|
27
|
-
strokeLinecap="round"
|
|
28
|
-
strokeLinejoin="round"
|
|
29
|
-
{...props}>
|
|
30
|
-
<rect x="9" y="9" width="13" height="13" rx="2" />
|
|
31
|
-
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" />
|
|
32
|
-
</svg>
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
const ShareIcon = (props: React.SVGProps<SVGSVGElement>) => (
|
|
36
|
-
<svg
|
|
37
|
-
viewBox="0 0 24 24"
|
|
38
|
-
fill="none"
|
|
39
|
-
stroke="currentColor"
|
|
40
|
-
strokeWidth={1.5}
|
|
41
|
-
strokeLinecap="round"
|
|
42
|
-
strokeLinejoin="round"
|
|
43
|
-
{...props}>
|
|
44
|
-
<circle cx="18" cy="5" r="3" />
|
|
45
|
-
<circle cx="6" cy="12" r="3" />
|
|
46
|
-
<circle cx="18" cy="19" r="3" />
|
|
47
|
-
<line x1="8.59" y1="13.51" x2="15.42" y2="17.49" />
|
|
48
|
-
<line x1="15.41" y1="6.51" x2="8.59" y2="10.49" />
|
|
49
|
-
</svg>
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
const TrashIcon = (props: React.SVGProps<SVGSVGElement>) => (
|
|
53
|
-
<svg
|
|
54
|
-
viewBox="0 0 24 24"
|
|
55
|
-
fill="none"
|
|
56
|
-
stroke="currentColor"
|
|
57
|
-
strokeWidth={1.5}
|
|
58
|
-
strokeLinecap="round"
|
|
59
|
-
strokeLinejoin="round"
|
|
60
|
-
{...props}>
|
|
61
|
-
<polyline points="3 6 5 6 21 6" />
|
|
62
|
-
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />
|
|
63
|
-
</svg>
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
export default function ContextMenuItemShowcase() {
|
|
67
|
-
return (
|
|
68
|
-
<ContextMenu
|
|
69
|
-
menuContent={
|
|
70
|
-
<>
|
|
71
|
-
<ContextMenuItem
|
|
72
|
-
icon={PencilIcon}
|
|
73
|
-
label="Edit"
|
|
74
|
-
description="Modify this item"
|
|
75
|
-
onClick={() => {}}
|
|
76
|
-
/>
|
|
77
|
-
<ContextMenuItem
|
|
78
|
-
icon={CopyIcon}
|
|
79
|
-
label="Duplicate"
|
|
80
|
-
description="Create a copy"
|
|
81
|
-
onClick={() => {}}
|
|
82
|
-
/>
|
|
83
|
-
<ContextMenuItem icon={ShareIcon} label="Share" onClick={() => {}} />
|
|
84
|
-
<ContextMenuItem
|
|
85
|
-
icon={TrashIcon}
|
|
86
|
-
label="Delete"
|
|
87
|
-
description="This action cannot be undone"
|
|
88
|
-
onClick={() => {}}
|
|
89
|
-
/>
|
|
90
|
-
</>
|
|
91
|
-
}>
|
|
92
|
-
<div
|
|
93
|
-
style={{
|
|
94
|
-
padding: '48px',
|
|
95
|
-
borderWidth: '2px',
|
|
96
|
-
borderStyle: 'dashed',
|
|
97
|
-
borderColor: 'var(--color-border)',
|
|
98
|
-
borderRadius: '8px',
|
|
99
|
-
textAlign: 'center',
|
|
100
|
-
color: 'var(--color-text-secondary)',
|
|
101
|
-
userSelect: 'none',
|
|
102
|
-
}}>
|
|
103
|
-
Right-click this area
|
|
104
|
-
</div>
|
|
105
|
-
</ContextMenu>
|
|
106
|
-
);
|
|
107
|
-
}
|