@websline/system-components 0.0.5 → 0.0.6
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/atoms/icon/Icon.svelte +3 -1
- package/dist/components/atoms/icon/Icon.svelte.d.ts +2 -2
- package/dist/components/atoms/icon/components/Attach.svelte +27 -0
- package/dist/components/atoms/icon/components/Attach.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Block.svelte +27 -0
- package/dist/components/atoms/icon/components/Block.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Cogs.svelte +31 -0
- package/dist/components/atoms/icon/components/Cogs.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Controlling.svelte +27 -0
- package/dist/components/atoms/icon/components/Controlling.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Dashboard.svelte +41 -0
- package/dist/components/atoms/icon/components/Dashboard.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Database.svelte +27 -0
- package/dist/components/atoms/icon/components/Database.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Dragger.svelte +27 -0
- package/dist/components/atoms/icon/components/Dragger.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Globe.svelte +27 -0
- package/dist/components/atoms/icon/components/Globe.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Layout.svelte +27 -0
- package/dist/components/atoms/icon/components/Layout.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Menu.svelte +27 -0
- package/dist/components/atoms/icon/components/Menu.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Notifications.svelte +26 -0
- package/dist/components/atoms/icon/components/Notifications.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Picture.svelte +27 -0
- package/dist/components/atoms/icon/components/Picture.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Search.svelte +27 -0
- package/dist/components/atoms/icon/components/Search.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Settings.svelte +31 -0
- package/dist/components/atoms/icon/components/Settings.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Trash.svelte +27 -0
- package/dist/components/atoms/icon/components/Trash.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/index.d.ts +30 -0
- package/dist/components/atoms/icon/index.js +30 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/package.json +16 -16
- package/dist/components/molecules/navigationItem/NavigationItem.svelte +0 -80
- package/dist/components/molecules/navigationItem/NavigationItem.svelte.d.ts +0 -81
- package/dist/components/molecules/navigationItem/navigationItem.variants.d.ts +0 -61
- package/dist/components/molecules/navigationItem/navigationItem.variants.js +0 -29
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { Icon } from "../../../index.js";
|
|
3
|
-
import { fly } from "svelte/transition";
|
|
4
|
-
import { cubicOut } from "svelte/easing";
|
|
5
|
-
import { navigationItemVariants } from "./navigationItem.variants.js";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @typedef {Object} Props
|
|
9
|
-
* @property {string} [as="a"] The HTML element to use for the navigation item
|
|
10
|
-
* @property {string} [class=""] Additional CSS classes to apply to the component
|
|
11
|
-
* @property {boolean} [disabled=false] Whether the navigation item is disabled
|
|
12
|
-
* @property {boolean} [hasAlert=false] Whether the navigation item has an alert
|
|
13
|
-
* @property {string} [href=""] The URL the navigation item links to
|
|
14
|
-
* @property {string} [icon=""] The name of the icon to display
|
|
15
|
-
* @property {string} [label=""] The label of the navigation item
|
|
16
|
-
* @property {boolean} [selected=false] Whether the navigation item is selected
|
|
17
|
-
* @property {"_self" | "_blank" | "_parent" | "_top"} [target="_self"] The target attribute for the link
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/** @type {Props} */
|
|
21
|
-
let {
|
|
22
|
-
as = "a",
|
|
23
|
-
class: className = "",
|
|
24
|
-
disabled = false,
|
|
25
|
-
hasAlert = false,
|
|
26
|
-
href = "",
|
|
27
|
-
icon = "",
|
|
28
|
-
label = "",
|
|
29
|
-
selected = false,
|
|
30
|
-
target = "_self",
|
|
31
|
-
...rest
|
|
32
|
-
} = $props();
|
|
33
|
-
|
|
34
|
-
let styles = $derived(navigationItemVariants({ disabled }));
|
|
35
|
-
let hideTimer;
|
|
36
|
-
|
|
37
|
-
let showLabel = $state(false);
|
|
38
|
-
|
|
39
|
-
function enter() {
|
|
40
|
-
clearTimeout(hideTimer);
|
|
41
|
-
showLabel = true;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function leave() {
|
|
45
|
-
clearTimeout(hideTimer);
|
|
46
|
-
hideTimer = setTimeout(() => (showLabel = false), 50);
|
|
47
|
-
}
|
|
48
|
-
</script>
|
|
49
|
-
|
|
50
|
-
<svelte:element
|
|
51
|
-
this={as}
|
|
52
|
-
class={styles.base({ class: className })}
|
|
53
|
-
{href}
|
|
54
|
-
onmouseenter={enter}
|
|
55
|
-
onmouseleave={leave}
|
|
56
|
-
{target}
|
|
57
|
-
{...rest}>
|
|
58
|
-
{#if icon}
|
|
59
|
-
<div class={styles.icon({ hasAlert, selected })}>
|
|
60
|
-
<Icon name={icon} />
|
|
61
|
-
</div>
|
|
62
|
-
{/if}
|
|
63
|
-
{#if label && showLabel}
|
|
64
|
-
<span
|
|
65
|
-
class={styles.label()}
|
|
66
|
-
in:fly={{
|
|
67
|
-
x: -32,
|
|
68
|
-
y: 0,
|
|
69
|
-
duration: 300,
|
|
70
|
-
delay: 0,
|
|
71
|
-
easing: cubicOut,
|
|
72
|
-
}}
|
|
73
|
-
out:fly={{
|
|
74
|
-
x: -32,
|
|
75
|
-
y: 0,
|
|
76
|
-
duration: 300,
|
|
77
|
-
delay: 0,
|
|
78
|
-
}}>{label}</span>
|
|
79
|
-
{/if}
|
|
80
|
-
</svelte:element>
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
export default NavigationItem;
|
|
2
|
-
type NavigationItem = {
|
|
3
|
-
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
-
$set?(props: Partial<Props>): void;
|
|
5
|
-
};
|
|
6
|
-
declare const NavigationItem: import("svelte").Component<{
|
|
7
|
-
/**
|
|
8
|
-
* The HTML element to use for the navigation item
|
|
9
|
-
*/
|
|
10
|
-
as?: string;
|
|
11
|
-
/**
|
|
12
|
-
* Additional CSS classes to apply to the component
|
|
13
|
-
*/
|
|
14
|
-
class?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Whether the navigation item is disabled
|
|
17
|
-
*/
|
|
18
|
-
disabled?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Whether the navigation item has an alert
|
|
21
|
-
*/
|
|
22
|
-
hasAlert?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* The URL the navigation item links to
|
|
25
|
-
*/
|
|
26
|
-
href?: string;
|
|
27
|
-
/**
|
|
28
|
-
* The name of the icon to display
|
|
29
|
-
*/
|
|
30
|
-
icon?: string;
|
|
31
|
-
/**
|
|
32
|
-
* The label of the navigation item
|
|
33
|
-
*/
|
|
34
|
-
label?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Whether the navigation item is selected
|
|
37
|
-
*/
|
|
38
|
-
selected?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* The target attribute for the link
|
|
41
|
-
*/
|
|
42
|
-
target?: "_self" | "_blank" | "_parent" | "_top";
|
|
43
|
-
}, {}, "">;
|
|
44
|
-
type Props = {
|
|
45
|
-
/**
|
|
46
|
-
* The HTML element to use for the navigation item
|
|
47
|
-
*/
|
|
48
|
-
as?: string;
|
|
49
|
-
/**
|
|
50
|
-
* Additional CSS classes to apply to the component
|
|
51
|
-
*/
|
|
52
|
-
class?: string;
|
|
53
|
-
/**
|
|
54
|
-
* Whether the navigation item is disabled
|
|
55
|
-
*/
|
|
56
|
-
disabled?: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Whether the navigation item has an alert
|
|
59
|
-
*/
|
|
60
|
-
hasAlert?: boolean;
|
|
61
|
-
/**
|
|
62
|
-
* The URL the navigation item links to
|
|
63
|
-
*/
|
|
64
|
-
href?: string;
|
|
65
|
-
/**
|
|
66
|
-
* The name of the icon to display
|
|
67
|
-
*/
|
|
68
|
-
icon?: string;
|
|
69
|
-
/**
|
|
70
|
-
* The label of the navigation item
|
|
71
|
-
*/
|
|
72
|
-
label?: string;
|
|
73
|
-
/**
|
|
74
|
-
* Whether the navigation item is selected
|
|
75
|
-
*/
|
|
76
|
-
selected?: boolean;
|
|
77
|
-
/**
|
|
78
|
-
* The target attribute for the link
|
|
79
|
-
*/
|
|
80
|
-
target?: "_self" | "_blank" | "_parent" | "_top";
|
|
81
|
-
};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
export const navigationItemVariants: import("tailwind-variants").TVReturnType<{
|
|
2
|
-
disabled: {
|
|
3
|
-
true: {
|
|
4
|
-
base: string;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
7
|
-
hasAlert: {
|
|
8
|
-
true: {
|
|
9
|
-
icon: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
selected: {
|
|
13
|
-
true: {
|
|
14
|
-
icon: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
}, {
|
|
18
|
-
base: string;
|
|
19
|
-
icon: string;
|
|
20
|
-
label: string;
|
|
21
|
-
}, undefined, {
|
|
22
|
-
disabled: {
|
|
23
|
-
true: {
|
|
24
|
-
base: string;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
hasAlert: {
|
|
28
|
-
true: {
|
|
29
|
-
icon: string;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
selected: {
|
|
33
|
-
true: {
|
|
34
|
-
icon: string;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
}, {
|
|
38
|
-
base: string;
|
|
39
|
-
icon: string;
|
|
40
|
-
label: string;
|
|
41
|
-
}, import("tailwind-variants").TVReturnType<{
|
|
42
|
-
disabled: {
|
|
43
|
-
true: {
|
|
44
|
-
base: string;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
hasAlert: {
|
|
48
|
-
true: {
|
|
49
|
-
icon: string;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
selected: {
|
|
53
|
-
true: {
|
|
54
|
-
icon: string;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
}, {
|
|
58
|
-
base: string;
|
|
59
|
-
icon: string;
|
|
60
|
-
label: string;
|
|
61
|
-
}, undefined, unknown, unknown, undefined>>;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { tv } from "tailwind-variants";
|
|
2
|
-
|
|
3
|
-
const navigationItemVariants = tv({
|
|
4
|
-
slots: {
|
|
5
|
-
base: "inline-flex relative cursor-pointer select-none hover:pr-2 hover:[&>div]:bg-neutral-100 dark:hover:[&>div]:bg-neutral-700 dark:text-white",
|
|
6
|
-
icon: "bg-white dark:bg-neutral-900 p-2.5 rounded-sm transition duration-200 relative z-2",
|
|
7
|
-
label:
|
|
8
|
-
"body-small shadow-[0_2px_16px_0_rgba(0,_0,_0,_0.08)] px-2.5 flex items-center rounded-sm left-12 h-full absolute z-1",
|
|
9
|
-
},
|
|
10
|
-
variants: {
|
|
11
|
-
disabled: {
|
|
12
|
-
true: {
|
|
13
|
-
base: "opacity-40 pointer-events-none",
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
hasAlert: {
|
|
17
|
-
true: {
|
|
18
|
-
icon: "after:content-[''] after:absolute after:top-1 after:right-1 after:w-2 after:h-2 after:rounded-full after:bg-blue-500 dark:after:bg-blue-400",
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
selected: {
|
|
22
|
-
true: {
|
|
23
|
-
icon: "bg-neutral-300 dark:bg-neutral-700",
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
export { navigationItemVariants };
|