Skip to content

Commit

Permalink
feat: export new components
Browse files Browse the repository at this point in the history
  • Loading branch information
gabaldon committed Aug 29, 2024
1 parent 624fab8 commit 4972e39
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/components/EmptyState/WEmptyState.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type Story = StoryObj<typeof meta>
* to learn how to use render functions.
*/

export const Section: Story = {
export const Default: Story = {
render: (args: any) => ({
components: { WEmptyState },
setup() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/EmptyState/WEmptyState.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</div>
</template>

<script setup>
<script setup lang="ts">
import EmptyStateLogo from '@/assets/svg/empty-state.svg?component'
defineProps({
text: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const meta: any = {
export default meta
type Story = StoryObj<typeof meta>

export const Section: Story = {
export const Default: Story = {
render: (args: any) => ({
components: { WLoadingPlaceholder },
setup() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Section/WSection.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const meta: any = {
export default meta
type Story = StoryObj<typeof meta>

export const Section: Story = {
export const Default: Story = {
render: (args: any) => ({
components: { WSection },
setup() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Spinner/WSpinner.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const meta: any = {
export default meta
type Story = StoryObj<typeof meta>

export const Section: Story = {
export const Default: Story = {
render: (args: any) => ({
components: { WSpinner },
setup() {
Expand Down
11 changes: 0 additions & 11 deletions src/components/index.ts

This file was deleted.

14 changes: 13 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,36 @@
import './assets/main.css'

import WButton from './components/Button/WButton.vue'
import WEmptyState from './components/EmptyState/WEmptyState.vue'
import WFooter from './components/Footer/WFooter.vue'
import WLink from './components/Link/WLink.vue'
import WLoadingPlaceholder from './components/LoadingPlaceholder/WLoadingPlaceholder.vue'
import WNavbar from './components/Navbar/WNavbar.vue'
import WSection from './components/Section/WSection.vue'
import WSpinner from './components/Spinner/WSpinner.vue'

export { WLink, WButton, WNavbar, WFooter }
export { WButton, WEmptyState, WFooter, WLink, WLoadingPlaceholder, WNavbar, WSection, WSpinner }
export type WButton = typeof WButton
export type WEmptyState = typeof WEmptyState
export type WFooter = typeof WFooter
export type WLink = typeof WLink
export type WLoadingPlaceholder = typeof WLoadingPlaceholder
export type WNavbar = typeof WNavbar
export type WSection = typeof WSection
export type WSpinner = typeof WSpinner

import type { App } from 'vue'

const WComponents = {
install(app: App) {
app.component('WButton', WButton)
app.component('WEmptyState', WEmptyState)
app.component('WFooter', WFooter)
app.component('WLink', WLink)
app.component('WLoadingPlaceholder', WLoadingPlaceholder)
app.component('WNavbar', WNavbar)
app.component('WSection', WSection)
app.component('WSpinner', WSpinner)
}
}

Expand Down
3 changes: 0 additions & 3 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ export default mergeConfig(
defineConfig({
test: {
environment: 'jsdom',
snapshotFormat: {
printBasicPrototype: true
},
exclude: [...configDefaults.exclude, 'e2e/**'],
root: fileURLToPath(new URL('./', import.meta.url))
}
Expand Down

0 comments on commit 4972e39

Please sign in to comment.