noph-ui 0.8.15 → 0.9.1

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.
@@ -1,8 +1,12 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from 'svelte'
3
+ import type { HTMLAttributes } from 'svelte/elements'
3
4
 
4
- let { children, element = $bindable() }: { children: Snippet; element?: HTMLSpanElement } =
5
- $props()
5
+ interface IconProps extends HTMLAttributes<HTMLSpanElement> {
6
+ children: Snippet
7
+ element?: HTMLSpanElement
8
+ }
9
+ let { children, element = $bindable(), ...attributes }: IconProps = $props()
6
10
  </script>
7
11
 
8
12
  <svelte:head>
@@ -11,7 +15,7 @@
11
15
  font-family: 'Material Symbols Outlined';
12
16
  font-weight: normal;
13
17
  font-style: normal;
14
- font-size: 24px;
18
+ font-size: var(--np-icon-size, 1.5rem);
15
19
  line-height: 1;
16
20
  letter-spacing: normal;
17
21
  text-transform: none;
@@ -33,9 +37,9 @@
33
37
  display: inline-flex;
34
38
  fill: currentColor;
35
39
  color: var(--_icon-color);
36
- font-size: var(--_icon-size);
37
- inline-size: var(--_icon-size);
38
- block-size: var(--_icon-size);
40
+ font-size: var(--np-icon-size, var(--_icon-size));
41
+ inline-size: var(--np-icon-size, var(--_icon-size));
42
+ block-size: var(--np-icon-size, var(--_icon-size));
39
43
  flex-shrink: 0;
40
44
  writing-mode: horizontal-tb;
41
45
  position: relative;
@@ -43,4 +47,6 @@
43
47
  </style>
44
48
  </svelte:head>
45
49
 
46
- <span class="np-icon" bind:this={element}>{@render children()}</span>
50
+ <span {...attributes} class={['np-icon', attributes.class]} bind:this={element}
51
+ >{@render children()}</span
52
+ >
@@ -1,5 +1,6 @@
1
1
  import type { Snippet } from 'svelte';
2
- declare const Icon: import("svelte").Component<{
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ declare const Icon: import("svelte").Component<HTMLAttributes<HTMLSpanElement> & {
3
4
  children: Snippet;
4
5
  element?: HTMLSpanElement;
5
6
  }, {}, "element">;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "noph-ui",
3
- "version": "0.8.15",
3
+ "version": "0.9.1",
4
4
  "license": "MIT",
5
5
  "homepage": "https://noph.dev",
6
6
  "repository": {