@celar-ui/svelte 0.0.9 → 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/buttons/BaseButton.svelte +3 -2
- package/dist/buttons/BaseButton.svelte.d.ts +1 -0
- package/dist/buttons/TextBaseButton.svelte +2 -2
- package/dist/buttons/styles/elevated_button.scss +5 -5
- package/dist/buttons/styles/filled_button.scss +6 -6
- package/dist/buttons/styles/icon_button.scss +5 -5
- package/dist/buttons/styles/outlined_button.scss +5 -5
- package/dist/buttons/styles/text_button.scss +4 -4
- package/dist/containment/styles/avatar.scss +2 -2
- package/package.json +1 -1
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
export type BaseButtonProps = ButtonRootProps & {
|
|
7
7
|
loading?: boolean;
|
|
8
|
+
active?: boolean;
|
|
8
9
|
};
|
|
9
10
|
|
|
10
|
-
let { children, ...rest }: BaseButtonProps = $props();
|
|
11
|
+
let { children, active = false, ...rest }: BaseButtonProps = $props();
|
|
11
12
|
</script>
|
|
12
13
|
|
|
13
|
-
<Button.Root {...rest}>
|
|
14
|
+
<Button.Root {...rest} data-active={active}>
|
|
14
15
|
{#if children}
|
|
15
16
|
{@render children()}
|
|
16
17
|
{/if}
|
|
@@ -2,6 +2,7 @@ import './styles/base_button.scss';
|
|
|
2
2
|
import { type ButtonRootProps } from 'bits-ui';
|
|
3
3
|
export type BaseButtonProps = ButtonRootProps & {
|
|
4
4
|
loading?: boolean;
|
|
5
|
+
active?: boolean;
|
|
5
6
|
};
|
|
6
7
|
declare const BaseButton: import("svelte").Component<BaseButtonProps, {}, "">;
|
|
7
8
|
type BaseButton = ReturnType<typeof BaseButton>;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
icon?: Snippet;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
let { children, loading, icon, ...rest }: TextBaseButtonProps = $props();
|
|
11
|
+
let { children, loading, icon, active = false, ...rest }: TextBaseButtonProps = $props();
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
{#snippet baseChildren()}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
{/if}
|
|
34
34
|
{/snippet}
|
|
35
35
|
|
|
36
|
-
<BaseButton {...rest} children={baseChildren} {loading} data-button-base-text />
|
|
36
|
+
<BaseButton {...rest} children={baseChildren} {loading} {active} data-button-base-text />
|
|
37
37
|
|
|
38
38
|
<style>:global([data-button-base-text]) {
|
|
39
39
|
border-radius: var(--radius);
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
&:not(:disabled):active {
|
|
13
13
|
box-shadow: 0 2px 2px var(--color-shadow--strong);
|
|
14
14
|
}
|
|
15
|
-
}
|
|
16
15
|
|
|
17
|
-
[data-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
16
|
+
&[data-active='true'] {
|
|
17
|
+
box-shadow: 0 2px 2px var(--color-shadow--strong);
|
|
18
|
+
background-color: var(--color-alt);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
&:not(:disabled):active {
|
|
12
12
|
box-shadow: 0 2px 2px var(--color-shadow--strong);
|
|
13
13
|
}
|
|
14
|
-
}
|
|
15
14
|
|
|
16
|
-
[data-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
15
|
+
&[data-active='true'] {
|
|
16
|
+
box-shadow: 0 2px 2px var(--color-shadow--strong);
|
|
17
|
+
background-color: var(--color-alt--darker);
|
|
18
|
+
color: var(--color-bg);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
&:not(:disabled, [data-active='true']):hover {
|
|
28
28
|
background-color: var(--color-primary--light);
|
|
29
29
|
}
|
|
30
|
-
}
|
|
31
30
|
|
|
32
|
-
[data-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
31
|
+
&[data-active='true'] {
|
|
32
|
+
background-color: var(--color-alt);
|
|
33
|
+
color: var(--color-primary--text);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
background-color: var(--color-primary--light);
|
|
9
9
|
border-color: var(--color-primary);
|
|
10
10
|
}
|
|
11
|
-
}
|
|
12
11
|
|
|
13
|
-
[data-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
12
|
+
&[data-active='true'] {
|
|
13
|
+
background-color: var(--color-alt);
|
|
14
|
+
border-color: var(--color-primary);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
&:not(:disabled, [data-active='true']):hover {
|
|
7
7
|
background-color: var(--color-primary--light);
|
|
8
8
|
}
|
|
9
|
-
}
|
|
10
9
|
|
|
11
|
-
[data-
|
|
12
|
-
|
|
13
|
-
}
|
|
10
|
+
&[data-active='true'] {
|
|
11
|
+
background-color: var(--color-alt);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[data-avatar-root] {
|
|
2
2
|
display: block;
|
|
3
3
|
position: relative;
|
|
4
|
-
background-color: var(--
|
|
4
|
+
background-color: var(--color-bg-info);
|
|
5
5
|
aspect-ratio: 1;
|
|
6
6
|
width: var(--size);
|
|
7
7
|
}
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
border-radius: 50%;
|
|
13
13
|
width: 100%;
|
|
14
14
|
height: 100%;
|
|
15
|
-
}
|
|
15
|
+
}
|