@stonecrop/nuxt 0.27.0 → 0.29.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 CHANGED
@@ -21,7 +21,7 @@ Stonecrop is a **schema-driven UI framework** that generates forms, tables, and
21
21
 
22
22
  - **Route Generation**: Scans your `/doctypes` folder and registers routes using your own page components
23
23
  - **Plugin System**: Auto-registers Stonecrop composables and utilities
24
- - **Theme Support**: Import and customize Stonecrop themes
24
+ - **Styling**: Loads the Stonecrop token floor automatically; restyle by overriding `--sc-*` variables
25
25
  - **TypeScript First**: Full type safety and IntelliSense support
26
26
  - **Thin Wrapper**: The module is intentionally opinion-free — page rendering, queries, and navigation stay in your application
27
27
 
@@ -219,14 +219,12 @@ export default defineNuxtConfig({
219
219
 
220
220
  // Enable DocBuilder for visual schema editing
221
221
  docbuilder: false,
222
-
223
- // The default theme (@stonecrop/themes/default.css) loads automatically.
224
- // Override it, or set `false` to bring your own:
225
- // theme: '@stonecrop/themes/dark.css',
226
222
  },
227
223
  })
228
224
  ```
229
225
 
226
+ The Stonecrop token floor (`@stonecrop/themes/default.css`) is always loaded — see [Theming](#theming).
227
+
230
228
  ### Module Options
231
229
 
232
230
  | Option | Type | Description |
@@ -235,10 +233,28 @@ export default defineNuxtConfig({
235
233
  | `routeStrategy` | `RouteStrategyFn` | Custom function receiving all parsed doctypes; returns a `NuxtPage[]`. Takes priority over `pageComponent`. |
236
234
  | `docbuilder` | `boolean` | Enable the DocBuilder feature at `/docbuilder`. Defaults to `false`. |
237
235
  | `doctypesDir` | `string` | Override the doctypes directory path. Defaults to `doctypes/` inside `srcDir`. |
238
- | `theme` | `string \| false` | Base theme stylesheet loaded into the host app (supplies the `--sc-*` CSS variables). Defaults to `'@stonecrop/themes/default.css'`; set `false` to load none and bring your own. |
239
236
 
240
237
  If neither `pageComponent` nor `routeStrategy` is configured the module logs a warning and skips doctype route registration.
241
238
 
239
+ ## Theming
240
+
241
+ The module loads `@stonecrop/themes/default.css` into `nuxt.options.css` unconditionally. There is no option to change or disable it: that sheet is the only definition of the `--sc-*` variables every Stonecrop component reads, so opting out could only produce an unstyled app.
242
+
243
+ Restyle by overriding the variables in your own CSS:
244
+
245
+ ```css
246
+ /* app/assets/tokens.css */
247
+ :root {
248
+ --sc-primary-color: #6d28d9;
249
+ --sc-brand-color: #111827;
250
+ --sc-font-family: 'IBM Plex Sans', sans-serif;
251
+ }
252
+ ```
253
+
254
+ Your declaration wins. The floor wraps its own in the `stonecrop.tokens` cascade layer, and an unlayered declaration beats a layered one regardless of specificity or source order — so this works no matter where your stylesheet sits in `nuxt.options.css`. Keep the overrides on `:root`; scoping them to a container changes how they resolve outside it.
255
+
256
+ See the [`@stonecrop/themes` README](../themes/README.md) for the full token list and the rules on adding one.
257
+
242
258
  ## Route Generation
243
259
 
244
260
  ### Default: routes the doctypes declare
package/dist/module.d.mts CHANGED
@@ -78,19 +78,14 @@ interface ModuleOptions {
78
78
  * ```
79
79
  */
80
80
  routeStrategy?: RouteStrategyFn;
81
- /**
82
- * Base theme stylesheet loaded into the host app. Provides the `--sc-*` CSS variables,
83
- * applies the document font, and normalizes form controls / code to inherit it. Defaults
84
- * to Stonecrop's default theme. Set to `false` to load no theme (bring your own), or pass
85
- * a different theme's module specifier / path (e.g. `'@stonecrop/themes/dark.css'`).
86
- *
87
- * The Stonecrop component packages are theme-agnostic — they consume `--sc-*` variables
88
- * but never bundle a theme — so the host must supply one; the module does that here.
89
- */
90
- theme?: string | false;
91
81
  }
92
82
  declare const STONECROP_PACKAGES: string[];
83
+ /**
84
+ * The Stonecrop token floor — the single definition of every `--sc-*` variable the component
85
+ * packages consume. Named once here so the specifier lives in one place.
86
+ */
87
+ declare const STONECROP_TOKENS = "@stonecrop/themes/default.css";
93
88
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
94
89
 
