@sit-onyx/nuxt 1.0.0-beta.1 → 1.0.0-beta.100

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/dist/module.d.mts CHANGED
@@ -1,6 +1,12 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
+ import { OnyxTheme } from 'sit-onyx';
2
3
 
3
4
  interface ModuleOptions {
5
+ /**
6
+ * The onyx theme to use. See: [https://onyx.schwarz/development/theming.html](https://onyx.schwarz/development/theming.html)
7
+ * @default "onyx"
8
+ */
9
+ theme: OnyxTheme;
4
10
  /**
5
11
  * By default, the global onyx styles (`global.css` file) will be included
6
12
  * which applies some global styles like background color and font styles.
@@ -26,6 +32,6 @@ interface ModuleOptions {
26
32
  registerLocales?: Record<string, "en-US" | "de-DE" | "ko-KR">;
27
33
  };
28
34
  }
29
- declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
35
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
30
36
 
31
37
  export { type ModuleOptions, _default as default };
package/dist/module.d.ts CHANGED
@@ -1,6 +1,12 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
+ import { OnyxTheme } from 'sit-onyx';
2
3
 
3
4
  interface ModuleOptions {
5
+ /**
6
+ * The onyx theme to use. See: [https://onyx.schwarz/development/theming.html](https://onyx.schwarz/development/theming.html)
7
+ * @default "onyx"
8
+ */
9
+ theme: OnyxTheme;
4
10
  /**
5
11
  * By default, the global onyx styles (`global.css` file) will be included
6
12
  * which applies some global styles like background color and font styles.
@@ -26,6 +32,6 @@ interface ModuleOptions {
26
32
  registerLocales?: Record<string, "en-US" | "de-DE" | "ko-KR">;
27
33
  };
28
34
  }
29
- declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
35
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
30
36
 
31
37
  export { type ModuleOptions, _default as default };
package/dist/module.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@sit-onyx/nuxt",
3
3
  "configKey": "onyx",
4
- "version": "1.0.0-beta.0",
4
+ "version": "1.0.0-beta.99",
5
5
  "builder": {
6
- "@nuxt/module-builder": "0.8.1",
6
+ "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "unknown"
8
8
  }
9
9
  }
package/dist/module.mjs CHANGED
@@ -6,12 +6,18 @@ const module = defineNuxtModule({
6
6
  name: "@sit-onyx/nuxt",
7
7
  configKey: "onyx"
8
8
  },
9
- defaults: {},
9
+ defaults: {
10
+ theme: "onyx"
11
+ },
10
12
  setup(options, nuxt) {
11
13
  const logger = useLogger("@sit-onyx/nuxt");
12
14
  const { resolve } = createResolver(import.meta.url);
13
15
  nuxt.options.postcss.plugins.cssnano = { preset: ["default", { calc: false }] };
14
16
  nuxt.options.css.push("sit-onyx/style.css");
17
+ if (options.theme !== "onyx") {
18
+ nuxt.options.css.push(`sit-onyx/themes/${options.theme}-light.css`);
19
+ nuxt.options.css.push(`sit-onyx/themes/${options.theme}-dark.css`);
20
+ }
15
21
  if (!options.disableGlobalStyles) {
16
22
  nuxt.options.css.push("sit-onyx/global.css");
17
23
  }
@@ -1,6 +1,6 @@
1
- import { computed, watchEffect } from "#imports";
1
+ import { computed } from "#imports";
2
2
  import { defineNuxtPlugin, useNuxtApp } from "nuxt/app";
3
- import { provideI18n, syncGlobalOptionalText } from "sit-onyx";
3
+ import { createOnyx } from "sit-onyx";
4
4
  export default defineNuxtPlugin({
5
5
  name: "onyx:plugin",
6
6
  // @ts-ignore: dependency comes from @nuxtjs/i18n
@@ -12,14 +12,15 @@ export default defineNuxtPlugin({
12
12
  return translate(`onyx.${key}`, placeholders?.n ?? 1, { named: placeholders });
13
13
  };
14
14
  });
15
- provideI18n(app.vueApp, {
16
- locale: computed(() => localeProperties.value.iso ?? "en-US"),
17
- t
18
- });
19
- app.hook("app:beforeMount", () => {
20
- watchEffect(() => {
21
- syncGlobalOptionalText(translate(`onyx.optional`));
22
- });
23
- });
15
+ app.vueApp.use(
16
+ createOnyx({
17
+ i18n: {
18
+ locale: computed(
19
+ () => localeProperties.value.language ?? localeProperties.value.iso ?? "en-US"
20
+ ),
21
+ t
22
+ }
23
+ })
24
+ );
24
25
  }
25
26
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sit-onyx/nuxt",
3
- "version": "1.0.0-beta.1",
3
+ "version": "1.0.0-beta.100",
4
4
  "description": "A Nuxt module to easily integrate onyx into Nuxt projects",
5
5
  "author": "Schwarz IT KG",
6
6
  "license": "Apache-2.0",
@@ -26,22 +26,25 @@
26
26
  "dist"
27
27
  ],
28
28
  "dependencies": {
29
- "@nuxt/kit": "^3.12.3"
29
+ "@nuxt/kit": "^3.14.1592"
30
30
  },
31
31
  "devDependencies": {
32
- "@nuxt/devtools": "^1.3.9",
33
- "@nuxt/module-builder": "~0.8.1",
34
- "@nuxt/schema": "^3.12.3",
35
- "@nuxt/test-utils": "^3.13.1",
36
- "@nuxtjs/i18n": "^8.3.1",
37
- "nuxt": "^3.12.3",
38
- "vue-i18n": "^9.13.1"
32
+ "@nuxt/devtools": "^1.6.4",
33
+ "@nuxt/module-builder": "~0.8.4",
34
+ "@nuxt/schema": "^3.14.1592",
35
+ "@nuxt/test-utils": "^3.15.1",
36
+ "@nuxtjs/i18n": "^9.1.1",
37
+ "nuxt": "^3.14.1592",
38
+ "typescript": "5.6.3",
39
+ "vue-i18n": "^10.0.5",
40
+ "sit-onyx": "^1.0.0-beta.99"
39
41
  },
40
42
  "peerDependencies": {
41
- "sit-onyx": "^1.0.0-beta.1"
43
+ "sit-onyx": "^1.0.0-beta.99"
42
44
  },
43
45
  "scripts": {
44
- "dev": "nuxi dev playground",
46
+ "dev": "turbo run turbo:dev --filter=.",
47
+ "turbo:dev": "nuxi dev playground",
45
48
  "dev:build": "nuxi build playground",
46
49
  "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
47
50
  "build": "pnpm run dev:prepare && nuxt-module-build build",