@x33025/sveltely 0.0.6 → 0.0.8
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/Tooltip.svelte +63 -0
- package/dist/components/Tooltip.svelte.d.ts +10 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/style/index.css +6 -0
- package/dist/style.css +34 -0
- package/package.json +9 -2
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
label,
|
|
6
|
+
class: className = '',
|
|
7
|
+
disabled = false,
|
|
8
|
+
children,
|
|
9
|
+
...props
|
|
10
|
+
}: { label: string; class?: string; disabled?: boolean; children: Snippet } & Record<
|
|
11
|
+
string,
|
|
12
|
+
unknown
|
|
13
|
+
> = $props();
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<span class="tooltip {className}" aria-label={!disabled ? label : undefined} {...props}>
|
|
17
|
+
{@render children()}
|
|
18
|
+
{#if !disabled}
|
|
19
|
+
<span class="tooltip-content" role="tooltip">{label}</span>
|
|
20
|
+
{/if}
|
|
21
|
+
</span>
|
|
22
|
+
|
|
23
|
+
<style>
|
|
24
|
+
.tooltip {
|
|
25
|
+
position: relative;
|
|
26
|
+
display: inline-flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.tooltip-content {
|
|
31
|
+
position: absolute;
|
|
32
|
+
left: 50%;
|
|
33
|
+
bottom: calc(100% + 6px);
|
|
34
|
+
transform: translateX(-50%);
|
|
35
|
+
padding: var(--tooltip-padding);
|
|
36
|
+
border-radius: var(--tooltip-border-radius);
|
|
37
|
+
background: var(--tooltip-background);
|
|
38
|
+
color: var(--tooltip-text);
|
|
39
|
+
font-size: var(--tooltip-font-size);
|
|
40
|
+
white-space: nowrap;
|
|
41
|
+
opacity: 0;
|
|
42
|
+
pointer-events: none;
|
|
43
|
+
z-index: 10;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.tooltip-content::after {
|
|
47
|
+
content: '';
|
|
48
|
+
position: absolute;
|
|
49
|
+
top: calc(100% - 5px);
|
|
50
|
+
left: 50%;
|
|
51
|
+
width: 10px;
|
|
52
|
+
height: 10px;
|
|
53
|
+
transform: translateX(-50%) rotate(45deg);
|
|
54
|
+
background: var(--tooltip-background);
|
|
55
|
+
border-radius: 0;
|
|
56
|
+
border-bottom-right-radius: calc(var(--tooltip-border-radius) / 2);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.tooltip:hover .tooltip-content,
|
|
60
|
+
.tooltip:focus-within .tooltip-content {
|
|
61
|
+
opacity: 1;
|
|
62
|
+
}
|
|
63
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
label: string;
|
|
4
|
+
class?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
children: Snippet;
|
|
7
|
+
} & Record<string, unknown>;
|
|
8
|
+
declare const Tooltip: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
9
|
+
type Tooltip = ReturnType<typeof Tooltip>;
|
|
10
|
+
export default Tooltip;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,5 +6,6 @@ export { default as Portal } from './components/Portal.svelte';
|
|
|
6
6
|
export { default as Sheet } from './components/Sheet';
|
|
7
7
|
export { default as Spinner } from './components/Spinner.svelte';
|
|
8
8
|
export { default as TextShimmer } from './components/TextShimmer.svelte';
|
|
9
|
+
export { default as Tooltip } from './components/Tooltip.svelte';
|
|
9
10
|
export { default as Dropdown } from './components/Dropdown';
|
|
10
11
|
export { default as TabView } from './components/TabView';
|
package/dist/index.js
CHANGED
|
@@ -6,5 +6,6 @@ export { default as Portal } from './components/Portal.svelte';
|
|
|
6
6
|
export { default as Sheet } from './components/Sheet';
|
|
7
7
|
export { default as Spinner } from './components/Spinner.svelte';
|
|
8
8
|
export { default as TextShimmer } from './components/TextShimmer.svelte';
|
|
9
|
+
export { default as Tooltip } from './components/Tooltip.svelte';
|
|
9
10
|
export { default as Dropdown } from './components/Dropdown';
|
|
10
11
|
export { default as TabView } from './components/TabView';
|
package/dist/style/index.css
CHANGED
|
@@ -58,5 +58,11 @@
|
|
|
58
58
|
|
|
59
59
|
--dropdown-background: var(--color-white);
|
|
60
60
|
--dropdown-shadow: var(--shadow-md);
|
|
61
|
+
|
|
62
|
+
--tooltip-border-radius: var(--radius-sm);
|
|
63
|
+
--tooltip-padding: 4px 8px;
|
|
64
|
+
--tooltip-font-size: 12px;
|
|
65
|
+
--tooltip-background: #111827;
|
|
66
|
+
--tooltip-text: #f9fafb;
|
|
61
67
|
}
|
|
62
68
|
}
|
package/dist/style.css
CHANGED
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
--font-weight-medium: 500;
|
|
29
29
|
--font-weight-semibold: 600;
|
|
30
30
|
--tracking-wide: 0.025em;
|
|
31
|
+
--radius-sm: 0.25rem;
|
|
31
32
|
--radius-md: 0.375rem;
|
|
32
33
|
--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
|
|
33
34
|
--ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
|
|
@@ -264,6 +265,9 @@
|
|
|
264
265
|
.flex-1 {
|
|
265
266
|
flex: 1;
|
|
266
267
|
}
|
|
268
|
+
.transform {
|
|
269
|
+
transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);
|
|
270
|
+
}
|
|
267
271
|
.transform-gpu {
|
|
268
272
|
transform: translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);
|
|
269
273
|
}
|
|
@@ -555,8 +559,33 @@
|
|
|
555
559
|
--dropdown-content-padding: calc(var(--spacing));
|
|
556
560
|
--dropdown-background: var(--color-white);
|
|
557
561
|
--dropdown-shadow: var(--shadow-md);
|
|
562
|
+
--tooltip-border-radius: var(--radius-sm);
|
|
563
|
+
--tooltip-padding: 4px 8px;
|
|
564
|
+
--tooltip-font-size: 12px;
|
|
565
|
+
--tooltip-background: #111827;
|
|
566
|
+
--tooltip-text: #f9fafb;
|
|
558
567
|
}
|
|
559
568
|
}
|
|
569
|
+
@property --tw-rotate-x {
|
|
570
|
+
syntax: "*";
|
|
571
|
+
inherits: false;
|
|
572
|
+
}
|
|
573
|
+
@property --tw-rotate-y {
|
|
574
|
+
syntax: "*";
|
|
575
|
+
inherits: false;
|
|
576
|
+
}
|
|
577
|
+
@property --tw-rotate-z {
|
|
578
|
+
syntax: "*";
|
|
579
|
+
inherits: false;
|
|
580
|
+
}
|
|
581
|
+
@property --tw-skew-x {
|
|
582
|
+
syntax: "*";
|
|
583
|
+
inherits: false;
|
|
584
|
+
}
|
|
585
|
+
@property --tw-skew-y {
|
|
586
|
+
syntax: "*";
|
|
587
|
+
inherits: false;
|
|
588
|
+
}
|
|
560
589
|
@property --tw-space-y-reverse {
|
|
561
590
|
syntax: "*";
|
|
562
591
|
inherits: false;
|
|
@@ -765,6 +794,11 @@
|
|
|
765
794
|
@layer properties {
|
|
766
795
|
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
767
796
|
*, ::before, ::after, ::backdrop {
|
|
797
|
+
--tw-rotate-x: initial;
|
|
798
|
+
--tw-rotate-y: initial;
|
|
799
|
+
--tw-rotate-z: initial;
|
|
800
|
+
--tw-skew-x: initial;
|
|
801
|
+
--tw-skew-y: initial;
|
|
768
802
|
--tw-space-y-reverse: 0;
|
|
769
803
|
--tw-border-style: solid;
|
|
770
804
|
--tw-font-weight: initial;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x33025/sveltely",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite dev",
|
|
6
6
|
"build": "vite build && npm run prepack",
|
|
@@ -27,7 +27,14 @@
|
|
|
27
27
|
"exports": {
|
|
28
28
|
".": {
|
|
29
29
|
"types": "./dist/index.d.ts",
|
|
30
|
-
"svelte": "./dist/index.js"
|
|
30
|
+
"svelte": "./dist/index.js",
|
|
31
|
+
"import": "./dist/index.js",
|
|
32
|
+
"default": "./dist/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./*.svelte": {
|
|
35
|
+
"types": "./dist/components/*.svelte.d.ts",
|
|
36
|
+
"svelte": "./dist/components/*.svelte",
|
|
37
|
+
"default": "./dist/components/*.svelte"
|
|
31
38
|
},
|
|
32
39
|
"./style.css": "./dist/style.css"
|
|
33
40
|
},
|