@celar-ui/svelte 1.2.2 → 1.3.0

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.
@@ -20,12 +20,12 @@
20
20
  :global([data-breadcrumb] > a) {
21
21
  padding: 0;
22
22
  margin: 0;
23
- color: var(--color-onInfo);
23
+ color: var(--color-info);
24
24
  text-decoration: none;
25
25
  }
26
26
  :global([data-breadcrumb] > a):not(:last-child)::after {
27
27
  content: "/";
28
- color: var(--color-onInfo);
28
+ color: currentColor;
29
29
  padding: 0 var(--gap--half);
30
30
  }
31
31
  :global([data-breadcrumb] > a):last-child {
package/dist/index.d.ts CHANGED
@@ -20,6 +20,7 @@ export { default as Gap } from './misc/Gap.svelte';
20
20
  export { default as DuckSpinner } from './misc/DuckSpinner.svelte';
21
21
  export { default as DotSpinner } from './misc/DotSpinner.svelte';
22
22
  export { default as LinearProgressIndicator } from './misc/LinearProgressIndicator.svelte';
23
+ export { default as Badge } from './misc/Badge.svelte';
23
24
  export { default as TextInput } from './inputs/TextInput.svelte';
24
25
  export { default as FileInput } from './inputs/FileInput.svelte';
25
26
  export { default as ColorInput } from './inputs/ColorInput.svelte';
package/dist/index.js CHANGED
@@ -21,6 +21,7 @@ export { default as Gap } from './misc/Gap.svelte';
21
21
  export { default as DuckSpinner } from './misc/DuckSpinner.svelte';
22
22
  export { default as DotSpinner } from './misc/DotSpinner.svelte';
23
23
  export { default as LinearProgressIndicator } from './misc/LinearProgressIndicator.svelte';
24
+ export { default as Badge } from './misc/Badge.svelte';
24
25
  export { default as TextInput } from './inputs/TextInput.svelte';
25
26
  export { default as FileInput } from './inputs/FileInput.svelte';
26
27
  export { default as ColorInput } from './inputs/ColorInput.svelte';
@@ -1,13 +1,16 @@
1
1
  <script lang="ts">
2
2
  import type { HTMLInputAttributes } from 'svelte/elements';
3
3
 
4
- let { value = $bindable(), min, max, ...rest }: HTMLInputAttributes = $props();
4
+ let { value = $bindable(), min, max, step, ...rest }: HTMLInputAttributes = $props();
5
5
  </script>
6
6
 
7
7
  <div data-slider>
8
8
  <input
9
9
  type="range"
10
10
  bind:value
11
+ {min}
12
+ {max}
13
+ {step}
11
14
  style:--val={value || 0}
12
15
  style:--min={min || 0}
13
16
  style:--max={max || 100}
@@ -18,6 +21,8 @@
18
21
  <style>[data-slider] {
19
22
  position: relative;
20
23
  padding: 0 var(--gap);
24
+ width: 100%;
25
+ box-sizing: border-box;
21
26
  }
22
27
  [data-slider] > input {
23
28
  --range: calc(var(--max) - var(--min));
@@ -0,0 +1,55 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+
4
+ interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
5
+ color?: 'success' | 'info' | 'warning' | 'error' | 'surface';
6
+ size?: 'small' | 'medium' | 'large';
7
+ }
8
+
9
+ let { children, color = 'surface', size = 'small', ...rest }: BadgeProps = $props();
10
+ </script>
11
+
12
+ <span {...rest} data-badge data-color={color} data-size={size}>
13
+ {@render children?.()}
14
+ </span>
15
+
16
+ <style>[data-badge] {
17
+ box-sizing: border-box;
18
+ border-radius: var(--gap);
19
+ line-height: 1;
20
+ display: inline-flex;
21
+ align-items: center;
22
+ justify-content: center;
23
+ }
24
+ [data-badge][data-color=surface] {
25
+ background-color: var(--color-surfaceContainerHighest);
26
+ color: var(--color-onSurface);
27
+ }
28
+ [data-badge][data-color=info] {
29
+ background-color: var(--color-info);
30
+ color: var(--color-onInfo);
31
+ }
32
+ [data-badge][data-color=success] {
33
+ background-color: var(--color-success);
34
+ color: var(--color-onSuccess);
35
+ }
36
+ [data-badge][data-color=warning] {
37
+ background-color: var(--color-warning);
38
+ color: var(--color-onWarning);
39
+ }
40
+ [data-badge][data-color=error] {
41
+ background-color: var(--color-error);
42
+ color: var(--color-onError);
43
+ }
44
+ [data-badge][data-size=small] {
45
+ font-size: 0.8em;
46
+ padding: var(--gap--sm) var(--gap--half);
47
+ }
48
+ [data-badge][data-size=medium] {
49
+ font-size: 0.9em;
50
+ padding: var(--gap--sm) var(--gap--half);
51
+ }
52
+ [data-badge][data-size=large] {
53
+ font-size: 1em;
54
+ padding: var(--gap--sm) var(--gap--md);
55
+ }</style>
@@ -0,0 +1,8 @@
1
+ import type { HTMLAttributes } from 'svelte/elements';
2
+ interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
3
+ color?: 'success' | 'info' | 'warning' | 'error' | 'surface';
4
+ size?: 'small' | 'medium' | 'large';
5
+ }
6
+ declare const Badge: import("svelte").Component<BadgeProps, {}, "">;
7
+ type Badge = ReturnType<typeof Badge>;
8
+ export default Badge;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celar-ui/svelte",
3
- "version": "1.2.2",
3
+ "version": "1.3.0",
4
4
  "license": "MIT",
