Skip to content

Commit

Permalink
chore(package.json): updated dependancies
Browse files Browse the repository at this point in the history
fix(Accordion): forwarded events including all child components
  • Loading branch information
Craig Howell authored and Craig Howell committed Oct 13, 2022
1 parent dbb0f8a commit 19f3ced
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 35 deletions.
58 changes: 29 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"devDependencies": {
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"@playwright/test": "^1.27.0",
"@playwright/test": "^1.27.1",
"@sveltejs/adapter-auto": "next",
"@sveltejs/adapter-vercel": "next",
"@sveltejs/kit": "next",
Expand All @@ -50,7 +50,7 @@
"highlight.js": "^11.6.0",
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
"postcss": "^8.4.17",
"postcss": "^8.4.18",
"prettier": "^2.7.1",
"prettier-plugin-svelte": "^2.8.0",
"svelte": "^3.51.0",
Expand All @@ -60,7 +60,7 @@
"tailwindcss": "^3.1.8",
"tslib": "^2.4.0",
"typescript": "^4.8.4",
"vite": "^3.1.7"
"vite": "^3.1.8"
},
"type": "module",
"dependencies": {
Expand Down
13 changes: 12 additions & 1 deletion src/lib/components/accordion/Accordion.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
<script lang="ts">
import { setContext } from 'svelte';
import { twMerge } from 'tailwind-merge';
import { current_component } from 'svelte/internal';
import { forwardEventsBuilder, useActions, type ActionArray } from '../../actions';
import { exclude } from '../../utils/exclude';
export let use: ActionArray = [];
const forwardEvents = forwardEventsBuilder(current_component);
setContext(ACCORDION_CONTEXT_ID, {
accordion: true
Expand All @@ -14,6 +19,12 @@
$: finalClass = twMerge(defaultClass, $$props.class);
</script>

<div class={finalClass} style={$$props.style}>
<div
class={finalClass}
style={$$props.style}
use:useActions={use}
use:forwardEvents
{...exclude($$props, ['use', 'class'])}
>
<slot />
</div>
14 changes: 13 additions & 1 deletion src/lib/components/accordion/Content.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
<script lang="ts">
import { slide } from 'svelte/transition';
import { twMerge } from 'tailwind-merge';
import { current_component } from 'svelte/internal';
import { forwardEventsBuilder, useActions, type ActionArray } from '../../actions';
import { exclude } from '../../utils/exclude';
export let use: ActionArray = [];
const forwardEvents = forwardEventsBuilder(current_component);
const defaultClass =
'border-t border-light-border dark:border-dark-border text-light-secondary-content dark:text-dark-secondary-content';
$: finalClass = twMerge(defaultClass, $$props.class);
</script>

<div transition:slide|local class={finalClass} style={$$props.style}>
<div
transition:slide|local
class={finalClass}
style={$$props.style}
use:useActions={use}
use:forwardEvents
{...exclude($$props, ['use', 'class'])}
>
<slot />
</div>
13 changes: 12 additions & 1 deletion src/lib/components/accordion/Item.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
import { useContext } from '../../utils/useContext';
import { twMerge } from 'tailwind-merge';
import { writable } from 'svelte/store';
import { current_component } from 'svelte/internal';
import { forwardEventsBuilder, useActions, type ActionArray } from '../../actions';
import { exclude } from '../../utils/exclude';
export let use: ActionArray = [];
const forwardEvents = forwardEventsBuilder(current_component);
export let open = false;
let isOpen = writable(open);
Expand All @@ -29,7 +34,13 @@
$: finalClass = twMerge(defaultClass, $$props.class);
</script>

<div class={finalClass} style={$$props.style}>
<div
class={finalClass}
style={$$props.style}
use:useActions={use}
use:forwardEvents
{...exclude($$props, ['use', 'class'])}
>
<slot name="title" />
{#if open}
<slot name="content" />
Expand Down

0 comments on commit 19f3ced

Please sign in to comment.