@iroco/ui 1.6.1 → 1.6.2
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/Alert.stories.svelte +1 -1
- package/dist/Alert.svelte +12 -3
- package/dist/Alert.svelte.d.ts +4 -1
- package/dist/Button.svelte +2 -5
- package/dist/TextInput.svelte +6 -0
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
{#snippet template({ ...args })}
|
|
16
|
-
<Alert {...args}>
|
|
16
|
+
<Alert {...args} onclose={() => alert('click')}>
|
|
17
17
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc eros lacus, commodo eu tristique
|
|
18
18
|
non, ultricies eu tellus. Nulla facilisi. Integer a tincidunt purus. Proin vulputate tristique
|
|
19
19
|
magna. Aliquam id eros id ante malesuada interdum. Phasellus tristique ac leo at fringilla. Cras
|
package/dist/Alert.svelte
CHANGED
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import IconClose from './IconClose.svelte';
|
|
3
|
+
import type { MouseEventHandler } from 'svelte/elements';
|
|
3
4
|
|
|
4
5
|
interface Props {
|
|
5
6
|
type?: 'success' | 'danger' | 'flash';
|
|
6
7
|
showClose?: boolean;
|
|
7
|
-
|
|
8
|
+
/** @deprecated use onclose instead */
|
|
9
|
+
callback?: MouseEventHandler<HTMLButtonElement>;
|
|
10
|
+
onclose?: MouseEventHandler<HTMLButtonElement>;
|
|
8
11
|
children?: import('svelte').Snippet;
|
|
9
12
|
}
|
|
10
13
|
|
|
11
|
-
let { type = 'success', showClose = true, callback, children }: Props = $props();
|
|
14
|
+
let { type = 'success', showClose = true, onclose, callback, children }: Props = $props();
|
|
12
15
|
</script>
|
|
13
16
|
|
|
14
17
|
<div class={`alert alert--${type}`}>
|
|
15
18
|
{#if showClose}
|
|
16
|
-
<button
|
|
19
|
+
<button
|
|
20
|
+
onclick={() => {
|
|
21
|
+
callback();
|
|
22
|
+
onclose();
|
|
23
|
+
}}
|
|
24
|
+
class="alert__close"
|
|
25
|
+
>
|
|
17
26
|
<IconClose width="2em" height="2em" />
|
|
18
27
|
</button>
|
|
19
28
|
{/if}
|
package/dist/Alert.svelte.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import type { MouseEventHandler } from 'svelte/elements';
|
|
1
2
|
interface Props {
|
|
2
3
|
type?: 'success' | 'danger' | 'flash';
|
|
3
4
|
showClose?: boolean;
|
|
4
|
-
|
|
5
|
+
/** @deprecated use onclose instead */
|
|
6
|
+
callback?: MouseEventHandler<HTMLButtonElement>;
|
|
7
|
+
onclose?: MouseEventHandler<HTMLButtonElement>;
|
|
5
8
|
children?: import('svelte').Snippet;
|
|
6
9
|
}
|
|
7
10
|
declare const Alert: import("svelte").Component<Props, {}, "">;
|
package/dist/Button.svelte
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type {
|
|
3
|
-
HTMLButtonAttributes,
|
|
4
|
-
HTMLInputAttributes,
|
|
5
|
-
MouseEventHandler
|
|
6
|
-
} from 'svelte/elements';
|
|
2
|
+
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
7
3
|
|
|
8
4
|
interface Props extends HTMLButtonAttributes {
|
|
9
5
|
kind?: 'danger' | 'success' | 'dark' | 'basic';
|
|
@@ -24,6 +20,7 @@
|
|
|
24
20
|
|
|
25
21
|
<button
|
|
26
22
|
class={`iroco-ui-button iroco-ui-button--${size} iroco-ui-button--${kind} ${fullWidth ? 'iroco-ui-button--full-width' : ''}`}
|
|
23
|
+
{disabled}
|
|
27
24
|
class:disabled
|
|
28
25
|
{...rest}
|
|
29
26
|
>
|
package/dist/TextInput.svelte
CHANGED
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
let {
|
|
15
|
+
id,
|
|
15
16
|
type = 'text',
|
|
17
|
+
value,
|
|
18
|
+
placeholder,
|
|
16
19
|
label = null,
|
|
17
20
|
error = null,
|
|
18
21
|
errors = [],
|
|
@@ -33,6 +36,9 @@
|
|
|
33
36
|
<label class="iroco-ui-label" for={id}>{label}</label>
|
|
34
37
|
{/if}
|
|
35
38
|
<input
|
|
39
|
+
{id}
|
|
40
|
+
{placeholder}
|
|
41
|
+
{readonly}
|
|
36
42
|
{type}
|
|
37
43
|
class:border
|
|
38
44
|
class:error={hasErrors()}
|