@skeletonlabs/skeleton 1.7.1-dev.326eb31e → 1.7.1-dev.702244cb
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.
- package/dist/components/Ratings/Ratings.svelte +31 -0
- package/dist/components/Ratings/Ratings.svelte.d.ts +34 -0
- package/dist/components/Tab/Tab.svelte +2 -1
- package/dist/components/Tab/Tab.svelte.d.ts +2 -0
- package/dist/components/Tab/TabAnchor.svelte +44 -0
- package/dist/components/Tab/TabAnchor.svelte.d.ts +44 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/tailwind/generated/intellisense-classes.cjs +1 -1
- package/dist/tailwind/generated/intellisense-classes.d.cts +2038 -237
- package/dist/utilities/Drawer/Drawer.svelte +1 -1
- package/dist/utilities/Toast/Toast.svelte +25 -5
- package/dist/utilities/Toast/stores.d.ts +6 -2
- package/dist/utilities/Toast/stores.js +32 -14
- package/dist/utilities/Toast/types.d.ts +4 -0
- package/package.json +19 -22
|
@@ -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 {};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export let group;
|
|
3
3
|
export let name;
|
|
4
4
|
export let value;
|
|
5
|
+
export let title = "";
|
|
5
6
|
export let controls = "";
|
|
6
7
|
export let regionTab = "";
|
|
7
8
|
export let active = getContext("active");
|
|
@@ -67,7 +68,7 @@ function prunedRestProps() {
|
|
|
67
68
|
}
|
|
68
69
|
</script>
|
|
69
70
|
|
|
70
|
-
<label class={classesBase}>
|
|
71
|
+
<label class={classesBase} {title}>
|
|
71
72
|
<!-- A11y attributes are not allowed on <label> -->
|
|
72
73
|
<div
|
|
73
74
|
class="tab {classesTab}"
|
|
@@ -8,6 +8,8 @@ declare const __propDef: {
|
|
|
8
8
|
name: string;
|
|
9
9
|
/** Set the input's value.*/
|
|
10
10
|
value: any;
|
|
11
|
+
/** Provide a hoverable title attribute for the tab.*/
|
|
12
|
+
title?: string | undefined;
|
|
11
13
|
/** Set the ARIA controls value to define which panel this tab controls.*/
|
|
12
14
|
controls?: string | undefined;
|
|
13
15
|
/** Provide arbitrary classes to style the tab region.*/
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<script>import { getContext } from "svelte";
|
|
2
|
+
export let selected = false;
|
|
3
|
+
export let controls = "";
|
|
4
|
+
export let active = getContext("active");
|
|
5
|
+
export let hover = getContext("hover");
|
|
6
|
+
export let flex = getContext("flex");
|
|
7
|
+
export let padding = getContext("padding");
|
|
8
|
+
export let rounded = getContext("rounded");
|
|
9
|
+
export let spacing = getContext("spacing");
|
|
10
|
+
const cBase = "text-center cursor-pointer transition-colors duration-100";
|
|
11
|
+
const cInterface = "";
|
|
12
|
+
$:
|
|
13
|
+
classesActive = selected ? active : hover;
|
|
14
|
+
$:
|
|
15
|
+
classesBase = `${cBase} ${flex} ${padding} ${rounded} ${classesActive} ${$$props.class ?? ""}`;
|
|
16
|
+
$:
|
|
17
|
+
classesInterface = `${cInterface} ${spacing}`;
|
|
18
|
+
function prunedRestProps() {
|
|
19
|
+
delete $$restProps.class;
|
|
20
|
+
return $$restProps;
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<a
|
|
25
|
+
class="tab-anchor {classesBase}"
|
|
26
|
+
href={$$props.href}
|
|
27
|
+
{...prunedRestProps()}
|
|
28
|
+
aria-controls={controls}
|
|
29
|
+
on:click
|
|
30
|
+
on:keydown
|
|
31
|
+
on:keyup
|
|
32
|
+
on:keypress
|
|
33
|
+
on:mouseover
|
|
34
|
+
on:mouseleave
|
|
35
|
+
on:focus
|
|
36
|
+
on:blur
|
|
37
|
+
data-testid="tab-anchor"
|
|
38
|
+
>
|
|
39
|
+
<!-- Interface -->
|
|
40
|
+
<div class="tab-interface {classesInterface}">
|
|
41
|
+
{#if $$slots.lead}<div class="tab-lead"><slot name="lead" /></div>{/if}
|
|
42
|
+
<div class="tab-label"><slot /></div>
|
|
43
|
+
</div>
|
|
44
|
+
</a>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
/** Enables the active state styles when set true.*/
|
|
6
|
+
selected?: boolean | undefined;
|
|
7
|
+
/** Set the ARIA controls value to define which panel this tab controls.*/
|
|
8
|
+
controls?: string | undefined;
|
|
9
|
+
/** Provide classes to style each tab's active styles.*/
|
|
10
|
+
active?: string | undefined;
|
|
11
|
+
/** Provide classes to style each tab's hover styles.*/
|
|
12
|
+
hover?: string | undefined;
|
|
13
|
+
/** Provide classes to style each tab's flex styles.*/
|
|
14
|
+
flex?: string | undefined;
|
|
15
|
+
/** Provide classes to style each tab's padding styles.*/
|
|
16
|
+
padding?: string | undefined;
|
|
17
|
+
/** Provide classes to style each tab's box radius styles.*/
|
|
18
|
+
rounded?: string | undefined;
|
|
19
|
+
/** Provide classes to set the vertical spacing between items.*/
|
|
20
|
+
spacing?: string | undefined;
|
|
21
|
+
};
|
|
22
|
+
events: {
|
|
23
|
+
click: MouseEvent;
|
|
24
|
+
keydown: KeyboardEvent;
|
|
25
|
+
keyup: KeyboardEvent;
|
|
26
|
+
keypress: KeyboardEvent;
|
|
27
|
+
mouseover: MouseEvent;
|
|
28
|
+
mouseleave: MouseEvent;
|
|
29
|
+
focus: FocusEvent;
|
|
30
|
+
blur: FocusEvent;
|
|
31
|
+
} & {
|
|
32
|
+
[evt: string]: CustomEvent<any>;
|
|
33
|
+
};
|
|
34
|
+
slots: {
|
|
35
|
+
lead: {};
|
|
36
|
+
default: {};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export type TabAnchorProps = typeof __propDef.props;
|
|
40
|
+
export type TabAnchorEvents = typeof __propDef.events;
|
|
41
|
+
export type TabAnchorSlots = typeof __propDef.slots;
|
|
42
|
+
export default class TabAnchor extends SvelteComponentTyped<TabAnchorProps, TabAnchorEvents, TabAnchorSlots> {
|
|
43
|
+
}
|
|
44
|
+
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';
|
|
@@ -47,6 +48,7 @@ export { default as Step } from './components/Stepper/Step.svelte';
|
|
|
47
48
|
export { default as Table } from './components/Table/Table.svelte';
|
|
48
49
|
export { default as TabGroup } from './components/Tab/TabGroup.svelte';
|
|
49
50
|
export { default as Tab } from './components/Tab/Tab.svelte';
|
|
51
|
+
export { default as TabAnchor } from './components/Tab/TabAnchor.svelte';
|
|
50
52
|
export { default as TableOfContents } from './components/TableOfContents/TableOfContents.svelte';
|
|
51
53
|
export { default as CodeBlock } from './utilities/CodeBlock/CodeBlock.svelte';
|
|
52
54
|
export { default as Modal } from './utilities/Modal/Modal.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';
|
|
@@ -56,6 +57,7 @@ export { default as Step } from './components/Stepper/Step.svelte';
|
|
|
56
57
|
export { default as Table } from './components/Table/Table.svelte';
|
|
57
58
|
export { default as TabGroup } from './components/Tab/TabGroup.svelte';
|
|
58
59
|
export { default as Tab } from './components/Tab/Tab.svelte';
|
|
60
|
+
export { default as TabAnchor } from './components/Tab/TabAnchor.svelte';
|
|
59
61
|
export { default as TableOfContents } from './components/TableOfContents/TableOfContents.svelte';
|
|
60
62
|
// Utility Components
|
|
61
63
|
export { default as CodeBlock } from './utilities/CodeBlock/CodeBlock.svelte';
|