@knitify/vue 0.0.1 → 0.0.2

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": "@knitify/vue",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -8,6 +8,9 @@
8
8
  "main": "dist/index.umd.js",
9
9
  "module": "dist/index.es.js",
10
10
  "types": "dist/types/index.d.ts",
11
+ "files": [
12
+ "dist"
13
+ ],
11
14
  "devDependencies": {
12
15
  "@vitejs/plugin-vue": "^6.0.4",
13
16
  "typescript": "^5.9.3",
@@ -1,30 +0,0 @@
1
- <script setup lang="ts">
2
- import { onMounted, onUnmounted } from 'vue'
3
- import '@knitify/core/main.css'
4
- import Knitify from '@knitify/core'
5
-
6
- onMounted(() => {
7
- Knitify.init()
8
- })
9
-
10
- onUnmounted(() => {
11
- Knitify.destroy()
12
- })
13
- </script>
14
-
15
- <template>
16
- <div>
17
- <RouterView />
18
- </div>
19
- </template>
20
-
21
- <style>
22
- html {
23
- box-sizing: border-box;
24
- }
25
- *,
26
- *::before,
27
- *::after {
28
- box-sizing: inherit;
29
- }
30
- </style>
@@ -1,11 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <title>Playground</title>
6
- </head>
7
- <body>
8
- <div id="app"></div>
9
- <script type="module" src="/main.ts"></script>
10
- </body>
11
- </html>
@@ -1,23 +0,0 @@
1
- import { createApp } from 'vue'
2
- import App from './App.vue'
3
- import knitifyVue from '../src'
4
- import { createRouter, createWebHashHistory } from 'vue-router'
5
-
6
- const app = createApp(App)
7
-
8
- app.use(knitifyVue)
9
-
10
- const router = createRouter({
11
- history: createWebHashHistory('/'),
12
- routes: [
13
- {
14
- name: 'main',
15
- path: '',
16
- component: () => import('./views/MainView.vue'),
17
- },
18
- ],
19
- })
20
-
21
- app.use(router)
22
-
23
- app.mount('#app')
@@ -1,13 +0,0 @@
1
- <template>
2
- <KNavbar
3
- :items="[
4
- {
5
- text: 'HR Hub',
6
- icon: '#moduleHrhubColored',
7
- route: '/',
8
- children: [{ text: 'Child', icon: '#moduleWeavesColored', route: '/' }],
9
- },
10
- { text: 'Weaves', icon: '#moduleWeavesColored', route: '/' },
11
- ]"
12
- />
13
- </template>
@@ -1,11 +0,0 @@
1
- <script setup lang="ts">
2
- import { KIconProps } from './types'
3
-
4
- const { href = '' } = defineProps<KIconProps>()
5
- </script>
6
-
7
- <template>
8
- <svg class="KIcon" title="icon" role="img">
9
- <use :href="`#${href.replace(/^#/, '')}`"></use>
10
- </svg>
11
- </template>
@@ -1,3 +0,0 @@
1
- export type KIconProps = {
2
- href: string
3
- }
@@ -1,25 +0,0 @@
1
- <script setup lang="ts">
2
- import { KNavbarProps, KNavbarSlots } from './types'
3
- import KNavbarMenu from './KNavbarMenu.vue'
4
-
5
- const { items } = defineProps<KNavbarProps>()
6
- const slots = defineSlots<KNavbarSlots>()
7
- </script>
8
-
9
- <template>
10
- <aside class="KNavbar">
11
- <div class="KNavbar-inner">
12
- <div v-if="slots.brand" class="KNavbar-brand">
13
- <slot name="brand"></slot>
14
- </div>
15
- <nav class="KNavbar-body">
16
- <slot>
17
- <KNavbarMenu :items="items" />
18
- </slot>
19
- </nav>
20
- <div v-if="slots.footer" class="KNavbar-footer">
21
- <slot name="footer"></slot>
22
- </div>
23
- </div>
24
- </aside>
25
- </template>
@@ -1,47 +0,0 @@
1
- <script setup lang="ts">
2
- import { KNavbarMenuProps } from './types'
3
- import { RouterLink } from 'vue-router'
4
-
5
- const { items = [] } = defineProps<KNavbarMenuProps>()
6
- </script>
7
-
8
- <template>
9
- <ul class="KNavbar-menu">
10
- <RouterLink
11
- v-for="(item, index) in items"
12
- :key="`navbar-menu-item-${index}`"
13
- :to="item.route"
14
- custom
15
- v-slot="{ isActive, href, navigate }"
16
- >
17
- <li
18
- :class="[
19
- 'KNavbar-item',
20
- 'KCollapse is-collapsed',
21
- isActive && 'KNavbar-item-is-active',
22
- ]"
23
- data-collapse
24
- >
25
- <a :class="['KNavbar-link']" :href="href" @click="navigate">
26
- <span class="KNavbar-icon">
27
- <KIcon :href="item.icon" />
28
- </span>
29
- <span :class="['KNavbar-text']">{{ item.text }}</span>
30
- <span
31
- v-if="item.children"
32
- :class="['KNavbar-caret', 'KCollapse-toggle']"
33
- data-collapse-toggle
34
- >
35
- <KIcon href="#caretUp" />
36
- </span>
37
- </a>
38
- <KNavbarMenu
39
- v-if="item.children"
40
- :items="item.children"
41
- class="KCollapse-content"
42
- data-collapse-content
43
- />
44
- </li>
45
- </RouterLink>
46
- </ul>
47
- </template>
@@ -1,22 +0,0 @@
1
- import { RouteLocationRaw } from 'vue-router'
2
-
3
- export type MenuItem = {
4
- text: string
5
- route: RouteLocationRaw
6
- children?: MenuItem[]
7
- icon?: string
8
- }
9
-
10
- export type KNavbarProps = {
11
- items: MenuItem[]
12
- }
13
-
14
- export type KNavbarSlots = {
15
- brand?(): any
16
- default?(): any
17
- footer?(): any
18
- }
19
-
20
- export type KNavbarMenuProps = {
21
- items: MenuItem[]
22
- }
@@ -1,3 +0,0 @@
1
- export { default as KIcon } from './Icon/KIcon.vue'
2
- export { default as KNavbar } from './Navbar/KNavbar.vue'
3
- export { default as KNavbarMenu } from './Navbar/KNavbarMenu.vue'
@@ -1,2 +0,0 @@
1
- export * from './Icon/types'
2
- export * from './Navbar/types'
package/src/index.ts DELETED
@@ -1,16 +0,0 @@
1
- import { App } from 'vue'
2
- import * as Components from './components'
3
-
4
- export * from './components/types'
5
- export * from './components'
6
-
7
- export default {
8
- install(app: App) {
9
- for (const componentName in Components) {
10
- app.component(
11
- componentName,
12
- Components[componentName as keyof typeof Components]
13
- )
14
- }
15
- },
16
- }
package/tsconfig.json DELETED
@@ -1,16 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ESNext",
4
- "module": "ESNext",
5
- "moduleResolution": "Node",
6
- "declaration": true,
7
- "declarationDir": "dist/types",
8
- "outDir": "dist",
9
- "strict": true,
10
- "jsx": "preserve",
11
- "esModuleInterop": true,
12
- "skipLibCheck": true
13
- },
14
- "include": ["src"],
15
- "exclude": ["node_modules", "dist"]
16
- }
package/vite.config.ts DELETED
@@ -1,25 +0,0 @@
1
- import { defineConfig } from 'vite'
2
- import vue from '@vitejs/plugin-vue'
3
- import path from 'path'
4
-
5
- export default defineConfig(({ mode }) => ({
6
- plugins: [vue()],
7
-
8
- build: {
9
- lib: {
10
- entry: path.resolve(__dirname, 'src/index.ts'),
11
- name: 'knitify-vue',
12
- fileName: (format, name) => `${name}.${format}.js`,
13
- },
14
- rollupOptions: {
15
- external: ['vue', 'vue-router'],
16
- output: {
17
- globals: {
18
- vue: 'Vue',
19
- },
20
- },
21
- },
22
- },
23
-
24
- root: mode === 'development' ? 'playground' : '.',
25
- }))