@skeletonlabs/skeleton 1.6.2-dev.d43336e4 → 1.7.0-dev.e2cc14c3

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.
@@ -32,6 +32,10 @@ function prunedRestProps() {
32
32
  on:keydown
33
33
  on:keyup
34
34
  on:keypress
35
+ on:mouseover
36
+ on:mouseleave
37
+ on:focus
38
+ on:blur
35
39
  data-testid="app-rail-anchor"
36
40
  >
37
41
  <div class="app-rail-wrapper {classesWrapper}">
@@ -17,6 +17,10 @@ declare const __propDef: {
17
17
  keydown: KeyboardEvent;
18
18
  keyup: KeyboardEvent;
19
19
  keypress: KeyboardEvent;
20
+ mouseover: MouseEvent;
21
+ mouseleave: MouseEvent;
22
+ focus: FocusEvent;
23
+ blur: FocusEvent;
20
24
  } & {
21
25
  [evt: string]: CustomEvent<any>;
22
26
  };
@@ -31,7 +31,7 @@ function prunedRestProps() {
31
31
  }
32
32
  </script>
33
33
 
34
- <label class="app-rail-tile {classesBase}" data-testid="app-rail-tile" {title}>
34
+ <label class="app-rail-tile {classesBase}" data-testid="app-rail-tile" {title} on:mouseover on:mouseleave on:focus on:blur>
35
35
  <!-- A11y attributes are not allowed on <label> -->
36
36
  <div class="app-rail-wrapper {classesWrapper}" on:keydown on:keyup on:keypress>
37
37
  <!-- NOTE: Don't use `hidden` as it prevents `required` from operating -->
@@ -19,6 +19,10 @@ declare const __propDef: {
19
19
  spacing?: string | undefined;
20
20
  };
21
21
  events: {
22
+ mouseover: MouseEvent;
23
+ mouseleave: MouseEvent;
24
+ focus: FocusEvent;
25
+ blur: FocusEvent;
22
26
  keydown: KeyboardEvent;
23
27
  keyup: KeyboardEvent;
24
28
  keypress: KeyboardEvent;
@@ -74,7 +74,7 @@ $:
74
74
  {#if optionsFiltered.length > 0}
75
75
  <nav class="autocomplete-nav {classesNav}">
76
76
  <ul class="autocomplete-list {classesList}">
77
- {#each optionsFiltered.slice(0, sliceLimit) as option, i (option)}
77
+ {#each optionsFiltered.slice(0, sliceLimit) as option (option)}
78
78
  <li class="autocomplete-item {classesItem}">
79
79
  <button class="autocomplete-button {classesButton}" type="button" on:click={() => onSelection(option)} on:click on:keypress>
80
80
  {@html option.label}
@@ -5,6 +5,7 @@ export let legend = false;
5
5
  export let spin = false;
6
6
  export let width = "w-24";
7
7
  export let hover = "bg-primary-hover-token";
8
+ export let digits = 0;
8
9
  export let regionCaption = "";
9
10
  export let regionCone = "";
10
11
  export let regionLegend = "";
@@ -32,7 +33,7 @@ function genLegend() {
32
33
  return {
33
34
  label: v.label,
34
35
  color: setColorValue(v.color),
35
- value: v.end - v.start
36
+ value: (v.end - v.start).toFixed(digits)
36
37
  };
37
38
  });
38
39
  }
@@ -13,6 +13,8 @@ declare const __propDef: {
13
13
  width?: string | undefined;
14
14
  /** Style the legend hover effect.*/
15
15
  hover?: string | undefined;
16
+ /** Set the number of digits on the legend values.*/
17
+ digits?: number | undefined;
16
18
  /** Style the caption region above the gradient.*/
17
19
  regionCaption?: string | undefined;
18
20
  /** Style the conic gradient region.*/
@@ -11,6 +11,23 @@ const cBase = "cursor-pointer -outline-offset-[3px]";
11
11
  const cLabel = "flex items-center space-x-4";
12
12
  let checked;
13
13
  let elemInput;
14
+ function areDeeplyEqual(param1, param2) {
15
+ if (param1 === param2)
16
+ return true;
17
+ if (!(param1 instanceof Object) || !(param2 instanceof Object))
18
+ return false;
19
+ const keys1 = Object.keys(param1);
20
+ const keys2 = Object.keys(param2);
21
+ if (keys1.length !== keys2.length)
22
+ return false;
23
+ for (const key of keys1) {
24
+ const value1 = param1[key];
25
+ const value2 = param2[key];
26
+ if (!areDeeplyEqual(value1, value2))
27
+ return false;
28
+ }
29
+ return true;
30
+ }
14
31
  $:
15
32
  if (multiple)
16
33
  updateCheckbox(group);
@@ -41,7 +58,7 @@ function onKeyDown(event) {
41
58
  }
42
59
  }
43
60
  $:
44
- selected = multiple ? group.includes(value) : group === value;
61
+ selected = multiple ? group.some((groupVal) => areDeeplyEqual(value, groupVal)) : areDeeplyEqual(group, value);
45
62
  $:
46
63
  classesActive = selected ? active : hover;
47
64
  $:
@@ -1,4 +1,5 @@
1
1
  <script>import { createEventDispatcher } from "svelte";
2
+ import { leftAngles, leftArrow, rightAngles, rightArrow } from "./icons.js";
2
3
  const dispatch = createEventDispatcher();
3
4
  export let settings = { offset: 0, limit: 5, size: 0, amounts: [1, 2, 5, 10] };
4
5
  export let disabled = false;
@@ -13,11 +14,11 @@ export let regionControl = "btn-group";
13
14
  export let controlVariant = "variant-filled";
14
15
  export let controlSeparator = "";
15
16
  export let active = "variant-filled-primary";
16
- export let buttonClasses = "!px-3 !py-1.5";
17
- export let buttonTextPrevious = "&larr;";
18
- export let buttonTextNext = "&rarr;";
19
- export let buttonTextFirst = "&laquo;";
20
- export let buttonTextLast = "&raquo;";
17
+ export let buttonClasses = "!px-3 !py-1.5 fill-current";
18
+ export let buttonTextPrevious = leftArrow;
19
+ export let buttonTextNext = rightArrow;
20
+ export let buttonTextFirst = leftAngles;
21
+ export let buttonTextLast = rightAngles;
21
22
  const cBase = "flex flex-col md:flex-row items-center space-y-4 md:space-y-0 md:space-x-4";
22
23
  const cLabel = "w-full md:w-auto";
23
24
  let lastPage = Math.ceil(settings.size / settings.limit - 1);
@@ -0,0 +1,4 @@
1
+ export declare const leftArrow = "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"1em\" viewBox=\"0 0 448 512\"><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d=\"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z\"/></svg>";
2
+ export declare const rightArrow = "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"1em\" viewBox=\"0 0 448 512\"><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d=\"M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z\"/></svg>";
3
+ export declare const leftAngles = "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"1em\" viewBox=\"0 0 512 512\"><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d=\"M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160zm352-160l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L301.3 256 438.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0z\"/></svg>";
4
+ export declare const rightAngles = "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"1em\" viewBox=\"0 0 512 512\"><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d=\"M470.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256 265.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160zm-352 160l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L210.7 256 73.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z\"/></svg>";
@@ -0,0 +1,4 @@
1
+ export const leftArrow = `<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"/></svg>`;
2
+ export const rightArrow = `<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"/></svg>`;
3
+ export const leftAngles = `<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160zm352-160l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L301.3 256 438.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0z"/></svg>`;
4
+ export const rightAngles = `<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M470.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256 265.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160zm-352 160l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L210.7 256 73.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"/></svg>`;
@@ -3,6 +3,7 @@ const dispatch = createEventDispatcher();
3
3
  export let name;
4
4
  export let checked = false;
5
5
  export let size = "md";
6
+ export let background = "bg-surface-400 dark:bg-surface-700";
6
7
  export let active = "bg-surface-900 dark:bg-surface-300";
7
8
  export let border = "";
8
9
  export let rounded = "rounded-full";
@@ -30,7 +31,7 @@ function onKeyDown(event) {
30
31
  }
31
32
  }
32
33
  $:
33
- cTrackActive = checked ? active : "bg-surface-400 dark:bg-surface-700 cursor-pointer";
34
+ cTrackActive = checked ? active : `${background} cursor-pointer`;
34
35
  $:
35
36
  cThumbBackground = checked ? "bg-white/75" : "bg-white";
36
37
  $:
@@ -8,7 +8,9 @@ declare const __propDef: {
8
8
  checked?: boolean | undefined;
9
9
  /** Sets the size of the component.*/
10
10
  size?: string | undefined;
11
- /** Provide classes to set the checked state color.*/
11
+ /** Provide classe to set the inactive state background color.*/
12
+ background?: string | undefined;
13
+ /** Provide classes to set the active state background color.*/
12
14
  active?: string | undefined;
13
15
  /** Provide classes to set the border styles.*/
14
16
  border?: string | undefined;
@@ -92,7 +92,7 @@ $:
92
92
  <div class="toc {classesBase}" transition:fade|local={{ duration: 100 }}>
93
93
  <nav class="toc-list {classesList}">
94
94
  <div class="toc-label {classesLabel}">{label}</div>
95
- {#each filteredHeadingsList as headingElem, i}
95
+ {#each filteredHeadingsList as headingElem}
96
96
  <!-- prettier-ignore -->
97
97
  <li
98
98
  class="toc-list-item {classesListItem} {setHeadingClasses(headingElem)} {headingElem.id === activeHeaderId ? active : ''}"
@@ -19,7 +19,7 @@
19
19
 
20
20
  /* Typography Settings */
21
21
  @import 'partials/typography.css';
22
- @import 'partials/typography-prose.css';
22
+ /* DEPRECATED: 'partials/typography-prose.css' must now be imported directly */
23
23
 
24
24
  /* === REQUIRED STYLESHEETS === */
25
25
 
@@ -3,49 +3,47 @@
3
3
  /* Provides default styling for the Tailwind Typography plugin via element modifiers. */
4
4
  /* https://tailwindcss.com/docs/typography-plugin */
5
5
 
6
- @layer base {
7
- .prose {
8
- @apply text-base font-token text-token;
9
- /* Element Modifiers */
10
- /* https://tailwindcss.com/docs/typography-plugin#element-modifiers */
11
- @apply prose-headings:text-token;
12
- /* @apply prose-lead:{utility}; */
13
- @apply prose-h1:font-heading-token prose-h1:text-3xl prose-h1:md:text-5xl;
14
- @apply prose-h2:font-heading-token prose-h1:text-2xl prose-h1:md:text-4xl;
15
- @apply prose-h3:font-heading-token prose-h1:text-xl prose-h1:md:text-2xl;
16
- @apply prose-h4:font-heading-token prose-h1:text-lg prose-h1:md:text-xl;
17
- @apply prose-p:text-base;
18
- /* @apply prose-a:{utility}; */
19
- @apply prose-a:text-primary-700 prose-a:dark:text-primary-500 prose-a:hover:brightness-110 prose-a:underline;
20
- @apply prose-blockquote:text-token prose-blockquote:text-base prose-blockquote:!border-secondary-500;
21
- /* @apply prose-figure:{utility}; */
22
- @apply prose-figcaption:text-token prose-figcaption:!text-sm prose-figcaption:italic prose-figcaption:text-center mt-3;
23
- @apply prose-strong:text-token;
24
- @apply prose-em:text-token;
25
- /* @apply prose-ol:{utility}; */
26
- /* @apply prose-ul:{utility}; */
27
- @apply prose-li:text-base;
28
- /* @apply prose-table:{utility}; */
29
- /* @apply prose-thead:{utility}; */
30
- /* @apply prose-tr:{utility}; */
31
- /* @apply prose-th:{utility}; */
32
- /* @apply prose-td:{utility}; */
33
- /* @apply prose-img:{utility}; */
34
- /* @apply prose-video:{utility}; */
35
- /* @apply prose-hr:{utility}; */
6
+ .prose {
7
+ @apply text-base font-token text-token;
8
+ /* Element Modifiers */
9
+ /* https://tailwindcss.com/docs/typography-plugin#element-modifiers */
10
+ @apply prose-headings:text-token;
11
+ /* @apply prose-lead:{utility}; */
12
+ @apply prose-h1:font-heading-token prose-h1:text-3xl prose-h1:md:text-5xl;
13
+ @apply prose-h2:font-heading-token prose-h1:text-2xl prose-h1:md:text-4xl;
14
+ @apply prose-h3:font-heading-token prose-h1:text-xl prose-h1:md:text-2xl;
15
+ @apply prose-h4:font-heading-token prose-h1:text-lg prose-h1:md:text-xl;
16
+ @apply prose-p:text-base;
17
+ /* @apply prose-a:{utility}; */
18
+ @apply prose-a:text-primary-700 prose-a:dark:text-primary-500 prose-a:hover:brightness-110 prose-a:underline;
19
+ @apply prose-blockquote:text-token prose-blockquote:text-base prose-blockquote:!border-secondary-500;
20
+ /* @apply prose-figure:{utility}; */
21
+ @apply prose-figcaption:text-token prose-figcaption:!text-sm prose-figcaption:italic prose-figcaption:text-center mt-3;
22
+ @apply prose-strong:text-token;
23
+ @apply prose-em:text-token;
24
+ /* @apply prose-ol:{utility}; */
25
+ /* @apply prose-ul:{utility}; */
26
+ @apply prose-li:text-base;
27
+ /* @apply prose-table:{utility}; */
28
+ /* @apply prose-thead:{utility}; */
29
+ /* @apply prose-tr:{utility}; */
30
+ /* @apply prose-th:{utility}; */
31
+ /* @apply prose-td:{utility}; */
32
+ /* @apply prose-img:{utility}; */
33
+ /* @apply prose-video:{utility}; */
34
+ /* @apply prose-hr:{utility}; */
36
35
 
37
- /* The following have special use cases and must be handled seperately */
38
- /* @apply prose-code:{utility}; */
39
- /* @apply prose-pre:{utility}; */
40
- }
36
+ /* The following have special use cases and must be handled seperately */
37
+ /* @apply prose-code:{utility}; */
38
+ /* @apply prose-pre:{utility}; */
39
+ }
41
40
 
42
- /* NOTE: keep these in sync with typography.css */
43
- .prose pre:not(.code-block pre) {
44
- @apply font-mono text-base bg-neutral-900/90 text-white p-4 whitespace-pre-wrap overflow-x-auto rounded-container-token;
45
- }
46
- .prose code:is(:not(pre *)) {
47
- @apply font-mono text-xs text-primary-700 dark:text-primary-400 whitespace-nowrap;
48
- @apply bg-primary-500/30 dark:bg-primary-500/20;
49
- @apply py-0.5 px-1 rounded;
50
- }
41
+ /* NOTE: keep these in sync with typography.css */
42
+ .prose pre:not(.code-block pre) {
43
+ @apply font-mono text-base bg-neutral-900/90 text-white p-4 whitespace-pre-wrap overflow-x-auto rounded-container-token;
44
+ }
45
+ .prose code:is(:not(pre *)) {
46
+ @apply font-mono text-xs text-primary-700 dark:text-primary-400 whitespace-nowrap;
47
+ @apply bg-primary-500/30 dark:bg-primary-500/20;
48
+ @apply py-0.5 px-1 rounded;
51
49
  }
@@ -19,7 +19,7 @@
19
19
 
20
20
  /* Typography Settings */
21
21
  @import 'partials/typography-next.css';
22
- @import 'partials/typography-prose.css';
22
+ /* DEPRECATED: 'partials/typography-prose.css' must now be imported directly */
23
23
 
24
24
  /* === REQUIRED STYLESHEETS === */
25
25
 
@@ -86,10 +86,13 @@ function applyAnimationSettings() {
86
86
  break;
87
87
  }
88
88
  }
89
- function onBackdropInteraction(event) {
90
- if (event.target === elemBackdrop)
89
+ function onDrawerInteraction(event) {
90
+ if (event.target === elemBackdrop) {
91
91
  drawerStore.close();
92
- dispatch("backdrop", event);
92
+ dispatch("backdrop", event);
93
+ } else {
94
+ dispatch("drawer", event);
95
+ }
93
96
  }
94
97
  function onKeydownWindow(event) {
95
98
  if (!$drawerStore)
@@ -125,8 +128,9 @@ $:
125
128
  bind:this={elemBackdrop}
126
129
  class="drawer-backdrop {classesBackdrop}"
127
130
  data-testid="drawer-backdrop"
128
- on:mousedown={onBackdropInteraction}
129
- on:touchstart={onBackdropInteraction}
131
+ on:mousedown={onDrawerInteraction}
132
+ on:touchstart
133
+ on:touchend
130
134
  on:keypress
131
135
  transition:fade|local={{ duration }}
132
136
  use:focusTrap={true}
@@ -36,9 +36,13 @@ declare const __propDef: {
36
36
  describedby?: string | undefined;
37
37
  };
38
38
  events: {
39
+ touchstart: TouchEvent;
40
+ touchend: TouchEvent;
39
41
  keypress: KeyboardEvent;
40
42
  /** {{ event }} backdrop - Fires on backdrop interaction.*/
41
43
  backdrop: CustomEvent<any>;
44
+ /** {{ event }} drawer - Fires on drawer interaction.*/
45
+ drawer: CustomEvent<any>;
42
46
  } & {
43
47
  [evt: string]: CustomEvent<any>;
44
48
  };
@@ -49,7 +49,8 @@ $:
49
49
  </script>
50
50
 
51
51
  <svelte:head>
52
- {@html `<script nonce="%sveltekit.nonce%">(${setInitialClassState.toString()})();</script>`}
52
+ <!-- Workaround for a svelte parsing error: https://github.com/sveltejs/eslint-plugin-svelte/issues/492 -->
53
+ {@html `<\u{73}cript nonce="%sveltekit.nonce%">(${setInitialClassState.toString()})();</script>`}
53
54
  </svelte:head>
54
55
 
55
56
  <div
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skeletonlabs/skeleton",
3
- "version": "1.6.2-dev.d43336e4",
3
+ "version": "1.7.0-dev.e2cc14c3",
4
4
  "description": "A SvelteKit component library.",
5
5
  "author": "endigo9740 <chris@skeletonlabs.dev>",
6
6
  "repository": {
@@ -41,7 +41,7 @@
41
41
  "autoprefixer": "10.4.14",
42
42
  "eslint": "8.37.0",
43
43
  "eslint-config-prettier": "8.8.0",
44
- "eslint-plugin-svelte3": "4.0.0",
44
+ "eslint-plugin-svelte": "^2.29.0",
45
45
  "jsdom": "21.1.1",
46
46
  "postcss": "8.4.21",
47
47
  "postcss-import": "15.1.0",