Skip to content

Commit ec88d6f

Browse files
feat(components): [Tooltip] implements
1 parent 32783bf commit ec88d6f

File tree

148 files changed

+3429
-897
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+3429
-897
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Enter the component you want most in the components, leave the emojis and follow
6565
| [ToggleGroup](https://vue-primitives.netlify.app/?path=/story/components-togglegroup--single) ||
6666
| [Toggle](https://vue-primitives.netlify.app/?path=/story/components-toggle--styled) ||
6767
| [Toolbar](https://vue-primitives.netlify.app/?path=/story/components-toolbar--styled) ||
68-
| Tooltip | 🚧 |
68+
| [Tooltip](https://vue-primitives.netlify.app/?path=/story/components-tooltip--styled) | |
6969

7070
## Utilites
7171

@@ -76,7 +76,7 @@ Enter the component you want most in the components, leave the emojis and follow
7676
| [FocusScope](https://vue-primitives.netlify.app/?path=/story/utilities-focusscope--basic) ||
7777
| Menu | 🚧 |
7878
| [Popper](https://vue-primitives.netlify.app/?path=/story/utilities-popper--styled) ||
79-
| Portal ||
79+
| [Portal](https://vue-primitives.netlify.app/?path=/story/utilities-portal--base) ||
8080
| [Presence](https://vue-primitives.netlify.app/?path=/story/utilities-presence--basic) ||
8181
| Primitives ||
8282
| [RovingFocusGroup](https://vue-primitives.netlify.app/?path=/story/utilities-rovingfocusgroup--basic) ||

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
"root-lint:fix": "eslint . --fix"
1616
},
1717
"devDependencies": {
18-
"@antfu/eslint-config": "^3.0.0",
18+
"@antfu/eslint-config": "^3.1.0",
1919
"@teleskop150750/typescript-config": "workspace:*",
20-
"@types/node": "^20.16.3",
20+
"@types/node": "^20.16.4",
2121
"eslint": "npm:[email protected]",
2222
"eslint-ts-patch": "9.4.0-0",
2323
"prettier": "^3.3.3",

packages/vue-primitives/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190
"@storybook/vue3-vite": "^8.2.9",
191191
"@tsconfig/node20": "^20.1.4",
192192
"@types/jsdom": "^21.1.7",
193-
"@types/node": "^20.16.3",
193+
"@types/node": "^20.16.4",
194194
"@vitejs/plugin-vue": "^5.1.3",
195195
"@vitejs/plugin-vue-jsx": "^4.0.1",
196196
"@vue/test-utils": "^2.4.6",
@@ -199,11 +199,11 @@
199199
"npm-run-all2": "^6.2.2",
200200
"storybook": "^8.2.9",
201201
"unbuild": "^2.0.0",
202-
"vite": "^5.4.2",
202+
"vite": "^5.4.3",
203203
"vite-plugin-dts": "^4.1.0",
204204
"vite-plugin-externalize-deps": "^0.8.0",
205205
"vitest": "^2.0.5",
206-
"vue": "^3.4.38",
206+
"vue": "^3.5.0",
207207
"vue-tsc": "2.0.28"
208208
}
209209
}

packages/vue-primitives/src/accordion/AccordionContent.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const itemContext = useAccordionItemContext('AccordionContent')
1414
<template>
1515
<CollapsibleContent
1616
role="region"
17-
:aria-labelledby="itemContext.triggerId()"
17+
:aria-labelledby="itemContext.triggerId"
1818
:data-orientation="accordionContext.orientation"
1919
style="--radix-accordion-content-height: var(--radix-collapsible-content-height); --radix-accordion-content-width: var(--radix-collapsible-content-width);"
2020
>

packages/vue-primitives/src/accordion/AccordionItem.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export interface AccordionItemProps {
1717
export interface AccordionItemContext {
1818
open: Ref<boolean>
1919
disabled: Ref<boolean>
20-
triggerId: () => string
20+
triggerId: string
2121
}
2222

2323
export const [provideAccordionItemContext, useAccordionItemContext] = createContext<AccordionItemContext>('AccordionItem')

packages/vue-primitives/src/accordion/AccordionItem.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script setup lang="ts">
22
import { computed } from 'vue'
33
import { CollapsibleRoot } from '../collapsible/index.ts'
4+
import { useId } from '../hooks/index.ts'
45
import { type AccordionItemProps, provideAccordionItemContext } from './AccordionItem.ts'
56
import { useAccordionContext } from './AccordionRoot.ts'
67
import { getState } from './utils.ts'
@@ -25,9 +26,7 @@ function onUpdateOpen(open: boolean) {
2526
provideAccordionItemContext({
2627
open,
2728
disabled,
28-
triggerId() {
29-
return `${context.id}-${props.value}`
30-
},
29+
triggerId: useId(),
3130
})
3231
</script>
3332

packages/vue-primitives/src/accordion/AccordionTrigger.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const itemContext = useAccordionItemContext('AccordionHeader')
2121

2222
<template>
2323
<CollapsibleTrigger
24-
:id="itemContext.triggerId()"
24+
:id="itemContext.triggerId"
2525
:ref="forwardElement"
2626
:aria-disabled="(itemContext.open.value && !accordionContext.collapsible) || undefined"
2727
:data-orientation="accordionContext.orientation"

packages/vue-primitives/src/accordion/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ export { default as AccordionHeader } from './AccordionHeader.vue'
44
export { default as AccordionTrigger } from './AccordionTrigger.vue'
55
export { default as AccordionContent } from './AccordionContent.vue'
66

7-
export type{ AccordionRootProps } from './AccordionRoot.ts'
8-
export type{ AccordionItemProps } from './AccordionItem.ts'
9-
export type{ AccordionHeaderProps } from './AccordionHeader.ts'
7+
export { type AccordionRootProps, type AccordionRootEmits, type AccordionContext, provideAccordionContext, useAccordionContext } from './AccordionRoot.ts'
8+
export { type AccordionItemProps, type AccordionItemContext, provideAccordionItemContext, useAccordionItemContext } from './AccordionItem.ts'
9+
export { type AccordionHeaderProps } from './AccordionHeader.ts'

packages/vue-primitives/src/accordion/stories/Animated.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import './styles.css'
3-
import { shallowRef, watch } from 'vue'
3+
import { onWatcherCleanup, shallowRef, watch } from 'vue'
44
import { AccordionContent, AccordionHeader, AccordionItem, AccordionRoot, AccordionTrigger } from '../index.ts'
55
66
const values = ['One', 'Two', 'Three', 'Four']
@@ -14,15 +14,15 @@ function setHasDynamicContent(newValue: boolean) {
1414
}
1515
let timerRef = 0
1616
17-
watch([hasDynamicContent, count], (_, __, onCleanup) => {
17+
watch([hasDynamicContent, count], () => {
1818
if (hasDynamicContent.value) {
1919
timerRef = window.setTimeout(() => {
2020
const nextCount = count.value < 5 ? count.value + 1 : count.value
2121
if (nextCount === 5)
2222
setHasDynamicContent(false)
2323
count.value = nextCount
2424
}, 3000)
25-
onCleanup(() => {
25+
onWatcherCleanup(() => {
2626
clearTimeout(timerRef)
2727
})
2828
}

packages/vue-primitives/src/alert-dialog/AlertDialogContent.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ export type AlertDialogContentElement = HTMLDivElement
1414

1515
export type AlertDialogCancelElement = HTMLButtonElement
1616

17-
export interface AlertDialogContentContextValue {
17+
export interface AlertDialogContentContext {
1818
cancelRef: MutableRefObject<AlertDialogCancelElement | undefined>
1919
}
2020

21-
export const [provideAlertDialogContentContext, useAlertDialogContentContext] = createContext<AlertDialogContentContextValue>('AlertDialogContent')
21+
export const [provideAlertDialogContentContext, useAlertDialogContentContext] = createContext<AlertDialogContentContext>('AlertDialogContent')

0 commit comments

Comments
 (0)