@makolabs/ripple 0.0.1-dev.47 → 0.0.1-dev.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,12 +18,7 @@
18
18
  icon: Icon
19
19
  }: AccordionProps = $props();
20
20
 
21
- const {
22
- base,
23
- header,
24
- title: titleClass,
25
- body
26
- } = accordion({ color, open, bordered });
21
+ const { base, header, title: titleClass, body } = accordion({ color, open, bordered });
27
22
 
28
23
  function handleClick() {
29
24
  open = !open;
@@ -58,23 +53,25 @@
58
53
  </div>
59
54
  </div>
60
55
  {@render summary?.()}
61
- <div class="flex items-center">
62
- <svg
63
- xmlns="http://www.w3.org/2000/svg"
64
- width="20"
65
- height="20"
66
- viewBox="0 0 20 20"
67
- class="text-default-500 size-5 transition-transform duration-200"
68
- class:rotate-180={open}
69
- >
70
- <path
71
- fill="currentColor"
72
- d="M15.794 7.733a.75.75 0 0 1-.026 1.06l-5.25 5.001a.75.75 0 0 1-1.035 0l-5.25-5a.75.75 0 0 1 1.034-1.087l4.734 4.509l4.733-4.51a.75.75 0 0 1 1.06.027"
73
- />
74
- </svg>
75
- </div>
56
+ {#if children}
57
+ <div class="flex items-center">
58
+ <svg
59
+ xmlns="http://www.w3.org/2000/svg"
60
+ width="20"
61
+ height="20"
62
+ viewBox="0 0 20 20"
63
+ class="text-default-500 size-5 transition-transform duration-200"
64
+ class:rotate-180={open}
65
+ >
66
+ <path
67
+ fill="currentColor"
68
+ d="M15.794 7.733a.75.75 0 0 1-.026 1.06l-5.25 5.001a.75.75 0 0 1-1.035 0l-5.25-5a.75.75 0 0 1 1.034-1.087l4.734 4.509l4.733-4.51a.75.75 0 0 1 1.06.027"
69
+ />
70
+ </svg>
71
+ </div>
72
+ {/if}
76
73
  </button>
77
- {#if open}
74
+ {#if open && children}
78
75
  <div class={body()} {id}>
79
76
  {@render children()}
80
77
  </div>
package/dist/index.d.ts CHANGED
@@ -724,7 +724,7 @@ export type AccordionProps = {
724
724
  id?: string;
725
725
  title?: string;
726
726
  description?: string;
727
- children: Snippet;
727
+ children?: Snippet;
728
728
  summary?: Snippet;
729
729
  open?: boolean;
730
730
  color?: VariantColors;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makolabs/ripple",
3
- "version": "0.0.1-dev.47",
3
+ "version": "0.0.1-dev.48",
4
4
  "description": "Simple Svelte 5 powered component library ✨",
5
5
  "repository": {
6
6
  "type": "git",