@valerius_petrini/corekit-ui 0.1.66 → 0.1.70
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/actions/toast.svelte.d.ts +1 -1
- package/dist/actions/toast.svelte.js +1 -1
- package/dist/components/display/Card/index.stories.svelte +35 -0
- package/dist/components/display/Card/index.stories.svelte.d.ts +18 -0
- package/dist/components/{Card.svelte → display/Card/index.svelte} +4 -3
- package/dist/components/display/Card/index.svelte.d.ts +4 -0
- package/dist/{types/Card.d.ts → components/display/Card/types.d.ts} +2 -3
- package/dist/components/display/Card/variant.d.ts +2 -0
- package/dist/components/display/KBD/index.stories.svelte +13 -0
- package/dist/components/display/KBD/index.stories.svelte.d.ts +18 -0
- package/dist/components/display/KBD/index.svelte.d.ts +3 -0
- package/dist/components/{Skeleton.svelte → display/Skeleton/index.svelte} +2 -2
- package/dist/components/display/Skeleton/index.svelte.d.ts +4 -0
- package/dist/{types/Skeleton.d.ts → components/display/Skeleton/types.d.ts} +1 -1
- package/dist/components/{Table.svelte → display/Table/index.svelte} +1 -1
- package/dist/components/display/Table/index.svelte.d.ts +4 -0
- package/dist/{types/Table.d.ts → components/display/Table/types.d.ts} +2 -2
- package/dist/components/display/index.d.ts +7 -0
- package/dist/components/display/index.js +4 -0
- package/dist/components/{Loader.svelte → feedback/Loader/index.svelte} +3 -3
- package/dist/components/feedback/Loader/index.svelte.d.ts +4 -0
- package/dist/components/feedback/Loader/types.d.ts +7 -0
- package/dist/components/{Modal.svelte → feedback/Modal/index.svelte} +3 -3
- package/dist/components/feedback/Modal/index.svelte.d.ts +4 -0
- package/dist/components/feedback/Modal/types.d.ts +6 -0
- package/dist/components/{Progress.svelte → feedback/Progress/index.svelte} +3 -3
- package/dist/components/feedback/Progress/index.svelte.d.ts +4 -0
- package/dist/{types/Progress.d.ts → components/feedback/Progress/types.d.ts} +3 -3
- package/dist/components/{Toast.svelte → feedback/Toast/index.svelte} +6 -6
- package/dist/components/feedback/Toast/index.svelte.d.ts +5 -0
- package/dist/{types/Toast.d.ts → components/feedback/Toast/types.d.ts} +3 -3
- package/dist/components/{Toaster.svelte → feedback/Toaster/index.svelte} +3 -3
- package/dist/components/feedback/Toaster/index.svelte.d.ts +3 -0
- package/dist/components/feedback/index.d.ts +9 -0
- package/dist/components/feedback/index.js +5 -0
- package/dist/components/inputs/Button/index.stories.svelte +53 -0
- package/dist/components/inputs/Button/index.stories.svelte.d.ts +18 -0
- package/dist/components/inputs/Button/index.svelte +98 -0
- package/dist/components/inputs/Button/index.svelte.d.ts +4 -0
- package/dist/components/inputs/Button/size.d.ts +3 -0
- package/dist/components/inputs/Button/size.js +28 -0
- package/dist/{types/Button.d.ts → components/inputs/Button/types.d.ts} +4 -4
- package/dist/components/{Checkbox.svelte → inputs/Checkbox/index.svelte} +2 -2
- package/dist/components/inputs/Checkbox/index.svelte.d.ts +4 -0
- package/dist/{types/Checkbox.d.ts → components/inputs/Checkbox/types.d.ts} +1 -1
- package/dist/components/inputs/ColorInput/index.stories.svelte +23 -0
- package/dist/components/inputs/ColorInput/index.stories.svelte.d.ts +18 -0
- package/dist/components/inputs/ColorInput/index.svelte +384 -0
- package/dist/components/inputs/ColorInput/index.svelte.d.ts +4 -0
- package/dist/components/inputs/ColorInput/types.d.ts +16 -0
- package/dist/components/inputs/Combobox/index.stories.svelte +34 -0
- package/dist/components/inputs/Combobox/index.stories.svelte.d.ts +18 -0
- package/dist/components/{Combobox.svelte → inputs/Combobox/index.svelte} +67 -10
- package/dist/components/inputs/Combobox/index.svelte.d.ts +4 -0
- package/dist/components/inputs/Combobox/types.d.ts +8 -0
- package/dist/components/{FileInput.svelte → inputs/FileInput/index.svelte} +4 -4
- package/dist/components/inputs/FileInput/index.svelte.d.ts +4 -0
- package/dist/components/inputs/FileInput/types.d.ts +14 -0
- package/dist/components/inputs/Input/index.stories.svelte +27 -0
- package/dist/components/inputs/Input/index.stories.svelte.d.ts +18 -0
- package/dist/components/{Input.svelte → inputs/Input/index.svelte} +8 -11
- package/dist/components/inputs/Input/index.svelte.d.ts +5 -0
- package/dist/components/inputs/Input/types.d.ts +15 -0
- package/dist/components/inputs/Input/types.js +3 -0
- package/dist/components/{Select.svelte → inputs/Select/index.svelte} +3 -4
- package/dist/components/inputs/Select/index.svelte.d.ts +3 -0
- package/dist/components/inputs/Select/types.d.ts +7 -0
- package/dist/components/inputs/Select/types.js +2 -0
- package/dist/components/{helper → inputs/helper}/BaseInput.svelte +14 -8
- package/dist/components/{helper → inputs/helper}/BaseInput.svelte.d.ts +2 -2
- package/dist/components/{helper → inputs/helper}/NumberInput.svelte +8 -7
- package/dist/components/{helper → inputs/helper}/NumberInput.svelte.d.ts +1 -2
- package/dist/components/inputs/index.d.ts +12 -0
- package/dist/components/inputs/index.js +6 -0
- package/dist/components/navigation/Breadcrumb/BreadcrumbItem.svelte +37 -0
- package/dist/components/navigation/Breadcrumb/BreadcrumbItem.svelte.d.ts +4 -0
- package/dist/components/navigation/Breadcrumb/index.stories.svelte +19 -0
- package/dist/components/navigation/Breadcrumb/index.stories.svelte.d.ts +18 -0
- package/dist/components/navigation/Breadcrumb/index.svelte +21 -0
- package/dist/components/navigation/Breadcrumb/index.svelte.d.ts +4 -0
- package/dist/components/navigation/Breadcrumb/types.d.ts +6 -0
- package/dist/components/{NavbarDropdown.svelte → navigation/Navbar/NavbarDropdown.svelte} +1 -1
- package/dist/components/{NavbarDropdown.svelte.d.ts → navigation/Navbar/NavbarDropdown.svelte.d.ts} +1 -1
- package/dist/components/{NavbarElement.svelte → navigation/Navbar/NavbarElement.svelte} +2 -2
- package/dist/components/{NavbarElement.svelte.d.ts → navigation/Navbar/NavbarElement.svelte.d.ts} +1 -1
- package/dist/components/{NavbarSeparator.svelte → navigation/Navbar/NavbarSeparator.svelte} +1 -1
- package/dist/components/{NavbarSeparator.svelte.d.ts → navigation/Navbar/NavbarSeparator.svelte.d.ts} +1 -1
- package/dist/components/{Navbar.svelte → navigation/Navbar/index.svelte} +1 -2
- package/dist/components/navigation/Navbar/index.svelte.d.ts +4 -0
- package/dist/{types/Navbar.d.ts → components/navigation/Navbar/types.d.ts} +2 -10
- package/dist/{types/Navbar.js → components/navigation/Navbar/types.js} +0 -1
- package/dist/components/{SideNavbar.svelte → navigation/SideNavbar/index.svelte} +3 -3
- package/dist/components/navigation/SideNavbar/index.svelte.d.ts +4 -0
- package/dist/components/navigation/SideNavbar/types.d.ts +10 -0
- package/dist/components/navigation/SideNavbar/types.js +2 -0
- package/dist/components/navigation/index.d.ts +10 -0
- package/dist/components/navigation/index.js +7 -0
- package/dist/components/overlay/Tooltip/index.stories.svelte +20 -0
- package/dist/components/overlay/Tooltip/index.stories.svelte.d.ts +18 -0
- package/dist/components/overlay/Tooltip/index.svelte +193 -0
- package/dist/components/overlay/Tooltip/index.svelte.d.ts +4 -0
- package/dist/components/overlay/Tooltip/types.d.ts +9 -0
- package/dist/components/overlay/Tooltip/types.js +1 -0
- package/dist/components/overlay/index.d.ts +2 -0
- package/dist/components/overlay/index.js +1 -0
- package/dist/components/typography/Text/index.stories.svelte +16 -0
- package/dist/components/typography/Text/index.stories.svelte.d.ts +18 -0
- package/dist/components/{Text.svelte → typography/Text/index.svelte} +10 -10
- package/dist/components/typography/Text/index.svelte.d.ts +4 -0
- package/dist/{types/Text.d.ts → components/typography/Text/types.d.ts} +2 -2
- package/dist/components/typography/Text/types.js +2 -0
- package/dist/components/{Typewriter.svelte → typography/Typewriter/index.svelte} +2 -2
- package/dist/components/typography/Typewriter/index.svelte.d.ts +4 -0
- package/dist/{types/Typewriter.d.ts → components/typography/Typewriter/types.d.ts} +1 -1
- package/dist/components/typography/Typewriter/types.js +2 -0
- package/dist/components/typography/index.d.ts +4 -0
- package/dist/components/typography/index.js +2 -0
- package/dist/components/{Analytics.svelte → utility/Analytics/index.svelte} +1 -1
- package/dist/components/utility/Analytics/index.svelte.d.ts +4 -0
- package/dist/components/utility/Analytics/types.js +1 -0
- package/dist/components/{SEO.svelte → utility/SEO/index.svelte} +1 -1
- package/dist/components/utility/SEO/index.svelte.d.ts +4 -0
- package/dist/components/utility/SEO/types.js +1 -0
- package/dist/components/utility/index.d.ts +4 -0
- package/dist/components/utility/index.js +2 -0
- package/dist/index.d.ts +8 -25
- package/dist/index.js +8 -24
- package/dist/styles/color.d.ts +4 -1
- package/dist/styles/color.js +175 -166
- package/dist/styles/layout.css +38 -2
- package/dist/styles/size.d.ts +3 -1
- package/dist/styles/size.js +19 -39
- package/dist/types/BaseComponent.d.ts +18 -0
- package/dist/utils/color.d.ts +16 -0
- package/dist/utils/color.js +70 -0
- package/package.json +23 -11
- package/dist/components/Analytics.svelte.d.ts +0 -4
- package/dist/components/Button.svelte +0 -66
- package/dist/components/Button.svelte.d.ts +0 -4
- package/dist/components/Card.svelte.d.ts +0 -4
- package/dist/components/Checkbox.svelte.d.ts +0 -4
- package/dist/components/Combobox.svelte.d.ts +0 -4
- package/dist/components/FileInput.svelte.d.ts +0 -4
- package/dist/components/Input.svelte.d.ts +0 -5
- package/dist/components/KBD.svelte.d.ts +0 -3
- package/dist/components/Loader.svelte.d.ts +0 -4
- package/dist/components/Modal.svelte.d.ts +0 -4
- package/dist/components/Navbar.svelte.d.ts +0 -4
- package/dist/components/Progress.svelte.d.ts +0 -4
- package/dist/components/SEO.svelte.d.ts +0 -4
- package/dist/components/Select.svelte.d.ts +0 -4
- package/dist/components/SideNavbar.svelte.d.ts +0 -4
- package/dist/components/Skeleton.svelte.d.ts +0 -4
- package/dist/components/Table.svelte.d.ts +0 -4
- package/dist/components/Text.svelte.d.ts +0 -4
- package/dist/components/Toast.svelte.d.ts +0 -5
- package/dist/components/Toaster.svelte.d.ts +0 -3
- package/dist/components/Tooltip.svelte +0 -123
- package/dist/components/Tooltip.svelte.d.ts +0 -4
- package/dist/components/Typewriter.svelte.d.ts +0 -4
- package/dist/types/Input.d.ts +0 -57
- package/dist/types/Input.js +0 -5
- package/dist/types/Loader.d.ts +0 -5
- package/dist/types/Modal.d.ts +0 -6
- package/dist/types/Tooltip.d.ts +0 -7
- /package/dist/{types/Analytics.js → components/display/Card/types.js} +0 -0
- /package/dist/{types/Card.js → components/display/Card/variant.js} +0 -0
- /package/dist/components/{KBD.svelte → display/KBD/index.svelte} +0 -0
- /package/dist/{types/Button.js → components/display/Skeleton/types.js} +0 -0
- /package/dist/{types/Table.js → components/display/Table/types.js} +0 -0
- /package/dist/{types/Loader.js → components/feedback/Loader/types.js} +0 -0
- /package/dist/{types/Modal.js → components/feedback/Modal/types.js} +0 -0
- /package/dist/{types/Checkbox.js → components/feedback/Progress/types.js} +0 -0
- /package/dist/{types/SEO.js → components/feedback/Toast/types.js} +0 -0
- /package/dist/{types/Skeleton.js → components/inputs/Button/types.js} +0 -0
- /package/dist/{types/Progress.js → components/inputs/Checkbox/types.js} +0 -0
- /package/dist/{types/Text.js → components/inputs/ColorInput/types.js} +0 -0
- /package/dist/{types/Toast.js → components/inputs/Combobox/types.js} +0 -0
- /package/dist/{types/Typewriter.js → components/inputs/FileInput/types.js} +0 -0
- /package/dist/{types/Tooltip.js → components/navigation/Breadcrumb/types.js} +0 -0
- /package/dist/{types/Analytics.d.ts → components/utility/Analytics/types.d.ts} +0 -0
- /package/dist/{types/SEO.d.ts → components/utility/SEO/types.d.ts} +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SizeStyle } from "../../../styles/size";
|
|
2
|
+
import type { BaseComponentProps } from "../../../types/BaseComponent";
|
|
3
|
+
export interface FileInputProps extends BaseComponentProps {
|
|
4
|
+
label?: string;
|
|
5
|
+
labelClass?: string;
|
|
6
|
+
divClass?: string;
|
|
7
|
+
outerDivClass?: string;
|
|
8
|
+
files?: FileList;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
size?: SizeStyle;
|
|
12
|
+
radius?: SizeStyle;
|
|
13
|
+
id?: `${string}-${string}-${string}-${string}-${string}`;
|
|
14
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
3
|
+
import Input from "./index.svelte";
|
|
4
|
+
import { colorStyles, colorStyleTypes } from "../../../styles/color.js";
|
|
5
|
+
import { sizeStyles } from "../../../styles/size.js";
|
|
6
|
+
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
title: "Components/Inputs/Input",
|
|
9
|
+
component: Input,
|
|
10
|
+
argTypes: {
|
|
11
|
+
size: {
|
|
12
|
+
control: "select",
|
|
13
|
+
options: sizeStyles,
|
|
14
|
+
},
|
|
15
|
+
radius: {
|
|
16
|
+
control: "select",
|
|
17
|
+
options: sizeStyles,
|
|
18
|
+
},
|
|
19
|
+
type: {
|
|
20
|
+
control: "select",
|
|
21
|
+
options: ["text", "password", "email", "number", "search", "tel", "url"],
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<Story name="Default" args={{ label: "Input Label", placeholder: "Enter text here..." }}></Story>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const Index: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type Index = InstanceType<typeof Index>;
|
|
18
|
+
export default Index;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type { InputProps } from "
|
|
2
|
+
import type { InputProps } from "./types";
|
|
3
3
|
import { twMerge } from "tailwind-merge";
|
|
4
|
-
import Text from "
|
|
5
|
-
import { getSizeStyleClass } from "
|
|
4
|
+
import Text from "../../typography/Text/index.svelte";
|
|
5
|
+
import { getSizeStyleClass } from "../../../styles/size.js";
|
|
6
6
|
import { type Component } from "svelte";
|
|
7
|
-
import Button from "
|
|
7
|
+
import Button from "../Button/index.svelte";
|
|
8
8
|
|
|
9
9
|
import Mail from "@lucide/svelte/icons/mail";
|
|
10
10
|
import Lock from "@lucide/svelte/icons/lock";
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
import X from "@lucide/svelte/icons/x";
|
|
15
15
|
import Check from "@lucide/svelte/icons/check";
|
|
16
16
|
import { slide } from "svelte/transition";
|
|
17
|
-
import BaseInput from "
|
|
18
|
-
import NumberInput from "
|
|
17
|
+
import BaseInput from "../helper/BaseInput.svelte";
|
|
18
|
+
import NumberInput from "../helper/NumberInput.svelte";
|
|
19
19
|
|
|
20
20
|
let {
|
|
21
21
|
children = undefined,
|
|
@@ -43,8 +43,6 @@
|
|
|
43
43
|
...restProps
|
|
44
44
|
}: InputProps = $props();
|
|
45
45
|
|
|
46
|
-
let isHovered = $state(false);
|
|
47
|
-
|
|
48
46
|
const sizeClasses = $derived(getSizeStyleClass(size, "form"));
|
|
49
47
|
const labelSizeClass = $derived(getSizeStyleClass(size, "formLabel"));
|
|
50
48
|
|
|
@@ -130,7 +128,6 @@
|
|
|
130
128
|
{isFocused}
|
|
131
129
|
{id}
|
|
132
130
|
icon={Icon}
|
|
133
|
-
bind:isHovered
|
|
134
131
|
{...restProps}>
|
|
135
132
|
{#snippet outerDivElementAfter()}
|
|
136
133
|
{#if touched && requirements}
|
|
@@ -169,11 +166,11 @@
|
|
|
169
166
|
type={canSeePassword ? "text" : restProps.type}
|
|
170
167
|
/>
|
|
171
168
|
{#if restProps.type === "password"}
|
|
172
|
-
<Button class={iconContainerClass} onclick={() => { canSeePassword = !canSeePassword; }}>
|
|
169
|
+
<Button color="none" class={iconContainerClass} onclick={() => { canSeePassword = !canSeePassword; }}>
|
|
173
170
|
<EyeComponent class={iconClass}></EyeComponent>
|
|
174
171
|
</Button>
|
|
175
172
|
{:else if restProps.type === "number"}
|
|
176
|
-
<NumberInput {max} {min} {step} bind:value {
|
|
173
|
+
<NumberInput {max} {min} {step} bind:value {size}/>
|
|
177
174
|
{/if}
|
|
178
175
|
{/snippet}
|
|
179
176
|
</BaseInput>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { BaseInputProps } from "../../../types/BaseComponent";
|
|
2
|
+
export interface InputRequirements {
|
|
3
|
+
label: string;
|
|
4
|
+
requirements: RegExp | ((value: any) => boolean);
|
|
5
|
+
}
|
|
6
|
+
export interface InputProps extends BaseInputProps {
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
min?: number;
|
|
9
|
+
max?: number;
|
|
10
|
+
step?: number;
|
|
11
|
+
onfocus?: (e?: FocusEvent) => void;
|
|
12
|
+
onblur?: (e?: FocusEvent) => void;
|
|
13
|
+
requirements?: InputRequirements[];
|
|
14
|
+
valid?: boolean;
|
|
15
|
+
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { twMerge } from "tailwind-merge";
|
|
3
|
-
import
|
|
4
|
-
import { getSizeStyleClass } from "../styles/size.js";
|
|
3
|
+
import { getSizeStyleClass } from "../../../styles/size";
|
|
5
4
|
|
|
6
|
-
import type { SelectProps } from "
|
|
7
|
-
import BaseInput from "
|
|
5
|
+
import type { SelectProps } from "../../../types/Input.js";
|
|
6
|
+
import BaseInput from "../helper/BaseInput.svelte";
|
|
8
7
|
|
|
9
8
|
let {
|
|
10
9
|
children = undefined,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { twMerge } from "tailwind-merge";
|
|
3
|
-
import type { BaseInputProps } from "
|
|
4
|
-
import Text from "
|
|
5
|
-
import { getSizeStyleClass } from "
|
|
3
|
+
import type { BaseInputProps } from "../../../types/BaseComponent";
|
|
4
|
+
import Text from "../../typography/Text/index.svelte";
|
|
5
|
+
import { getSizeStyleClass } from "../../../styles/size.js";
|
|
6
6
|
|
|
7
7
|
let {
|
|
8
8
|
children = undefined,
|
|
@@ -19,10 +19,9 @@
|
|
|
19
19
|
radius = "md",
|
|
20
20
|
isFocused = false,
|
|
21
21
|
icon = undefined,
|
|
22
|
+
wrapper = $bindable(),
|
|
22
23
|
id = crypto.randomUUID(),
|
|
23
24
|
|
|
24
|
-
isHovered = $bindable(false),
|
|
25
|
-
|
|
26
25
|
innerDivElement = undefined,
|
|
27
26
|
outerDivElementAfter = undefined,
|
|
28
27
|
|
|
@@ -63,7 +62,7 @@
|
|
|
63
62
|
));
|
|
64
63
|
|
|
65
64
|
const combinedDivClass = $derived(twMerge(
|
|
66
|
-
"relative *:transition-all transition-colors flex-center bg-form-background border-[1px] border-form-border focus-within:ring-1 focus-within:ring-blue-500 overflow-hidden",
|
|
65
|
+
"vpcui-base-input-div-class relative *:transition-all transition-colors flex-center bg-form-background border-[1px] border-form-border focus-within:ring-1 focus-within:ring-blue-500 overflow-hidden",
|
|
67
66
|
getSizeStyleClass(radius, "radius"),
|
|
68
67
|
size === "full" ? "w-full" : "",
|
|
69
68
|
divClass,
|
|
@@ -81,7 +80,7 @@
|
|
|
81
80
|
{/snippet}
|
|
82
81
|
|
|
83
82
|
{#snippet innerDivElementWrapper()}
|
|
84
|
-
<div
|
|
83
|
+
<div class={combinedDivClass} bind:this={wrapper}>
|
|
85
84
|
{#if variant === "floating"}
|
|
86
85
|
{@render labelElement()}
|
|
87
86
|
{/if}
|
|
@@ -102,4 +101,11 @@
|
|
|
102
101
|
{@render innerDivElementWrapper()}
|
|
103
102
|
|
|
104
103
|
{@render outerDivElementAfter?.()}
|
|
105
|
-
</div>
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
<style>
|
|
107
|
+
:global(.vpcui-base-input-div-class:hover .vpcui-number-input-icon-class) {
|
|
108
|
+
opacity: 1 !important;
|
|
109
|
+
scale: 1 !important;
|
|
110
|
+
}
|
|
111
|
+
</style>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseInputProps } from "
|
|
2
|
-
declare const BaseInput: import("svelte").Component<BaseInputProps, {}, "value" | "
|
|
1
|
+
import type { BaseInputProps } from "../../../types/BaseComponent";
|
|
2
|
+
declare const BaseInput: import("svelte").Component<BaseInputProps, {}, "value" | "wrapper">;
|
|
3
3
|
type BaseInput = ReturnType<typeof BaseInput>;
|
|
4
4
|
export default BaseInput;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import Button from "../Button.svelte";
|
|
2
|
+
import Button from "../Button/index.svelte";
|
|
3
3
|
import ChevronUp from "@lucide/svelte/icons/chevron-up";
|
|
4
4
|
import ChevronDown from "@lucide/svelte/icons/chevron-down";
|
|
5
5
|
import { twMerge } from "tailwind-merge";
|
|
6
|
-
import { getSizeStyleClass, type SizeStyle } from "
|
|
6
|
+
import { getSizeStyleClass, type SizeStyle } from "../../../styles/size.js";
|
|
7
7
|
|
|
8
8
|
let {
|
|
9
9
|
max = undefined,
|
|
10
10
|
min = undefined,
|
|
11
11
|
step = undefined,
|
|
12
12
|
value = $bindable(),
|
|
13
|
-
isHovered = false,
|
|
14
13
|
size = "md" as SizeStyle,
|
|
15
14
|
...restProps
|
|
16
15
|
} = $props();
|
|
@@ -52,14 +51,15 @@
|
|
|
52
51
|
|
|
53
52
|
const numberIconClass = $derived(twMerge(
|
|
54
53
|
getSizeStyleClass(size, "form"),
|
|
55
|
-
"text-sub-text/70 w-fit aspect-auto p-0 flex-center flex-col transition-all duration-150"
|
|
54
|
+
"vpcui-number-input-icon-class text-sub-text/70 w-fit aspect-auto p-0 flex-center flex-col transition-all duration-150 opacity-0 scale-75"
|
|
56
55
|
));
|
|
57
56
|
const numberButtonClass = "py-0! h-1/2 gap-0 px-0.5 hover:bg-form-border aspect-square rounded-none";
|
|
58
57
|
</script>
|
|
59
58
|
|
|
60
|
-
<div class={
|
|
59
|
+
<div class={numberIconClass}>
|
|
61
60
|
<Button
|
|
62
|
-
size="none" radius="none"
|
|
61
|
+
size="none" radius="none" color="none"
|
|
62
|
+
aria-label="Increment"
|
|
63
63
|
class={numberButtonClass}
|
|
64
64
|
onmousedown={startIncrement}
|
|
65
65
|
onmouseup={stopIncrement}
|
|
@@ -68,7 +68,8 @@
|
|
|
68
68
|
<ChevronUp class="w-full h-full"/>
|
|
69
69
|
</Button>
|
|
70
70
|
<Button
|
|
71
|
-
size="none" radius="none"
|
|
71
|
+
size="none" radius="none" color="none"
|
|
72
|
+
aria-label="Decrement"
|
|
72
73
|
class={numberButtonClass}
|
|
73
74
|
onmousedown={startDecrement}
|
|
74
75
|
onmouseup={stopDecrement}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { type SizeStyle } from "
|
|
1
|
+
import { type SizeStyle } from "../../../styles/size.js";
|
|
2
2
|
declare const NumberInput: import("svelte").Component<{
|
|
3
3
|
max?: any;
|
|
4
4
|
min?: any;
|
|
5
5
|
step?: any;
|
|
6
6
|
value?: any;
|
|
7
|
-
isHovered?: boolean;
|
|
8
7
|
size?: SizeStyle;
|
|
9
8
|
} & Record<string, any>, {}, "value">;
|
|
10
9
|
type NumberInput = ReturnType<typeof NumberInput>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { default as Button } from "./Button/index.svelte";
|
|
2
|
+
export { default as Checkbox } from "./Checkbox/index.svelte";
|
|
3
|
+
export { default as Input } from "./Input/index.svelte";
|
|
4
|
+
export { default as Select } from "./Select/index.svelte";
|
|
5
|
+
export { default as FileInput } from "./FileInput/index.svelte";
|
|
6
|
+
export { default as Combobox } from "./Combobox/index.svelte";
|
|
7
|
+
export type { ButtonProps } from "./Button/types.ts";
|
|
8
|
+
export type { CheckboxProps } from "./Checkbox/types.ts";
|
|
9
|
+
export type { InputProps } from "./Input/types.ts";
|
|
10
|
+
export type { SelectProps } from "./Select/types.ts";
|
|
11
|
+
export type { FileInputProps } from "./FileInput/types.ts";
|
|
12
|
+
export type { ComboboxProps } from "./Combobox/types.ts";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as Button } from "./Button/index.svelte";
|
|
2
|
+
export { default as Checkbox } from "./Checkbox/index.svelte";
|
|
3
|
+
export { default as Input } from "./Input/index.svelte";
|
|
4
|
+
export { default as Select } from "./Select/index.svelte";
|
|
5
|
+
export { default as FileInput } from "./FileInput/index.svelte";
|
|
6
|
+
export { default as Combobox } from "./Combobox/index.svelte";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
import type { BreadcrumbItemProps } from "./types";
|
|
4
|
+
import { Text } from "../../typography";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
children = undefined,
|
|
8
|
+
class: className = "",
|
|
9
|
+
href = undefined,
|
|
10
|
+
...restProps
|
|
11
|
+
}: BreadcrumbItemProps = $props();
|
|
12
|
+
|
|
13
|
+
const combinedClass = $derived(twMerge(
|
|
14
|
+
"vpcui-breadcrumb-item text-main-text",
|
|
15
|
+
className
|
|
16
|
+
));
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<li class={combinedClass} {...restProps} aria-current={href ? undefined : 'page'}>
|
|
20
|
+
{#if href}
|
|
21
|
+
<a class="hover:underline hover:text-sub-text transition-colors" href={href}>
|
|
22
|
+
{@render children?.()}
|
|
23
|
+
</a>
|
|
24
|
+
{:else}
|
|
25
|
+
<span class="font-medium text-main-text opacity-100 cursor-default">
|
|
26
|
+
{@render children?.()}
|
|
27
|
+
</span>
|
|
28
|
+
{/if}
|
|
29
|
+
</li>
|
|
30
|
+
|
|
31
|
+
<style>
|
|
32
|
+
:global(li.vpcui-breadcrumb-item + li.vpcui-breadcrumb-item::before) {
|
|
33
|
+
content: "›";
|
|
34
|
+
margin: 0 0.25rem;
|
|
35
|
+
color: var(--color-main-text);
|
|
36
|
+
}
|
|
37
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
3
|
+
import Breadcrumb from "./index.svelte";
|
|
4
|
+
import BreadcrumbItem from "./BreadcrumbItem.svelte";
|
|
5
|
+
|
|
6
|
+
const { Story } = defineMeta({
|
|
7
|
+
title: "Components/Navigation/Breadcrumb",
|
|
8
|
+
component: Breadcrumb,
|
|
9
|
+
argTypes: {
|
|
10
|
+
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<Story name="Default" args={{ color: "primary", size: "md" }}>
|
|
16
|
+
<BreadcrumbItem href="/">Home</BreadcrumbItem>
|
|
17
|
+
<BreadcrumbItem href="/library">Library</BreadcrumbItem>
|
|
18
|
+
<BreadcrumbItem>Data</BreadcrumbItem>
|
|
19
|
+
</Story>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const Index: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type Index = InstanceType<typeof Index>;
|
|
18
|
+
export default Index;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
import type { BreadcrumbProps } from "./types";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
children = undefined,
|
|
7
|
+
class: className = "",
|
|
8
|
+
...restProps
|
|
9
|
+
}: BreadcrumbProps = $props();
|
|
10
|
+
|
|
11
|
+
const combinedClass = $derived(twMerge(
|
|
12
|
+
"vpcui-breadcrumb",
|
|
13
|
+
className
|
|
14
|
+
));
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<nav aria-label="Breadcrumb" class={combinedClass} {...restProps}>
|
|
18
|
+
<ol class="flex flex-wrap items-center">
|
|
19
|
+
{@render children?.()}
|
|
20
|
+
</ol>
|
|
21
|
+
</nav>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { fly } from "svelte/transition";
|
|
3
3
|
import NavbarElement from "./NavbarElement.svelte";
|
|
4
4
|
import { tick } from "svelte";
|
|
5
|
-
import type { NavbarDropdownProps } from "
|
|
5
|
+
import type { NavbarDropdownProps } from "./types.js";
|
|
6
6
|
|
|
7
7
|
let {
|
|
8
8
|
children = undefined,
|
package/dist/components/{NavbarDropdown.svelte.d.ts → navigation/Navbar/NavbarDropdown.svelte.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NavbarDropdownProps } from "
|
|
1
|
+
import type { NavbarDropdownProps } from "./types.js";
|
|
2
2
|
declare const NavbarDropdown: import("svelte").Component<NavbarDropdownProps, {}, "">;
|
|
3
3
|
type NavbarDropdown = ReturnType<typeof NavbarDropdown>;
|
|
4
4
|
export default NavbarDropdown;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { twMerge } from "tailwind-merge";
|
|
3
|
-
import Button from "
|
|
4
|
-
import type { NavbarElementProps } from "
|
|
3
|
+
import Button from "../../inputs/Button/index.svelte";
|
|
4
|
+
import type { NavbarElementProps } from "./types";
|
|
5
5
|
import { page } from "$app/state";
|
|
6
6
|
|
|
7
7
|
let {
|
package/dist/components/{NavbarElement.svelte.d.ts → navigation/Navbar/NavbarElement.svelte.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NavbarElementProps } from "
|
|
1
|
+
import type { NavbarElementProps } from "./types";
|
|
2
2
|
declare const NavbarElement: import("svelte").Component<NavbarElementProps, {}, "">;
|
|
3
3
|
type NavbarElement = ReturnType<typeof NavbarElement>;
|
|
4
4
|
export default NavbarElement;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type NavbarSeparatorProps } from "
|
|
1
|
+
import { type NavbarSeparatorProps } from "./types.js";
|
|
2
2
|
declare const NavbarSeparator: import("svelte").Component<NavbarSeparatorProps, {}, "">;
|
|
3
3
|
type NavbarSeparator = ReturnType<typeof NavbarSeparator>;
|
|
4
4
|
export default NavbarSeparator;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { BaseComponentProps } from "
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { BaseComponentProps } from "../../../types/BaseComponent.ts";
|
|
3
3
|
export interface NavbarProps extends BaseComponentProps {
|
|
4
4
|
classTop?: string;
|
|
5
5
|
threshold?: number;
|
|
@@ -10,19 +10,11 @@ export interface NavbarElementProps extends BaseComponentProps {
|
|
|
10
10
|
href?: string;
|
|
11
11
|
threshold?: number;
|
|
12
12
|
}
|
|
13
|
-
export interface SideNavbarProps extends BaseComponentProps {
|
|
14
|
-
items?: SideNavbarItem[];
|
|
15
|
-
}
|
|
16
13
|
export type NavbarSeparatorVariant = "vertical" | "horizontal" | "dynamic";
|
|
17
14
|
export declare const NavbarSeparatorClasses: Record<NavbarSeparatorVariant, string>;
|
|
18
15
|
export interface NavbarSeparatorProps extends BaseComponentProps {
|
|
19
16
|
variant?: NavbarSeparatorVariant;
|
|
20
17
|
}
|
|
21
|
-
export interface SideNavbarItem {
|
|
22
|
-
href: string;
|
|
23
|
-
label: string;
|
|
24
|
-
icon: Component;
|
|
25
|
-
}
|
|
26
18
|
export interface NavbarDropdownProps extends BaseComponentProps {
|
|
27
19
|
label?: string;
|
|
28
20
|
element?: Snippet;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type { SideNavbarProps } from "
|
|
2
|
+
import type { SideNavbarProps } from "./types";
|
|
3
3
|
import { twMerge } from "tailwind-merge";
|
|
4
|
-
import Button from "
|
|
5
|
-
import Text from "
|
|
4
|
+
import Button from "../../inputs/Button/index.svelte";
|
|
5
|
+
import Text from "../../typography/Text/index.svelte";
|
|
6
6
|
import { page } from '$app/state';
|
|
7
7
|
|
|
8
8
|
let {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BaseComponentProps } from "../../../types/BaseComponent";
|
|
2
|
+
import type { Component } from "svelte";
|
|
3
|
+
export interface SideNavbarProps extends BaseComponentProps {
|
|
4
|
+
items?: SideNavbarItem[];
|
|
5
|
+
}
|
|
6
|
+
export interface SideNavbarItem {
|
|
7
|
+
href: string;
|
|
8
|
+
label: string;
|
|
9
|
+
icon: Component;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default as Navbar } from "./Navbar/index.svelte";
|
|
2
|
+
export { default as NavbarSeparator } from "./Navbar/NavbarSeparator.svelte";
|
|
3
|
+
export { default as NavbarElement } from "./Navbar/NavbarElement.svelte";
|
|
4
|
+
export { default as NavbarDropdown } from "./Navbar/NavbarDropdown.svelte";
|
|
5
|
+
export { default as SideNavbar } from "./SideNavbar/index.svelte";
|
|
6
|
+
export { default as Breadcrumb } from "./Breadcrumb/index.svelte";
|
|
7
|
+
export { default as BreadcrumbItem } from "./Breadcrumb/BreadcrumbItem.svelte";
|
|
8
|
+
export type { NavbarProps, NavbarElementProps, NavbarSeparatorProps, NavbarDropdownProps } from "./Navbar/types.ts";
|
|
9
|
+
export type { SideNavbarProps, SideNavbarItem } from "./SideNavbar/types.ts";
|
|
10
|
+
export type { BreadcrumbProps, BreadcrumbItemProps } from "./Breadcrumb/types.ts";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as Navbar } from "./Navbar/index.svelte";
|
|
2
|
+
export { default as NavbarSeparator } from "./Navbar/NavbarSeparator.svelte";
|
|
3
|
+
export { default as NavbarElement } from "./Navbar/NavbarElement.svelte";
|
|
4
|
+
export { default as NavbarDropdown } from "./Navbar/NavbarDropdown.svelte";
|
|
5
|
+
export { default as SideNavbar } from "./SideNavbar/index.svelte";
|
|
6
|
+
export { default as Breadcrumb } from "./Breadcrumb/index.svelte";
|
|
7
|
+
export { default as BreadcrumbItem } from "./Breadcrumb/BreadcrumbItem.svelte";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
3
|
+
import Tooltip from "./index.svelte";
|
|
4
|
+
import Button from "../../inputs/Button/index.svelte";
|
|
5
|
+
import { Text } from "../../typography";
|
|
6
|
+
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
title: "Components/Overlay/Tooltip",
|
|
9
|
+
component: Tooltip
|
|
10
|
+
});
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<Story name="Default" args={{ color: "primary", size: "md", text: "This is a tooltip", position: "top" }}>
|
|
14
|
+
<Button>Hover me</Button>
|
|
15
|
+
</Story>
|
|
16
|
+
|
|
17
|
+
<Story name="Attached to Element" args={{ color: "primary", size: "md", text: "This is a tooltip", position: "top", attachedTo: document }}>
|
|
18
|
+
<Text tag="h1">Tooltip attached to document</Text>
|
|
19
|
+
<Text>This is a tooltip with the <Text tag="code">attachedTo</Text> prop.</Text>
|
|
20
|
+
</Story>
|