Skip to content

Commit

Permalink
Connect components to site (#19)
Browse files Browse the repository at this point in the history
* Connect components to site

* import css

* title size base-icon fix

---------

Co-authored-by: bryantgillespie <[email protected]>
  • Loading branch information
paescuj and bryantgillespie committed Jul 14, 2023
1 parent a7d692c commit dd9e291
Show file tree
Hide file tree
Showing 8 changed files with 245 additions and 79 deletions.
9 changes: 9 additions & 0 deletions components/nuxt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { addPlugin, createResolver, defineNuxtModule } from '@nuxt/kit';

export default defineNuxtModule({
async setup() {
const { resolve } = createResolver(import.meta.url);

addPlugin(resolve('./nuxt.plugin.js'));
},
});
8 changes: 8 additions & 0 deletions components/nuxt.plugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineNuxtPlugin } from '#app';
import * as components from './src/index.ts';

export default defineNuxtPlugin((nuxtApp) => {
for (const [name, component] of Object.entries(components)) {
nuxtApp.vueApp.component(name, component);
}
});
3 changes: 2 additions & 1 deletion components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"exports": {
".": "./dist/index.js",
"./package.json": "./package.json",
"./styles": "./src/theme/main.css"
"./styles": "./src/theme/main.css",
"./nuxt": "./nuxt.js"
},
"main": "dist/index.js",
"files": [
Expand Down
6 changes: 4 additions & 2 deletions components/src/base-icon/base-icon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ export interface BaseIconProps {
/**
* Size of the icon. Controls both font size and optical size
* @values small, medium, large
* @values small, medium, large, title
*/
size?: 'small' | 'medium' | 'large';
size?: 'small' | 'medium' | 'large' | 'title';
/**
* Weight of the icon. Similar to font-weight
Expand All @@ -35,6 +35,8 @@ const opticalSize = computed(() => {
return 24;
case 'large':
return 48;
case 'title':
return 96;
}
});
Expand Down
3 changes: 2 additions & 1 deletion components/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export { default as BaseIcon } from './base-icon/base-icon.vue';
export { default as BaseDivider } from './base-button/base-divider.vue';
export { default as BaseDivider } from './base-divider/base-divider.vue';
export { default as BaseHeading } from './base-heading/base-heading.vue';
3 changes: 0 additions & 3 deletions components/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"extends": "@directus/tsconfig/node18-esm.json",
"compilerOptions": {
"outDir": "dist"
},
"include": ["src"]
}
Loading

0 comments on commit dd9e291

Please sign in to comment.