@skeletonlabs/skeleton 2.5.1-dev.d9e107cc → 2.6.0-dev.2dc0e817

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.
@@ -1,12 +1,11 @@
1
- <script>import { getContext } from "svelte";
2
- import { createEventDispatcher } from "svelte";
1
+ <script>import { createEventDispatcher, getContext } from "svelte";
3
2
  import { dynamicTransition } from "../../internal/transitions.js";
4
3
  const dispatch = createEventDispatcher();
5
4
  export let open = false;
6
5
  export let id = String(Math.random());
7
6
  const cBase = "";
8
7
  const cControl = "text-start w-full flex items-center space-x-4";
9
- const cControlCaret = "fill-current w-3 transition-transform duration-[200ms]";
8
+ const cControlIcons = "fill-current w-3 transition-transform duration-[200ms]";
10
9
  const cPanel = "";
11
10
  export let autocollapse = getContext("autocollapse");
12
11
  export let active = getContext("active");
@@ -24,6 +23,10 @@ export let transitionIn = getContext("transitionIn");
24
23
  export let transitionInParams = getContext("transitionInParams");
25
24
  export let transitionOut = getContext("transitionOut");
26
25
  export let transitionOutParams = getContext("transitionOutParams");
26
+ const svgCaretIcon = `
27
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class={classesControlCaret}>
28
+ <path d="M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z" />
29
+ </svg>`;
27
30
  function setActive(event) {
28
31
  if (autocollapse === true) {
29
32
  active.set(id);
@@ -56,7 +59,9 @@ $:
56
59
  $:
57
60
  classesCaretState = openState ? caretOpen : caretClosed;
58
61
  $:
59
- classesControlCaret = `${cControlCaret} ${regionCaret} ${classesCaretState}`;
62
+ classesControlCaret = `${cControlIcons} ${regionCaret} ${classesCaretState}`;
63
+ $:
64
+ classesControlIcons = `${cControlIcons} ${regionCaret}`;
60
65
  $:
61
66
  classesPanel = `${cPanel} ${padding} ${rounded} ${regionPanel}`;
62
67
  </script>
@@ -88,15 +93,21 @@ $:
88
93
  <div class="accordion-summary flex-1">
89
94
  <slot name="summary">(summary)</slot>
90
95
  </div>
91
- <!-- Caret -->
92
- <div class="accordion-summary-caret {classesControlCaret}">
96
+ <!-- Icons -->
97
+ {#if $$slots.iconClosed || $$slots.iconOpen}
98
+ <!-- Custom -->
99
+ <!-- If a custom icon is provided, do not use rotation -->
100
+ <div class="accordion-summary-icons {classesControlIcons}">
101
+ {#if openState}
102
+ <slot name="iconClosed">{@html svgCaretIcon}</slot>
103
+ {:else}
104
+ <slot name="iconOpen">{@html svgCaretIcon}</slot>
105
+ {/if}
106
+ </div>
107
+ {:else}
93
108
  <!-- SVG Caret -->
94
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
95
- <path
96
- d="M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"
97
- />
98
- </svg>
99
- </div>
109
+ <div class="accordion-summary-caret {classesControlCaret}">{@html svgCaretIcon}</div>
110
+ {/if}
100
111
  </button>
101
112
  <!-- Panel -->
102
113
  {#if openState}
@@ -28,7 +28,7 @@ declare class __sveltets_Render<TransitionIn extends Transition, TransitionOut e
28
28
  regionControl?: string | undefined;
29
29
  /** Provide arbitrary classes to content panel region.*/
30
30
  regionPanel?: string | undefined;
31
- /** Provide arbitrary classes caret icon region.*/
31
+ /** Provide arbitrary classes default region.*/
32
32
  regionCaret?: string | undefined;
33
33
  /** Enable/Disable transitions*/
34
34
  transitions?: boolean | undefined;
@@ -59,6 +59,8 @@ declare class __sveltets_Render<TransitionIn extends Transition, TransitionOut e
59
59
  slots(): {
60
60
  lead: {};
61
61
  summary: {};
62
+ iconClosed: {};
63
+ iconOpen: {};
62
64
  content: {};
63
65
  };
64
66
  }
@@ -1,5 +1,6 @@
1
1
  <script>export let initials = "AB";
2
2
  export let fill = "fill-token";
3
+ export let fontSize = 150;
3
4
  export let src = "";
4
5
  export let fallback = "";
5
6
  export let action = () => {
@@ -36,7 +37,15 @@ function prunedRestProps() {
36
37
  />
37
38
  {:else}
38
39
  <svg class="avatar-initials w-full h-full" viewBox="0 0 512 512">
39
- <text x="50%" y="50%" dominant-baseline="central" text-anchor="middle" font-weight="bold" font-size={150} class="avatar-text {fill}">
40
+ <text
41
+ x="50%"
42
+ y="50%"
43
+ dominant-baseline="central"
44
+ text-anchor="middle"
45
+ font-weight="bold"
46
+ font-size={fontSize}
47
+ class="avatar-text {fill}"
48
+ >
40
49
  {String(initials).substring(0, 2).toUpperCase()}
41
50
  </text>
42
51
  </svg>
@@ -7,6 +7,8 @@ declare const __propDef: {
7
7
  initials?: string | undefined;
8
8
  /** Initials only - Provide classes to set the SVG text fill color.*/
9
9
  fill?: string | undefined;
10
+ /** Initials only - Set the base font size for the scalable SVG text.*/
11
+ fontSize?: number | undefined;
10
12
  /** Provide the avatar image element source.*/
11
13
  src?: string | undefined;
12
14
  /** Provide the fallback image element source.*/
@@ -4,6 +4,7 @@ export let max = 100;
4
4
  export let height = "h-2";
5
5
  export let rounded = "rounded-token";
6
6
  export let transition = "transition-[width]";
7
+ export let animIndeterminate = "anim-indeterminate";
7
8
  export let meter = "bg-surface-900-50-token";
8
9
  export let track = "bg-surface-200-700-token";
9
10
  export let labelledby = "";
@@ -14,7 +15,7 @@ $:
14
15
  $:
15
16
  indeterminate = value === void 0 || value < 0;
16
17
  $:
17
- classesIndeterminate = indeterminate ? "animIndeterminate" : "";
18
+ classesIndeterminate = indeterminate ? animIndeterminate : "";
18
19
  $:
19
20
  classesTrack = `${cTrack} ${track} ${height} ${rounded} ${$$props.class ?? ""}`;
20
21
  $:
@@ -36,12 +37,12 @@ $:
36
37
  </div>
37
38
 
38
39
  <style>
39
- .animIndeterminate {
40
+ .anim-indeterminate {
40
41
  transform-origin: 0% 50%;
41
- animation: animIndeterminate 2s infinite linear;
42
+ animation: anim-indeterminate 2s infinite linear;
42
43
  }
43
44
  /* prettier-ignore */
44
- @keyframes animIndeterminate {
45
+ @keyframes anim-indeterminate {
45
46
  0% { transform: translateX(0) scaleX(0); }
46
47
  40% { transform: translateX(0) scaleX(0.4); }
47
48
  100% { transform: translateX(100%) scaleX(0.5); }
@@ -14,6 +14,8 @@ declare const __propDef: {
14
14
  rounded?: string | undefined;
15
15
  /** Provide classes to set the meter transition styles.*/
16
16
  transition?: string | undefined;
17
+ /** Provide classes to replace the default animation styles.*/
18
+ animIndeterminate?: string | undefined;
17
19
  /** Sets the base classes of the meter element.*/
18
20
  meter?: string | undefined;
19
21
  /** Sets the base classes of the track element.*/
@@ -1,8 +1,9 @@
1
1
  <script>import { setContext } from "svelte";
2
2
  export let display = "inline-flex";
3
+ export let flexDirection = "flex-row";
4
+ export let gap = "gap-1";
3
5
  export let background = "bg-surface-200-700-token";
4
6
  export let border = "border-token border-surface-400-500-token";
5
- export let spacing = "";
6
7
  export let rounded = "rounded-token";
7
8
  export let padding = "px-4 py-1";
8
9
  export let active = "variant-filled";
@@ -20,9 +21,7 @@ setContext("fill", fill);
20
21
  setContext("regionLabel", regionLabel);
21
22
  const cBase = "p-1";
22
23
  $:
23
- spacing = `${display.includes("flex-col") ? "" : "space-x-1"}`;
24
- $:
25
- classesBase = `${cBase} ${display} ${background} ${border} ${spacing} ${rounded} ${$$props.class ?? ""}`;
24
+ classesBase = `${cBase} ${display} ${flexDirection} ${gap} ${background} ${border} ${rounded} ${$$props.class ?? ""}`;
26
25
  </script>
27
26
 
28
27
  <div class="radio-group {classesBase}" data-testid="radio-group" role="radiogroup" aria-labelledby={labelledby}>
@@ -2,14 +2,16 @@ import { SvelteComponentTyped } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
4
  [x: string]: any;
5
- /** Provide display classes. Set `flex` to stretch full width.*/
5
+ /** Provide display classes. Use `flex` to stretch full width.*/
6
6
  display?: string | undefined;
7
+ /** Provide classes to set flex-direction. Use `flex-col` for vertical layout.*/
8
+ flexDirection?: string | undefined;
9
+ /** Provide classes to set gap spacing between items.*/
10
+ gap?: string | undefined;
7
11
  /** Provide classes to set the base background color.*/
8
12
  background?: string | undefined;
9
13
  /** Provide classes to set the border styles.*/
10
14
  border?: string | undefined;
11
- /** Provide classes horizontal spacing between items.*/
12
- spacing?: string | undefined;
13
15
  /** Provide classes to set the border radius.*/
14
16
  rounded?: string | undefined;
15
17
  /** Provide classes to set the RadioItem padding.*/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skeletonlabs/skeleton",
3
- "version": "2.5.1-dev.d9e107cc",
3
+ "version": "2.6.0-dev.2dc0e817",
4
4
  "description": "A SvelteKit component library.",
5
5
  "author": "endigo9740 <chris@skeletonlabs.dev>",
6
6
  "repository": {