@r2digisolutions/components 0.21.23 → 0.21.25

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.
@@ -44,7 +44,13 @@
44
44
  lg: 'px-5 py-5 sm:px-6 sm:py-6'
45
45
  };
46
46
 
47
- const isClickable = $derived(!!onclick || hoverable);
47
+ function handleKeydown(e: KeyboardEvent) {
48
+ if (!onclick) return;
49
+ if (e.key === 'Enter' || e.key === ' ') {
50
+ e.preventDefault();
51
+ onclick(e as unknown as MouseEvent);
52
+ }
53
+ }
48
54
  </script>
49
55
 
50
56
  <!-- svelte-ignore a11y_no_noninteractive_tabindex -->
@@ -60,10 +66,8 @@
60
66
  ]}
61
67
  role={onclick ? 'button' : undefined}
62
68
  tabindex={onclick ? 0 : undefined}
63
- {onclick}
64
- onkeydown={onclick
65
- ? (e) => e.key === 'Enter' && onclick?.(e as unknown as MouseEvent)
66
- : undefined}
69
+ onclick={onclick}
70
+ onkeydown={onclick ? handleKeydown : undefined}
67
71
  >
68
72
  {#if header}
69
73
  <div
@@ -108,18 +108,24 @@
108
108
  {:else if children}
109
109
  {@render children()}
110
110
  {:else if hasBody}
111
- <div class="grid gap-4 lg:grid-cols-[minmax(0,1fr)_20rem] xl:grid-cols-[minmax(0,1fr)_22rem]">
111
+ {#if secondary}
112
+ <div class="grid gap-4 lg:grid-cols-[minmax(0,1fr)_20rem] xl:grid-cols-[minmax(0,1fr)_22rem]">
113
+ <div class="min-w-0 space-y-4">
114
+ {#if primary}
115
+ {@render primary()}
116
+ {/if}
117
+ </div>
118
+ <aside class="min-w-0 space-y-4">
119
+ {@render secondary()}
120
+ </aside>
121
+ </div>
122
+ {:else}
112
123
  <div class="min-w-0 space-y-4">
113
124
  {#if primary}
114
125
  {@render primary()}
115
126
  {/if}
116
127
  </div>
117
- {#if secondary}
118
- <aside class="min-w-0 space-y-4">
119
- {@render secondary()}
120
- </aside>
121
- {/if}
122
- </div>
128
+ {/if}
123
129
  {#if footer}
124
130
  <div class="space-y-4">
125
131
  {@render footer()}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r2digisolutions/components",
3
- "version": "0.21.23",
3
+ "version": "0.21.25",
4
4
  "private": false,
5
5
  "description": "R2DigiSolutions Svelte 5 component library — Atomic Design, Tailwind 4, Light/Dark mode",
6
6
  "license": "MIT",