@skeletonlabs/skeleton 2.4.0-dev.8fddb2b2 → 2.4.0-dev.a85483d9

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.
@@ -11,7 +11,7 @@ export let spacing = getContext("spacing");
11
11
  export let width = getContext("width");
12
12
  export let aspectRatio = getContext("aspectRatio");
13
13
  const cBase = "cursor-pointer";
14
- const cWrapper = "flex flex-col justify-center items-stretch";
14
+ const cWrapper = "flex flex-col justify-center items-stretch w-full";
15
15
  const cInterface = "text-center";
16
16
  const cLabel = "font-bold text-xs";
17
17
  let elemInput;
@@ -27,6 +27,12 @@ $:
27
27
  classesLead = `${regionLead}`;
28
28
  $:
29
29
  classesLabel = `${cLabel} ${regionLabel}`;
30
+ function onKeyDown(event) {
31
+ if (["Enter", "Space"].includes(event.code)) {
32
+ event.preventDefault();
33
+ elemInput.click();
34
+ }
35
+ }
30
36
  function prunedRestProps() {
31
37
  delete $$restProps.class;
32
38
  return $$restProps;
@@ -35,9 +41,7 @@ function prunedRestProps() {
35
41
 
36
42
  <label class="app-rail-tile {classesBase}" data-testid="app-rail-tile" {title} on:mouseover on:mouseleave on:focus on:blur>
37
43
  <!-- A11y attributes are not allowed on <label> -->
38
- <!-- FIXME: resolve a11y warnings -->
39
- <!-- svelte-ignore a11y-no-static-element-interactions -->
40
- <div class="app-rail-wrapper {classesWrapper}" on:keydown on:keyup on:keypress>
44
+ <button class="app-rail-wrapper {classesWrapper}" tabindex="0" on:keydown={onKeyDown} on:keyup on:keypress>
41
45
  <!-- NOTE: Don't use `hidden` as it prevents `required` from operating -->
42
46
  <div class="h-0 w-0 overflow-hidden">
43
47
  <input bind:this={elemInput} type="radio" bind:group {name} {value} {...prunedRestProps()} tabindex="-1" on:click on:change />
@@ -47,5 +51,5 @@ function prunedRestProps() {
47
51
  {#if $$slots.lead}<div class="app-rail-lead {classesLead}"><slot name="lead" /></div>{/if}
48
52
  <div class="app-rail-label {classesLabel}"><slot /></div>
49
53
  </div>
50
- </div>
54
+ </button>
51
55
  </label>
@@ -25,7 +25,6 @@ declare const __propDef: {
25
25
  mouseleave: MouseEvent;
26
26
  focus: FocusEvent;
27
27
  blur: FocusEvent;
28
- keydown: KeyboardEvent;
29
28
  keyup: KeyboardEvent;
30
29
  keypress: KeyboardEvent;
31
30
  click: MouseEvent;
@@ -36,7 +36,7 @@ $:
36
36
  <table
37
37
  class="{classesTable}"
38
38
  class:table-interactive={interactive}
39
- role="grid"
39
+ role={interactive ? "grid" : "table"}
40
40
  use:tableA11y
41
41
  >
42
42
  <!-- on:keydown={(e) => onTableKeydown(elemTable, e)} -->
@@ -44,7 +44,7 @@ $:
44
44
  <thead class="table-head {regionHead}">
45
45
  <tr>
46
46
  {#each source.head as heading }
47
- <th class="{regionHeadCell}">{@html heading}</th>
47
+ <th class="{regionHeadCell}" role="columnheader">{@html heading}</th>
48
48
  {/each}
49
49
  </tr>
50
50
  </thead>
@@ -63,9 +63,9 @@ $:
63
63
  <!-- prettier-ignore -->
64
64
  <td
65
65
  class="{regionCell}"
66
- role="gridcell"
66
+ role={interactive ? "gridcell" : "cell"}
67
67
  aria-colindex={cellIndex + 1}
68
- tabindex={cellIndex === 0 ? 0 : -1}
68
+ tabindex={cellIndex === 0 && interactive ? 0 : -1}
69
69
  >
70
70
  {@html Number(cell) === 0 ? cell : (cell ? cell : '-')}
71
71
  </td>
@@ -138,8 +138,8 @@ $:
138
138
  class="drawer-backdrop {classesBackdrop}"
139
139
  data-testid="drawer-backdrop"
140
140
  on:mousedown={onDrawerInteraction}
141
- on:touchstart
142
- on:touchend
141
+ on:touchstart|passive
142
+ on:touchend|passive
143
143
  on:keypress
144
144
  in:dynamicTransition|local={{
145
145
  transition: fade,
@@ -8,7 +8,7 @@ import type { ModalSettings } from './types.js';
8
8
  * @example
9
9
  * ```svelte
10
10
  * <script>
11
- * import { getmodalStore } from "@skeletonlabs/skeleton";
11
+ * import { getModalStore } from "@skeletonlabs/skeleton";
12
12
  *
13
13
  * const modalStore = getModalStore();
14
14
  *
@@ -10,7 +10,7 @@ const MODAL_STORE_KEY = 'modalStore';
10
10
  * @example
11
11
  * ```svelte
12
12
  * <script>
13
- * import { getmodalStore } from "@skeletonlabs/skeleton";
13
+ * import { getModalStore } from "@skeletonlabs/skeleton";
14
14
  *
15
15
  * const modalStore = getModalStore();
16
16
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skeletonlabs/skeleton",
3
- "version": "2.4.0-dev.8fddb2b2",
3
+ "version": "2.4.0-dev.a85483d9",
4
4
  "description": "A SvelteKit component library.",
5
5
  "author": "endigo9740 <chris@skeletonlabs.dev>",
6
6
  "repository": {