@dosgato/dialog 1.1.17 → 1.1.19
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/FieldAutocomplete.svelte.d.ts +2 -2
- package/dist/FieldChoices.svelte.d.ts +2 -2
- package/dist/FieldMultiple.svelte.d.ts +1 -1
- package/dist/FieldRadio.svelte.d.ts +2 -2
- package/dist/FieldSelect.svelte.d.ts +2 -2
- package/dist/Form.svelte +12 -0
- package/dist/InlineMessage.svelte +3 -12
- package/dist/Switcher.svelte.d.ts +2 -2
- package/dist/errorIcons.d.ts +8 -0
- package/dist/errorIcons.js +9 -1
- package/package.json +3 -3
|
@@ -9,9 +9,9 @@ declare const __propDef: {
|
|
|
9
9
|
notNull?: boolean | undefined;
|
|
10
10
|
disabled?: boolean | undefined;
|
|
11
11
|
choices: {
|
|
12
|
-
label?: string
|
|
12
|
+
label?: string;
|
|
13
13
|
value: string;
|
|
14
|
-
disabled?: boolean
|
|
14
|
+
disabled?: boolean;
|
|
15
15
|
}[];
|
|
16
16
|
defaultValue?: string | undefined;
|
|
17
17
|
conditional?: boolean | undefined;
|
|
@@ -6,9 +6,9 @@ declare const __propDef: {
|
|
|
6
6
|
path: string;
|
|
7
7
|
label?: string | undefined;
|
|
8
8
|
choices: {
|
|
9
|
-
label?: string
|
|
9
|
+
label?: string;
|
|
10
10
|
value: any;
|
|
11
|
-
disabled?: boolean
|
|
11
|
+
disabled?: boolean;
|
|
12
12
|
}[];
|
|
13
13
|
defaultValue?: any;
|
|
14
14
|
conditional?: boolean | undefined;
|
|
@@ -7,9 +7,9 @@ declare const __propDef: {
|
|
|
7
7
|
label?: string | undefined;
|
|
8
8
|
notNull?: boolean | undefined;
|
|
9
9
|
choices: {
|
|
10
|
-
label?: string
|
|
10
|
+
label?: string;
|
|
11
11
|
value: any;
|
|
12
|
-
disabled?: boolean
|
|
12
|
+
disabled?: boolean;
|
|
13
13
|
}[];
|
|
14
14
|
defaultValue?: any;
|
|
15
15
|
conditional?: boolean | undefined;
|
|
@@ -9,9 +9,9 @@ declare const __propDef: {
|
|
|
9
9
|
notNull?: boolean | undefined;
|
|
10
10
|
disabled?: boolean | undefined;
|
|
11
11
|
choices: {
|
|
12
|
-
label?: string
|
|
12
|
+
label?: string;
|
|
13
13
|
value: any;
|
|
14
|
-
disabled?: boolean
|
|
14
|
+
disabled?: boolean;
|
|
15
15
|
}[];
|
|
16
16
|
defaultValue?: any;
|
|
17
17
|
conditional?: boolean | undefined;
|
package/dist/Form.svelte
CHANGED
|
@@ -18,6 +18,7 @@ setContext(CHOOSER_API_CONTEXT, chooserClient);
|
|
|
18
18
|
<slot {messages} {saved} {validating} {submitting} {valid} {invalid} {data} {allMessages} {showingInlineErrors} />
|
|
19
19
|
{@const errorMessages = messages.filter(m => m.type === 'error' || m.type === 'system')}
|
|
20
20
|
{@const warningMessages = messages.filter(m => m.type === 'warning')}
|
|
21
|
+
{@const infoMessages = messages.filter(m => m.type === 'info')}
|
|
21
22
|
{@const successMessages = messages.filter(m => m.type === 'success')}
|
|
22
23
|
{#if errorMessages.length || showingInlineErrors}
|
|
23
24
|
<ul class="form-errors" aria-live='assertive'>
|
|
@@ -36,6 +37,13 @@ setContext(CHOOSER_API_CONTEXT, chooserClient);
|
|
|
36
37
|
{/each}
|
|
37
38
|
</ul>
|
|
38
39
|
{/if}
|
|
40
|
+
{#if infoMessages.length}
|
|
41
|
+
<ul class="form-info" aria-live='assertive'>
|
|
42
|
+
{#each infoMessages as message}
|
|
43
|
+
<li><Icon icon={messageIcons.info} inline hiddenLabel="info"/> {message.message}</li>
|
|
44
|
+
{/each}
|
|
45
|
+
</ul>
|
|
46
|
+
{/if}
|
|
39
47
|
{#if successMessages.length}
|
|
40
48
|
<ul class="form-successes" aria-live='assertive'>
|
|
41
49
|
{#each successMessages as message}
|
|
@@ -68,6 +76,10 @@ setContext(CHOOSER_API_CONTEXT, chooserClient);
|
|
|
68
76
|
background-color: var(--dg-warning-bg, #ffc107);
|
|
69
77
|
color: var(--dg-warning-text, black);
|
|
70
78
|
}
|
|
79
|
+
.form-info {
|
|
80
|
+
background-color: var(--dg-info-bg, #619bff);
|
|
81
|
+
color: var(--dg-info-text, black);
|
|
82
|
+
}
|
|
71
83
|
.form-successes {
|
|
72
84
|
background-color: var(--dg-success-bg, #218739);
|
|
73
85
|
color: var(--dg-success-text, white);
|
|
@@ -2,20 +2,11 @@
|
|
|
2
2
|
The purpose of this component is to provide common `Feedback` message styling with icons that support screen readers.
|
|
3
3
|
-->
|
|
4
4
|
<script>import { htmlEncode } from 'txstate-utils';
|
|
5
|
-
import { messageIcons } from './';
|
|
5
|
+
import { messageIcons, messageLabels } from './';
|
|
6
6
|
import Icon from './Icon.svelte';
|
|
7
7
|
export let message;
|
|
8
8
|
$: icon = messageIcons[message.type] ?? messageIcons.error;
|
|
9
|
-
|
|
10
|
-
/*
|
|
11
|
-
const ariaLables = {
|
|
12
|
-
error: 'Error',
|
|
13
|
-
warning: 'Warning',
|
|
14
|
-
success: 'Success',
|
|
15
|
-
system: 'System'
|
|
16
|
-
}
|
|
17
|
-
$: hiddenLabel = ariaLables[message.type] ?? 'Error'
|
|
18
|
-
*/
|
|
9
|
+
$: iconLabel = messageLabels[message.type] ?? messageLabels.error;
|
|
19
10
|
function addMarkup(msg) {
|
|
20
11
|
const lines = msg.split(/\r?\n/);
|
|
21
12
|
const output = [];
|
|
@@ -43,7 +34,7 @@ function addMarkup(msg) {
|
|
|
43
34
|
}
|
|
44
35
|
</script>
|
|
45
36
|
|
|
46
|
-
<div class={message.type}><Icon width='1.5em' {icon} inline hiddenLabel=
|
|
37
|
+
<div class={message.type}><Icon width='1.5em' {icon} inline hiddenLabel={iconLabel} /><span>{@html addMarkup(message.message)}</span></div>
|
|
47
38
|
|
|
48
39
|
<style>
|
|
49
40
|
div {
|
|
@@ -7,9 +7,9 @@ declare const __propDef: {
|
|
|
7
7
|
path?: string | undefined;
|
|
8
8
|
name?: string | undefined;
|
|
9
9
|
choices: {
|
|
10
|
-
label?: string
|
|
10
|
+
label?: string;
|
|
11
11
|
value: string;
|
|
12
|
-
disabled?: boolean
|
|
12
|
+
disabled?: boolean;
|
|
13
13
|
}[];
|
|
14
14
|
horizontal?: boolean | undefined;
|
|
15
15
|
label: string;
|
package/dist/errorIcons.d.ts
CHANGED
|
@@ -3,4 +3,12 @@ export declare const messageIcons: {
|
|
|
3
3
|
warning: import("@iconify/types").IconifyIcon;
|
|
4
4
|
success: import("@iconify/types").IconifyIcon;
|
|
5
5
|
system: import("@iconify/types").IconifyIcon;
|
|
6
|
+
info: import("@iconify/types").IconifyIcon;
|
|
7
|
+
};
|
|
8
|
+
export declare const messageLabels: {
|
|
9
|
+
readonly error: "error";
|
|
10
|
+
readonly warning: "warning";
|
|
11
|
+
readonly success: "success";
|
|
12
|
+
readonly info: "info";
|
|
13
|
+
readonly system: "error";
|
|
6
14
|
};
|
package/dist/errorIcons.js
CHANGED
|
@@ -6,5 +6,13 @@ export const messageIcons = {
|
|
|
6
6
|
error: alertCircleOutline,
|
|
7
7
|
warning: informationOutline,
|
|
8
8
|
success: checkCircleOutline,
|
|
9
|
-
system: closeOctagonOutline
|
|
9
|
+
system: closeOctagonOutline,
|
|
10
|
+
info: informationOutline
|
|
11
|
+
};
|
|
12
|
+
export const messageLabels = {
|
|
13
|
+
error: 'error',
|
|
14
|
+
warning: 'warning',
|
|
15
|
+
success: 'success',
|
|
16
|
+
info: 'info',
|
|
17
|
+
system: 'error'
|
|
10
18
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dosgato/dialog",
|
|
3
3
|
"description": "A component library for building forms that edit a JSON document.",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.19",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"prepublishOnly": "svelte-package",
|
|
7
7
|
"dev": "vite dev --force",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
".": {
|
|
16
16
|
"types": "./dist/index.d.ts",
|
|
17
17
|
"svelte": "./dist/index.js",
|
|
18
|
-
"
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
19
|
},
|
|
20
20
|
"./package.json": "./package.json"
|
|
21
21
|
},
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@iconify-icons/mdi": "^1.2.22",
|
|
28
28
|
"@iconify-icons/ph": "^1.2.2",
|
|
29
29
|
"@txstate-mws/svelte-components": "^1.5.5",
|
|
30
|
-
"@txstate-mws/svelte-forms": "^1.
|
|
30
|
+
"@txstate-mws/svelte-forms": "^1.4.2",
|
|
31
31
|
"codemirror": "^6.0.1",
|
|
32
32
|
"txstate-utils": "^1.8.0"
|
|
33
33
|
},
|