@marianmeres/stuic 2.65.0 → 2.66.0
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,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
+
import { DevicePointer, twMerge } from "../../index.js";
|
|
2
3
|
export interface Props {
|
|
3
4
|
class?: string;
|
|
4
5
|
strokeWidth?: 0.5 | 1 | 1.5 | 2 | 2.5 | 3 | 3.5 | 4;
|
|
@@ -6,9 +7,13 @@
|
|
|
6
7
|
</script>
|
|
7
8
|
|
|
8
9
|
<script lang="ts">
|
|
9
|
-
|
|
10
|
+
let { class: classProps, strokeWidth }: Props = $props();
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
const dp = new DevicePointer();
|
|
13
|
+
const auto = $derived(dp.isCoarse ? 3 : 2);
|
|
14
|
+
|
|
15
|
+
// if sw not provided use thicker on mobile
|
|
16
|
+
const _strokeWidth = $derived(strokeWidth ?? auto);
|
|
12
17
|
|
|
13
18
|
// size-6 = 1.5rem = 24px
|
|
14
19
|
</script>
|
|
@@ -16,7 +21,7 @@
|
|
|
16
21
|
<svg
|
|
17
22
|
fill="none"
|
|
18
23
|
viewBox="0 0 24 24"
|
|
19
|
-
stroke-width={
|
|
24
|
+
stroke-width={_strokeWidth}
|
|
20
25
|
stroke="currentColor"
|
|
21
26
|
class={twMerge("inline size-6", classProps)}
|
|
22
27
|
>
|