@kong/kongponents 9.43.2-pr.2953.34318bf.0 → 9.43.3-pr.2956.1f3e80c.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kong/kongponents",
3
- "version": "9.43.2-pr.2953.34318bf.0",
3
+ "version": "9.43.3-pr.2956.1f3e80c.0",
4
4
  "description": "Kong Component library",
5
5
  "type": "module",
6
6
  "repository": {
@@ -22,10 +22,6 @@
22
22
  "import": "./dist/kongponents.es.js",
23
23
  "require": "./dist/kongponents.umd.js"
24
24
  },
25
- "./nuxt": {
26
- "import": "./dist/nuxt/index.js",
27
- "types": "./dist/types/nuxt/index.d.ts"
28
- },
29
25
  "./dist/style.css": "./dist/kongponents.css",
30
26
  "./package.json": "./package.json",
31
27
  "./dist/*": "./dist/*"
@@ -60,7 +56,6 @@
60
56
  "@kong-ui-public/sandbox-layout": "^2.3.4",
61
57
  "@kong/design-tokens": "^1.18.0",
62
58
  "@kong/eslint-config-kong-ui": "1.5.1",
63
- "@nuxt/kit": "^4.1.3",
64
59
  "@semantic-release/changelog": "^6.0.3",
65
60
  "@semantic-release/git": "^10.0.1",
66
61
  "@stylistic/stylelint-plugin": "^4.0.0",
@@ -84,7 +79,6 @@
84
79
  "inquirer": "^9.3.6",
85
80
  "nanospinner": "^1.2.2",
86
81
  "node-emoji": "^2.2.0",
87
- "nuxt": "^4.1.3",
88
82
  "picocolors": "^1.1.1",
89
83
  "postcss-cli": "^11.0.1",
90
84
  "postcss-custom-properties": "^14.0.6",
