Skip to content

Commit 87d997e

Browse files
authored
Merge pull request #135 from unoforge/next
Next
2 parents 4e5da8b + 9b63d81 commit 87d997e

File tree

22 files changed

+861
-484
lines changed

22 files changed

+861
-484
lines changed

examples/vue-example/package-lock.json

Lines changed: 715 additions & 279 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/vue-example/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
1313
},
1414
"dependencies": {
15-
"@flexilla/flexilla": "^2.0.3",
15+
"@flexilla/flexilla": "^2.1.6",
1616
"@tailwindcss/vite": "^4.0.0-alpha.9",
1717
"tailwindcss": "^4.0.0-alpha.9",
1818
"vue": "^3.4.21"
@@ -28,7 +28,7 @@
2828
"eslint-plugin-vue": "^9.17.0",
2929
"npm-run-all2": "^6.1.2",
3030
"typescript": "~5.4.0",
31-
"vite": "^5.1.5",
31+
"vite": "^6.2.2",
3232
"vue-tsc": "^2.0.6"
3333
}
3434
}

examples/vue-example/src/components/AccordionComponent.vue

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
<script setup lang="ts">
2-
import { onMounted } from 'vue'
2+
import { onMounted, onUnmounted, ref } from 'vue'
33
import { Accordion } from "@flexilla/flexilla"
4+
const accordion = ref<Accordion|null>(null)
45
onMounted(() => {
5-
new Accordion("[data-fx-accordion]")
6+
accordion.value = new Accordion("[data-fx-accordion]")
7+
})
8+
onUnmounted(() => {
9+
if(accordion.value) accordion.value.cleanup()
610
})
711
</script>
812
<template>
@@ -14,7 +18,7 @@ onMounted(() => {
1418
<div data-fx-accordion data-default-value="accordion-1" data-type="single" class="space-y-2">
1519
<div data-accordion-item data-accordion-value="accordion-1"
1620
class="rounded-md bg-gray-100/5 dark:bg-gray-900/5 border border-gray-200/30 dark:border-gray-800/20 data-[state=open]:bg-gray-100/80 dark:data-[state=open]:bg-gray-900/60 data-[state=open]:border-gray-200/50 dark:data-[state=open]:border-gray-800/40">
17-
<button data-accordion-trigger aria-label="toggle button"
21+
<button data-accordion-trigger aria-expanded="true" aria-label="toggle button"
1822
class="cursor-pointer px-4 w-full flex justify-between items-center py-2 text-gray-800 dark:text-gray-200 font-medium text-lg ease-linear hover:bg-gray-200/50 dark:hover:bg-gray-800/40 rounded-md [&[aria-expanded=true]>svg]:rotate-180">
1923
Is it accessible?
2024
<svg viewBox="0 0 20 20" fill="currentColor" class="size-5 ease-linear duration-300">
@@ -23,8 +27,8 @@ onMounted(() => {
2327
clip-rule="evenodd"></path>
2428
</svg>
2529
</button>
26-
<div aria-hidden="true" data-accordion-content
27-
class="text-gray-700 dark:text-gray-300 duration-200 ease-linear overflow-hidden">
30+
<div aria-hidden="false" data-state="open" data-accordion-content
31+
class="text-gray-700 dark:text-gray-300 duration-200 ease-linear overflow-hidden h-0 data-[state=open]:h-auto">
2832
<p class="p-4">Yes. It adheres to the WAI-ARIA design pattern.</p>
2933
</div>
3034
</div>
@@ -40,7 +44,7 @@ onMounted(() => {
4044
</svg>
4145
</button>
4246
<div aria-hidden="true" data-accordion-content
43-
class="text-gray-700 dark:text-gray-300 duration-200 ease-linear overflow-hidden">
47+
class="text-gray-700 dark:text-gray-300 duration-200 ease-linear overflow-hidden h-0 data-[state=open]:h-auto">
4448
<p class="p-4">
4549
Yes. It's unstyled by default, giving you freedom over the look and
4650
feel.
@@ -59,7 +63,7 @@ onMounted(() => {
5963
</svg>
6064
</button>
6165
<div aria-hidden="true" data-accordion-content
62-
class="text-gray-700 dark:text-gray-300 duration-200 ease-linear overflow-hidden">
66+
class="text-gray-700 dark:text-gray-300 duration-200 ease-linear overflow-hidden h-0 data-[state=open]:h-auto">
6367
<p class="p-4">
6468
Yes! You can use the transition prop to configure the animation.
6569
</p>

examples/with-tailwind/ui/accordion/index.html

Lines changed: 4 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ <h1 class="text-xl font-semibold text-zinc-900 dark:text-white">
2222
class="px-4 w-full flex justify-between items-center py-2 text-zinc-800 dark:text-zinc-200 font-medium text-lg ease-linear hover:bg-zinc-200/50 dark:hover:bg-zinc-800/40 rounded-md focus:outline-blue-600 aria-expanded:text-blue-600">
2323
Is it accessible?
2424
</button>
25-
<div aria-hidden="true" data-accordion-content
25+
<div aria-hidden="false" data-state="open" data-accordion-content
2626
class="text-zinc-700 dark:text-zinc-300 duration-200 ease-linear h-0 fx-open:h-auto overflow-hidden">
2727
<p class="p-4">
2828
Yes. It adheres to the WAI-ARIA design pattern.
@@ -156,7 +156,7 @@ <h1 class="text-xl font-semibold text-zinc-900 dark:text-white">
156156
clip-rule="evenodd"></path>
157157
</svg>
158158
</button>
159-
<div aria-hidden="true" data-accordion-content
159+
<div aria-hidden="false" data-state="open" data-accordion-content
160160
class="text-zinc-700 dark:text-zinc-300 duration-200 ease-linear h-0 fx-open:h-auto overflow-hidden">
161161
<p class="p-4">
162162
Yes. It adheres to the WAI-ARIA design pattern.
@@ -278,7 +278,7 @@ <h1 class="text-xl font-semibold text-zinc-900 dark:text-white">
278278
<div data-accordion-4 class="space-y-2">
279279
<div data-accordion-item data-accordion-value="accordion-1"
280280
class="rounded-md bg-zinc-100/5 dark:bg-zinc-900/5 border border-zinc-200/30 dark:border-zinc-800/20 fx-open:bg-zinc-100/80 dark:fx-open:bg-zinc-900/60 fx-open:border-zinc-200/50 dark:fx-open:border-zinc-800/40">
281-
<button data-accordion-trigger aria-label="toggle button"
281+
<button data-accordion-trigger aria-expanded="true" aria-label="toggle button"
282282
class="px-4 w-full flex justify-between items-center py-2 text-zinc-800 dark:text-zinc-200 font-medium text-lg ease-linear hover:bg-zinc-200/50 dark:hover:bg-zinc-800/40 rounded-md focus:outline-blue-600 group">
283283
Is it accessible?
284284
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"
@@ -288,69 +288,7 @@ <h1 class="text-xl font-semibold text-zinc-900 dark:text-white">
288288
clip-rule="evenodd"></path>
289289
</svg>
290290
</button>
291-
<div aria-hidden="true" data-accordion-content
292-
class="text-zinc-700 dark:text-zinc-300 duration-200 ease-linear h-0 fx-open:h-auto overflow-hidden">
293-
<p class="p-4">
294-
Yes. It adheres to the WAI-ARIA design pattern.
295-
</p>
296-
</div>
297-
</div>
298-
<div data-accordion-item data-accordion-value="accordion-2"
299-
class="rounded-md bg-zinc-100/5 dark:bg-zinc-900/5 border border-zinc-200/30 dark:border-zinc-800/20 fx-open:bg-zinc-100/80 dark:fx-open:bg-zinc-900/60 fx-open:border-zinc-200/50 dark:fx-open:border-zinc-800/40">
300-
<button data-accordion-trigger aria-label="toggle button"
301-
class="px-4 w-full flex justify-between items-center py-2 text-zinc-800 dark:text-zinc-200 font-medium text-lg ease-linear hover:bg-zinc-200/50 dark:hover:bg-zinc-800/40 rounded-md focus:outline-blue-600 group">
302-
Is it unstyled?
303-
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"
304-
class="size-5 ease-linear duration-300 group:aria-expanded:rotate-180">
305-
<path fill-rule="evenodd"
306-
d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z"
307-
clip-rule="evenodd"></path>
308-
</svg>
309-
</button>
310-
<div aria-hidden="true" data-accordion-content
311-
class="text-zinc-700 dark:text-zinc-300 duration-200 ease-linear h-0 fx-open:h-auto overflow-hidden">
312-
<p class="p-4">
313-
Yes. It's unstyled by default, giving you freedom over the look and feel.
314-
</p>
315-
</div>
316-
</div>
317-
<div data-accordion-item data-accordion-value="accordion-3"
318-
class="rounded-md bg-zinc-100/5 dark:bg-zinc-900/5 border border-zinc-200/30 dark:border-zinc-800/20 fx-open:bg-zinc-100/80 dark:fx-open:bg-zinc-900/60 fx-open:border-zinc-200/50 dark:fx-open:border-zinc-800/40">
319-
<button data-accordion-trigger aria-label="toggle button"
320-
class="px-4 w-full flex justify-between items-center py-2 text-zinc-800 dark:text-zinc-200 font-medium text-lg ease-linear hover:bg-zinc-200/50 dark:hover:bg-zinc-800/40 rounded-md focus:outline-blue-600 group">
321-
Can it be animated?
322-
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"
323-
class="size-5 ease-linear duration-300 group:aria-expanded:rotate-180">
324-
<path fill-rule="evenodd"
325-
d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z"
326-
clip-rule="evenodd"></path>
327-
</svg>
328-
</button>
329-
<div aria-hidden="true" data-accordion-content
330-
class="text-zinc-700 dark:text-zinc-300 duration-200 ease-linear h-0 fx-open:h-auto overflow-hidden">
331-
<p class="p-4">
332-
Yes! You can use the transition prop to configure the animation.
333-
</p>
334-
</div>
335-
</div>
336-
</div>
337-
</div>
338-
</div>
339-
<div class="space-y-6">
340-
<h1 class="text-xl font-semibold text-zinc-900 dark:text-white">
341-
Allow trigger On item Focus
342-
</h1>
343-
<div class="p-6 rounded-lg border border-zinc-200 dark:border-zinc-900">
344-
<div data-accordion-5 class="space-y-2">
345-
<div data-accordion-item data-accordion-value="accordion-1"
346-
class="rounded-md bg-zinc-100/5 dark:bg-zinc-900/5 border border-zinc-200/30 dark:border-zinc-800/20 fx-open:bg-zinc-100/80 dark:fx-open:bg-zinc-900/60 fx-open:border-zinc-200/50 dark:fx-open:border-zinc-800/40">
347-
<button data-accordion-trigger aria-label="toggle button"
348-
class="px-4 w-full flex justify-between items-center py-2 text-zinc-800 dark:text-zinc-200 font-medium text-lg ease-linear hover:bg-zinc-200/50 dark:hover:bg-zinc-800/40 rounded-md focus:outline-blue-600 group">
349-
Is it accessible?
350-
<span
351-
class="ease-linear duration-300 i-carbon-chevron-down group-aria-expanded:rotate-180 text-md"></span>
352-
</button>
353-
<div aria-hidden="true" data-accordion-content
291+
<div aria-hidden="false" data-state="open" data-accordion-content
354292
class="text-zinc-700 dark:text-zinc-300 duration-200 ease-linear h-0 fx-open:h-auto overflow-hidden">
355293
<p class="p-4">
356294
Yes. It adheres to the WAI-ARIA design pattern.
@@ -401,5 +339,4 @@ <h1 class="text-xl font-semibold text-zinc-900 dark:text-white">
401339
</section>
402340
<script type="module" src="./main.ts"></script>
403341
</body>
404-
405342
</html>

examples/with-tailwind/ui/accordion/main.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,3 @@ new Accordion(
2828
}
2929
)
3030

31-
32-
new Accordion(
33-
document.querySelector('[data-accordion-5]') as HTMLElement,
34-
{
35-
defaultValue: "accordion-1",
36-
}
37-
)

package-lock.json

Lines changed: 24 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/accordion/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "@flexilla/accordion",
33
"private": false,
4-
"version": "2.1.1",
4+
"version": "2.1.3",
55
"type": "module",
66
"description": "A versatile and interactive accordion component for creating collapsible sections in web applications, conserving space and improving user experience",
77
"publishConfig": {
88
"access": "public"
99
},
10-
"main": "./dist/accordion.umd.js",
10+
"main": "./dist/accordion.umd.cjs",
1111
"module": "./dist/accordion.js",
1212
"types": "./dist/index.d.ts",
1313
"exports": {
@@ -18,7 +18,7 @@
1818
},
1919
"require": {
2020
"types": "./dist/index.d.ts",
21-
"default": "./dist/accordion.umd.js"
21+
"default": "./dist/accordion.umd.cjs"
2222
}
2323
}
2424
},
@@ -37,7 +37,7 @@
3737
},
3838
"dependencies": {
3939
"@flexilla/manager": "latest",
40-
"@flexilla/utilities": "^2.1.0"
40+
"@flexilla/utilities": "^2.1.1"
4141
},
4242
"devDependencies": {
4343
"typescript": "^5.2.2",

packages/auto-resize-area/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "@flexilla/auto-resize-area",
33
"private": false,
4-
"version": "2.0.9",
4+
"version": "2.0.10",
55
"type": "module",
66
"description": "A lightweight JavaScript component that automatically resizes text areas based on content",
77
"publishConfig": {
88
"access": "public"
99
},
10-
"main": "./dist/auto-resize-area.umd.js",
10+
"main": "./dist/auto-resize-area.umd.cjs",
1111
"module": "./dist/auto-resize-area.js",
1212
"types": "./dist/index.d.ts",
1313
"exports": {
@@ -18,7 +18,7 @@
1818
},
1919
"require": {
2020
"types": "./dist/index.d.ts",
21-
"default": "./dist/auto-resize-area.umd.js"
21+
"default": "./dist/auto-resize-area.umd.cjs"
2222
}
2323
}
2424
},

0 commit comments

Comments
 (0)