Skip to content

Commit 9ecd0e9

Browse files
committed
chore(release): v1.0.3
1 parent 6330e57 commit 9ecd0e9

4 files changed

Lines changed: 69 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,26 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## v1.0.3
9+
10+
[compare changes](https://github.com/sfxcode/nuxt-ui-formkit/compare/v1.0.2...v1.0.3)
11+
12+
### 🚀 Enhancements
13+
14+
- Update repeater component with improved default values and internal class handling ([4085e06](https://github.com/sfxcode/nuxt-ui-formkit/commit/4085e06))
15+
- Update repeater sample component with modified default values and improved list structure ([082a8ef](https://github.com/sfxcode/nuxt-ui-formkit/commit/082a8ef))
16+
- Enhance repeater component with new input handling and improved list structure ([ca4a56c](https://github.com/sfxcode/nuxt-ui-formkit/commit/ca4a56c))
17+
- Add initial project setup for documentation with configuration files and example components ([7368a6e](https://github.com/sfxcode/nuxt-ui-formkit/commit/7368a6e))
18+
- Update README with repeater component details and enhance composables section ([6330e57](https://github.com/sfxcode/nuxt-ui-formkit/commit/6330e57))
19+
20+
### 🏡 Chore
21+
22+
- Update dependencies to latest versions in package.json ([e5f41ca](https://github.com/sfxcode/nuxt-ui-formkit/commit/e5f41ca))
23+
24+
### ❤️ Contributors
25+
26+
- Sfxcode ([@sfxcode](https://github.com/sfxcode))
27+
828
## v1.0.2
929

1030
[compare changes](https://github.com/sfxcode/nuxt-ui-formkit/compare/v1.0.1...v1.0.2)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sfxcode/nuxt-ui-formkit",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "FormKit integration for Nuxt UI - Seamlessly connect FormKit form handling with Nuxt UI components",
55
"author": {
66
"name": "Tom",
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import autoAnimate, { type AutoAnimateOptions, type AutoAnimationPlugin } from '@formkit/auto-animate'
2+
import type { Ref } from 'vue'
3+
4+
/**
5+
* Composable to apply autoAnimate to an element
6+
* @param options - AutoAnimate options
7+
* @returns A function that can be used as a template ref
8+
*/
9+
export function useAutoAnimate<T extends HTMLElement>(
10+
options?: Partial<AutoAnimateOptions> | AutoAnimationPlugin,
11+
): [(el: T | null) => void, (enabled: boolean) => void] {
12+
let autoAnimateController: ReturnType<typeof autoAnimate> | undefined
13+
14+
const setEnabled = (enabled: boolean) => {
15+
if (autoAnimateController) {
16+
autoAnimateController.isEnabled = enabled
17+
}
18+
}
19+
20+
const ref = (el: T | null) => {
21+
if (el) {
22+
autoAnimateController = autoAnimate(el, options || {})
23+
}
24+
}
25+
26+
return [ref, setEnabled]
27+
}
28+
29+
/**
30+
* Apply autoAnimate directly to a ref element
31+
* @param target - The ref to apply autoAnimate to
32+
* @param options - AutoAnimate options
33+
*/
34+
export function applyAutoAnimate<T extends HTMLElement>(
35+
target: Ref<T | null | undefined>,
36+
options?: Partial<AutoAnimateOptions> | AutoAnimationPlugin,
37+
): void {
38+
watch(
39+
target,
40+
(el) => {
41+
if (el) {
42+
autoAnimate(el, options || {})
43+
}
44+
},
45+
{ immediate: true },
46+
)
47+
}
48+

src/runtime/plugin.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { defineNuxtPlugin } from '#app'
22

33
export default defineNuxtPlugin((_nuxtApp) => {
4-
54
})

0 commit comments

Comments
 (0)