diff --git a/src/lib/holocene/accordion.stories.svelte b/src/lib/holocene/accordion.stories.svelte index 0775ba0b4..0ec142fd8 100644 --- a/src/lib/holocene/accordion.stories.svelte +++ b/src/lib/holocene/accordion.stories.svelte @@ -12,12 +12,14 @@ title: 'Accordion Title', subtitle: 'Subtitle', open: false, + expandable: true, error: '', }, argTypes: { title: { name: 'Title', control: 'text' }, subtitle: { name: 'Subtitle', control: 'text' }, open: { name: 'Open', control: 'boolean' }, + expandable: { name: 'Expandable', control: 'boolean' }, error: { name: 'Error', control: 'text' }, icon: { name: 'Icon', @@ -39,7 +41,9 @@ - + + + diff --git a/src/lib/holocene/accordion.svelte b/src/lib/holocene/accordion.svelte index 997c35f29..474330b1e 100644 --- a/src/lib/holocene/accordion.svelte +++ b/src/lib/holocene/accordion.svelte @@ -6,6 +6,7 @@ import { v4 } from 'uuid'; import Badge from '$lib/holocene/badge.svelte'; + import Card from '$lib/holocene/card.svelte'; import Icon from '$lib/holocene/icon/icon.svelte'; import type { IconName } from './icon'; @@ -16,6 +17,7 @@ subtitle?: string; icon?: IconName; open?: boolean; + expandable?: boolean; error?: string; onToggle?: () => void; 'data-testid'?: string; @@ -26,6 +28,7 @@ export let subtitle = ''; export let icon = null; export let open = false; + export let expandable = true; export let error = ''; export let onToggle = noop; @@ -38,50 +41,78 @@ }; -
- + +
+
-

- {#if error} - {error} - {/if} - {subtitle} -

- -
-
-
+{:else} + +
+
+

+ {#if icon}{/if} + {title} + +

+
+ +
+
+

+ {#if error} + {error} + {/if} + {subtitle} +

+
+ +
+ +
+
+{/if}