Skip to content

Commit

Permalink
Merge pull request #1009 from privy-open-source/fix/nuxt-link-not-res…
Browse files Browse the repository at this point in the history
…olved

fix: nuxt-link not resolved
  • Loading branch information
adenvt authored Nov 7, 2023
2 parents a24bb91 + 9d68621 commit 4458c6b
Show file tree
Hide file tree
Showing 17 changed files with 35 additions and 26 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@privyid/design-system",
"version": "0.25.1",
"version": "0.25.2",
"packageManager": "[email protected]",
"private": true,
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/browserslist-config/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@privyid/browserslist-config",
"description": "Browserslist shareable config for Persona project",
"version": "0.25.1",
"version": "0.25.2",
"packageManager": "[email protected]",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-persona/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@privyid/eslint-config-persona",
"description": "Eslint shareable config for Persona project",
"version": "0.25.1",
"version": "0.25.2",
"packageManager": "[email protected]",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/persona-icon/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@privyid/persona-icon",
"description": "Persona icon package",
"version": "0.25.1",
"version": "0.25.2",
"packageManager": "[email protected]",
"type": "module",
"main": "./dist/module.cjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/persona/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@privyid/persona",
"description": "Persona core package",
"version": "0.25.1",
"version": "0.25.2",
"license": "MIT",
"repository": {
"url": "https://github.com/privy-open-source/design-system.git",
Expand Down
2 changes: 1 addition & 1 deletion packages/persona/src/runtime/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { defineNuxtPlugin, useRouter } from '#imports'
import type { State } from '@privyid/persona/core'
import {
initStore,
installRouter,
State,
} from '@privyid/persona/core'

export default defineNuxtPlugin((nuxtApp) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/tailwind-animation/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@privyid/tailwind-animation",
"description": "Collection animation class for vue `<transition>`",
"version": "0.25.1",
"version": "0.25.2",
"packageManager": "[email protected]",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/tailwind-extended/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@privyid/tailwind-extended",
"description": "Add missing tailwind utilities",
"version": "0.25.1",
"version": "0.25.2",
"packageManager": "[email protected]",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/tailwind-preset/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@privyid/tailwind-preset",
"description": "Tailwind preset for Persona project",
"version": "0.25.1",
"version": "0.25.2",
"packageManager": "[email protected]",
"license": "MIT",
"repository": {
Expand Down
6 changes: 4 additions & 2 deletions src/components/breadcrumbs/Breadcrumb.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ import DropdownItem from '../dropdown/DropdownItem.vue'
export default defineComponent({
components: {
BreadcrumbItem, BreadcrumbItemDropdown, DropdownItem,
BreadcrumbItem,
BreadcrumbItemDropdown,
DropdownItem,
},
props: {
items: {
type : Array<BreadcrumbItems>,
default: () => {},
default: () => ([]),
},
},
setup (_, { slots }) {
Expand Down
13 changes: 5 additions & 8 deletions src/components/breadcrumbs/BreadcrumbItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ import {
computed,
inject,
h,
resolveComponent,
} from 'vue-demi'
import IconChevron from '@privyid/persona-icon/vue/chevron-right/20.vue'
import type { TagVariant } from '.'
import type { RouteLocationRaw } from 'vue-router'
export default defineComponent({
props: {
href: {
type : [String, Object] as PropType<RouteLocationRaw>,
default: '#',
default: '#' as RouteLocationRaw,
},
active: {
type : Boolean,
Expand All @@ -53,12 +53,9 @@ export default defineComponent({
})
const tagName = computed(() => {
let tag: TagVariant = 'nuxt-link'
if (props.active)
tag = 'span'
return tag
return props.active
? 'span'
: resolveComponent('nuxt-link')
})
const permalink = computed(() => {
Expand Down
6 changes: 3 additions & 3 deletions src/components/breadcrumbs/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import type { RouteLocationRaw } from 'vue-router'

interface Breadcrumb {
text: string,
href?: string,
href?: RouteLocationRaw,
active?: boolean,
}

export interface BreadcrumbItems extends Breadcrumb {
subitem?: Breadcrumb[],
}

export type TagVariant = 'a' | 'span' | 'nuxt-link'

export function defineNavigation (navigation: BreadcrumbItems[]): BreadcrumbItems[] {
return navigation
}
3 changes: 2 additions & 1 deletion src/components/button/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import type {
import {
computed,
inject,
resolveComponent,
} from 'vue-demi'
import type { RouteLocationRaw } from 'vue-router'
import type {
Expand Down Expand Up @@ -110,7 +111,7 @@ const classNames = computed(() => {
const tagName = computed(() => {
return props.href
? 'nuxt-link'
? resolveComponent('nuxt-link')
: 'button'
})
Expand Down
4 changes: 3 additions & 1 deletion src/components/dropdown/DropdownItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
</template>

<script lang="ts">
import type { PropType } from 'vue-demi'
import {
defineComponent,
inject,
computed,
} from 'vue-demi'
import { DROPDOWN_CONTEXT } from '.'
import type { TagVariant } from '../button'
import type { RouteLocationRaw } from 'vue-router'
export default defineComponent({
props: {
Expand All @@ -29,7 +31,7 @@ export default defineComponent({
default: '',
},
href: {
type : String,
type : [String, Object] as PropType<RouteLocationRaw>,
default: undefined,
},
active: {
Expand Down
5 changes: 4 additions & 1 deletion src/components/text/Text.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import type { PropType } from 'vue-demi'
import {
defineComponent,
computed,
resolveComponent,
} from 'vue-demi'
import type { StyleVariant, ElementVariant } from '.'
import type { WeightVariant, TransformVariant } from '../heading'
Expand Down Expand Up @@ -45,7 +46,9 @@ export default defineComponent({
setup (props) {
const elementNames = computed(() => {
return props.href ? 'nuxt-link' : props.element
return props.href
? resolveComponent('nuxt-link')
: props.element
})
const classNames = computed(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/truncate/Truncate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<template v-if="expandable && text.length > maxLength">
<a
data-testid="truncate-expand"
href="#"
href="javascript:void"
@click.stop.prevent="toggle">
{{ expand ? showLessText : showMoreText }}
</a>
Expand Down
4 changes: 4 additions & 0 deletions src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,7 @@ export {
export {
useSelector,
} from '../components/pdf-object/utils/use-selector'

export {
getDocument,
} from '../components/pdf-viewer/utils/pdfjs'

1 comment on commit 4458c6b

@vercel
Copy link

@vercel vercel bot commented on 4458c6b Nov 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

design-system – ./

design-system-privyid.vercel.app
design-system-git-main-privyid.vercel.app
privy-design-system.vercel.app

Please sign in to comment.