@noxlovette/material 0.1.8 → 0.1.10
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/buttons/Button.svelte +7 -1
- package/dist/components/buttons/ButtonIcon.svelte +11 -2
- package/dist/components/buttons/FAB.svelte +1 -0
- package/dist/components/buttons/FABMenu.svelte +1 -0
- package/dist/components/buttons/FABMenuItem.svelte +6 -1
- package/dist/components/buttons/Toggle.svelte +1 -0
- package/dist/components/cards/Card.svelte +2 -2
- package/dist/components/forms/multipart/Multipart.svelte +0 -1
- package/dist/components/forms/tooltip/Tooltip.svelte +7 -2
- package/dist/components/forms/tooltip/types.d.ts +1 -1
- package/dist/components/misc/Avatar.svelte +2 -2
- package/dist/components/progress/CircularProgress.svelte +1 -1
- package/dist/components/progress/LinearProgress.svelte +1 -0
- package/dist/components/snackbar/Snackbar.svelte +2 -2
- package/package.json +1 -1
|
@@ -36,7 +36,13 @@ Buttons help people take actions, such as sending an email, sharing a document,
|
|
|
36
36
|
const btnCls = $derived(base({ class: clsx(className) }));
|
|
37
37
|
</script>
|
|
38
38
|
|
|
39
|
-
<Button.Root
|
|
39
|
+
<Button.Root
|
|
40
|
+
{disabled}
|
|
41
|
+
{formaction}
|
|
42
|
+
class={btnCls}
|
|
43
|
+
data-cy="m3-button"
|
|
44
|
+
{...restProps as ButtonRootProps}
|
|
45
|
+
>
|
|
40
46
|
{#if iconProps}
|
|
41
47
|
{#if loading}
|
|
42
48
|
<LoadingIndicator container={variant === 'filled'} class={icon()} />
|
|
@@ -49,14 +49,16 @@ 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()}
|
|
52
|
+
{#snippet trigger(triggerAttrs)}
|
|
53
53
|
{#if variation === 'toggle'}
|
|
54
54
|
<Toggle.Root
|
|
55
55
|
bind:pressed
|
|
56
56
|
{onPressedChange}
|
|
57
57
|
{disabled}
|
|
58
58
|
class={btnCls}
|
|
59
|
+
data-cy="m3-button-icon"
|
|
59
60
|
{...restProps as ToggleRootProps}
|
|
61
|
+
{...triggerAttrs}
|
|
60
62
|
>
|
|
61
63
|
{#if loading}
|
|
62
64
|
<LoadingIndicator />
|
|
@@ -66,7 +68,14 @@ Icon buttons help people take minor actions and are often used in app bars.
|
|
|
66
68
|
{/if}
|
|
67
69
|
</Toggle.Root>
|
|
68
70
|
{:else}
|
|
69
|
-
<Button.Root
|
|
71
|
+
<Button.Root
|
|
72
|
+
{disabled}
|
|
73
|
+
{formaction}
|
|
74
|
+
class={btnCls}
|
|
75
|
+
data-cy="m3-button-icon"
|
|
76
|
+
{...restProps as ButtonRootProps}
|
|
77
|
+
{...triggerAttrs}
|
|
78
|
+
>
|
|
70
79
|
{#if loading}
|
|
71
80
|
<LoadingIndicator />
|
|
72
81
|
{:else}
|
|
@@ -23,7 +23,12 @@ An individual action within a FAB menu.
|
|
|
23
23
|
const btnCls = $derived(base({ class: clsx(className) }));
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
|
-
<Button.Root
|
|
26
|
+
<Button.Root
|
|
27
|
+
{formaction}
|
|
28
|
+
class={btnCls}
|
|
29
|
+
data-cy="m3-fab-menu-item"
|
|
30
|
+
{...restProps as ButtonRootProps}
|
|
31
|
+
>
|
|
27
32
|
{#if iconProps}
|
|
28
33
|
{#if loading}
|
|
29
34
|
<LoadingIndicator />
|
|
@@ -27,12 +27,12 @@ and serve as an entry point to more detailed information.
|
|
|
27
27
|
</script>
|
|
28
28
|
|
|
29
29
|
{#if href}
|
|
30
|
-
<a {href} class={base({ class: clsx(className) })} {...restProps}>
|
|
30
|
+
<a {href} class={base({ class: clsx(className) })} data-cy="m3-card" {...restProps}>
|
|
31
31
|
{#if hoverable}<Layer />{/if}
|
|
32
32
|
{@render children?.()}
|
|
33
33
|
</a>
|
|
34
34
|
{:else}
|
|
35
|
-
<div class={base({ class: clsx(className) })} {...restProps}>
|
|
35
|
+
<div class={base({ class: clsx(className) })} data-cy="m3-card" {...restProps}>
|
|
36
36
|
{#if hoverable}<Layer />{/if}
|
|
37
37
|
{@render children?.()}
|
|
38
38
|
</div>
|
|
@@ -51,8 +51,13 @@ Plain tooltips are used for simple labels, while rich tooltips can contain forma
|
|
|
51
51
|
</script>
|
|
52
52
|
|
|
53
53
|
<Tooltip.Root {...restProps} {delayDuration} bind:open={isOpen}>
|
|
54
|
-
<Tooltip.Trigger {...triggerProps}
|
|
55
|
-
{
|
|
54
|
+
<Tooltip.Trigger {...triggerProps}>
|
|
55
|
+
{#snippet child({ props })}
|
|
56
|
+
{@render trigger?.({
|
|
57
|
+
...props,
|
|
58
|
+
class: triggerCls({ class: clsx(triggerClass, props.class as string) })
|
|
59
|
+
})}
|
|
60
|
+
{/snippet}
|
|
56
61
|
</Tooltip.Trigger>
|
|
57
62
|
<Tooltip.Portal>
|
|
58
63
|
{#if showArrow}
|
|
@@ -9,7 +9,7 @@ export type TooltipProps = TooltipVariants & TooltipRootProps & {
|
|
|
9
9
|
/** Secondary text providing additional context */
|
|
10
10
|
supportingText?: string | null;
|
|
11
11
|
/** The element that triggers the tooltip on hover or focus */
|
|
12
|
-
trigger?: Snippet
|
|
12
|
+
trigger?: Snippet<[Record<string, unknown>]>;
|
|
13
13
|
/** CSS class applied to the trigger element */
|
|
14
14
|
triggerClass?: string;
|
|
15
15
|
/** Additional props passed to the underlying Tooltip.Trigger component */
|
|
@@ -47,7 +47,7 @@ Avatars can be used to represent people or objects.
|
|
|
47
47
|
</script>
|
|
48
48
|
|
|
49
49
|
{#if onclick}
|
|
50
|
-
<button class={button({ class: rootClasses })} {onclick} type="button">
|
|
50
|
+
<button class={button({ class: rootClasses })} {onclick} type="button" data-cy="m3-avatar">
|
|
51
51
|
<Layer />
|
|
52
52
|
<AvatarPrimitive.Root {...rest} bind:loadingStatus class="h-full w-full">
|
|
53
53
|
{#if src}
|
|
@@ -59,7 +59,7 @@ Avatars can be used to represent people or objects.
|
|
|
59
59
|
</AvatarPrimitive.Root>
|
|
60
60
|
</button>
|
|
61
61
|
{:else}
|
|
62
|
-
<AvatarPrimitive.Root {...rest} bind:loadingStatus class={rootClasses}>
|
|
62
|
+
<AvatarPrimitive.Root {...rest} bind:loadingStatus class={rootClasses} data-cy="m3-avatar">
|
|
63
63
|
{#if src}
|
|
64
64
|
<AvatarPrimitive.Image {src} {alt} class={image()} />
|
|
65
65
|
{/if}
|
|
@@ -24,7 +24,7 @@ Material 3 Circular Progress Indicator.
|
|
|
24
24
|
let circumference = $derived(Math.PI * r * 2);
|
|
25
25
|
</script>
|
|
26
26
|
|
|
27
|
-
<Progress.Root value={percent ?? null} max={100}>
|
|
27
|
+
<Progress.Root value={percent ?? null} max={100} data-cy="m3-circular-progress">
|
|
28
28
|
{#snippet child({ props })}
|
|
29
29
|
<svg
|
|
30
30
|
{...props}
|
|
@@ -61,7 +61,7 @@ Snackbars provide brief messages about app processes at the bottom of the screen
|
|
|
61
61
|
{#if message && !dismissed}
|
|
62
62
|
<div
|
|
63
63
|
class={base()}
|
|
64
|
-
data-cy="
|
|
64
|
+
data-cy="m3-snackbar"
|
|
65
65
|
{...restProps}
|
|
66
66
|
in:enterExit={{
|
|
67
67
|
duration: 400,
|
|
@@ -100,7 +100,7 @@ Snackbars provide brief messages about app processes at the bottom of the screen
|
|
|
100
100
|
}
|
|
101
101
|
}}
|
|
102
102
|
aria-label="Dismiss snackbar"
|
|
103
|
-
data-cy="
|
|
103
|
+
data-cy="m3-snackbar-dismiss"
|
|
104
104
|
>
|
|
105
105
|
<Icon class={icon()} name="close" />
|
|
106
106
|
<Layer />
|