@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
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { createEventDispatcher } from "svelte";
|
|
3
|
+
|
|
4
|
+
const dispatch = createEventDispatcher();
|
|
5
|
+
|
|
6
|
+
// API compatible with flowbite-svelte Search
|
|
7
|
+
export let value = "";
|
|
8
|
+
export let placeholder = "Search";
|
|
9
|
+
export let size = "lg"; // sm, md, lg
|
|
10
|
+
export let disabled = false;
|
|
11
|
+
export let id = "";
|
|
12
|
+
export let name = "";
|
|
13
|
+
|
|
14
|
+
// Additional props
|
|
15
|
+
let className = "";
|
|
16
|
+
export { className as class };
|
|
17
|
+
|
|
18
|
+
const sizes = {
|
|
19
|
+
sm: { icon: "w-3.5 h-3.5", input: "h-8 text-xs pl-8", wrapper: "h-8" },
|
|
20
|
+
md: { icon: "w-4 h-4", input: "h-10 text-sm pl-9", wrapper: "h-10" },
|
|
21
|
+
lg: { icon: "w-5 h-5", input: "h-11 text-sm pl-10", wrapper: "h-11" }
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
$: sizeConfig = sizes[size] || sizes.lg;
|
|
25
|
+
|
|
26
|
+
function handleInput(event) {
|
|
27
|
+
value = event.target.value;
|
|
28
|
+
dispatch("input", event);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function handleChange(event) {
|
|
32
|
+
dispatch("change", event);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function handleKeydown(event) {
|
|
36
|
+
dispatch("keydown", event);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function handleKeyup(event) {
|
|
40
|
+
dispatch("keyup", event);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function handleFocus(event) {
|
|
44
|
+
dispatch("focus", event);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function handleBlur(event) {
|
|
48
|
+
dispatch("blur", event);
|
|
49
|
+
}
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<div class="search-wrapper {sizeConfig.wrapper} {className}">
|
|
53
|
+
<div class="search-icon-wrapper">
|
|
54
|
+
<svg
|
|
55
|
+
class="search-icon {sizeConfig.icon}"
|
|
56
|
+
fill="currentColor"
|
|
57
|
+
viewBox="0 0 20 20"
|
|
58
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
59
|
+
>
|
|
60
|
+
<path
|
|
61
|
+
fill-rule="evenodd"
|
|
62
|
+
d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z"
|
|
63
|
+
clip-rule="evenodd"
|
|
64
|
+
/>
|
|
65
|
+
</svg>
|
|
66
|
+
</div>
|
|
67
|
+
<input
|
|
68
|
+
type="search"
|
|
69
|
+
{id}
|
|
70
|
+
{name}
|
|
71
|
+
{placeholder}
|
|
72
|
+
{disabled}
|
|
73
|
+
class="search-input {sizeConfig.input}"
|
|
74
|
+
bind:value
|
|
75
|
+
on:input={handleInput}
|
|
76
|
+
on:change={handleChange}
|
|
77
|
+
on:keydown={handleKeydown}
|
|
78
|
+
on:keyup={handleKeyup}
|
|
79
|
+
on:focus={handleFocus}
|
|
80
|
+
on:blur={handleBlur}
|
|
81
|
+
{...$$restProps}
|
|
82
|
+
/>
|
|
83
|
+
{#if $$slots.default}
|
|
84
|
+
<div class="search-actions">
|
|
85
|
+
<slot />
|
|
86
|
+
</div>
|
|
87
|
+
{/if}
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
<style>
|
|
91
|
+
.search-wrapper {
|
|
92
|
+
--search-bg: #f9fafb;
|
|
93
|
+
--search-text: #0d1526;
|
|
94
|
+
--search-text-placeholder: #6b7280;
|
|
95
|
+
--search-border: #e5e7eb;
|
|
96
|
+
--search-focus-ring: #3b82f6;
|
|
97
|
+
--search-icon-color: #6b7280;
|
|
98
|
+
position: relative;
|
|
99
|
+
width: 100%;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.search-icon-wrapper {
|
|
103
|
+
position: absolute;
|
|
104
|
+
inset-y: 0;
|
|
105
|
+
left: 0;
|
|
106
|
+
display: flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
padding-left: 0.75rem;
|
|
109
|
+
pointer-events: none;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.search-icon {
|
|
113
|
+
color: var(--search-icon-color);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.search-input {
|
|
117
|
+
width: 100%;
|
|
118
|
+
padding-right: 0.75rem;
|
|
119
|
+
background-color: var(--search-bg);
|
|
120
|
+
color: var(--search-text);
|
|
121
|
+
font-weight: 500;
|
|
122
|
+
border: 1px solid var(--search-border);
|
|
123
|
+
border-radius: 0.5rem;
|
|
124
|
+
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.search-input:focus {
|
|
128
|
+
outline: none;
|
|
129
|
+
box-shadow: 0 0 0 2px var(--search-focus-ring);
|
|
130
|
+
border-color: var(--search-focus-ring);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.search-input:hover:not(:focus):not(:disabled) {
|
|
134
|
+
border-color: var(--search-focus-ring);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.search-input:disabled {
|
|
138
|
+
opacity: 0.5;
|
|
139
|
+
cursor: not-allowed;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.search-input::-moz-placeholder {
|
|
143
|
+
color: var(--search-text-placeholder);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.search-input::placeholder {
|
|
147
|
+
color: var(--search-text-placeholder);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/* Hide browser's default clear button on search inputs */
|
|
151
|
+
.search-input::-webkit-search-cancel-button {
|
|
152
|
+
-webkit-appearance: none;
|
|
153
|
+
appearance: none;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.search-actions {
|
|
157
|
+
position: absolute;
|
|
158
|
+
inset-y: 0;
|
|
159
|
+
right: 0;
|
|
160
|
+
display: flex;
|
|
161
|
+
align-items: center;
|
|
162
|
+
color: var(--search-icon-color);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* Dark mode overrides */
|
|
166
|
+
:global(.dark) .search-wrapper {
|
|
167
|
+
--search-bg: #111827;
|
|
168
|
+
--search-text: #f7f7f8;
|
|
169
|
+
--search-text-placeholder: #9ca3af;
|
|
170
|
+
--search-border: #374151;
|
|
171
|
+
--search-icon-color: #9ca3af;
|
|
172
|
+
}
|
|
173
|
+
</style>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export default Search;
|
|
2
|
+
type Search = SvelteComponent<$$__sveltets_2_PropsWithChildren<{
|
|
3
|
+
[x: string]: any;
|
|
4
|
+
class?: string | undefined;
|
|
5
|
+
size?: string | undefined;
|
|
6
|
+
disabled?: boolean | undefined;
|
|
7
|
+
value?: string | undefined;
|
|
8
|
+
name?: string | undefined;
|
|
9
|
+
id?: string | undefined;
|
|
10
|
+
placeholder?: string | undefined;
|
|
11
|
+
}, {
|
|
12
|
+
default: {};
|
|
13
|
+
}>, {
|
|
14
|
+
input: CustomEvent<any>;
|
|
15
|
+
change: CustomEvent<any>;
|
|
16
|
+
keydown: CustomEvent<any>;
|
|
17
|
+
keyup: CustomEvent<any>;
|
|
18
|
+
focus: CustomEvent<any>;
|
|
19
|
+
blur: CustomEvent<any>;
|
|
20
|
+
} & {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
}, {
|
|
23
|
+
default: {};
|
|
24
|
+
}> & {
|
|
25
|
+
$$bindings?: string | undefined;
|
|
26
|
+
};
|
|
27
|
+
declare const Search: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
28
|
+
[x: string]: any;
|
|
29
|
+
class?: string | undefined;
|
|
30
|
+
size?: string | undefined;
|
|
31
|
+
disabled?: boolean | undefined;
|
|
32
|
+
value?: string | undefined;
|
|
33
|
+
name?: string | undefined;
|
|
34
|
+
id?: string | undefined;
|
|
35
|
+
placeholder?: string | undefined;
|
|
36
|
+
}, {
|
|
37
|
+
default: {};
|
|
38
|
+
}>, {
|
|
39
|
+
input: CustomEvent<any>;
|
|
40
|
+
change: CustomEvent<any>;
|
|
41
|
+
keydown: CustomEvent<any>;
|
|
42
|
+
keyup: CustomEvent<any>;
|
|
43
|
+
focus: CustomEvent<any>;
|
|
44
|
+
blur: CustomEvent<any>;
|
|
45
|
+
} & {
|
|
46
|
+
[evt: string]: CustomEvent<any>;
|
|
47
|
+
}, {
|
|
48
|
+
default: {};
|
|
49
|
+
}, {}, string>;
|
|
50
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
51
|
+
default: any;
|
|
52
|
+
} ? Props extends Record<string, never> ? any : {
|
|
53
|
+
children?: any;
|
|
54
|
+
} : {});
|
|
55
|
+
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> {
|
|
56
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
57
|
+
$$bindings?: Bindings;
|
|
58
|
+
} & Exports;
|
|
59
|
+
(internal: unknown, props: Props & {
|
|
60
|
+
$$events?: Events;
|
|
61
|
+
$$slots?: Slots;
|
|
62
|
+
}): Exports & {
|
|
63
|
+
$set?: any;
|
|
64
|
+
$on?: any;
|
|
65
|
+
};
|
|
66
|
+
z_$$bindings?: Bindings;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=Search.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Search.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Input/Search.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAwFA;;;;;;;;;;;;;;;;;;;;;;eAAgM;sCAT1J,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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import { createEventDispatcher, onMount
|
|
2
|
+
import { createEventDispatcher, onMount } from "svelte";
|
|
3
3
|
|
|
4
4
|
const dispatch = createEventDispatcher();
|
|
5
5
|
|
|
@@ -96,10 +96,9 @@
|
|
|
96
96
|
|
|
97
97
|
onMount(() => {
|
|
98
98
|
document.addEventListener("click", handleClickOutside);
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
document.removeEventListener("click", handleClickOutside);
|
|
99
|
+
return () => {
|
|
100
|
+
document.removeEventListener("click", handleClickOutside);
|
|
101
|
+
};
|
|
103
102
|
});
|
|
104
103
|
</script>
|
|
105
104
|
|
|
@@ -5,9 +5,9 @@ type Select = SvelteComponent<{
|
|
|
5
5
|
value?: string | undefined;
|
|
6
6
|
name?: string | undefined;
|
|
7
7
|
label?: string | undefined;
|
|
8
|
+
id?: string | undefined;
|
|
8
9
|
required?: boolean | undefined;
|
|
9
10
|
placeholder?: string | undefined;
|
|
10
|
-
id?: string | undefined;
|
|
11
11
|
animateFocus?: boolean | undefined;
|
|
12
12
|
items?: any[] | undefined;
|
|
13
13
|
}, {
|
|
@@ -23,9 +23,9 @@ declare const Select: $$__sveltets_2_IsomorphicComponent<{
|
|
|
23
23
|
value?: string | undefined;
|
|
24
24
|
name?: string | undefined;
|
|
25
25
|
label?: string | undefined;
|
|
26
|
+
id?: string | undefined;
|
|
26
27
|
required?: boolean | undefined;
|
|
27
28
|
placeholder?: string | undefined;
|
|
28
|
-
id?: string | undefined;
|
|
29
29
|
animateFocus?: boolean | undefined;
|
|
30
30
|
items?: any[] | undefined;
|
|
31
31
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Input/Select.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Select.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Input/Select.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAoKA;;;;;;;;;;;;;;;mBAAoN;6CATvK,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,160 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { createEventDispatcher } from "svelte";
|
|
3
|
+
|
|
4
|
+
const dispatch = createEventDispatcher();
|
|
5
|
+
|
|
6
|
+
// API compatible with flowbite-svelte Textarea
|
|
7
|
+
export let value = "";
|
|
8
|
+
export let placeholder = "";
|
|
9
|
+
export let rows = 4;
|
|
10
|
+
export let disabled = false;
|
|
11
|
+
export let required = false;
|
|
12
|
+
export let readonly = false;
|
|
13
|
+
export let id = "";
|
|
14
|
+
export let name = "";
|
|
15
|
+
export let label = "";
|
|
16
|
+
export let error = "";
|
|
17
|
+
export let maxlength = null;
|
|
18
|
+
export let minlength = null;
|
|
19
|
+
|
|
20
|
+
// Additional props
|
|
21
|
+
let className = "";
|
|
22
|
+
export { className as class };
|
|
23
|
+
|
|
24
|
+
function handleInput(event) {
|
|
25
|
+
value = event.target.value;
|
|
26
|
+
dispatch("input", { value });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function handleChange(event) {
|
|
30
|
+
dispatch("change", { value: event.target.value });
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function handleBlur(event) {
|
|
34
|
+
dispatch("blur", event);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function handleFocus(event) {
|
|
38
|
+
dispatch("focus", event);
|
|
39
|
+
}
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<div class="textarea-wrapper">
|
|
43
|
+
{#if label}
|
|
44
|
+
<label for={id || name} class="textarea-label">
|
|
45
|
+
{label}{#if required}<span class="textarea-required">*</span>{/if}
|
|
46
|
+
</label>
|
|
47
|
+
{/if}
|
|
48
|
+
|
|
49
|
+
<textarea
|
|
50
|
+
{id}
|
|
51
|
+
{name}
|
|
52
|
+
{placeholder}
|
|
53
|
+
{rows}
|
|
54
|
+
{disabled}
|
|
55
|
+
{readonly}
|
|
56
|
+
{maxlength}
|
|
57
|
+
{minlength}
|
|
58
|
+
class="textarea-field {error ? 'textarea-error' : ''} {className}"
|
|
59
|
+
bind:value
|
|
60
|
+
on:input={handleInput}
|
|
61
|
+
on:change={handleChange}
|
|
62
|
+
on:blur={handleBlur}
|
|
63
|
+
on:focus={handleFocus}
|
|
64
|
+
on:keydown
|
|
65
|
+
on:keyup
|
|
66
|
+
on:keypress
|
|
67
|
+
aria-required={required}
|
|
68
|
+
aria-invalid={!!error}
|
|
69
|
+
{...$$restProps}
|
|
70
|
+
></textarea>
|
|
71
|
+
|
|
72
|
+
{#if error}
|
|
73
|
+
<p class="textarea-error-text">{error}</p>
|
|
74
|
+
{/if}
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<style>
|
|
78
|
+
.textarea-wrapper {
|
|
79
|
+
--textarea-bg: #f9fafb;
|
|
80
|
+
--textarea-text: #0d1526;
|
|
81
|
+
--textarea-text-placeholder: #6b7280;
|
|
82
|
+
--textarea-border: #e5e7eb;
|
|
83
|
+
--textarea-border-error: #ff6666;
|
|
84
|
+
--textarea-focus-ring: #3b82f6;
|
|
85
|
+
--textarea-label-text: #0d1526;
|
|
86
|
+
width: 100%;
|
|
87
|
+
display: flex;
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
gap: 0.5rem;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.textarea-label {
|
|
93
|
+
color: var(--textarea-label-text);
|
|
94
|
+
font-size: 0.875rem;
|
|
95
|
+
font-weight: 500;
|
|
96
|
+
line-height: 1.25;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.textarea-required {
|
|
100
|
+
color: var(--textarea-border-error);
|
|
101
|
+
font-weight: 500;
|
|
102
|
+
font-size: 0.875rem;
|
|
103
|
+
margin-left: 0.125rem;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.textarea-field {
|
|
107
|
+
width: 100%;
|
|
108
|
+
padding: 0.625rem 0.75rem;
|
|
109
|
+
background-color: var(--textarea-bg);
|
|
110
|
+
color: var(--textarea-text);
|
|
111
|
+
font-size: 0.875rem;
|
|
112
|
+
line-height: 1.5;
|
|
113
|
+
border: 1px solid var(--textarea-border);
|
|
114
|
+
border-radius: 0.5rem;
|
|
115
|
+
resize: vertical;
|
|
116
|
+
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.textarea-field:focus {
|
|
120
|
+
outline: none;
|
|
121
|
+
box-shadow: 0 0 0 2px var(--textarea-focus-ring);
|
|
122
|
+
border-color: var(--textarea-focus-ring);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.textarea-field:hover:not(:focus):not(:disabled) {
|
|
126
|
+
border-color: var(--textarea-focus-ring);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.textarea-field:disabled {
|
|
130
|
+
opacity: 0.5;
|
|
131
|
+
cursor: not-allowed;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.textarea-field::-moz-placeholder {
|
|
135
|
+
color: var(--textarea-text-placeholder);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.textarea-field::placeholder {
|
|
139
|
+
color: var(--textarea-text-placeholder);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.textarea-field.textarea-error {
|
|
143
|
+
border-color: var(--textarea-border-error);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.textarea-error-text {
|
|
147
|
+
margin: 0;
|
|
148
|
+
color: var(--textarea-border-error);
|
|
149
|
+
font-size: 0.875rem;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/* Dark mode overrides */
|
|
153
|
+
:global(.dark) .textarea-wrapper {
|
|
154
|
+
--textarea-bg: #111827;
|
|
155
|
+
--textarea-text: #f7f7f8;
|
|
156
|
+
--textarea-text-placeholder: #9ca3af;
|
|
157
|
+
--textarea-border: #374151;
|
|
158
|
+
--textarea-label-text: #f7f7f8;
|
|
159
|
+
}
|
|
160
|
+
</style>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export default Textarea;
|
|
2
|
+
type Textarea = SvelteComponent<{
|
|
3
|
+
[x: string]: any;
|
|
4
|
+
class?: string | undefined;
|
|
5
|
+
error?: string | undefined;
|
|
6
|
+
disabled?: boolean | undefined;
|
|
7
|
+
value?: string | undefined;
|
|
8
|
+
name?: string | undefined;
|
|
9
|
+
label?: string | undefined;
|
|
10
|
+
id?: string | undefined;
|
|
11
|
+
required?: boolean | undefined;
|
|
12
|
+
maxlength?: null | undefined;
|
|
13
|
+
minlength?: null | undefined;
|
|
14
|
+
placeholder?: string | undefined;
|
|
15
|
+
readonly?: boolean | undefined;
|
|
16
|
+
rows?: number | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
keydown: KeyboardEvent;
|
|
19
|
+
keyup: KeyboardEvent;
|
|
20
|
+
keypress: KeyboardEvent;
|
|
21
|
+
input: CustomEvent<any>;
|
|
22
|
+
change: CustomEvent<any>;
|
|
23
|
+
blur: CustomEvent<any>;
|
|
24
|
+
focus: CustomEvent<any>;
|
|
25
|
+
} & {
|
|
26
|
+
[evt: string]: CustomEvent<any>;
|
|
27
|
+
}, {}> & {
|
|
28
|
+
$$bindings?: string | undefined;
|
|
29
|
+
};
|
|
30
|
+
declare const Textarea: $$__sveltets_2_IsomorphicComponent<{
|
|
31
|
+
[x: string]: any;
|
|
32
|
+
class?: string | undefined;
|
|
33
|
+
error?: string | undefined;
|
|
34
|
+
disabled?: boolean | undefined;
|
|
35
|
+
value?: string | undefined;
|
|
36
|
+
name?: string | undefined;
|
|
37
|
+
label?: string | undefined;
|
|
38
|
+
id?: string | undefined;
|
|
39
|
+
required?: boolean | undefined;
|
|
40
|
+
maxlength?: null | undefined;
|
|
41
|
+
minlength?: null | undefined;
|
|
42
|
+
placeholder?: string | undefined;
|
|
43
|
+
readonly?: boolean | undefined;
|
|
44
|
+
rows?: number | undefined;
|
|
45
|
+
}, {
|
|
46
|
+
keydown: KeyboardEvent;
|
|
47
|
+
keyup: KeyboardEvent;
|
|
48
|
+
keypress: KeyboardEvent;
|
|
49
|
+
input: CustomEvent<any>;
|
|
50
|
+
change: CustomEvent<any>;
|
|
51
|
+
blur: CustomEvent<any>;
|
|
52
|
+
focus: CustomEvent<any>;
|
|
53
|
+
} & {
|
|
54
|
+
[evt: string]: CustomEvent<any>;
|
|
55
|
+
}, {}, {}, string>;
|
|
56
|
+
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> {
|
|
57
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
58
|
+
$$bindings?: Bindings;
|
|
59
|
+
} & Exports;
|
|
60
|
+
(internal: unknown, props: Props & {
|
|
61
|
+
$$events?: Events;
|
|
62
|
+
$$slots?: Slots;
|
|
63
|
+
}): Exports & {
|
|
64
|
+
$set?: any;
|
|
65
|
+
$on?: any;
|
|
66
|
+
};
|
|
67
|
+
z_$$bindings?: Bindings;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=Textarea.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Textarea.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Input/Textarea.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyEA;;;;;;;;;;;;;;;;;;;;;;;;;mBAA0P;6CAT7M,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,60 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
// API compatible with flowbite-svelte Label
|
|
3
|
+
export let color = "gray";
|
|
4
|
+
export let defaultClass = "text-sm rtl:text-right font-medium block";
|
|
5
|
+
export let show = true;
|
|
6
|
+
|
|
7
|
+
// Additional props for convenience
|
|
8
|
+
let className = "";
|
|
9
|
+
export { className as class };
|
|
10
|
+
|
|
11
|
+
const colorClasses = {
|
|
12
|
+
gray: "label-gray",
|
|
13
|
+
green: "label-green",
|
|
14
|
+
red: "label-red",
|
|
15
|
+
disabled: "label-disabled"
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
$: labelClass = `label-wrapper ${defaultClass} ${colorClasses[color] || colorClasses.gray} ${className}`;
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
{#if show}
|
|
22
|
+
<!-- svelte-ignore a11y-label-has-associated-control -->
|
|
23
|
+
<label {...$$restProps} class={labelClass}><slot /></label>
|
|
24
|
+
{:else}
|
|
25
|
+
<slot />
|
|
26
|
+
{/if}
|
|
27
|
+
|
|
28
|
+
<style>
|
|
29
|
+
.label-wrapper {
|
|
30
|
+
--label-text-gray: #111827;
|
|
31
|
+
--label-text-green: #047857;
|
|
32
|
+
--label-text-red: #dc2626;
|
|
33
|
+
--label-text-disabled: #9ca3af;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.label-gray {
|
|
37
|
+
color: var(--label-text-gray);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.label-green {
|
|
41
|
+
color: var(--label-text-green);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.label-red {
|
|
45
|
+
color: var(--label-text-red);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.label-disabled {
|
|
49
|
+
color: var(--label-text-disabled);
|
|
50
|
+
filter: grayscale(1) contrast(0.5);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* Dark mode overrides */
|
|
54
|
+
:global(.dark) .label-wrapper {
|
|
55
|
+
--label-text-gray: #d1d5db;
|
|
56
|
+
--label-text-green: #34d399;
|
|
57
|
+
--label-text-red: #f87171;
|
|
58
|
+
--label-text-disabled: #6b7280;
|
|
59
|
+
}
|
|
60
|
+
</style>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export default Label;
|
|
2
|
+
type Label = SvelteComponent<$$__sveltets_2_PropsWithChildren<{
|
|
3
|
+
[x: string]: any;
|
|
4
|
+
class?: string | undefined;
|
|
5
|
+
color?: string | undefined;
|
|
6
|
+
show?: boolean | undefined;
|
|
7
|
+
defaultClass?: string | undefined;
|
|
8
|
+
}, {
|
|
9
|
+
default: {};
|
|
10
|
+
}>, {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
}, {
|
|
13
|
+
default: {};
|
|
14
|
+
}> & {
|
|
15
|
+
$$bindings?: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
declare const Label: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
18
|
+
[x: string]: any;
|
|
19
|
+
class?: string | undefined;
|
|
20
|
+
color?: string | undefined;
|
|
21
|
+
show?: boolean | undefined;
|
|
22
|
+
defaultClass?: string | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
default: {};
|
|
25
|
+
}>, {
|
|
26
|
+
[evt: string]: CustomEvent<any>;
|
|
27
|
+
}, {
|
|
28
|
+
default: {};
|
|
29
|
+
}, {}, string>;
|
|
30
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
31
|
+
default: any;
|
|
32
|
+
} ? Props extends Record<string, never> ? any : {
|
|
33
|
+
children?: any;
|
|
34
|
+
} : {});
|
|
35
|
+
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> {
|
|
36
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
37
|
+
$$bindings?: Bindings;
|
|
38
|
+
} & Exports;
|
|
39
|
+
(internal: unknown, props: Props & {
|
|
40
|
+
$$events?: Events;
|
|
41
|
+
$$slots?: Slots;
|
|
42
|
+
}): Exports & {
|
|
43
|
+
$set?: any;
|
|
44
|
+
$on?: any;
|
|
45
|
+
};
|
|
46
|
+
z_$$bindings?: Bindings;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=Label.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Label.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Label/Label.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAgDA;;;;;;;;;;;;eAAyK;sCATnI,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"}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
export let title = "";
|
|
10
10
|
export let description = "";
|
|
11
11
|
export let closeBtn = false; // To show close button
|
|
12
|
+
export let persistent = false; // When true, prevents closing by clicking backdrop or pressing Escape
|
|
12
13
|
|
|
13
14
|
// Input configuration
|
|
14
15
|
export let inputLabel = "";
|
|
@@ -76,7 +77,7 @@
|
|
|
76
77
|
}
|
|
77
78
|
</script>
|
|
78
79
|
|
|
79
|
-
<Modal bind:show {size}>
|
|
80
|
+
<Modal bind:show {size} {persistent}>
|
|
80
81
|
<div slot="header" class="text-left">
|
|
81
82
|
{#if closeBtn}
|
|
82
83
|
<div class="flex justify-end -mt-2 -mr-2 mb-2">
|
|
@@ -5,6 +5,7 @@ type InputModal = SvelteComponent<{
|
|
|
5
5
|
show?: boolean | undefined;
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
loading?: boolean | undefined;
|
|
8
|
+
persistent?: boolean | undefined;
|
|
8
9
|
description?: string | undefined;
|
|
9
10
|
closeBtn?: boolean | undefined;
|
|
10
11
|
primaryButtonText?: string | undefined;
|
|
@@ -36,6 +37,7 @@ declare const InputModal: $$__sveltets_2_IsomorphicComponent<{
|
|
|
36
37
|
show?: boolean | undefined;
|
|
37
38
|
disabled?: boolean | undefined;
|
|
38
39
|
loading?: boolean | undefined;
|
|
40
|
+
persistent?: boolean | undefined;
|
|
39
41
|
description?: string | undefined;
|
|
40
42
|
closeBtn?: boolean | undefined;
|
|
41
43
|
primaryButtonText?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputModal.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Modal/InputModal.svelte.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InputModal.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Modal/InputModal.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAka;6CATrX,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"}
|