95
- export { STONECROP_PACKAGES, _default as default };
90
+ export { STONECROP_PACKAGES, STONECROP_TOKENS, _default as default };
96
91
  export type { ModuleOptions, ParsedDoctype, RouteStrategyFn };
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stonecrop/nuxt",
3
3
  "configKey": "stonecrop",
4
- "version": "0.27.0",
4
+ "version": "0.29.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
package/dist/module.mjs CHANGED
@@ -34,6 +34,7 @@ const STONECROP_PACKAGES = [
34
34
  "@stonecrop/utilities",
35
35
  "@stonecrop/themes"
36
36
  ];
37
+ const STONECROP_TOKENS = "@stonecrop/themes/default.css";
37
38
  const module$1 = defineNuxtModule({
38
39
  meta: {
39
40
  name: "@stonecrop/nuxt",
@@ -42,8 +43,7 @@ const module$1 = defineNuxtModule({
42
43
  defaults: (_nuxt) => {
43
44
  return {
44
45
  docbuilder: false,
45
- doctypesDir: "doctypes",
46
- theme: "@stonecrop/themes/default.css"
46
+ doctypesDir: "doctypes"
47
47
  };
48
48
  },
49
49
  async setup(options, nuxt) {
@@ -68,9 +68,9 @@ const module$1 = defineNuxtModule({
68
68
  } catch {
69
69
  }
70
70
  }
71
- if (options.theme && !nuxt.options.css.includes(options.theme)) {
72
- nuxt.options.css.unshift(options.theme);
73
- logger.log(`Added Stonecrop theme to app CSS: ${options.theme}`);
71
+ if (!nuxt.options.css.includes(STONECROP_TOKENS)) {
72
+ nuxt.options.css.unshift(STONECROP_TOKENS);
73
+ logger.log(`Added Stonecrop tokens to app CSS: ${STONECROP_TOKENS}`);
74
74
  }
75
75
  nuxt.hook("nitro:config", (config) => {
76
76
  config.externals = config.externals || {};
@@ -274,4 +274,4 @@ const module$1 = defineNuxtModule({
274
274
  }
275
275
  });
276
276
 
277
- export { STONECROP_PACKAGES, module$1 as default };
277
+ export { STONECROP_PACKAGES, STONECROP_TOKENS, module$1 as default };
package/dist/types.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- export { type STONECROP_PACKAGES, default } from './module.mjs'
1
+ export { type STONECROP_PACKAGES, type STONECROP_TOKENS, default } from './module.mjs'
2
2
 
3
3
  export { type ModuleOptions, type ParsedDoctype, type RouteStrategyFn } from './module.mjs'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stonecrop/nuxt",
3
- "version": "0.27.0",
3
+ "version": "0.29.0",
4
4
  "description": "Nuxt module for Stonecrop",
5
5
  "repository": {
6
6
  "type": "git",
@@ -45,18 +45,18 @@
45
45
  "pathe": "^2.0.3",
46
46
  "pinia": "^3.0.4",
47
47
  "prompts": "^2.4.2",
48
- "@stonecrop/aform": "0.27.0",
49
- "@stonecrop/atable": "0.27.0",
50
- "@stonecrop/code-editor": "0.27.0",
51
- "@stonecrop/desktop": "0.27.0",
52
- "@stonecrop/casl-middleware": "0.27.0",
53
- "@stonecrop/graphql-client": "0.27.0",
54
- "@stonecrop/node-editor": "0.27.0",
55
- "@stonecrop/nuxt-grafserv": "0.27.0",
56
- "@stonecrop/schema": "0.27.0",
57
- "@stonecrop/stonecrop": "0.27.0",
58
- "@stonecrop/graphql-middleware": "0.27.0",
59
- "@stonecrop/themes": "0.27.0"
48
+ "@stonecrop/aform": "0.29.0",
49
+ "@stonecrop/casl-middleware": "0.29.0",
50
+ "@stonecrop/code-editor": "0.29.0",
51
+ "@stonecrop/desktop": "0.29.0",
52
+ "@stonecrop/atable": "0.29.0",
53
+ "@stonecrop/graphql-client": "0.29.0",
54
+ "@stonecrop/graphql-middleware": "0.29.0",
55
+ "@stonecrop/node-editor": "0.29.0",
56
+ "@stonecrop/nuxt-grafserv": "0.29.0",
57
+ "@stonecrop/schema": "0.29.0",
58
+ "@stonecrop/stonecrop": "0.29.0",
59
+ "@stonecrop/themes": "0.29.0"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@eslint/js": "^10.0.1",