milk-lib 0.0.10 → 0.0.11

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,61 @@
1
+ <script lang="ts">
2
+ import type { IBadgeProps } from './Badge.types';
3
+
4
+ let {
5
+ variant="default",
6
+ shape="straight",
7
+ ref=$bindable(null),
8
+ children,
9
+ href,
10
+ ...restProps
11
+ } : IBadgeProps = $props();
12
+
13
+ </script>
14
+
15
+ <svelte:element
16
+ this={href ? 'a' : 'span'}
17
+ {href}
18
+ bind:this={ref}
19
+ class={`Badge Badge-${variant} Badge-${shape}`}
20
+ {...restProps}
21
+ >
22
+ {@render children()}
23
+ </svelte:element>
24
+
25
+ <style>.Badge {
26
+ font-size: 12px;
27
+ line-height: 100%;
28
+ padding: 4px 8px;
29
+ background: var(--bg-base-100);
30
+ display: inline-flex;
31
+ align-items: center;
32
+ border: 1px solid transparent;
33
+ text-decoration: none;
34
+ color: inherit;
35
+ }
36
+ .Badge.Badge-primary {
37
+ background-color: var(--bg-primary-emp-100);
38
+ color: var(--text-base-main);
39
+ }
40
+ .Badge.Badge-secondary {
41
+ background-color: var(--bg-base-emp-100);
42
+ color: var(--text-base-inv);
43
+ }
44
+ .Badge.Badge-outline {
45
+ background-color: white;
46
+ border-color: var(--line-base);
47
+ }
48
+ .Badge.Badge-danger {
49
+ background-color: var(--bg-danger-emp-100);
50
+ color: var(--text-base-inv);
51
+ }
52
+ .Badge.Badge-warning {
53
+ background-color: var(--bg-danger-100);
54
+ color: var(--text-danger-main);
55
+ }
56
+ .Badge.Badge-rounded {
57
+ border-radius: 6px;
58
+ }
59
+ .Badge.Badge-circled {
60
+ border-radius: 20px;
61
+ }</style>
@@ -0,0 +1,4 @@
1
+ import type { IBadgeProps } from './Badge.types';
2
+ declare const Badge: import("svelte").Component<IBadgeProps, {}, "ref">;
3
+ type Badge = ReturnType<typeof Badge>;
4
+ export default Badge;
@@ -0,0 +1,10 @@
1
+ import type { Snippet } from "svelte";
2
+ export type BadgeVariant = 'default' | 'primary' | 'secondary' | 'warning' | 'danger' | 'outline';
3
+ export type BadgeShape = 'rounded' | 'circled' | 'straight';
4
+ export interface IBadgeProps {
5
+ children: Snippet;
6
+ variant?: BadgeVariant;
7
+ shape?: BadgeShape;
8
+ href?: string;
9
+ ref?: HTMLAnchorElement | HTMLSpanElement | null;
10
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { default as Badge } from './Badge.svelte';
@@ -0,0 +1 @@
1
+ export { default as Badge } from './Badge.svelte';
@@ -8,9 +8,11 @@
8
8
  <style>
9
9
  .SidebarGroupTitle {
10
10
  font-size: 14px;
11
+ line-height: 20px;
11
12
  color: var(--text-base-main);
12
13
  font-weight: 500;
13
- margin-top: 1.5rem;
14
14
  list-style: none;
15
+ margin-top: 1.5rem;
16
+ margin-bottom: .5rem;
15
17
  }
16
18
  </style>
@@ -17,7 +17,11 @@
17
17
 
18
18
  .SidebarLink {
19
19
  font-size: 14px;
20
- color: var(--text-base-muted);
20
+ line-height: 20px;
21
+ color: var(--text-base-placeholder);
22
+ text-decoration: none;
23
+ display: block;
24
+ margin-bottom: .5rem;
21
25
  }
22
26
 
23
27
  .SidebarLink:hover {
@@ -5,3 +5,4 @@ export * from './Sidebar';
5
5
  export * from './ThemeProvider';
6
6
  export * from './Button';
7
7
  export * from './ButtonMilk';
8
+ export * from './Badge';
@@ -5,3 +5,4 @@ export * from './Sidebar';
5
5
  export * from './ThemeProvider';
6
6
  export * from './Button';
7
7
  export * from './ButtonMilk';
8
+ export * from './Badge';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "milk-lib",
3
3
  "license": "MIT",
4
- "version": "0.0.10",
4
+ "version": "0.0.11",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
7
7
  "build": "vite build && npm run prepack",