@skeletonlabs/skeleton 1.7.1-dev.6ae8177a → 1.7.1-dev.b359bc76

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.
@@ -0,0 +1,31 @@
1
+ <script>import { createEventDispatcher } from "svelte/internal";
2
+ export let value = 0;
3
+ export let max = 5;
4
+ export let text = "text-token";
5
+ export let fill = "fill-token";
6
+ export let justify = "justify-center";
7
+ export let spacing = "space-x-2";
8
+ export let regionIcon = "";
9
+ const dispatch = createEventDispatcher();
10
+ function iconClick(index) {
11
+ dispatch("icon", {
12
+ index: index + 1
13
+ });
14
+ }
15
+ const cBase = "w-full flex";
16
+ $:
17
+ classesBase = `${cBase} ${text} ${fill} ${justify} ${spacing} ${$$props.class ?? ""}`;
18
+ </script>
19
+
20
+ <div class="ratings {classesBase}" data-testid="rating-bar">
21
+ <!-- eslint-disable-next-line @typescript-eslint/no-unused-vars -->
22
+ {#each Array(max) as _, i}
23
+ {#if Math.floor(value) >= i + 1}
24
+ <button type="button" class="rating-icon {regionIcon}" on:click={() => iconClick(i)}><slot name="full" /></button>
25
+ {:else if value === i + 0.5}
26
+ <button type="button" class="rating-icon {regionIcon}" on:click={() => iconClick(i)}><slot name="half" /></button>
27
+ {:else}
28
+ <button type="button" class="rating-icon {regionIcon}" on:click={() => iconClick(i)}><slot name="empty" /></button>
29
+ {/if}
30
+ {/each}
31
+ </div>
@@ -0,0 +1,34 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ /** Current rating value.*/
6
+ value?: number | undefined;
7
+ /** Maximum rating value.*/
8
+ max?: number | undefined;
9
+ /** Provide classes to set the text color.*/
10
+ text?: string | undefined;
11
+ /** Provide classes to set the SVG fill color.*/
12
+ fill?: string | undefined;
13
+ /** Provide classes to set the flexbox justification.*/
14
+ justify?: string | undefined;
15
+ /** Provide classes to set the horizontal spacing style.*/
16
+ spacing?: string | undefined;
17
+ /** Provide arbitrary classes to the icon region.*/
18
+ regionIcon?: string | undefined;
19
+ };
20
+ events: {
21
+ [evt: string]: CustomEvent<any>;
22
+ };
23
+ slots: {
24
+ full: {};
25
+ half: {};
26
+ empty: {};
27
+ };
28
+ };
29
+ export type RatingsProps = typeof __propDef.props;
30
+ export type RatingsEvents = typeof __propDef.events;
31
+ export type RatingsSlots = typeof __propDef.slots;
32
+ export default class Ratings extends SvelteComponentTyped<RatingsProps, RatingsEvents, RatingsSlots> {
33
+ }
34
+ export {};
package/dist/index.d.ts CHANGED
@@ -38,6 +38,7 @@ export { default as ListBoxItem } from './components/ListBox/ListBoxItem.svelte'
38
38
  export { default as Paginator } from './components/Paginator/Paginator.svelte';
39
39
  export { default as ProgressBar } from './components/ProgressBar/ProgressBar.svelte';
40
40
  export { default as ProgressRadial } from './components/ProgressRadial/ProgressRadial.svelte';
41
+ export { default as Ratings } from './components/Ratings/Ratings.svelte';
41
42
  export { default as RadioGroup } from './components/Radio/RadioGroup.svelte';
42
43
  export { default as RadioItem } from './components/Radio/RadioItem.svelte';
43
44
  export { default as RangeSlider } from './components/RangeSlider/RangeSlider.svelte';
package/dist/index.js CHANGED
@@ -47,6 +47,7 @@ export { default as ListBoxItem } from './components/ListBox/ListBoxItem.svelte'
47
47
  export { default as Paginator } from './components/Paginator/Paginator.svelte';
48
48
  export { default as ProgressBar } from './components/ProgressBar/ProgressBar.svelte';
49
49
  export { default as ProgressRadial } from './components/ProgressRadial/ProgressRadial.svelte';
50
+ export { default as Ratings } from './components/Ratings/Ratings.svelte';
50
51
  export { default as RadioGroup } from './components/Radio/RadioGroup.svelte';
51
52
  export { default as RadioItem } from './components/Radio/RadioItem.svelte';
52
53
  export { default as RangeSlider } from './components/RangeSlider/RangeSlider.svelte';
@@ -7,7 +7,7 @@ import { drawerStore } from "./stores.js";
7
7
  export let position = "left";
8
8
  export let duration = 150;
9
9
  export let bgBackdrop = "bg-surface-backdrop-token";
10
- export let blur = "backdrop-blur-xs";
10
+ export let blur = "";
11
11
  export let padding = "";
12
12
  export let bgDrawer = "bg-surface-100-800-token";
13
13
  export let border = "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skeletonlabs/skeleton",
3
- "version": "1.7.1-dev.6ae8177a",
3
+ "version": "1.7.1-dev.b359bc76",
4
4
  "description": "A SvelteKit component library.",
5
5
  "author": "endigo9740 <chris@skeletonlabs.dev>",
6
6
  "repository": {