@valerius_petrini/corekit-ui 0.1.82 → 0.1.83
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/display/Card/index.stories.svelte +11 -3
- package/dist/components/display/Card/index.svelte +16 -2
- package/dist/components/display/Card/types.d.ts +4 -1
- package/dist/components/display/Card/variant.js +3 -1
- package/dist/components/navigation/Navbar/NavbarElement.svelte +1 -0
- package/dist/styles/layout.css +7 -4
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
argTypes: {
|
|
13
13
|
variant: {
|
|
14
14
|
control: "select",
|
|
15
|
-
options: ["bordered", "elevated"],
|
|
15
|
+
options: ["bordered", "elevated", "ghost", "flat"],
|
|
16
16
|
},
|
|
17
17
|
size: {
|
|
18
18
|
control: "select",
|
|
@@ -28,8 +28,16 @@
|
|
|
28
28
|
});
|
|
29
29
|
</script>
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
{#snippet header()}
|
|
32
|
+
<img src="https://upload.wikimedia.org/wikipedia/commons/c/c8/Altja_j%C3%B5gi_Lahemaal.jpg" alt="Card">
|
|
33
|
+
{/snippet}
|
|
34
|
+
|
|
35
|
+
{#snippet footer()}
|
|
36
|
+
<Button href="https://example.com" external class="ml-auto mr-4" color="sub">Learn More</Button>
|
|
37
|
+
<Button href="https://example.com" external>Get Started</Button>
|
|
38
|
+
{/snippet}
|
|
39
|
+
|
|
40
|
+
<Story name="Default" args={{ variant: "bordered", size: "md", footer, header }}>
|
|
32
41
|
<Text tag="h2" class="text-2xl font-bold mb-4">Customizable Card</Text>
|
|
33
42
|
<Text class="mb-4">This is a customizable card component. You can add any content here and style it as needed.</Text>
|
|
34
|
-
<Button href="https://example.com" target="_blank">Learn More</Button>
|
|
35
43
|
</Story>
|
|
@@ -14,12 +14,14 @@
|
|
|
14
14
|
variant = "bordered",
|
|
15
15
|
size = "md",
|
|
16
16
|
radius = "md",
|
|
17
|
+
footer = undefined,
|
|
18
|
+
header = undefined,
|
|
17
19
|
...restProps
|
|
18
20
|
}: CardProps = $props();
|
|
19
21
|
|
|
20
22
|
let combinedClass = $derived(twMerge(
|
|
21
|
-
"text-main-text rounded-lg transition-all ease-in-out bg-gradient-to-br from-sub-background to-sub-background-accent p-4 w-full",
|
|
22
|
-
href && "block hover:
|
|
23
|
+
"text-main-text rounded-lg transition-colors transition-all ease-in-out bg-gradient-to-br from-sub-background to-sub-background-accent p-4 w-full flex flex-col",
|
|
24
|
+
href && "block hover:from-sub-background-hover hover:to-sub-background-hover cursor-pointer hover:border-sub-background-border-hover hover:-translate-y-0.5",
|
|
23
25
|
cardVariantStyles[variant],
|
|
24
26
|
getSizeStyleClass(size, "card"),
|
|
25
27
|
getSizeStyleClass(radius, "radius"),
|
|
@@ -43,5 +45,17 @@
|
|
|
43
45
|
{...restProps}
|
|
44
46
|
bind:this={element}
|
|
45
47
|
>
|
|
48
|
+
{#if header}
|
|
49
|
+
<div class="-mx-4 -mt-4 mb-4 overflow-hidden">
|
|
50
|
+
{@render header()}
|
|
51
|
+
</div>
|
|
52
|
+
{/if}
|
|
53
|
+
|
|
46
54
|
{@render children?.()}
|
|
55
|
+
|
|
56
|
+
{#if footer}
|
|
57
|
+
<div class="flex items-center justify-between border-t border-sub-background-border mt-4 -mx-4 -mb-4 px-4 py-3 text-sm text-sub-text">
|
|
58
|
+
{@render footer()}
|
|
59
|
+
</div>
|
|
60
|
+
{/if}
|
|
47
61
|
</svelte:element>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
1
2
|
import type { SizeStyle } from "../../../styles/size";
|
|
2
3
|
import type { BaseComponentProps } from "../../../types/BaseComponent";
|
|
3
|
-
export type CardVariant = "bordered" | "elevated";
|
|
4
|
+
export type CardVariant = "bordered" | "elevated" | "ghost" | "flat";
|
|
4
5
|
/**
|
|
5
6
|
* <Corekit UI> A Card component
|
|
6
7
|
*
|
|
@@ -13,4 +14,6 @@ export interface CardProps extends BaseComponentProps {
|
|
|
13
14
|
variant?: CardVariant;
|
|
14
15
|
size?: SizeStyle;
|
|
15
16
|
radius?: SizeStyle;
|
|
17
|
+
footer?: Snippet;
|
|
18
|
+
header?: Snippet;
|
|
16
19
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export const cardVariantStyles = {
|
|
2
2
|
bordered: "border-[1px] border-sub-background-border",
|
|
3
|
-
elevated: "shadow-
|
|
3
|
+
elevated: "shadow-[0_4px_12px_rgba(0,0,0,0.35)]",
|
|
4
|
+
ghost: "bg-transparent border-transparent",
|
|
5
|
+
flat: "border border-transparent shadow-none",
|
|
4
6
|
};
|
package/dist/styles/layout.css
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
--color-form-background: var(--vpcui-form-background);
|
|
19
19
|
--color-form-hover: var(--vpcui-form-hover);
|
|
20
20
|
--color-form-border: var(--vpcui-form-border);
|
|
21
|
+
--color-sub-background-border-hover: var(--vpcui-sub-background-border-hover);
|
|
21
22
|
|
|
22
23
|
--color-primary: var(--vpcui-primary);
|
|
23
24
|
--color-secondary: var(--vpcui-secondary);
|
|
@@ -79,8 +80,9 @@
|
|
|
79
80
|
--vpcui-main-background: var(--vpcui-light-50);
|
|
80
81
|
--vpcui-sub-background: var(--vpcui-light-100);
|
|
81
82
|
--vpcui-sub-background-hover: var(--vpcui-light-150);
|
|
82
|
-
--vpcui-sub-background-border: var(--vpcui-light-
|
|
83
|
-
--vpcui-sub-background-accent: var(--vpcui-light-
|
|
83
|
+
--vpcui-sub-background-border: var(--vpcui-light-200);
|
|
84
|
+
--vpcui-sub-background-accent: var(--vpcui-light-50);
|
|
85
|
+
--vpcui-sub-background-border-hover: var(--vpcui-light-250);
|
|
84
86
|
--vpcui-main-text: var(--vpcui-light-950);
|
|
85
87
|
--vpcui-sub-text: var(--vpcui-light-300);
|
|
86
88
|
--vpcui-contrast-text: var(--vpcui-light-950);
|
|
@@ -109,8 +111,9 @@ html.dark {
|
|
|
109
111
|
--vpcui-main-background: var(--vpcui-dark-50);
|
|
110
112
|
--vpcui-sub-background: var(--vpcui-dark-100);
|
|
111
113
|
--vpcui-sub-background-hover: var(--vpcui-dark-150);
|
|
112
|
-
--vpcui-sub-background-border: var(--vpcui-dark-
|
|
113
|
-
--vpcui-sub-background-accent: var(--vpcui-dark-
|
|
114
|
+
--vpcui-sub-background-border: var(--vpcui-dark-200);
|
|
115
|
+
--vpcui-sub-background-accent: var(--vpcui-dark-150);
|
|
116
|
+
--vpcui-sub-background-border-hover: var(--vpcui-dark-250);
|
|
114
117
|
--vpcui-main-text: var(--vpcui-dark-950);
|
|
115
118
|
--vpcui-sub-text: var(--vpcui-dark-300);
|
|
116
119
|
--vpcui-contrast-text: var(--vpcui-dark-50);
|