@@ -183,8 +177,7 @@
183
177
  "scripts": {
184
178
  "build:cli": "rimraf ./bin && tsc --project ./cli/tsconfig.json && chmod u+x ./bin/index.js",
185
179
  "build:docs": "vitepress build docs",
186
- "build:kongponents": "pnpm typecheck && vite build && vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly && tsc-alias -p './tsconfig.build.json' && pnpm build:nuxt",
187
- "build:nuxt": "tsc -p ./tsconfig.build.nuxt.json --outDir dist/nuxt",
180
+ "build:kongponents": "pnpm typecheck && vite build && vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly && tsc-alias -p './tsconfig.build.json'",
188
181
  "build:visualize": "cross-env-shell BUILD_VISUALIZER=true vite build -m production",
189
182
  "build": "pnpm build:cli && pnpm stylelint && pnpm lint && pnpm build:kongponents && pnpm build:docs",
190
183
  "build:ci": "pnpm build:kongponents && pnpm build:docs",
@@ -1,71 +0,0 @@
1
- import { defineNuxtModule, createResolver, addComponent, useLogger, addImportsDir } from '@nuxt/kit';
2
- import { components } from '@kong/kongponents';
3
- // Components that should always be excluded from auto-registration
4
- const ALWAYS_EXCLUDE_COMPONENTS = ['ToastManager', 'KTable', 'KModalFullscreen', 'KDropdownMenu'];
5
- export default defineNuxtModule({
6
- meta: {
7
- name: '@kong/kongponents',
8
- configKey: 'kongponents',
9
- },
10
- defaults: {
11
- components: {
12
- include: [],
13
- exclude: [],
14
- },
15
- composables: true,
16
- },
17
- setup(options, nuxt) {
18
- const { resolve } = createResolver(import.meta.url);
19
- const logger = useLogger('kongponents');
20
- // Register the styles
21
- nuxt.options.css.push('@kong/kongponents/dist/style.css');
22
- if (options.composables) {
23
- // Register composables
24
- addImportsDir(resolve('./runtime/composables'));
25
- }
26
- // Define a list of components that should be auto-registered.
27
- const includeList = options.components?.include || [];
28
- // Define a list of components that should never be auto-registered.
29
- const excludeList = [...ALWAYS_EXCLUDE_COMPONENTS, ...(options.components?.exclude || [])];
30
- const filteredComponents = Object.keys(components).filter((name) => {
31
- // If include list is set, only register those
32
- if (includeList.length > 0 && !includeList.includes(name))
33
- return false;
34
- // Skip excluded or deprecated components
35
- if (excludeList.includes(name))
36
- return false;
37
- return true;
38
- });
39
- if (filteredComponents.length === 0) {
40
- logger.warn('⚠️ No Kongponents components were registered. Check your include/exclude config.');
41
- }
42
- filteredComponents.forEach((name) => {
43
- addComponent({
44
- name,
45
- export: name,
46
- filePath: '@kong/kongponents',
47
- // we don't need global registration here
48
- global: false,
49
- // 'all' means both client and server
50
- mode: 'all',
51
- });
52
- });
53
- /**
54
- * Integrate with Nuxt DevTools by adding a "Kongponents" tab.
55
- * This gives quick access to documentation within the DevTools UI.
56
- */
57
- // @ts-ignore - nuxt types are missing devtools hook
58
- nuxt.hook('devtools:customTabs', (tabs) => {
59
- tabs.push({
60
- name: 'kongponents',
61
- title: 'Kongponents',
62
- icon: 'https://kongponents.konghq.com/img/kong-logomark.png',
63
- view: {
64
- type: 'iframe',
65
- src: 'https://kongponents.konghq.com',
66
- },
67
- });
68
- });
69
- logger.success('🚀 Kongponents module has been registered.');
70
- },
71
- });
@@ -1,27 +0,0 @@
1
- import { onBeforeUnmount } from 'vue';
2
- import { ToastManager } from '@kong/kongponents';
3
- /** The default toaster configuration */
4
- const defaultToastConfig = {
5
- key: 'kongponents-toast',
6
- appearance: 'success',
7
- message: 'Success',
8
- timeoutMilliseconds: 3000,
9
- };
10
- export default function useToast() {
11
- // Initialize the toast manager; stub out the `open` and `destroy` methods on the server
12
- const toast = import.meta.client ? new ToastManager() : { open: () => { }, destroy: () => { } };
13
- const showToast = async (notification) => {
14
- if (import.meta.client) {
15
- toast.open({
16
- ...defaultToastConfig,
17
- ...notification,
18
- });
19
- }
20
- };
21
- onBeforeUnmount(() => {
22
- toast.destroy();
23
- });
24
- return {
25
- showToast,
26
- };
27
- }
@@ -1,14 +0,0 @@
1
- // TODO: testing some stuff...
2
- // @ts-ignore - import path exists
3
- import { defineNuxtPlugin } from '#app';
4
- // In some NodeJS environments, the `crypto` module is not available by default, so import it and make it available on the server
5
- import crypto from 'node:crypto';
6
- export default defineNuxtPlugin({
7
- name: 'kongponents',
8
- setup() {
9
- // Inject the crypto module into the global scope if it is not already available
10
- if (import.meta.server && typeof globalThis?.crypto === 'undefined') {
11
- globalThis.crypto = globalThis.crypto || crypto;
12
- }
13
- },
14
- });
@@ -1,24 +0,0 @@
1
- import { components } from '@kong/kongponents';
2
- type ComponentKeys = keyof typeof components;
3
- type ExcludedComponentKeys = Exclude<ComponentKeys, 'ToastManager' | 'KTable' | 'KModalFullscreen' | 'KDropdownMenu'>;
4
- export interface ModuleOptions {
5
- components?: {
6
- /**
7
- * List of components to include in auto-registration. If unset or empty, all components will be included.
8
- * @default []
9
- */
10
- include?: ComponentKeys[];
11
- /**
12
- * List of components to exclude from automatic registration
13
- * @default []
14
- */
15
- exclude?: ExcludedComponentKeys[];
16
- };
17
- /**
18
- * Whether to register composables globally
19
- * @default true
20
- */
21
- composables?: boolean;
22
- }
23
- declare const _default: import("nuxt/schema").NuxtModule<ModuleOptions, ModuleOptions, false>;
24
- export default _default;
@@ -1,4 +0,0 @@
1
- import type { Toast } from '@kong/kongponents';
2
- export default function useToast(): {
3
- showToast: (notification: Partial<Toast>) => Promise<void>;
4
- };
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;