@noxlovette/material 0.1.10 → 0.1.12
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.
|
@@ -49,13 +49,13 @@ Icon buttons help people take minor actions and are often used in app bars.
|
|
|
49
49
|
</script>
|
|
50
50
|
|
|
51
51
|
<Tooltip {triggerClass} variant="snack" supportingText={tooltipContent}>
|
|
52
|
-
{#snippet trigger(triggerAttrs)}
|
|
52
|
+
{#snippet trigger({ class: triggerClass_, ...triggerAttrs })}
|
|
53
53
|
{#if variation === 'toggle'}
|
|
54
54
|
<Toggle.Root
|
|
55
55
|
bind:pressed
|
|
56
56
|
{onPressedChange}
|
|
57
57
|
{disabled}
|
|
58
|
-
class={btnCls}
|
|
58
|
+
class={clsx(btnCls, triggerClass_ as string)}
|
|
59
59
|
data-cy="m3-button-icon"
|
|
60
60
|
{...restProps as ToggleRootProps}
|
|
61
61
|
{...triggerAttrs}
|
|
@@ -71,7 +71,7 @@ Icon buttons help people take minor actions and are often used in app bars.
|
|
|
71
71
|
<Button.Root
|
|
72
72
|
{disabled}
|
|
73
73
|
{formaction}
|
|
74
|
-
class={btnCls}
|
|
74
|
+
class={clsx(btnCls, triggerClass_ as string)}
|
|
75
75
|
data-cy="m3-button-icon"
|
|
76
76
|
{...restProps as ButtonRootProps}
|
|
77
77
|
{...triggerAttrs}
|
|
@@ -31,6 +31,7 @@ on screen until confirmed, dismissed, or a required action has been taken.
|
|
|
31
31
|
maxWidth = '560px',
|
|
32
32
|
children,
|
|
33
33
|
disabled = false,
|
|
34
|
+
delegateClose = false,
|
|
34
35
|
class: className,
|
|
35
36
|
contentProps,
|
|
36
37
|
...rootRest
|
|
@@ -100,11 +101,17 @@ on screen until confirmed, dismissed, or a required action has been taken.
|
|
|
100
101
|
{cancelText}
|
|
101
102
|
</Button>
|
|
102
103
|
|
|
103
|
-
|
|
104
|
+
{#if delegateClose}
|
|
104
105
|
<Button type="submit" {disabled} {loading} data-cy="dialogue-confirm">
|
|
105
106
|
{confirmText}
|
|
106
107
|
</Button>
|
|
107
|
-
|
|
108
|
+
{:else}
|
|
109
|
+
<Dialog.Close>
|
|
110
|
+
<Button type="submit" {disabled} {loading} data-cy="dialogue-confirm">
|
|
111
|
+
{confirmText}
|
|
112
|
+
</Button>
|
|
113
|
+
</Dialog.Close>
|
|
114
|
+
{/if}
|
|
108
115
|
</div>
|
|
109
116
|
</form>
|
|
110
117
|
{/if}
|
|
@@ -41,4 +41,11 @@ export type DialogueProps = DialogueVariants & Dialog.RootProps & {
|
|
|
41
41
|
class?: string;
|
|
42
42
|
/** Optional callback when the confirm button is clicked. */
|
|
43
43
|
onconfirm?: () => void;
|
|
44
|
+
/**
|
|
45
|
+
* When true, Dialog.Close is NOT rendered around the confirm button.
|
|
46
|
+
* The consumer is responsible for closing the dialog (e.g. via onResult in superforms).
|
|
47
|
+
* Useful when you need to keep the dialog open on validation failure.
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
50
|
+
delegateClose?: boolean;
|
|
44
51
|
};
|