-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1050 from privy-open-source/release/0.26.0
release: `0.26.0`
- Loading branch information
Showing
37 changed files
with
1,513 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
20 | ||
18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@privyid/design-system", | ||
"version": "0.25.2", | ||
"version": "0.26.0", | ||
"packageManager": "[email protected]", | ||
"private": true, | ||
"type": "module", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.2", | ||
"version": "0.26.0", | ||
"packageManager": "[email protected]", | ||
"license": "MIT", | ||
"repository": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.2", | ||
"version": "0.26.0", | ||
"packageManager": "[email protected]", | ||
"license": "MIT", | ||
"repository": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.2", | ||
"version": "0.26.0", | ||
"packageManager": "[email protected]", | ||
"type": "module", | ||
"main": "./dist/module.cjs", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.2", | ||
"version": "0.26.0", | ||
"packageManager": "[email protected]", | ||
"license": "MIT", | ||
"repository": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.2", | ||
"version": "0.26.0", | ||
"packageManager": "[email protected]", | ||
"license": "MIT", | ||
"repository": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.2", | ||
"version": "0.26.0", | ||
"packageManager": "[email protected]", | ||
"license": "MIT", | ||
"repository": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { fireEvent, render } from '@testing-library/vue' | ||
import pPopover from './Popover.vue' | ||
|
||
it('should able to show tooltip over activator element', async () => { | ||
const screen = render({ | ||
components: { pPopover }, | ||
template : ` | ||
<p-popover> | ||
<template #activator="{ toggle }"> | ||
<a href="javascript:void" data-testid="activator" @click="toggle"> | ||
Remove? | ||
</a> | ||
</template> | ||
<template #default> | ||
<div class="flex items-center space-x-2"> | ||
<span>Are you sure?</span> | ||
<p-button data-testid="confirm" @click="popoverPromise.finish(true)"> | ||
Yes | ||
</p-button> | ||
<p-button data-testid="cancel" @click="popoverPromise.finish(false)"> | ||
Cancel | ||
</p-button> | ||
</div> | ||
</template> | ||
</p-popover> | ||
`, | ||
setup () { | ||
return {} | ||
}, | ||
}) | ||
|
||
const popover = screen.queryByTestId('popover') | ||
const tooltip = screen.queryByTestId('popover-tooltip') | ||
const activator = screen.queryByTestId('activator') | ||
|
||
expect(popover).toBeInTheDocument() | ||
expect(tooltip).not.toBeVisible() | ||
|
||
await fireEvent.click(activator) | ||
|
||
expect(tooltip).toBeVisible() | ||
|
||
await fireEvent.click(activator) | ||
|
||
expect(tooltip).not.toBeVisible() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
<template> | ||
<div | ||
ref="root" | ||
data-testid="popover" | ||
class="popover"> | ||
<slot | ||
name="activator" | ||
:is-show="isShow" | ||
:toggle="toggle" | ||
:show="show" | ||
:hide="hide" /> | ||
|
||
<p-tooltip | ||
ref="tooltip" | ||
v-model="isShow" | ||
class="popover__tooltip" | ||
data-testid="popover-tooltip" | ||
:color="color" | ||
:placement="placement" | ||
:target="root" | ||
@show="$emit('show')" | ||
@hide="$emit('hide')"> | ||
<slot | ||
:is-show="isShow" | ||
:toggle="toggle" | ||
:show="show" | ||
:hide="hide" /> | ||
</p-tooltip> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import type { PropType, VNode } from 'vue-demi' | ||
import type { Placement } from '@floating-ui/dom' | ||
import type { ColorVariant } from '../tooltip' | ||
import { | ||
ref, | ||
provide, | ||
computed, | ||
} from 'vue-demi' | ||
import pTooltip from '../tooltip/Tooltip.vue' | ||
import { useVModel } from '../input' | ||
import { onClickOutside } from '@vueuse/core' | ||
import { POPOVER_CONTEXT } from '.' | ||
const props = defineProps({ | ||
modelValue: { | ||
type : Boolean, | ||
default: false, | ||
}, | ||
color: { | ||
type : String as PropType<ColorVariant>, | ||
default: 'white', | ||
}, | ||
placement: { | ||
type : String as PropType<Placement>, | ||
default: 'top', | ||
}, | ||
disabled: { | ||
type : Boolean, | ||
default: false, | ||
}, | ||
}) | ||
const root = ref<HTMLDivElement>() | ||
const tooltip = ref<InstanceType<typeof pTooltip>>() | ||
const isShow = useVModel(props) | ||
const tooltipEl = computed<HTMLElement>(() => tooltip.value.$el) | ||
onClickOutside(tooltipEl, () => { | ||
if (isShow.value) { | ||
// Add little delay too prevent race condition with v-model changing | ||
setTimeout(() => { | ||
hide() | ||
}) | ||
} | ||
}, { ignore: [root] }) | ||
function toggle () { | ||
if (!props.disabled) { | ||
if (isShow.value) | ||
hide() | ||
else | ||
show() | ||
} | ||
} | ||
function show () { | ||
if (!props.disabled) | ||
isShow.value = true | ||
} | ||
function hide () { | ||
if (!props.disabled) | ||
isShow.value = false | ||
} | ||
defineEmits<{ | ||
'show': [], | ||
'hide': [], | ||
'update:modelValue': [boolean], | ||
}>() | ||
defineSlots<{ | ||
'activator'(props: { isShow: boolean, show: () => void, hide: () => void, toggle: () => void }): VNode[], | ||
'default'(props: { isShow: boolean, show: () => void, hide: () => void, toggle: () => void }): VNode[], | ||
}>() | ||
defineExpose({ | ||
isShow, | ||
show, | ||
hide, | ||
toggle, | ||
}) | ||
provide(POPOVER_CONTEXT, { | ||
isShow, | ||
show, | ||
hide, | ||
toggle, | ||
}) | ||
</script> | ||
|
||
<style lang="postcss"> | ||
.popover { | ||
& > &__tooltip.tooltip { | ||
@apply text-base; | ||
} | ||
} | ||
</style> |
Oops, something went wrong.
62fb9e1
There was a problem hiding this comment.
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
privy-design-system.vercel.app
design-system-git-main-privyid.vercel.app