@marianmeres/stuic 2.1.30 → 2.1.32
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/AlertConfirmPrompt/AlertConfirmPrompt.svelte +9 -0
- package/dist/components/AlertConfirmPrompt/AlertConfirmPrompt.svelte.d.ts +3 -0
- package/dist/components/AlertConfirmPrompt/Current.svelte +24 -8
- package/dist/components/AlertConfirmPrompt/Current.svelte.d.ts +5 -0
- package/package.json +69 -71
|
@@ -29,6 +29,9 @@
|
|
|
29
29
|
classButtonCancel?: string;
|
|
30
30
|
classButtonCustom?: string;
|
|
31
31
|
classButtonPrimary?: string;
|
|
32
|
+
variantButtonCancel?: string;
|
|
33
|
+
variantButtonCustom?: string;
|
|
34
|
+
variantButtonPrimary?: string;
|
|
32
35
|
classSpinnerBox?: string;
|
|
33
36
|
defaultIcons?: Partial<
|
|
34
37
|
Record<"info" | "success" | "warn" | "error" | "spinner", () => string | undefined>
|
|
@@ -56,6 +59,9 @@
|
|
|
56
59
|
classButtonCancel,
|
|
57
60
|
classButtonCustom,
|
|
58
61
|
classButtonPrimary,
|
|
62
|
+
variantButtonCancel,
|
|
63
|
+
variantButtonCustom,
|
|
64
|
+
variantButtonPrimary,
|
|
59
65
|
}: Props = $props();
|
|
60
66
|
|
|
61
67
|
let modal = $state<ModalDialog>();
|
|
@@ -112,6 +118,9 @@
|
|
|
112
118
|
{classButtonCancel}
|
|
113
119
|
{classButtonCustom}
|
|
114
120
|
{classButtonPrimary}
|
|
121
|
+
{variantButtonCancel}
|
|
122
|
+
{variantButtonCustom}
|
|
123
|
+
{variantButtonPrimary}
|
|
115
124
|
/>
|
|
116
125
|
</ModalDialog>
|
|
117
126
|
{/if}
|
|
@@ -17,6 +17,9 @@ interface Props {
|
|
|
17
17
|
classButtonCancel?: string;
|
|
18
18
|
classButtonCustom?: string;
|
|
19
19
|
classButtonPrimary?: string;
|
|
20
|
+
variantButtonCancel?: string;
|
|
21
|
+
variantButtonCustom?: string;
|
|
22
|
+
variantButtonPrimary?: string;
|
|
20
23
|
classSpinnerBox?: string;
|
|
21
24
|
defaultIcons?: Partial<Record<"info" | "success" | "warn" | "error" | "spinner", () => string | undefined>>;
|
|
22
25
|
}
|
|
@@ -29,10 +29,17 @@
|
|
|
29
29
|
classInput?: string;
|
|
30
30
|
classMenu?: string;
|
|
31
31
|
classMenuLi?: string;
|
|
32
|
+
//
|
|
33
|
+
classMenuCustom?: string;
|
|
34
|
+
classMenuLiCustom?: string;
|
|
35
|
+
//
|
|
32
36
|
classButton?: string;
|
|
33
37
|
classButtonCancel?: string;
|
|
34
38
|
classButtonCustom?: string;
|
|
35
39
|
classButtonPrimary?: string;
|
|
40
|
+
variantButtonCancel?: string;
|
|
41
|
+
variantButtonCustom?: string;
|
|
42
|
+
variantButtonPrimary?: string;
|
|
36
43
|
classSpinnerBox?: string;
|
|
37
44
|
defaultIcons?: Partial<
|
|
38
45
|
Record<"info" | "success" | "warn" | "error" | "spinner", () => string | undefined>
|
|
@@ -53,10 +60,15 @@
|
|
|
53
60
|
classInput,
|
|
54
61
|
classMenu,
|
|
55
62
|
classMenuLi,
|
|
63
|
+
classMenuCustom,
|
|
64
|
+
classMenuLiCustom,
|
|
56
65
|
classButton,
|
|
57
66
|
classButtonCancel,
|
|
58
67
|
classButtonCustom,
|
|
59
68
|
classButtonPrimary,
|
|
69
|
+
variantButtonCancel,
|
|
70
|
+
variantButtonCustom,
|
|
71
|
+
variantButtonPrimary = "primary",
|
|
60
72
|
classSpinnerBox,
|
|
61
73
|
defaultIcons = acpDefaultIcons,
|
|
62
74
|
}: Props = $props();
|
|
@@ -126,6 +138,8 @@
|
|
|
126
138
|
const _classButton = "min-w-24 text-center w-full sm:w-auto";
|
|
127
139
|
|
|
128
140
|
const _classSpinnerBox = `absolute inset-0 flex items-center justify-center bg-white/75 dark:bg-black/75`;
|
|
141
|
+
|
|
142
|
+
let hasCustom = $derived(current.labelCustom && typeof current.onCustom === "function");
|
|
129
143
|
</script>
|
|
130
144
|
|
|
131
145
|
<div class={twMerge("stuic-acp", _class, classProp)}>
|
|
@@ -196,11 +210,12 @@
|
|
|
196
210
|
</div>
|
|
197
211
|
</div>
|
|
198
212
|
</div>
|
|
199
|
-
<menu class={twMerge(_classMenu, classMenu)}>
|
|
213
|
+
<menu class={twMerge(_classMenu, classMenu, hasCustom && classMenuCustom)}>
|
|
200
214
|
{#if current.type !== ALERT}
|
|
201
|
-
<li class={twMerge(_classMenuLi, classMenuLi)}>
|
|
215
|
+
<li class={twMerge(_classMenuLi, classMenuLi, hasCustom && classMenuLiCustom)}>
|
|
202
216
|
<CmpButtonCancel
|
|
203
217
|
class={twMerge("cancel", _classButton, classButton, classButtonCancel)}
|
|
218
|
+
variant={variantButtonCancel}
|
|
204
219
|
disabled={isPending}
|
|
205
220
|
onclick={createOnClick("cancel", current.onCancel)}
|
|
206
221
|
>
|
|
@@ -208,21 +223,22 @@
|
|
|
208
223
|
</CmpButtonCancel>
|
|
209
224
|
</li>
|
|
210
225
|
{/if}
|
|
211
|
-
{#if
|
|
212
|
-
<li class={twMerge(_classMenuLi, classMenuLi)}>
|
|
226
|
+
{#if hasCustom}
|
|
227
|
+
<li class={twMerge(_classMenuLi, classMenuLi, classMenuLiCustom)}>
|
|
213
228
|
<CmpButtonCustom
|
|
214
229
|
class={twMerge("custom", _classButton, classButton, classButtonCustom)}
|
|
230
|
+
variant={variantButtonCustom}
|
|
215
231
|
disabled={isPending}
|
|
216
|
-
onclick={createOnClick("custom", current.onCustom)}
|
|
232
|
+
onclick={createOnClick("custom", current.onCustom!)}
|
|
217
233
|
>
|
|
218
|
-
<Thc thc={current.labelCustom} {forceAsHtml} />
|
|
234
|
+
<Thc thc={current.labelCustom!} {forceAsHtml} />
|
|
219
235
|
</CmpButtonCustom>
|
|
220
236
|
</li>
|
|
221
237
|
{/if}
|
|
222
|
-
<li class={twMerge(_classMenuLi, classMenuLi)}>
|
|
238
|
+
<li class={twMerge(_classMenuLi, classMenuLi, hasCustom && classMenuLiCustom)}>
|
|
223
239
|
<CmpButtonOk
|
|
224
240
|
class={twMerge("ok", _classButton, classButton, classButtonPrimary)}
|
|
225
|
-
variant=
|
|
241
|
+
variant={variantButtonPrimary}
|
|
226
242
|
disabled={isPending}
|
|
227
243
|
onclick={createOnClick("ok", current.onOk)}
|
|
228
244
|
bind:el={okButtonEl}
|
|
@@ -13,10 +13,15 @@ interface Props {
|
|
|
13
13
|
classInput?: string;
|
|
14
14
|
classMenu?: string;
|
|
15
15
|
classMenuLi?: string;
|
|
16
|
+
classMenuCustom?: string;
|
|
17
|
+
classMenuLiCustom?: string;
|
|
16
18
|
classButton?: string;
|
|
17
19
|
classButtonCancel?: string;
|
|
18
20
|
classButtonCustom?: string;
|
|
19
21
|
classButtonPrimary?: string;
|
|
22
|
+
variantButtonCancel?: string;
|
|
23
|
+
variantButtonCustom?: string;
|
|
24
|
+
variantButtonPrimary?: string;
|
|
20
25
|
classSpinnerBox?: string;
|
|
21
26
|
defaultIcons?: Partial<Record<"info" | "success" | "warn" | "error" | "spinner", () => string | undefined>>;
|
|
22
27
|
}
|
package/package.json
CHANGED
|
@@ -1,72 +1,70 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
}
|
|
2
|
+
"name": "@marianmeres/stuic",
|
|
3
|
+
"version": "2.1.32",
|
|
4
|
+
"files": [
|
|
5
|
+
"dist",
|
|
6
|
+
"!dist/**/*.test.*",
|
|
7
|
+
"!dist/**/*.spec.*"
|
|
8
|
+
],
|
|
9
|
+
"sideEffects": [
|
|
10
|
+
"**/*.css"
|
|
11
|
+
],
|
|
12
|
+
"svelte": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"type": "module",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"svelte": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"svelte": "^5.0.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@marianmeres/icons-fns": "^4.4.0",
|
|
26
|
+
"@marianmeres/random-human-readable": "^1.6.1",
|
|
27
|
+
"@sveltejs/adapter-auto": "^4.0.0",
|
|
28
|
+
"@sveltejs/kit": "^2.48.4",
|
|
29
|
+
"@sveltejs/package": "^2.5.4",
|
|
30
|
+
"@sveltejs/vite-plugin-svelte": "^5.1.1",
|
|
31
|
+
"@tailwindcss/cli": "^4.1.16",
|
|
32
|
+
"@tailwindcss/forms": "^0.5.10",
|
|
33
|
+
"@tailwindcss/typography": "^0.5.19",
|
|
34
|
+
"@tailwindcss/vite": "^4.1.16",
|
|
35
|
+
"dotenv": "^16.6.1",
|
|
36
|
+
"prettier": "^3.6.2",
|
|
37
|
+
"prettier-plugin-svelte": "^3.4.0",
|
|
38
|
+
"publint": "^0.3.15",
|
|
39
|
+
"svelte": "^5.43.2",
|
|
40
|
+
"svelte-check": "^4.3.3",
|
|
41
|
+
"tailwindcss": "^4.1.16",
|
|
42
|
+
"typescript": "^5.9.3",
|
|
43
|
+
"vite": "^6.4.1",
|
|
44
|
+
"vitest": "^3.2.4"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@marianmeres/clog": "^2.3.3",
|
|
48
|
+
"@marianmeres/item-collection": "^1.2.19",
|
|
49
|
+
"@marianmeres/parse-boolean": "^1.1.7",
|
|
50
|
+
"@marianmeres/ticker": "^1.15.0",
|
|
51
|
+
"clsx": "^2.1.1",
|
|
52
|
+
"esm-env": "^1.2.2",
|
|
53
|
+
"runed": "^0.23.4",
|
|
54
|
+
"tailwind-merge": "^3.3.1"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"dev": "vite dev",
|
|
58
|
+
"build": "vite build && npm run prepack",
|
|
59
|
+
"preview": "vite preview",
|
|
60
|
+
"package": "npm run prepack",
|
|
61
|
+
"package:watch": "svelte-kit sync && svelte-package --watch && publint",
|
|
62
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
63
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
64
|
+
"format": "prettier --write .",
|
|
65
|
+
"lint": "prettier --check .",
|
|
66
|
+
"test": "vitest --dir src/",
|
|
67
|
+
"svelte-check": "svelte-check",
|
|
68
|
+
"svelte-package": "svelte-package"
|
|
69
|
+
}
|
|
70
|
+
}
|