@reshape-biotech/design-system 0.0.13 → 0.0.15
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,6 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import Tooltip from '../tooltip/Tooltip.svelte';
|
|
3
|
-
|
|
4
3
|
interface Props {
|
|
5
4
|
name: string | null | undefined;
|
|
6
5
|
size?: 'sm' | 'md';
|
|
@@ -44,7 +43,7 @@
|
|
|
44
43
|
|
|
45
44
|
{#snippet avatar()}
|
|
46
45
|
<div
|
|
47
|
-
class="{sizeClassName}
|
|
46
|
+
class="{sizeClassName} flex items-center justify-center rounded-full bg-accent-inverse text-primary-inverse"
|
|
48
47
|
>
|
|
49
48
|
{initials}
|
|
50
49
|
</div>
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { Tooltip } from 'flowbite-svelte';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
interface Props {
|
|
6
|
+
class?: string;
|
|
7
|
+
forceOpen?: boolean;
|
|
8
|
+
showArrow?: boolean;
|
|
9
|
+
placement?: 'top' | 'right' | 'bottom' | 'left';
|
|
10
|
+
trigger?: Snippet;
|
|
11
|
+
content?: Snippet;
|
|
12
|
+
}
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
let {
|
|
15
|
+
class: className = '',
|
|
16
|
+
forceOpen = false,
|
|
17
|
+
showArrow = true,
|
|
18
|
+
placement = 'top',
|
|
19
|
+
trigger,
|
|
20
|
+
content
|
|
21
|
+
}: Props = $props();
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
let tooltipClass = $derived(`${className} ${showArrow ? 'with-arrow' : ''}`);
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
26
|
{@render trigger?.()}
|
|
27
27
|
<Tooltip
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
open={forceOpen}
|
|
29
|
+
arrow={showArrow}
|
|
30
|
+
{placement}
|
|
31
|
+
class={`${tooltipClass} rounded bg-base-inverse px-2 py-1 text-sm font-normal text-primary-inverse shadow`}
|
|
32
32
|
>
|
|
33
|
-
|
|
33
|
+
{@render content?.()}
|
|
34
34
|
</Tooltip>
|
|
35
35
|
|
|
36
36
|
<style>
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
/* Hack to get the arrow styling to work */
|
|
38
|
+
:global(.tooltip.with-arrow > :last-child) {
|
|
39
39
|
pointer-events: none;
|
|
40
40
|
position: absolute;
|
|
41
41
|
display: block;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reshape-biotech/design-system",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite dev",
|
|
6
6
|
"build": "vite build && npm run package",
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
"exports": {
|
|
31
31
|
".": {
|
|
32
32
|
"types": "./dist/index.d.ts",
|
|
33
|
-
"svelte": "./dist/index.js"
|
|
33
|
+
"svelte": "./dist/index.js",
|
|
34
|
+
"default": "./dist/index.js"
|
|
34
35
|
}
|
|
35
36
|
},
|
|
36
37
|
"peerDependencies": {
|