@celar-ui/svelte 0.0.6 → 0.0.8
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.
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
[data-button-root] {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
position: relative;
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
padding: 0;
|
|
6
|
+
margin: 0;
|
|
7
|
+
transition-duration: var(--transition-dur);
|
|
8
|
+
transition-property: opacity;
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
border: none;
|
|
11
|
+
width: fit-content;
|
|
12
|
+
height: fit-content;
|
|
13
|
+
color: inherit;
|
|
14
|
+
font-size: inherit;
|
|
15
|
+
font-family: inherit;
|
|
16
|
+
user-select: none;
|
|
17
|
+
text-decoration: none;
|
|
18
|
+
-webkit-tap-highlight-color: transparent;
|
|
19
|
+
|
|
20
|
+
&:not(:disabled):active {
|
|
21
|
+
top: 1px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&:not([data-active='true']):disabled {
|
|
25
|
+
opacity: 0.5;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&:disabled {
|
|
29
|
+
cursor: default;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Checkbox as BitCheckbox, type CheckboxRootProps, type WithoutChildren } from 'bits-ui';
|
|
3
|
-
import IconTick from '~icons/hugeicons/tick-01';
|
|
4
|
-
import IconMinus from '~icons/hugeicons/minus-sign';
|
|
5
3
|
import type { Snippet } from 'svelte';
|
|
6
4
|
|
|
7
5
|
type CheckboxProps = WithoutChildren<CheckboxRootProps> & {
|
|
@@ -11,15 +9,43 @@
|
|
|
11
9
|
let { children, ...rest }: CheckboxProps = $props();
|
|
12
10
|
</script>
|
|
13
11
|
|
|
12
|
+
{#snippet iconTick()}
|
|
13
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
14
|
+
<path
|
|
15
|
+
fill="none"
|
|
16
|
+
stroke="currentColor"
|
|
17
|
+
stroke-linecap="round"
|
|
18
|
+
stroke-linejoin="round"
|
|
19
|
+
stroke-width="1.5"
|
|
20
|
+
d="M5 14.5s1.5 0 3.5 3.5c0 0 5.559-9.167 10.5-11"
|
|
21
|
+
color="currentColor"
|
|
22
|
+
/>
|
|
23
|
+
</svg>
|
|
24
|
+
{/snippet}
|
|
25
|
+
|
|
26
|
+
{#snippet iconMinus()}
|
|
27
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
28
|
+
<path
|
|
29
|
+
fill="none"
|
|
30
|
+
stroke="currentColor"
|
|
31
|
+
stroke-linecap="round"
|
|
32
|
+
stroke-linejoin="round"
|
|
33
|
+
stroke-width="1.5"
|
|
34
|
+
d="M20 12H4"
|
|
35
|
+
color="currentColor"
|
|
36
|
+
/>
|
|
37
|
+
</svg>
|
|
38
|
+
{/snippet}
|
|
39
|
+
|
|
14
40
|
<label data-checkbox>
|
|
15
41
|
<div data-checkbox-icon>
|
|
16
42
|
<BitCheckbox.Root {...rest}>
|
|
17
43
|
{#snippet children({ checked, indeterminate })}
|
|
18
44
|
{#if checked}
|
|
19
|
-
|
|
45
|
+
{@render iconTick()}
|
|
20
46
|
{/if}
|
|
21
47
|
{#if indeterminate}
|
|
22
|
-
|
|
48
|
+
{@render iconMinus()}
|
|
23
49
|
{/if}
|
|
24
50
|
{/snippet}
|
|
25
51
|
</BitCheckbox.Root>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import {
|
|
3
3
|
RadioGroup as BitRadioGroup,
|
|
4
|
-
type RadioGroupRootProps,
|
|
5
|
-
type
|
|
4
|
+
type RadioGroupRootProps as BitRadioGroupRootProps,
|
|
5
|
+
type WithoutChildrenOrChild
|
|
6
6
|
} from 'bits-ui';
|
|
7
7
|
import type { Snippet } from 'svelte';
|
|
8
8
|
|
|
9
|
-
export type RadioGroupProps =
|
|
9
|
+
export type RadioGroupProps = WithoutChildrenOrChild<BitRadioGroupRootProps> & {
|
|
10
10
|
children?: Snippet;
|
|
11
11
|
};
|
|
12
12
|
let { value = $bindable(''), children, ...rest }: RadioGroupProps = $props();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type RadioGroupRootProps, type
|
|
1
|
+
import { type RadioGroupRootProps as BitRadioGroupRootProps, type WithoutChildrenOrChild } from 'bits-ui';
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
-
export type RadioGroupProps =
|
|
3
|
+
export type RadioGroupProps = WithoutChildrenOrChild<BitRadioGroupRootProps> & {
|
|
4
4
|
children?: Snippet;
|
|
5
5
|
};
|
|
6
6
|
declare const RadioGroup: import("svelte").Component<RadioGroupProps, {}, "value">;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celar-ui/svelte",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "cuikho210",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"./styles": "./src/styles/*.scss"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
+
"bits-ui": "^1.3.19",
|
|
42
43
|
"svelte": "^5.0.0"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
@@ -50,7 +51,6 @@
|
|
|
50
51
|
"@sveltejs/package": "^2.0.0",
|
|
51
52
|
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
|
52
53
|
"autoprefixer": "^10.4.21",
|
|
53
|
-
"bits-ui": "^1.3.19",
|
|
54
54
|
"csstype": "^3.1.3",
|
|
55
55
|
"eslint": "^9.18.0",
|
|
56
56
|
"eslint-config-prettier": "^10.0.1",
|