@getmicdrop/svelte-components 2.3.0 → 2.4.0
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/Accordion/AccordionItem.svelte +13 -1
- package/dist/components/Accordion/AccordionItem.svelte.d.ts +4 -0
- package/dist/components/Accordion/AccordionItem.svelte.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.svelte +18 -6
- package/dist/components/Drawer/Drawer.svelte.d.ts +6 -0
- package/dist/components/Drawer/Drawer.svelte.d.ts.map +1 -1
- package/dist/components/Dropdown/Dropdown.svelte +129 -0
- package/dist/components/Dropdown/Dropdown.svelte.d.ts +48 -0
- package/dist/components/Dropdown/Dropdown.svelte.d.ts.map +1 -0
- package/dist/components/Dropdown/DropdownItem.svelte +111 -0
- package/dist/components/Dropdown/DropdownItem.svelte.d.ts +48 -0
- package/dist/components/Dropdown/DropdownItem.svelte.d.ts.map +1 -0
- package/dist/components/Input/Input.svelte.d.ts +2 -2
- package/dist/components/Input/MultiSelect.svelte +4 -5
- package/dist/components/Input/MultiSelect.svelte.d.ts +2 -2
- package/dist/components/Input/MultiSelect.svelte.d.ts.map +1 -1
- package/dist/components/Input/Search.svelte +173 -0
- package/dist/components/Input/Search.svelte.d.ts +68 -0
- package/dist/components/Input/Search.svelte.d.ts.map +1 -0
- package/dist/components/Input/Select.svelte +4 -5
- package/dist/components/Input/Select.svelte.d.ts +2 -2
- package/dist/components/Input/Select.svelte.d.ts.map +1 -1
- package/dist/components/Input/Textarea.svelte +160 -0
- package/dist/components/Input/Textarea.svelte.d.ts +69 -0
- package/dist/components/Input/Textarea.svelte.d.ts.map +1 -0
- package/dist/components/Label/Label.svelte +60 -0
- package/dist/components/Label/Label.svelte.d.ts +48 -0
- package/dist/components/Label/Label.svelte.d.ts.map +1 -0
- package/dist/components/Modal/InputModal.svelte +2 -1
- package/dist/components/Modal/InputModal.svelte.d.ts +2 -0
- package/dist/components/Modal/InputModal.svelte.d.ts.map +1 -1
- package/dist/components/Modal/Modal.svelte +3 -2
- package/dist/components/Modal/Modal.svelte.d.ts +2 -0
- package/dist/components/Modal/Modal.svelte.d.ts.map +1 -1
- package/dist/components/OrderSummary/OrderSummary.svelte +2 -2
- package/dist/components/OrderSummary/OrderSummary.svelte.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.svelte +27 -8
- package/dist/components/Pagination/Pagination.svelte.d.ts +16 -2
- package/dist/components/Pagination/Pagination.svelte.d.ts.map +1 -1
- package/dist/components/Radio/Radio.svelte +5 -2
- package/dist/components/Radio/Radio.svelte.d.ts +2 -0
- package/dist/components/Radio/Radio.svelte.d.ts.map +1 -1
- package/dist/components/Skeleton/Skeleton.svelte +11 -2
- package/dist/components/Skeleton/Skeleton.svelte.d.ts +2 -0
- package/dist/components/Skeleton/Skeleton.svelte.d.ts.map +1 -1
- package/dist/components/Tabs/TabItem.svelte +39 -0
- package/dist/components/Tabs/TabItem.svelte.d.ts +52 -0
- package/dist/components/Tabs/TabItem.svelte.d.ts.map +1 -0
- package/dist/components/Tabs/Tabs.svelte +181 -0
- package/dist/components/Tabs/Tabs.svelte.d.ts +46 -0
- package/dist/components/Tabs/Tabs.svelte.d.ts.map +1 -0
- package/dist/components/pages/performers/ShowItemCard.svelte.d.ts +2 -2
- package/dist/index.d.ts +7 -0
- package/dist/index.js +9 -0
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
export let isProcessing = false;
|
|
9
9
|
export let isSuccess = false;
|
|
10
10
|
export let size = "default"; // "default" | "small" | "large"
|
|
11
|
+
export let persistent = false; // When true, prevents closing by clicking backdrop or pressing Escape
|
|
11
12
|
|
|
12
13
|
const dispatch = createEventDispatcher();
|
|
13
14
|
|
|
@@ -16,7 +17,7 @@
|
|
|
16
17
|
|
|
17
18
|
// Handle escape key
|
|
18
19
|
function handleKeydown(event) {
|
|
19
|
-
if (event.key === "Escape" && show) {
|
|
20
|
+
if (event.key === "Escape" && show && !persistent) {
|
|
20
21
|
resetModal();
|
|
21
22
|
}
|
|
22
23
|
}
|
|
@@ -72,7 +73,7 @@
|
|
|
72
73
|
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
73
74
|
<div
|
|
74
75
|
class="modal-backdrop"
|
|
75
|
-
on:click={resetModal}
|
|
76
|
+
on:click={persistent ? null : resetModal}
|
|
76
77
|
transition:fade={{ duration: 300 }}
|
|
77
78
|
role="dialog"
|
|
78
79
|
aria-modal="true"
|
|
@@ -4,6 +4,7 @@ type Modal = SvelteComponent<{
|
|
|
4
4
|
show?: boolean | undefined;
|
|
5
5
|
isSuccess?: boolean | undefined;
|
|
6
6
|
isProcessing?: boolean | undefined;
|
|
7
|
+
persistent?: boolean | undefined;
|
|
7
8
|
}, {
|
|
8
9
|
click: PointerEvent;
|
|
9
10
|
cancel: CustomEvent<any>;
|
|
@@ -21,6 +22,7 @@ declare const Modal: $$__sveltets_2_IsomorphicComponent<{
|
|
|
21
22
|
show?: boolean | undefined;
|
|
22
23
|
isSuccess?: boolean | undefined;
|
|
23
24
|
isProcessing?: boolean | undefined;
|
|
25
|
+
persistent?: boolean | undefined;
|
|
24
26
|
}, {
|
|
25
27
|
click: PointerEvent;
|
|
26
28
|
cancel: CustomEvent<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Modal/Modal.svelte.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Modal.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Modal/Modal.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAmIA;;;;;;;;;;;;;;;eAAgL;6CAdnI,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,OAAO,OAAO,QAAQ;IAC3L,cAAc,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,WAAW,OAAO,SAAS,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,eAAe,QAAQ,CAAC"}
|
|
@@ -223,7 +223,7 @@
|
|
|
223
223
|
{#if loading}
|
|
224
224
|
<Spinner size="sm" color="white" />
|
|
225
225
|
{:else}
|
|
226
|
-
{btnText}
|
|
226
|
+
<span translate="no">{btnText}</span>
|
|
227
227
|
{/if}
|
|
228
228
|
</button>
|
|
229
229
|
</div>
|
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
{#if loading}
|
|
346
346
|
<Spinner size="sm" color="white" />
|
|
347
347
|
{:else}
|
|
348
|
-
Checkout
|
|
348
|
+
<span translate="no">Checkout</span>
|
|
349
349
|
{/if}
|
|
350
350
|
</button>
|
|
351
351
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrderSummary.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/OrderSummary/OrderSummary.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"OrderSummary.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/OrderSummary/OrderSummary.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAyVA;;;;;;;;;;;;;;;;;;;;;;;mBAA2S;6CAT9P,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,OAAO,OAAO,QAAQ;IAC3L,cAAc,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,WAAW,OAAO,SAAS,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,eAAe,QAAQ,CAAC"}
|
|
@@ -9,16 +9,27 @@
|
|
|
9
9
|
export let maxVisible = 5;
|
|
10
10
|
/** @type {boolean} Show previous/next buttons */
|
|
11
11
|
export let showPrevNext = true;
|
|
12
|
+
/** @type {boolean} Flowbite API: alias for showPrevNext */
|
|
13
|
+
export let showIcons = undefined;
|
|
14
|
+
/** @type {string} Flowbite API: previous button label */
|
|
15
|
+
export let previousLabel = undefined;
|
|
16
|
+
/** @type {string} Flowbite API: next button label */
|
|
17
|
+
export let nextLabel = undefined;
|
|
12
18
|
/** @type {string} Additional CSS classes */
|
|
13
19
|
let className = "";
|
|
14
20
|
export { className as class };
|
|
15
21
|
|
|
16
22
|
const dispatch = createEventDispatcher();
|
|
17
23
|
|
|
24
|
+
// Support flowbite's showIcons prop
|
|
25
|
+
$: effectiveShowPrevNext = showIcons !== undefined ? showIcons : showPrevNext;
|
|
26
|
+
|
|
18
27
|
function goToPage(page) {
|
|
19
28
|
if (page >= 1 && page <= totalPages && page !== currentPage) {
|
|
20
29
|
currentPage = page;
|
|
21
30
|
dispatch("change", { page });
|
|
31
|
+
// Also dispatch flowbite-style event
|
|
32
|
+
dispatch("pageChange", page);
|
|
22
33
|
}
|
|
23
34
|
}
|
|
24
35
|
|
|
@@ -53,7 +64,7 @@
|
|
|
53
64
|
</script>
|
|
54
65
|
|
|
55
66
|
<nav class="pagination {className}" aria-label="Pagination">
|
|
56
|
-
{#if
|
|
67
|
+
{#if effectiveShowPrevNext}
|
|
57
68
|
<button
|
|
58
69
|
type="button"
|
|
59
70
|
class="pagination__button pagination__button--prev"
|
|
@@ -61,9 +72,13 @@
|
|
|
61
72
|
on:click={previous}
|
|
62
73
|
aria-label="Previous page"
|
|
63
74
|
>
|
|
64
|
-
|
|
65
|
-
<
|
|
66
|
-
|
|
75
|
+
{#if $$slots.prev}
|
|
76
|
+
<slot name="prev" />
|
|
77
|
+
{:else}
|
|
78
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
79
|
+
<path d="M12.5 15L7.5 10L12.5 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
80
|
+
</svg>
|
|
81
|
+
{/if}
|
|
67
82
|
</button>
|
|
68
83
|
{/if}
|
|
69
84
|
|
|
@@ -103,7 +118,7 @@
|
|
|
103
118
|
{/if}
|
|
104
119
|
</div>
|
|
105
120
|
|
|
106
|
-
{#if
|
|
121
|
+
{#if effectiveShowPrevNext}
|
|
107
122
|
<button
|
|
108
123
|
type="button"
|
|
109
124
|
class="pagination__button pagination__button--next"
|
|
@@ -111,9 +126,13 @@
|
|
|
111
126
|
on:click={next}
|
|
112
127
|
aria-label="Next page"
|
|
113
128
|
>
|
|
114
|
-
|
|
115
|
-
<
|
|
116
|
-
|
|
129
|
+
{#if $$slots.next}
|
|
130
|
+
<slot name="next" />
|
|
131
|
+
{:else}
|
|
132
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
133
|
+
<path d="M7.5 5L12.5 10L7.5 15" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
134
|
+
</svg>
|
|
135
|
+
{/if}
|
|
117
136
|
</button>
|
|
118
137
|
{/if}
|
|
119
138
|
</nav>
|
|
@@ -5,11 +5,18 @@ type Pagination = SvelteComponent<{
|
|
|
5
5
|
totalPages?: number | undefined;
|
|
6
6
|
maxVisible?: number | undefined;
|
|
7
7
|
showPrevNext?: boolean | undefined;
|
|
8
|
+
showIcons?: boolean | undefined;
|
|
9
|
+
previousLabel?: string | undefined;
|
|
10
|
+
nextLabel?: string | undefined;
|
|
8
11
|
}, {
|
|
9
12
|
change: CustomEvent<any>;
|
|
13
|
+
pageChange: CustomEvent<any>;
|
|
10
14
|
} & {
|
|
11
15
|
[evt: string]: CustomEvent<any>;
|
|
12
|
-
}, {
|
|
16
|
+
}, {
|
|
17
|
+
prev: {};
|
|
18
|
+
next: {};
|
|
19
|
+
}> & {
|
|
13
20
|
$$bindings?: string | undefined;
|
|
14
21
|
};
|
|
15
22
|
declare const Pagination: $$__sveltets_2_IsomorphicComponent<{
|
|
@@ -18,11 +25,18 @@ declare const Pagination: $$__sveltets_2_IsomorphicComponent<{
|
|
|
18
25
|
totalPages?: number | undefined;
|
|
19
26
|
maxVisible?: number | undefined;
|
|
20
27
|
showPrevNext?: boolean | undefined;
|
|
28
|
+
showIcons?: boolean | undefined;
|
|
29
|
+
previousLabel?: string | undefined;
|
|
30
|
+
nextLabel?: string | undefined;
|
|
21
31
|
}, {
|
|
22
32
|
change: CustomEvent<any>;
|
|
33
|
+
pageChange: CustomEvent<any>;
|
|
23
34
|
} & {
|
|
24
35
|
[evt: string]: CustomEvent<any>;
|
|
25
|
-
}, {
|
|
36
|
+
}, {
|
|
37
|
+
prev: {};
|
|
38
|
+
next: {};
|
|
39
|
+
}, {}, string>;
|
|
26
40
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
27
41
|
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
28
42
|
$$bindings?: Bindings;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Pagination/Pagination.svelte.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Pagination.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Pagination/Pagination.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgJA;;;;;;;;;;;;;;;;;eAAsO;6CAdzL,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,OAAO,OAAO,QAAQ;IAC3L,cAAc,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,WAAW,OAAO,SAAS,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,eAAe,QAAQ,CAAC"}
|
|
@@ -9,13 +9,16 @@
|
|
|
9
9
|
export let name = "";
|
|
10
10
|
/** @type {boolean} Whether the radio is disabled */
|
|
11
11
|
export let disabled = false;
|
|
12
|
+
/** @type {boolean|undefined} Direct checked prop for flowbite API compatibility */
|
|
13
|
+
export let checked = undefined;
|
|
12
14
|
/** @type {string} Additional CSS classes */
|
|
13
15
|
let className = "";
|
|
14
16
|
export { className as class };
|
|
15
17
|
|
|
16
18
|
const dispatch = createEventDispatcher();
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
// Support both flowbite-style checked prop and group binding
|
|
21
|
+
$: isChecked = checked !== undefined ? checked : group === value;
|
|
19
22
|
|
|
20
23
|
function handleChange() {
|
|
21
24
|
group = value;
|
|
@@ -29,7 +32,7 @@
|
|
|
29
32
|
{name}
|
|
30
33
|
{value}
|
|
31
34
|
{disabled}
|
|
32
|
-
checked={
|
|
35
|
+
checked={isChecked}
|
|
33
36
|
on:change={handleChange}
|
|
34
37
|
class="radio__input"
|
|
35
38
|
/>
|
|
@@ -2,6 +2,7 @@ export default Radio;
|
|
|
2
2
|
type Radio = SvelteComponent<$$__sveltets_2_PropsWithChildren<{
|
|
3
3
|
class?: string | undefined;
|
|
4
4
|
disabled?: boolean | undefined;
|
|
5
|
+
checked?: boolean | undefined;
|
|
5
6
|
value?: string | undefined;
|
|
6
7
|
name?: string | undefined;
|
|
7
8
|
group?: string | undefined;
|
|
@@ -19,6 +20,7 @@ type Radio = SvelteComponent<$$__sveltets_2_PropsWithChildren<{
|
|
|
19
20
|
declare const Radio: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
21
|
class?: string | undefined;
|
|
21
22
|
disabled?: boolean | undefined;
|
|
23
|
+
checked?: boolean | undefined;
|
|
22
24
|
value?: string | undefined;
|
|
23
25
|
name?: string | undefined;
|
|
24
26
|
group?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Radio/Radio.svelte.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Radio.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Radio/Radio.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAqEA;;;cAhBW,OAAO,GAAC,SAAS;;;;;;;;;;;;eAgBkJ;sCATxI,KAAK,EAAE,KAAK;;;;;6CALL,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,OAAO,OAAO,QAAQ;IAC3L,cAAc,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,WAAW,OAAO,SAAS,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,eAAe,QAAQ,CAAC"}
|
|
@@ -10,12 +10,21 @@
|
|
|
10
10
|
/** @type {string} Additional CSS classes */
|
|
11
11
|
let className = "";
|
|
12
12
|
export { className as class };
|
|
13
|
+
/** @type {string} Flowbite-style divClass for Tailwind classes */
|
|
14
|
+
export let divClass = "";
|
|
15
|
+
|
|
16
|
+
// If divClass is provided, use it instead of explicit width/height
|
|
17
|
+
$: useFlowbiteStyle = divClass !== "";
|
|
18
|
+
$: computedStyle = useFlowbiteStyle ? "" : `width: ${width}; height: ${height};`;
|
|
19
|
+
$: computedClass = useFlowbiteStyle
|
|
20
|
+
? `skeleton skeleton--${variant} ${divClass} ${className}`.trim()
|
|
21
|
+
: `skeleton skeleton--${variant} ${className}`.trim();
|
|
13
22
|
</script>
|
|
14
23
|
|
|
15
24
|
<div
|
|
16
|
-
class=
|
|
25
|
+
class={computedClass}
|
|
17
26
|
class:skeleton--animated={animation}
|
|
18
|
-
style=
|
|
27
|
+
style={computedStyle}
|
|
19
28
|
aria-hidden="true"
|
|
20
29
|
></div>
|
|
21
30
|
|
|
@@ -5,6 +5,7 @@ type Skeleton = SvelteComponent<{
|
|
|
5
5
|
width?: string | undefined;
|
|
6
6
|
height?: string | undefined;
|
|
7
7
|
animation?: boolean | undefined;
|
|
8
|
+
divClass?: string | undefined;
|
|
8
9
|
}, {
|
|
9
10
|
[evt: string]: CustomEvent<any>;
|
|
10
11
|
}, {}> & {
|
|
@@ -16,6 +17,7 @@ declare const Skeleton: $$__sveltets_2_IsomorphicComponent<{
|
|
|
16
17
|
width?: string | undefined;
|
|
17
18
|
height?: string | undefined;
|
|
18
19
|
animation?: boolean | undefined;
|
|
20
|
+
divClass?: string | undefined;
|
|
19
21
|
}, {
|
|
20
22
|
[evt: string]: CustomEvent<any>;
|
|
21
23
|
}, {}, {}, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Skeleton.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Skeleton/Skeleton.svelte.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Skeleton.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Skeleton/Skeleton.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;AA+CA;;;;;;;;;mBAAiL;6CATpI,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,OAAO,OAAO,QAAQ;IAC3L,cAAc,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,WAAW,OAAO,SAAS,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { getContext, onMount, createEventDispatcher } from "svelte";
|
|
3
|
+
|
|
4
|
+
/** @type {string} Tab title displayed in the tab button */
|
|
5
|
+
export let title = "";
|
|
6
|
+
/** @type {boolean} Whether this tab is initially open/active (flowbite API) */
|
|
7
|
+
export let open = false;
|
|
8
|
+
/** @type {string|number|undefined} Unique identifier for this tab */
|
|
9
|
+
export let value = undefined;
|
|
10
|
+
/** @type {boolean} Whether the tab is disabled */
|
|
11
|
+
export let disabled = false;
|
|
12
|
+
/** @type {string} Additional CSS classes for the tab button */
|
|
13
|
+
let className = "";
|
|
14
|
+
export { className as class };
|
|
15
|
+
|
|
16
|
+
const dispatch = createEventDispatcher();
|
|
17
|
+
const { activeTab, registerTab } = getContext("tabs");
|
|
18
|
+
|
|
19
|
+
// Generate unique ID
|
|
20
|
+
let tabId = value || `tab-${Math.random().toString(36).substring(2, 9)}`;
|
|
21
|
+
|
|
22
|
+
onMount(() => {
|
|
23
|
+
registerTab(tabId, title, open);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
$: isActive = $activeTab === tabId;
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
{#if isActive}
|
|
30
|
+
<div class="tab-panel" role="tabpanel" on:click={() => dispatch("click")}>
|
|
31
|
+
<slot />
|
|
32
|
+
</div>
|
|
33
|
+
{/if}
|
|
34
|
+
|
|
35
|
+
<style>
|
|
36
|
+
.tab-panel {
|
|
37
|
+
/* Content panel styling can be customized via contentClass on Tabs */
|
|
38
|
+
}
|
|
39
|
+
</style>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export default TabItem;
|
|
2
|
+
type TabItem = SvelteComponent<$$__sveltets_2_PropsWithChildren<{
|
|
3
|
+
class?: string | undefined;
|
|
4
|
+
open?: boolean | undefined;
|
|
5
|
+
title?: string | undefined;
|
|
6
|
+
disabled?: boolean | undefined;
|
|
7
|
+
value?: string | number | undefined;
|
|
8
|
+
}, {
|
|
9
|
+
default: {};
|
|
10
|
+
}>, {
|
|
11
|
+
click: CustomEvent<any>;
|
|
12
|
+
} & {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
}, {
|
|
15
|
+
default: {};
|
|
16
|
+
}> & {
|
|
17
|
+
$$bindings?: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
declare const TabItem: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
|
+
class?: string | undefined;
|
|
21
|
+
open?: boolean | undefined;
|
|
22
|
+
title?: string | undefined;
|
|
23
|
+
disabled?: boolean | undefined;
|
|
24
|
+
value?: string | number | undefined;
|
|
25
|
+
}, {
|
|
26
|
+
default: {};
|
|
27
|
+
}>, {
|
|
28
|
+
click: CustomEvent<any>;
|
|
29
|
+
} & {
|
|
30
|
+
[evt: string]: CustomEvent<any>;
|
|
31
|
+
}, {
|
|
32
|
+
default: {};
|
|
33
|
+
}, {}, string>;
|
|
34
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
35
|
+
default: any;
|
|
36
|
+
} ? Props extends Record<string, never> ? any : {
|
|
37
|
+
children?: any;
|
|
38
|
+
} : {});
|
|
39
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
40
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
41
|
+
$$bindings?: Bindings;
|
|
42
|
+
} & Exports;
|
|
43
|
+
(internal: unknown, props: Props & {
|
|
44
|
+
$$events?: Events;
|
|
45
|
+
$$slots?: Slots;
|
|
46
|
+
}): Exports & {
|
|
47
|
+
$set?: any;
|
|
48
|
+
$on?: any;
|
|
49
|
+
};
|
|
50
|
+
z_$$bindings?: Bindings;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=TabItem.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabItem.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Tabs/TabItem.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA8DA;;;;;YAjBW,MAAM,GAAC,MAAM,GAAC,SAAS;;;;;;;;;eAiBoI;sCAThI,KAAK,EAAE,KAAK;;;;;6CALL,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,OAAO,OAAO,QAAQ;IAC3L,cAAc,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,WAAW,OAAO,SAAS,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { setContext, onMount } from "svelte";
|
|
3
|
+
import { writable } from "svelte/store";
|
|
4
|
+
|
|
5
|
+
/** @type {'underline' | 'pill' | 'full'} Tab style variant */
|
|
6
|
+
export let tabStyle = "underline";
|
|
7
|
+
/** @type {string} CSS classes for the content area (flowbite API) */
|
|
8
|
+
export let contentClass = "";
|
|
9
|
+
/** @type {string|number|undefined} Currently active tab value (bindable) */
|
|
10
|
+
export let activeTabValue = undefined;
|
|
11
|
+
/** @type {string} Additional CSS classes */
|
|
12
|
+
let className = "";
|
|
13
|
+
export { className as class };
|
|
14
|
+
|
|
15
|
+
// Create a store for the active tab
|
|
16
|
+
const activeTab = writable(activeTabValue);
|
|
17
|
+
const tabItems = writable([]);
|
|
18
|
+
|
|
19
|
+
// Keep activeTabValue in sync with store
|
|
20
|
+
$: if (activeTabValue !== undefined) {
|
|
21
|
+
activeTab.set(activeTabValue);
|
|
22
|
+
}
|
|
23
|
+
$: activeTabValue = $activeTab;
|
|
24
|
+
|
|
25
|
+
// Provide context to TabItem children
|
|
26
|
+
setContext("tabs", {
|
|
27
|
+
activeTab,
|
|
28
|
+
tabItems,
|
|
29
|
+
tabStyle,
|
|
30
|
+
registerTab: (id, title, open) => {
|
|
31
|
+
tabItems.update(items => {
|
|
32
|
+
// Avoid duplicates
|
|
33
|
+
if (items.find(item => item.id === id)) return items;
|
|
34
|
+
return [...items, { id, title }];
|
|
35
|
+
});
|
|
36
|
+
// If this tab has open prop and no active tab set, make it active
|
|
37
|
+
if (open && $activeTab === undefined) {
|
|
38
|
+
activeTab.set(id);
|
|
39
|
+
}
|
|
40
|
+
return id;
|
|
41
|
+
},
|
|
42
|
+
setActiveTab: (id) => {
|
|
43
|
+
activeTab.set(id);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// Ensure first tab is selected if none selected
|
|
48
|
+
$: if ($tabItems.length > 0 && $activeTab === undefined) {
|
|
49
|
+
activeTab.set($tabItems[0].id);
|
|
50
|
+
}
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<div class="tabs tabs--{tabStyle} {className}">
|
|
54
|
+
<div class="tabs__list" role="tablist">
|
|
55
|
+
{#each $tabItems as tab (tab.id)}
|
|
56
|
+
<button
|
|
57
|
+
type="button"
|
|
58
|
+
role="tab"
|
|
59
|
+
class="tabs__tab"
|
|
60
|
+
class:tabs__tab--active={$activeTab === tab.id}
|
|
61
|
+
aria-selected={$activeTab === tab.id}
|
|
62
|
+
tabindex={$activeTab === tab.id ? 0 : -1}
|
|
63
|
+
on:click={() => activeTab.set(tab.id)}
|
|
64
|
+
>
|
|
65
|
+
{tab.title}
|
|
66
|
+
</button>
|
|
67
|
+
{/each}
|
|
68
|
+
</div>
|
|
69
|
+
<div class="tabs__content {contentClass}">
|
|
70
|
+
<slot />
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<style>
|
|
75
|
+
.tabs {
|
|
76
|
+
display: flex;
|
|
77
|
+
flex-direction: column;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.tabs__list {
|
|
81
|
+
display: flex;
|
|
82
|
+
gap: 0;
|
|
83
|
+
border-bottom: 1px solid hsl(var(--Stroke-Primary, 220 13% 85%));
|
|
84
|
+
overflow-x: auto;
|
|
85
|
+
-webkit-overflow-scrolling: touch;
|
|
86
|
+
scrollbar-width: none;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.tabs__list::-webkit-scrollbar {
|
|
90
|
+
display: none;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.tabs--pill .tabs__list {
|
|
94
|
+
border-bottom: none;
|
|
95
|
+
gap: 0.5rem;
|
|
96
|
+
background-color: hsl(var(--BG-Secondary, 220 14% 96%));
|
|
97
|
+
padding: 0.25rem;
|
|
98
|
+
border-radius: 0.5rem;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.tabs--full .tabs__list {
|
|
102
|
+
border-bottom: none;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.tabs__tab {
|
|
106
|
+
padding: 0.75rem 1rem;
|
|
107
|
+
font-size: 0.875rem;
|
|
108
|
+
font-weight: 500;
|
|
109
|
+
color: hsl(var(--Text-Secondary, 220 9% 46%));
|
|
110
|
+
background: transparent;
|
|
111
|
+
border: none;
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
position: relative;
|
|
114
|
+
transition: all 0.15s ease;
|
|
115
|
+
white-space: nowrap;
|
|
116
|
+
flex-shrink: 0;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.tabs__tab:hover {
|
|
120
|
+
color: hsl(var(--Text-Primary, 220 13% 13%));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.tabs__tab--active {
|
|
124
|
+
color: hsl(var(--Brand-Primary, 221 83% 53%));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* Underline style (default) */
|
|
128
|
+
.tabs--underline .tabs__tab--active::after {
|
|
129
|
+
content: "";
|
|
130
|
+
position: absolute;
|
|
131
|
+
bottom: -1px;
|
|
132
|
+
left: 0;
|
|
133
|
+
right: 0;
|
|
134
|
+
height: 2px;
|
|
135
|
+
background-color: hsl(var(--Brand-Primary, 221 83% 53%));
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/* Pill style */
|
|
139
|
+
.tabs--pill .tabs__tab {
|
|
140
|
+
border-radius: 0.375rem;
|
|
141
|
+
padding: 0.5rem 0.75rem;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.tabs--pill .tabs__tab--active {
|
|
145
|
+
background-color: hsl(var(--BG-Primary, 0 0% 100%));
|
|
146
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.tabs--pill .tabs__tab--active::after {
|
|
150
|
+
display: none;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.tabs__content {
|
|
154
|
+
padding-top: 1rem;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* Dark mode */
|
|
158
|
+
:global(.dark) .tabs__list {
|
|
159
|
+
border-bottom-color: hsl(var(--Stroke-Primary, 220 13% 30%));
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
:global(.dark) .tabs__tab {
|
|
163
|
+
color: hsl(var(--Text-Secondary, 220 9% 70%));
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
:global(.dark) .tabs__tab:hover {
|
|
167
|
+
color: hsl(var(--Text-Primary, 0 0% 95%));
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
:global(.dark) .tabs__tab--active {
|
|
171
|
+
color: hsl(var(--Brand-Primary, 221 83% 60%));
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
:global(.dark) .tabs--pill .tabs__list {
|
|
175
|
+
background-color: hsl(var(--BG-Secondary, 220 13% 20%));
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
:global(.dark) .tabs--pill .tabs__tab--active {
|
|
179
|
+
background-color: hsl(var(--BG-Primary, 220 13% 15%));
|
|
180
|
+
}
|
|
181
|
+
</style>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export default Tabs;
|
|
2
|
+
type Tabs = SvelteComponent<$$__sveltets_2_PropsWithChildren<{
|
|
3
|
+
class?: string | undefined;
|
|
4
|
+
tabStyle?: "full" | "underline" | "pill" | undefined;
|
|
5
|
+
contentClass?: string | undefined;
|
|
6
|
+
activeTabValue?: string | number | undefined;
|
|
7
|
+
}, {
|
|
8
|
+
default: {};
|
|
9
|
+
}>, {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
}, {
|
|
12
|
+
default: {};
|
|
13
|
+
}> & {
|
|
14
|
+
$$bindings?: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
declare const Tabs: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
17
|
+
class?: string | undefined;
|
|
18
|
+
tabStyle?: "full" | "underline" | "pill" | undefined;
|
|
19
|
+
contentClass?: string | undefined;
|
|
20
|
+
activeTabValue?: string | number | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
default: {};
|
|
23
|
+
}>, {
|
|
24
|
+
[evt: string]: CustomEvent<any>;
|
|
25
|
+
}, {
|
|
26
|
+
default: {};
|
|
27
|
+
}, {}, string>;
|
|
28
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
29
|
+
default: any;
|
|
30
|
+
} ? Props extends Record<string, never> ? any : {
|
|
31
|
+
children?: any;
|
|
32
|
+
} : {});
|
|
33
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
34
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
35
|
+
$$bindings?: Bindings;
|
|
36
|
+
} & Exports;
|
|
37
|
+
(internal: unknown, props: Props & {
|
|
38
|
+
$$events?: Events;
|
|
39
|
+
$$slots?: Slots;
|
|
40
|
+
}): Exports & {
|
|
41
|
+
$set?: any;
|
|
42
|
+
$on?: any;
|
|
43
|
+
};
|
|
44
|
+
z_$$bindings?: Bindings;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=Tabs.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Tabs/Tabs.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;AA6FA;;;;qBAhBW,MAAM,GAAC,MAAM,GAAC,SAAS;;;;;;;eAgB0I;sCATtI,KAAK,EAAE,KAAK;;;;;6CALL,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,OAAO,OAAO,QAAQ;IAC3L,cAAc,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,WAAW,OAAO,SAAS,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,eAAe,QAAQ,CAAC"}
|
|
@@ -3,8 +3,8 @@ type ShowItemCard = SvelteComponent<{
|
|
|
3
3
|
title: any;
|
|
4
4
|
details: any;
|
|
5
5
|
image: any;
|
|
6
|
-
status: any;
|
|
7
6
|
id: any;
|
|
7
|
+
status: any;
|
|
8
8
|
location: any;
|
|
9
9
|
role: any;
|
|
10
10
|
startDateTime: any;
|
|
@@ -24,8 +24,8 @@ declare const ShowItemCard: $$__sveltets_2_IsomorphicComponent<{
|
|
|
24
24
|
title: any;
|
|
25
25
|
details: any;
|
|
26
26
|
image: any;
|
|
27
|
-
status: any;
|
|
28
27
|
id: any;
|
|
28
|
+
status: any;
|
|
29
29
|
location: any;
|
|
30
30
|
role: any;
|
|
31
31
|
startDateTime: any;
|