Skip to content

Commit dfc3a3a

Browse files
committed
v0.8.0
1 parent a00d4f3 commit dfc3a3a

File tree

38 files changed

+930
-466
lines changed

38 files changed

+930
-466
lines changed

.changeset/dry-cycles-joke.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 0.8.0
4+
5+
### Minor Changes
6+
7+
- feat: variants ([`a00d4f34dd05900e9ab84b93055073ba51171d7a`](https://github.com/shinokada/svelte-5-ui-lib/commit/a00d4f34dd05900e9ab84b93055073ba51171d7a))
8+
39
## 0.7.2
410

511
### Patch Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "svelte-5-ui-lib",
3-
"version": "0.7.2",
3+
"version": "0.8.0",
44
"description": "A UI library for Svelte 5.",
55
"license": "MIT",
66
"main": "dist/index.js",

src/lib/accordion/Accordion.svelte

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,22 @@
2121
2222
const ctx: AccordionCtxType = {
2323
flush,
24-
activeClass: twMerge('bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800', activeClass),
25-
inactiveClass: twMerge('text-gray-500 dark:text-gray-400 hover:bg-gray-100 hover:dark:bg-gray-800', inactiveClass)
24+
activeClass: twMerge(
25+
'bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800',
26+
activeClass
27+
),
28+
inactiveClass: twMerge(
29+
'text-gray-500 dark:text-gray-400 hover:bg-gray-100 hover:dark:bg-gray-800',
30+
inactiveClass
31+
)
2632
// selected: multiple ? undefined : writable()
2733
};
2834
2935
setContext<AccordionCtxType>('ctx', ctx);
3036
31-
let accordionClass = $derived(twMerge(
32-
accordionVariants({ flush }),
33-
defaultClass,
34-
className
35-
));
37+
let accordionClass = $derived(
38+
twMerge(accordionVariants({ flush }), defaultClass, className)
39+
);
3640
</script>
3741

3842
<div {...attributes} class={accordionClass} color="none">
@@ -45,11 +49,9 @@
4549
## Props
4650
@prop children
4751
@prop flush = false
48-
@prop activeClass = 'bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800'
49-
@prop inactiveClass = 'text-gray-500 dark:text-gray-400 hover:bg-gray-100 hover:dark:bg-gray-800'
52+
@prop activeClass = ''
53+
@prop inactiveClass = ''
5054
@prop defaultClass = 'text-gray-500 dark:text-gray-400'
51-
@prop classActive
52-
@prop classInactive
5355
@prop class: className
5456
@prop transition = undefined
5557
@prop params

src/lib/alert/Alert.svelte

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@
2020
...attributes
2121
}: Props = $props();
2222
23-
let divCls = $derived(alertVariants({
24-
color,
25-
rounded,
26-
border,
27-
icon: !!icon,
28-
dismissable,
29-
className
30-
}));
23+
let divCls = $derived(
24+
alertVariants({
25+
color,
26+
rounded,
27+
border,
28+
icon: !!icon,
29+
dismissable,
30+
className
31+
})
32+
);
3133
// $inspect('divCls: ', divCls);
3234
</script>
3335

src/lib/avatar/Avatar.svelte

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,15 @@
2020
2121
dot = dot && { placement: 'top-right', color: 'gray', size: 'lg', ...dot };
2222
23-
let avatarClass = $derived(avatarVariants({
24-
rounded, border, stacked, size, className
25-
}));
23+
let avatarClass = $derived(
24+
avatarVariants({
25+
rounded,
26+
border,
27+
stacked,
28+
size,
29+
className
30+
})
31+
);
2632
</script>
2733

2834
{#if !src || !!href || children || dot}

src/lib/badge/Badge.svelte

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@
2121
...attributes
2222
}: Props = $props();
2323
24-
let badgeClass = $derived(badgeVariants({
25-
color,
26-
size: large ? 'large' : 'small',
27-
border,
28-
rounded,
29-
className
30-
}));
24+
let badgeClass = $derived(
25+
badgeVariants({
26+
color,
27+
size: large ? 'large' : 'small',
28+
border,
29+
rounded,
30+
className
31+
})
32+
);
3133
// $inspect('badgeStatus: ', badgeStatus);
3234
</script>
3335

src/lib/banner/Banner.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,12 @@
6868
## Props
6969
@prop children
7070
@prop header
71+
@prop bannerStatus = $bindable(true)
7172
@prop position = 'sticky'
7273
@prop dismissable = true
7374
@prop color = 'gray'
7475
@prop bannerType = 'default'
75-
@prop divClass
76+
@prop class: className
7677
@prop innerClass
7778
@prop transition = fade
7879
@prop params

src/lib/buttongroup/ButtonGroup.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
## Props
2424
@prop children
2525
@prop size = 'md'
26-
@prop class: divClass
26+
@prop class: className
2727
@prop ...attributes
2828
-->

src/lib/cards/Card.svelte

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// import type { Snippet } from 'svelte';
33
// import { twMerge } from 'tailwind-merge';
44
// import type { HTMLAttributes } from 'svelte/elements';
5-
import { cardVariants, type CardProps as Props } from '.'
6-
5+
import { cardVariants, type CardProps as Props } from '.';
6+
77
let {
88
children,
99
href,
@@ -18,17 +18,26 @@
1818
...attributes
1919
}: Props = $props();
2020
21-
const {base, image, content} = $derived(cardVariants({
22-
size,
23-
shadow,
24-
padding,
25-
horizontal,
26-
reverse,
27-
href: !!href
28-
}));
21+
const { base, image, content } = $derived(
22+
cardVariants({
23+
size,
24+
shadow,
25+
padding,
26+
horizontal,
27+
reverse,
28+
href: !!href
29+
})
30+
);
2931
</script>
3032

31-
<svelte:element this={href ? 'a' : 'div'} {href} class={base()} role={href ? 'link' : 'presentation'} onclick={onclick} {...attributes}>
33+
<svelte:element
34+
this={href ? 'a' : 'div'}
35+
{href}
36+
class={base()}
37+
role={href ? 'link' : 'presentation'}
38+
{onclick}
39+
{...attributes}
40+
>
3241
{#if img}
3342
<img class={image()} src={img.src} alt={img.alt} />
3443
<div class={content()}>
@@ -48,7 +57,6 @@
4857
@prop children
4958
@prop href
5059
@prop horizontal = false
51-
@prop target
5260
@prop shadow = true
5361
@prop reverse = false
5462
@prop img

0 commit comments

Comments
 (0)