@thalavaisankar/atoms 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -62,6 +62,7 @@ export function Welcome() {
|
|
|
62
62
|
npx atoms-cli@latest init
|
|
63
63
|
npx atoms-cli@latest init --accent violet --radius lg
|
|
64
64
|
npx atoms-cli@latest theme --accent teal --radius sm
|
|
65
|
+
npx atoms-cli@latest theme --ui
|
|
65
66
|
npx atoms-cli@latest add button
|
|
66
67
|
npx atoms-cli@latest add --all
|
|
67
68
|
```
|
|
@@ -74,11 +75,25 @@ npx atoms-cli@latest add --all
|
|
|
74
75
|
- your package manager.
|
|
75
76
|
|
|
76
77
|
It then asks for the project's accent, default theme, radius, density and theme switching; in CI,
|
|
77
|
-
flags and defaults make the same choices without prompting. The CLI adds the foundation
|
|
78
|
-
(`styles/atoms.css`),
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
flags and defaults make the same choices without prompting. The CLI adds the immutable foundation
|
|
79
|
+
stylesheet (`styles/atoms.css`), applies preset accents with `data-accent`, and writes the radius plus
|
|
80
|
+
any custom `--brand`/`--brand-foreground` override to `styles/atoms-theme.css`. That generated file
|
|
81
|
+
is imported immediately after `atoms.css`. In Next.js App Router projects the CLI safely updates the
|
|
82
|
+
root layout with readable multiline attributes and provider wrappers. Run
|
|
83
|
+
`npx atoms-cli@latest theme` later to change the look.
|
|
84
|
+
|
|
85
|
+
For Next.js App Router projects, `init` also adds a local-development theme editor at
|
|
86
|
+
`/_atoms/theme`. It loads the exact saved choices, scopes the preview to its own card, and saves
|
|
87
|
+
`atoms.json`, the selected CSS destination, and the managed root-layout region together. The route
|
|
88
|
+
is unavailable in production and accepts saves only from a loopback host. Use `init --no-theme-editor`
|
|
89
|
+
to opt out, or `theme-editor install|open|remove` to manage it later. `init --ui` and `theme --ui`
|
|
90
|
+
provide the same choice flow from a temporary `127.0.0.1` browser session without needing the app's
|
|
91
|
+
dev server.
|
|
92
|
+
|
|
93
|
+
The generated file is the recommended default. Use `--theme-output globals` to place the same
|
|
94
|
+
variables in a marked block in the detected global stylesheet, or `--theme-output file` to move back.
|
|
95
|
+
Migrations remove the previous source so the variables are never active twice; a locally edited
|
|
96
|
+
generated theme file is protected unless `--force` is supplied.
|
|
82
97
|
|
|
83
98
|
`add` installs items and everything they depend on: foundations and utilities first, then components. It checks every downloaded file against the registry's SHA-256 hashes, installs only the npm packages your `package.json` doesn't already list, and rewrites imports to your alias. `add --all` installs the whole registry. `npx atoms-cli@latest list` shows what's available.
|
|
84
99
|
|
|
@@ -94,6 +109,10 @@ TSX automatically.
|
|
|
94
109
|
| `--dry-run` | Show what would change without writing or installing anything |
|
|
95
110
|
| `--skip-install` | Don't run the package manager; print the command instead |
|
|
96
111
|
| `--verbose` | Show paths, dependencies and instructions |
|
|
112
|
+
| `--theme-output <file\|globals>` | Choose the generated theme file (default) or a managed block in global CSS |
|
|
113
|
+
| `--ui` | Open the loopback-only visual theme picker (`init`, `theme`) |
|
|
114
|
+
| `--no-theme-editor` | Skip the local Next.js editor route during init |
|
|
115
|
+
| `--theme-editor-route <path>` | Choose the local editor route |
|
|
97
116
|
|
|
98
117
|
The registry itself is plain JSON: `https://atomsdesignsystem.vercel.app/r/index.json` lists every item, and `/r/<name>.json` serves one.
|
|
99
118
|
|
package/package.json
CHANGED