5
5
  "author": {
6
6
  "name": "cuikho210",
@@ -51,32 +51,32 @@
51
51
  "svelte": "^5.0.0"
52
52
  },
53
53
  "devDependencies": {
54
- "@eslint/compat": "^1.2.8",
55
- "@eslint/js": "^9.24.0",
56
- "@iconify-json/hugeicons": "^1.2.4",
54
+ "@eslint/compat": "^1.4.0",
55
+ "@eslint/js": "^9.36.0",
56
+ "@iconify-json/hugeicons": "^1.2.16",
57
57
  "@sveltejs/adapter-auto": "^4.0.0",
58
- "@sveltejs/kit": "^2.20.5",
59
- "@sveltejs/package": "^2.3.10",
60
- "@sveltejs/vite-plugin-svelte": "^5.0.3",
61
- "@types/bun": "^1.2.20",
58
+ "@sveltejs/kit": "^2.43.1",
59
+ "@sveltejs/package": "^2.5.3",
60
+ "@sveltejs/vite-plugin-svelte": "^5.1.1",
61
+ "@types/bun": "^1.2.22",
62
62
  "autoprefixer": "^10.4.21",
63
- "bits-ui": "^2.8.8",
63
+ "bits-ui": "^2.11.0",
64
64
  "csstype": "^3.1.3",
65
- "eslint": "^9.24.0",
66
- "eslint-config-prettier": "^10.1.2",
67
- "eslint-plugin-svelte": "^3.5.1",
68
- "globals": "^16.0.0",
65
+ "eslint": "^9.36.0",
66
+ "eslint-config-prettier": "^10.1.8",
67
+ "eslint-plugin-svelte": "^3.12.4",
68
+ "globals": "^16.4.0",
69
69
  "material-dynamic-colors": "^1.1.2",
70
- "prettier": "^3.5.3",
71
- "prettier-plugin-svelte": "^3.3.3",
72
- "publint": "^0.3.11",
73
- "sass": "^1.86.3",
74
- "svelte": "^5.34.7",
75
- "svelte-check": "^4.1.5",
76
- "typescript": "^5.8.3",
77
- "typescript-eslint": "^8.29.1",
78
- "unplugin-icons": "^22.1.0",
79
- "vite": "^6.2.6"
70
+ "prettier": "^3.6.2",
71
+ "prettier-plugin-svelte": "^3.4.0",
72
+ "publint": "^0.3.13",
73
+ "sass": "^1.93.1",
74
+ "svelte": "^5.39.4",
75
+ "svelte-check": "^4.3.2",
76
+ "typescript": "^5.9.2",
77
+ "typescript-eslint": "^8.44.1",
78
+ "unplugin-icons": "^22.3.0",
79
+ "vite": "^6.3.6"
80
80
  },
81
81
  "keywords": [
82
82
  "svelte"
@@ -3,21 +3,21 @@
3
3
  @use './scheme.scss';
4
4
 
5
5
  $ext-colors-light: (
6
- color-info: #e2ffff,
7
- color-onInfo: #1a3baa,
8
- color-success: #e8fef5,
9
- color-onSuccess: #2b5f50,
10
- color-warning: #fff8ec,
11
- color-onWarning: #8a5a00
6
+ color-info: #1a3baa,
7
+ color-onInfo: #e2ffff,
8
+ color-success: #2b5f50,
9
+ color-onSuccess: #e8fef5,
10
+ color-warning: #8a5a00,
11
+ color-onWarning: #fff8ec
12
12
  ) !default;
13
13
 
14
14
  $ext-colors-dark: (
15
- color-info: #101a3b,
16
- color-onInfo: #008eff,
17
- color-success: #184d3a,
18
- color-onSuccess: #9bdac7,
19
- color-warning: #4a3700,
20
- color-onWarning: #bfa060
15
+ color-info: #008eff,
16
+ color-onInfo: #101a3b,
17
+ color-success: #9bdac7,
18
+ color-onSuccess: #184d3a,
19
+ color-warning: #bfa060,
20
+ color-onWarning: #4a3700
21
21
  ) !default;
22
22
 
23
23
  $colors-misc: (