kosui 0.0.8 → 0.0.10
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/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/skeleton/index.d.ts +1 -0
- package/dist/skeleton/index.js +1 -0
- package/dist/skeleton/skeleton.svelte +23 -0
- package/dist/skeleton/skeleton.svelte.d.ts +8 -0
- package/dist/textarea/index.d.ts +1 -0
- package/dist/textarea/index.js +1 -0
- package/dist/textarea/textarea.svelte +41 -0
- package/dist/textarea/textarea.svelte.d.ts +7 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -32,6 +32,8 @@ export * from "./popover";
|
|
|
32
32
|
export * from "./portal";
|
|
33
33
|
export * from "./progress";
|
|
34
34
|
export * from "./shortcut";
|
|
35
|
+
export * from "./skeleton";
|
|
36
|
+
export * from "./textarea";
|
|
35
37
|
export * from "./toggle";
|
|
36
38
|
export * from "./tooltip";
|
|
37
39
|
export * from "./base";
|
package/dist/index.js
CHANGED
|
@@ -32,6 +32,8 @@ export * from "./popover";
|
|
|
32
32
|
export * from "./portal";
|
|
33
33
|
export * from "./progress";
|
|
34
34
|
export * from "./shortcut";
|
|
35
|
+
export * from "./skeleton";
|
|
36
|
+
export * from "./textarea";
|
|
35
37
|
export * from "./toggle";
|
|
36
38
|
export * from "./tooltip";
|
|
37
39
|
export * from "./base";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Skeleton, type SkeletonProps } from "./skeleton.svelte";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Skeleton } from "./skeleton.svelte";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import { twMerge } from "tailwind-merge";
|
|
4
|
+
import { Box, type BoxProps } from "../box";
|
|
5
|
+
|
|
6
|
+
export type SkeletonProps = { children?: Snippet } & BoxProps;
|
|
7
|
+
let {
|
|
8
|
+
children,
|
|
9
|
+
class: className,
|
|
10
|
+
backdrop = true,
|
|
11
|
+
shape = "rounded",
|
|
12
|
+
...restProps
|
|
13
|
+
}: SkeletonProps = $props();
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<Box
|
|
17
|
+
class={twMerge("animate-pulse", className)}
|
|
18
|
+
{backdrop}
|
|
19
|
+
{shape}
|
|
20
|
+
{...restProps}
|
|
21
|
+
>
|
|
22
|
+
{@render children?.()}
|
|
23
|
+
</Box>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import { type BoxProps } from "../box";
|
|
3
|
+
export type SkeletonProps = {
|
|
4
|
+
children?: Snippet;
|
|
5
|
+
} & BoxProps;
|
|
6
|
+
declare const Skeleton: import("svelte").Component<SkeletonProps, {}, "">;
|
|
7
|
+
type Skeleton = ReturnType<typeof Skeleton>;
|
|
8
|
+
export default Skeleton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Textarea, type TextareaProps } from "./textarea.svelte";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Textarea } from "./textarea.svelte";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { baseClasses, type Variants } from "../base";
|
|
3
|
+
import { noop, type ClassName, type ElementRef } from "../utils";
|
|
4
|
+
import type { HTMLTextareaAttributes } from "svelte/elements";
|
|
5
|
+
import { twMerge } from "tailwind-merge";
|
|
6
|
+
|
|
7
|
+
export type TextareaProps = ElementRef &
|
|
8
|
+
ClassName &
|
|
9
|
+
Variants &
|
|
10
|
+
HTMLTextareaAttributes;
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<script lang="ts">
|
|
14
|
+
let {
|
|
15
|
+
value = $bindable(),
|
|
16
|
+
el = $bindable(),
|
|
17
|
+
ref = noop,
|
|
18
|
+
class: className,
|
|
19
|
+
variant = "outlined",
|
|
20
|
+
color = "secondary",
|
|
21
|
+
shape = "rounded",
|
|
22
|
+
...restProps
|
|
23
|
+
}: TextareaProps = $props();
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<textarea
|
|
27
|
+
bind:this={el}
|
|
28
|
+
use:ref
|
|
29
|
+
bind:value
|
|
30
|
+
class={twMerge(
|
|
31
|
+
"bg-m3-surface-container",
|
|
32
|
+
baseClasses({ variant, color, shape, hover: true, focus: true }),
|
|
33
|
+
|
|
34
|
+
(variant === "outlined" || variant === "plain") &&
|
|
35
|
+
"hover:bg-m3-surface-container-low focus-visible:bg-m3-surface-container-low",
|
|
36
|
+
|
|
37
|
+
"px-3 py-2",
|
|
38
|
+
className,
|
|
39
|
+
)}
|
|
40
|
+
{...restProps}
|
|
41
|
+
></textarea>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Variants } from "../base";
|
|
2
|
+
import { type ClassName, type ElementRef } from "../utils";
|
|
3
|
+
import type { HTMLTextareaAttributes } from "svelte/elements";
|
|
4
|
+
export type TextareaProps = ElementRef & ClassName & Variants & HTMLTextareaAttributes;
|
|
5
|
+
declare const Textarea: import("svelte").Component<TextareaProps, {}, "el" | "value">;
|
|
6
|
+
type Textarea = ReturnType<typeof Textarea>;
|
|
7
|
+
export default Textarea;
|