@noxlovette/material 0.1.9 → 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.
@@ -49,7 +49,7 @@ 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
@@ -58,6 +58,7 @@ Icon buttons help people take minor actions and are often used in app bars.
58
58
  class={btnCls}
59
59
  data-cy="m3-button-icon"
60
60
  {...restProps as ToggleRootProps}
61
+ {...triggerAttrs}
61
62
  >
62
63
  {#if loading}
63
64
  <LoadingIndicator />
@@ -73,6 +74,7 @@ Icon buttons help people take minor actions and are often used in app bars.
73
74
  class={btnCls}
74
75
  data-cy="m3-button-icon"
75
76
  {...restProps as ButtonRootProps}
77
+ {...triggerAttrs}
76
78
  >
77
79
  {#if loading}
78
80
  <LoadingIndicator />
@@ -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} class={triggerCls({ class: clsx(triggerClass) })}>
55
- {@render trigger?.()}
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 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noxlovette/material",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {