@getmicdrop/svelte-components 2.2.0 → 2.3.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/Accordion.svelte +44 -0
- package/dist/components/Accordion/Accordion.svelte.d.ts +42 -0
- package/dist/components/Accordion/Accordion.svelte.d.ts.map +1 -0
- package/dist/components/Accordion/AccordionItem.svelte +129 -0
- package/dist/components/Accordion/AccordionItem.svelte.d.ts +46 -0
- package/dist/components/Accordion/AccordionItem.svelte.d.ts.map +1 -0
- package/dist/components/Badges/Badge.svelte +129 -3
- package/dist/components/Badges/Badge.svelte.d.ts +8 -2
- package/dist/components/Badges/Badge.svelte.d.ts.map +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.svelte +65 -36
- package/dist/components/Breadcrumb/Breadcrumb.svelte.d.ts +16 -2
- package/dist/components/Breadcrumb/Breadcrumb.svelte.d.ts.map +1 -1
- package/dist/components/Button/Button.svelte +1 -0
- package/dist/components/Checkbox/Checkbox.svelte +116 -0
- package/dist/components/Checkbox/Checkbox.svelte.d.ts +52 -0
- package/dist/components/Checkbox/Checkbox.svelte.d.ts.map +1 -0
- package/dist/components/Drawer/Drawer.svelte +195 -0
- package/dist/components/Drawer/Drawer.svelte.d.ts +68 -0
- package/dist/components/Drawer/Drawer.svelte.d.ts.map +1 -0
- package/dist/components/Input/Input.svelte.d.ts +4 -4
- package/dist/components/Input/MultiSelect.svelte.d.ts +4 -4
- package/dist/components/Input/Select.svelte.d.ts +4 -4
- package/dist/components/Layout/Header.svelte +14 -4
- package/dist/components/Modal/ConfirmationModal.svelte +69 -17
- package/dist/components/Modal/ConfirmationModal.svelte.d.ts +22 -0
- package/dist/components/Modal/ConfirmationModal.svelte.d.ts.map +1 -1
- package/dist/components/Modal/InputModal.svelte +179 -0
- package/dist/components/Modal/InputModal.svelte.d.ts +75 -0
- package/dist/components/Modal/InputModal.svelte.d.ts.map +1 -0
- package/dist/components/Modal/Modal.svelte +31 -6
- package/dist/components/Modal/StatusModal.svelte +221 -0
- package/dist/components/Modal/StatusModal.svelte.d.ts +59 -0
- package/dist/components/Modal/StatusModal.svelte.d.ts.map +1 -0
- package/dist/components/Pagination/Pagination.svelte +178 -0
- package/dist/components/Pagination/Pagination.svelte.d.ts +39 -0
- package/dist/components/Pagination/Pagination.svelte.d.ts.map +1 -0
- package/dist/components/PasswordStrengthIndicator/PasswordStrengthIndicator.svelte.d.ts +2 -2
- package/dist/components/Radio/Radio.svelte +116 -0
- package/dist/components/Radio/Radio.svelte.d.ts +52 -0
- package/dist/components/Radio/Radio.svelte.d.ts.map +1 -0
- package/dist/components/Skeleton/Skeleton.svelte +59 -0
- package/dist/components/Skeleton/Skeleton.svelte.d.ts +35 -0
- package/dist/components/Skeleton/Skeleton.svelte.d.ts.map +1 -0
- package/dist/components/pages/performers/SwitchOption.svelte.d.ts +2 -2
- package/dist/components/pages/performers/VenueInfo.svelte.d.ts +2 -2
- package/dist/components/pages/performers/VenueItemCard.svelte +2 -2
- package/dist/components/pages/performers/VenueItemCard.svelte.d.ts +2 -2
- package/dist/components/pages/profile/profile-form.svelte +1 -1
- package/dist/constants/formOptions.d.ts +5 -2
- package/dist/constants/formOptions.d.ts.map +1 -1
- package/dist/constants/formOptions.js +2 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.js +9 -0
- package/package.json +1 -1
|
@@ -5,21 +5,68 @@
|
|
|
5
5
|
import Modal from "./Modal.svelte";
|
|
6
6
|
|
|
7
7
|
export let show = false;
|
|
8
|
+
export let size = "default"; // "small" | "default" | "large"
|
|
8
9
|
export let title = "";
|
|
9
10
|
export let description = "";
|
|
10
11
|
export let warningText = "";
|
|
11
12
|
export let actions = [];
|
|
12
13
|
export let icon = null;
|
|
14
|
+
export let customIcon = null; // Alias for icon (used by some wrappers)
|
|
13
15
|
export let closeBtn = false; // To show close button
|
|
14
16
|
|
|
17
|
+
// Simple props-based API (alternative to actions array)
|
|
18
|
+
export let primaryButtonText = "";
|
|
19
|
+
export let secondaryButtonText = "";
|
|
20
|
+
export let variant = "default"; // "default" | "danger"
|
|
21
|
+
|
|
22
|
+
// Loading/disabled state
|
|
23
|
+
export let loading = false;
|
|
24
|
+
export let disabled = false;
|
|
25
|
+
|
|
15
26
|
const dispatch = createEventDispatcher();
|
|
16
27
|
|
|
28
|
+
// Resolve icon (support both prop names)
|
|
29
|
+
$: resolvedIcon = customIcon || icon;
|
|
30
|
+
|
|
31
|
+
// Build actions from simple props if actions array is empty
|
|
32
|
+
$: resolvedActions = actions.length > 0 ? actions : buildActionsFromProps();
|
|
33
|
+
|
|
34
|
+
function buildActionsFromProps() {
|
|
35
|
+
const result = [];
|
|
36
|
+
|
|
37
|
+
if (secondaryButtonText) {
|
|
38
|
+
result.push({
|
|
39
|
+
label: secondaryButtonText,
|
|
40
|
+
variant: "gray-outline",
|
|
41
|
+
onClick: () => dispatch("cancel")
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (primaryButtonText) {
|
|
46
|
+
result.push({
|
|
47
|
+
label: primaryButtonText,
|
|
48
|
+
variant: variant === "danger" ? "red-solid" : "blue-solid",
|
|
49
|
+
onClick: () => dispatch("confirm"),
|
|
50
|
+
primary: true
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
|
|
17
57
|
const handleAction = (action) => {
|
|
18
|
-
|
|
58
|
+
if (disabled || loading) return;
|
|
59
|
+
action.onClick?.();
|
|
19
60
|
dispatch(action.label.toLowerCase());
|
|
20
61
|
show = false;
|
|
21
62
|
};
|
|
22
63
|
|
|
64
|
+
const handleClose = () => {
|
|
65
|
+
if (disabled || loading) return;
|
|
66
|
+
dispatch("close");
|
|
67
|
+
show = false;
|
|
68
|
+
};
|
|
69
|
+
|
|
23
70
|
const getVariant = (action) => {
|
|
24
71
|
// If variant is already specified, use it
|
|
25
72
|
if (action.variant) return action.variant;
|
|
@@ -48,54 +95,59 @@
|
|
|
48
95
|
onClick,
|
|
49
96
|
beforeIcon,
|
|
50
97
|
afterIcon,
|
|
98
|
+
primary,
|
|
51
99
|
...rest
|
|
52
100
|
} = action;
|
|
53
101
|
return rest;
|
|
54
102
|
};
|
|
55
103
|
</script>
|
|
56
104
|
|
|
57
|
-
<Modal bind:show>
|
|
58
|
-
<div slot="header" class="
|
|
105
|
+
<Modal bind:show {size}>
|
|
106
|
+
<div slot="header" class="text-center">
|
|
59
107
|
{#if closeBtn}
|
|
60
|
-
<div class="flex justify-end">
|
|
61
|
-
<button
|
|
62
|
-
|
|
108
|
+
<div class="flex justify-end -mt-2 -mr-2 mb-2">
|
|
109
|
+
<button
|
|
110
|
+
class="p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none transition-colors"
|
|
111
|
+
on:click={handleClose}
|
|
112
|
+
{disabled}
|
|
113
|
+
>
|
|
114
|
+
<img src={Cancel} alt="Close" class="w-5 h-5" />
|
|
63
115
|
</button>
|
|
64
116
|
</div>
|
|
65
117
|
{/if}
|
|
66
|
-
{#if
|
|
67
|
-
<div class="flex justify-center
|
|
68
|
-
<img src={
|
|
118
|
+
{#if resolvedIcon}
|
|
119
|
+
<div class="flex justify-center mb-4">
|
|
120
|
+
<img src={resolvedIcon} alt="" class="w-12 h-12" />
|
|
69
121
|
</div>
|
|
70
122
|
{/if}
|
|
71
123
|
{#if title}
|
|
72
|
-
<h2 class="text-xl text-
|
|
124
|
+
<h2 class="text-xl font-medium text-gray-900 dark:text-white">{title}</h2>
|
|
73
125
|
{/if}
|
|
74
126
|
</div>
|
|
75
127
|
|
|
76
|
-
<div slot="body" class="
|
|
128
|
+
<div slot="body" class="text-center mt-4">
|
|
77
129
|
{#if description}
|
|
78
|
-
<p class="text-
|
|
130
|
+
<p class="text-sm text-gray-500 dark:text-gray-400 leading-relaxed">
|
|
79
131
|
{description}
|
|
80
132
|
</p>
|
|
81
133
|
{/if}
|
|
82
134
|
{#if warningText}
|
|
83
|
-
<p
|
|
84
|
-
class="text-accent-Danger text-center text-sm leading-[22px] font-bold"
|
|
85
|
-
>
|
|
135
|
+
<p class="mt-3 text-sm font-medium text-red-600 dark:text-red-400">
|
|
86
136
|
{warningText}
|
|
87
137
|
</p>
|
|
88
138
|
{/if}
|
|
89
139
|
</div>
|
|
90
140
|
|
|
91
|
-
<div slot="footer" class="flex
|
|
92
|
-
{#each
|
|
141
|
+
<div slot="footer" class="flex gap-3">
|
|
142
|
+
{#each resolvedActions as action}
|
|
93
143
|
<Button
|
|
94
144
|
size="full"
|
|
95
145
|
variant={getVariant(action)}
|
|
96
146
|
{...cleanActionProps(action)}
|
|
97
147
|
beforeIcon={action.beforeIcon}
|
|
98
148
|
afterIcon={action.afterIcon}
|
|
149
|
+
disabled={disabled || action.disabled}
|
|
150
|
+
loading={action.primary && loading}
|
|
99
151
|
on:click={() => handleAction(action)}
|
|
100
152
|
>
|
|
101
153
|
{action.label}
|
|
@@ -1,26 +1,48 @@
|
|
|
1
1
|
export default ConfirmationModal;
|
|
2
2
|
type ConfirmationModal = SvelteComponent<{
|
|
3
3
|
title?: string | undefined;
|
|
4
|
+
size?: string | undefined;
|
|
5
|
+
variant?: string | undefined;
|
|
4
6
|
actions?: any[] | undefined;
|
|
5
7
|
show?: boolean | undefined;
|
|
8
|
+
disabled?: boolean | undefined;
|
|
9
|
+
loading?: boolean | undefined;
|
|
6
10
|
icon?: null | undefined;
|
|
7
11
|
description?: string | undefined;
|
|
8
12
|
warningText?: string | undefined;
|
|
13
|
+
customIcon?: null | undefined;
|
|
9
14
|
closeBtn?: boolean | undefined;
|
|
15
|
+
primaryButtonText?: string | undefined;
|
|
16
|
+
secondaryButtonText?: string | undefined;
|
|
10
17
|
}, {
|
|
18
|
+
cancel: CustomEvent<any>;
|
|
19
|
+
confirm: CustomEvent<any>;
|
|
20
|
+
close: CustomEvent<any>;
|
|
21
|
+
} & {
|
|
11
22
|
[evt: string]: CustomEvent<any>;
|
|
12
23
|
}, {}> & {
|
|
13
24
|
$$bindings?: string | undefined;
|
|
14
25
|
};
|
|
15
26
|
declare const ConfirmationModal: $$__sveltets_2_IsomorphicComponent<{
|
|
16
27
|
title?: string | undefined;
|
|
28
|
+
size?: string | undefined;
|
|
29
|
+
variant?: string | undefined;
|
|
17
30
|
actions?: any[] | undefined;
|
|
18
31
|
show?: boolean | undefined;
|
|
32
|
+
disabled?: boolean | undefined;
|
|
33
|
+
loading?: boolean | undefined;
|
|
19
34
|
icon?: null | undefined;
|
|
20
35
|
description?: string | undefined;
|
|
21
36
|
warningText?: string | undefined;
|
|
37
|
+
customIcon?: null | undefined;
|
|
22
38
|
closeBtn?: boolean | undefined;
|
|
39
|
+
primaryButtonText?: string | undefined;
|
|
40
|
+
secondaryButtonText?: string | undefined;
|
|
23
41
|
}, {
|
|
42
|
+
cancel: CustomEvent<any>;
|
|
43
|
+
confirm: CustomEvent<any>;
|
|
44
|
+
close: CustomEvent<any>;
|
|
45
|
+
} & {
|
|
24
46
|
[evt: string]: CustomEvent<any>;
|
|
25
47
|
}, {}, {}, string>;
|
|
26
48
|
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> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmationModal.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Modal/ConfirmationModal.svelte.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConfirmationModal.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Modal/ConfirmationModal.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAoKA;;;;;;;;;;;;;;;;;;;;;mBAAoS;6CATvP,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,179 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { createEventDispatcher } from "svelte";
|
|
3
|
+
import Button from "../Button/Button.svelte";
|
|
4
|
+
import Cancel from "../../assets/svg/cancel.svg";
|
|
5
|
+
import Modal from "./Modal.svelte";
|
|
6
|
+
|
|
7
|
+
export let show = false;
|
|
8
|
+
export let size = "default"; // "small" | "default" | "large"
|
|
9
|
+
export let title = "";
|
|
10
|
+
export let description = "";
|
|
11
|
+
export let closeBtn = false; // To show close button
|
|
12
|
+
|
|
13
|
+
// Input configuration
|
|
14
|
+
export let inputLabel = "";
|
|
15
|
+
export let inputPlaceholder = "";
|
|
16
|
+
export let inputType = "text"; // text | email | password | textarea
|
|
17
|
+
export let inputValue = "";
|
|
18
|
+
export let inputRequired = false;
|
|
19
|
+
export let inputRows = 4; // For textarea
|
|
20
|
+
export let inputIcon = null; // SVG component for input prefix icon
|
|
21
|
+
export let helpText = ""; // Helper text below input
|
|
22
|
+
|
|
23
|
+
// Validation
|
|
24
|
+
export let errorMessage = "";
|
|
25
|
+
export let showError = false;
|
|
26
|
+
export let validateEmail = false; // Auto-validate email format
|
|
27
|
+
|
|
28
|
+
// Buttons
|
|
29
|
+
export let primaryButtonText = "Confirm";
|
|
30
|
+
export let secondaryButtonText = "Cancel";
|
|
31
|
+
export let primaryButtonVariant = "blue-solid"; // blue-solid | red-solid
|
|
32
|
+
|
|
33
|
+
// State
|
|
34
|
+
export let disabled = false;
|
|
35
|
+
export let loading = false;
|
|
36
|
+
|
|
37
|
+
const dispatch = createEventDispatcher();
|
|
38
|
+
|
|
39
|
+
// Email validation
|
|
40
|
+
const isValidEmail = (email) => {
|
|
41
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
42
|
+
return emailRegex.test(email);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
$: emailError = validateEmail && inputValue && !isValidEmail(inputValue);
|
|
46
|
+
$: isEmpty = inputRequired && (!inputValue || inputValue.trim() === "");
|
|
47
|
+
$: hasError = showError || emailError;
|
|
48
|
+
$: isDisabled = disabled || loading || isEmpty || emailError;
|
|
49
|
+
|
|
50
|
+
const handlePrimaryAction = () => {
|
|
51
|
+
if (!isDisabled) {
|
|
52
|
+
dispatch("confirm", { value: inputValue });
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const handleSecondaryAction = () => {
|
|
57
|
+
if (!disabled && !loading) {
|
|
58
|
+
dispatch("cancel");
|
|
59
|
+
closeModal();
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const closeModal = () => {
|
|
64
|
+
show = false;
|
|
65
|
+
dispatch("close");
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const handleClose = () => {
|
|
69
|
+
if (disabled || loading) return;
|
|
70
|
+
closeModal();
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// Reset input when modal closes
|
|
74
|
+
$: if (!show) {
|
|
75
|
+
// Optionally reset - controlled externally via inputValue prop
|
|
76
|
+
}
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<Modal bind:show {size}>
|
|
80
|
+
<div slot="header" class="text-left">
|
|
81
|
+
{#if closeBtn}
|
|
82
|
+
<div class="flex justify-end -mt-2 -mr-2 mb-2">
|
|
83
|
+
<button
|
|
84
|
+
class="p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none transition-colors"
|
|
85
|
+
on:click={handleClose}
|
|
86
|
+
{disabled}
|
|
87
|
+
>
|
|
88
|
+
<img src={Cancel} alt="Close" class="w-5 h-5" />
|
|
89
|
+
</button>
|
|
90
|
+
</div>
|
|
91
|
+
{/if}
|
|
92
|
+
{#if title}
|
|
93
|
+
<h3 class="text-xl font-medium text-gray-900 dark:text-white">{title}</h3>
|
|
94
|
+
{/if}
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
<div slot="body" class="text-left mt-4">
|
|
98
|
+
{#if description}
|
|
99
|
+
<p class="text-sm text-gray-500 dark:text-gray-400 leading-relaxed mb-4">
|
|
100
|
+
{description}
|
|
101
|
+
</p>
|
|
102
|
+
{/if}
|
|
103
|
+
|
|
104
|
+
<div>
|
|
105
|
+
{#if inputLabel}
|
|
106
|
+
<label
|
|
107
|
+
for="modal-input"
|
|
108
|
+
class="block text-sm font-medium text-gray-900 dark:text-white mb-2"
|
|
109
|
+
>
|
|
110
|
+
{inputLabel}
|
|
111
|
+
</label>
|
|
112
|
+
{/if}
|
|
113
|
+
|
|
114
|
+
{#if inputType === "textarea"}
|
|
115
|
+
<textarea
|
|
116
|
+
id="modal-input"
|
|
117
|
+
bind:value={inputValue}
|
|
118
|
+
placeholder={inputPlaceholder}
|
|
119
|
+
rows={inputRows}
|
|
120
|
+
class="w-full px-3 py-2 border {hasError ? 'border-red-500' : 'border-gray-300 dark:border-gray-600'} bg-gray-50 dark:bg-gray-700 text-gray-900 dark:text-white rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none"
|
|
121
|
+
disabled={disabled || loading}
|
|
122
|
+
></textarea>
|
|
123
|
+
{:else}
|
|
124
|
+
<div class="relative">
|
|
125
|
+
{#if inputIcon}
|
|
126
|
+
<div class="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none">
|
|
127
|
+
<svelte:component this={inputIcon} class="w-5 h-5 text-gray-500 dark:text-gray-400" />
|
|
128
|
+
</div>
|
|
129
|
+
{/if}
|
|
130
|
+
<input
|
|
131
|
+
id="modal-input"
|
|
132
|
+
type={inputType}
|
|
133
|
+
bind:value={inputValue}
|
|
134
|
+
placeholder={inputPlaceholder}
|
|
135
|
+
required={inputRequired}
|
|
136
|
+
disabled={disabled || loading}
|
|
137
|
+
class="w-full {inputIcon ? 'pl-10' : 'px-3'} py-2 border {hasError ? 'border-red-500' : 'border-gray-300 dark:border-gray-600'} rounded-lg text-gray-900 dark:text-white bg-white dark:bg-gray-700 focus:ring-2 focus:ring-blue-500 focus:border-transparent disabled:opacity-50 disabled:cursor-not-allowed"
|
|
138
|
+
/>
|
|
139
|
+
</div>
|
|
140
|
+
{/if}
|
|
141
|
+
|
|
142
|
+
{#if hasError && (errorMessage || emailError)}
|
|
143
|
+
<p class="mt-2 text-sm text-red-600 dark:text-red-400 font-medium flex items-center gap-1">
|
|
144
|
+
<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
145
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
|
|
146
|
+
</svg>
|
|
147
|
+
{emailError ? "Please enter a valid email address" : errorMessage}
|
|
148
|
+
</p>
|
|
149
|
+
{:else if helpText && !hasError}
|
|
150
|
+
<p class="text-xs font-normal text-gray-500 dark:text-gray-400 pt-2">
|
|
151
|
+
{helpText}
|
|
152
|
+
</p>
|
|
153
|
+
{/if}
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
|
|
157
|
+
<div slot="footer" class="flex gap-3">
|
|
158
|
+
{#if secondaryButtonText}
|
|
159
|
+
<Button
|
|
160
|
+
size="full"
|
|
161
|
+
variant="gray-outline"
|
|
162
|
+
on:click={handleSecondaryAction}
|
|
163
|
+
disabled={disabled || loading}
|
|
164
|
+
>
|
|
165
|
+
{secondaryButtonText}
|
|
166
|
+
</Button>
|
|
167
|
+
{/if}
|
|
168
|
+
|
|
169
|
+
<Button
|
|
170
|
+
size="full"
|
|
171
|
+
variant={primaryButtonVariant}
|
|
172
|
+
on:click={handlePrimaryAction}
|
|
173
|
+
disabled={isDisabled}
|
|
174
|
+
{loading}
|
|
175
|
+
>
|
|
176
|
+
{primaryButtonText}
|
|
177
|
+
</Button>
|
|
178
|
+
</div>
|
|
179
|
+
</Modal>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export default InputModal;
|
|
2
|
+
type InputModal = SvelteComponent<{
|
|
3
|
+
title?: string | undefined;
|
|
4
|
+
size?: string | undefined;
|
|
5
|
+
show?: boolean | undefined;
|
|
6
|
+
disabled?: boolean | undefined;
|
|
7
|
+
loading?: boolean | undefined;
|
|
8
|
+
description?: string | undefined;
|
|
9
|
+
closeBtn?: boolean | undefined;
|
|
10
|
+
primaryButtonText?: string | undefined;
|
|
11
|
+
secondaryButtonText?: string | undefined;
|
|
12
|
+
inputLabel?: string | undefined;
|
|
13
|
+
inputPlaceholder?: string | undefined;
|
|
14
|
+
inputType?: string | undefined;
|
|
15
|
+
inputValue?: string | undefined;
|
|
16
|
+
inputRequired?: boolean | undefined;
|
|
17
|
+
inputRows?: number | undefined;
|
|
18
|
+
inputIcon?: null | undefined;
|
|
19
|
+
helpText?: string | undefined;
|
|
20
|
+
errorMessage?: string | undefined;
|
|
21
|
+
showError?: boolean | undefined;
|
|
22
|
+
validateEmail?: boolean | undefined;
|
|
23
|
+
primaryButtonVariant?: string | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
confirm: CustomEvent<any>;
|
|
26
|
+
cancel: CustomEvent<any>;
|
|
27
|
+
close: CustomEvent<any>;
|
|
28
|
+
} & {
|
|
29
|
+
[evt: string]: CustomEvent<any>;
|
|
30
|
+
}, {}> & {
|
|
31
|
+
$$bindings?: string | undefined;
|
|
32
|
+
};
|
|
33
|
+
declare const InputModal: $$__sveltets_2_IsomorphicComponent<{
|
|
34
|
+
title?: string | undefined;
|
|
35
|
+
size?: string | undefined;
|
|
36
|
+
show?: boolean | undefined;
|
|
37
|
+
disabled?: boolean | undefined;
|
|
38
|
+
loading?: boolean | undefined;
|
|
39
|
+
description?: string | undefined;
|
|
40
|
+
closeBtn?: boolean | undefined;
|
|
41
|
+
primaryButtonText?: string | undefined;
|
|
42
|
+
secondaryButtonText?: string | undefined;
|
|
43
|
+
inputLabel?: string | undefined;
|
|
44
|
+
inputPlaceholder?: string | undefined;
|
|
45
|
+
inputType?: string | undefined;
|
|
46
|
+
inputValue?: string | undefined;
|
|
47
|
+
inputRequired?: boolean | undefined;
|
|
48
|
+
inputRows?: number | undefined;
|
|
49
|
+
inputIcon?: null | undefined;
|
|
50
|
+
helpText?: string | undefined;
|
|
51
|
+
errorMessage?: string | undefined;
|
|
52
|
+
showError?: boolean | undefined;
|
|
53
|
+
validateEmail?: boolean | undefined;
|
|
54
|
+
primaryButtonVariant?: string | undefined;
|
|
55
|
+
}, {
|
|
56
|
+
confirm: CustomEvent<any>;
|
|
57
|
+
cancel: CustomEvent<any>;
|
|
58
|
+
close: CustomEvent<any>;
|
|
59
|
+
} & {
|
|
60
|
+
[evt: string]: CustomEvent<any>;
|
|
61
|
+
}, {}, {}, string>;
|
|
62
|
+
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> {
|
|
63
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
64
|
+
$$bindings?: Bindings;
|
|
65
|
+
} & Exports;
|
|
66
|
+
(internal: unknown, props: Props & {
|
|
67
|
+
$$events?: Events;
|
|
68
|
+
$$slots?: Slots;
|
|
69
|
+
}): Exports & {
|
|
70
|
+
$set?: any;
|
|
71
|
+
$on?: any;
|
|
72
|
+
};
|
|
73
|
+
z_$$bindings?: Bindings;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=InputModal.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputModal.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Modal/InputModal.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAqZ;6CATxW,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"}
|
|
@@ -122,12 +122,17 @@
|
|
|
122
122
|
{/if}
|
|
123
123
|
|
|
124
124
|
<style>
|
|
125
|
+
/*
|
|
126
|
+
* Modal uses Tailwind-compatible colors with dark mode support.
|
|
127
|
+
* Works across projects without requiring CSS variable synchronization.
|
|
128
|
+
*/
|
|
129
|
+
|
|
125
130
|
.modal-backdrop {
|
|
126
131
|
position: fixed;
|
|
127
132
|
inset: 0;
|
|
128
133
|
display: flex;
|
|
129
134
|
background-color: rgba(0, 0, 0, 0.5);
|
|
130
|
-
z-index:
|
|
135
|
+
z-index: 50;
|
|
131
136
|
|
|
132
137
|
/* iOS scroll lock - prevent scroll bleed-through */
|
|
133
138
|
touch-action: none;
|
|
@@ -149,7 +154,7 @@
|
|
|
149
154
|
|
|
150
155
|
/* Mobile: Bottom sheet style */
|
|
151
156
|
.modal-sheet {
|
|
152
|
-
background-color:
|
|
157
|
+
background-color: #ffffff;
|
|
153
158
|
border-radius: 1.5rem 1.5rem 0 0;
|
|
154
159
|
width: 100%;
|
|
155
160
|
max-height: 90vh;
|
|
@@ -164,6 +169,10 @@
|
|
|
164
169
|
overscroll-behavior: contain;
|
|
165
170
|
}
|
|
166
171
|
|
|
172
|
+
:global(.dark) .modal-sheet {
|
|
173
|
+
background-color: #1f2937; /* gray-800 */
|
|
174
|
+
}
|
|
175
|
+
|
|
167
176
|
/* Hide sheet on desktop */
|
|
168
177
|
@media (min-width: 768px) {
|
|
169
178
|
.modal-sheet {
|
|
@@ -181,13 +190,18 @@
|
|
|
181
190
|
.sheet-handle {
|
|
182
191
|
width: 2.5rem;
|
|
183
192
|
height: 0.25rem;
|
|
184
|
-
background-color:
|
|
193
|
+
background-color: #d1d5db; /* gray-300 */
|
|
185
194
|
border-radius: 0.125rem;
|
|
186
195
|
}
|
|
187
196
|
|
|
197
|
+
:global(.dark) .sheet-handle {
|
|
198
|
+
background-color: #4b5563; /* gray-600 */
|
|
199
|
+
}
|
|
200
|
+
|
|
188
201
|
.modal-inner {
|
|
189
|
-
padding:
|
|
190
|
-
|
|
202
|
+
padding: 1.5rem;
|
|
203
|
+
/* Account for bottom nav bars (~70px) plus safe area */
|
|
204
|
+
padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
|
|
191
205
|
overflow-y: auto;
|
|
192
206
|
flex: 1;
|
|
193
207
|
}
|
|
@@ -195,13 +209,18 @@
|
|
|
195
209
|
/* Desktop: Centered modal style */
|
|
196
210
|
.modal-centered {
|
|
197
211
|
display: none;
|
|
198
|
-
background-color:
|
|
212
|
+
background-color: #ffffff;
|
|
199
213
|
padding: 1.5rem;
|
|
200
214
|
border-radius: 1rem;
|
|
201
215
|
max-width: 420px;
|
|
202
216
|
width: 100%;
|
|
203
217
|
max-height: calc(100vh - 4rem);
|
|
204
218
|
overflow-y: auto;
|
|
219
|
+
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
:global(.dark) .modal-centered {
|
|
223
|
+
background-color: #1f2937; /* gray-800 */
|
|
205
224
|
}
|
|
206
225
|
|
|
207
226
|
@media (min-width: 768px) {
|
|
@@ -223,6 +242,12 @@
|
|
|
223
242
|
display: flex;
|
|
224
243
|
flex-direction: column;
|
|
225
244
|
gap: 0.75rem;
|
|
245
|
+
margin-top: 1.5rem; /* 24px - consistent gap before buttons */
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.modal-footer:empty {
|
|
249
|
+
display: none;
|
|
250
|
+
margin-top: 0;
|
|
226
251
|
}
|
|
227
252
|
|
|
228
253
|
@media (min-width: 768px) {
|