milk-lib 0.0.7 → 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.
@@ -67,7 +67,7 @@
67
67
  --inner-gap: 4px;
68
68
  --border-width: 1px;
69
69
  --border-color: transparent;
70
- --hover-border-color: var(--line-base);
70
+ --hover-border-color: var(--border-color);
71
71
  --active-border-color: var(--border-color);
72
72
  --disabled-border-color: var(--border-color);
73
73
  --focus-color: var(--background-color);
@@ -0,0 +1,84 @@
1
+ .Button.Button-base-emphasis {
2
+ --background-color: var(--bg-base-emp-100);
3
+ --hover-background: var(--bg-base-emp-200);
4
+ --active-background: var(--bg-base-emp-300);
5
+ --color: white
6
+ }
7
+
8
+ .Button.Button-base-outlined {
9
+ --background-color: transparent;
10
+ --hover-background: var(--bg-base-200);
11
+ --active-background: var(--bg-base-300);
12
+ --color: var(--text-base-main);
13
+ --border-color: var(--line-control-100);
14
+ --focus-color: var(--line-base-emp);
15
+ }
16
+
17
+ .Button.Button-base-contained {
18
+ --background-color: var(--bg-base-100);
19
+ --hover-background: var(--bg-base-200);
20
+ --active-background: var(--bg-base-300);
21
+ --color: var(--text-base-main);
22
+ --focus-color: var(--line-base-emp);
23
+ }
24
+
25
+ .Button.Button-primary-contained {
26
+ --background-color: var(--bg-primary-100);
27
+ --hover-background: var(--bg-primary-200);
28
+ --active-background: var(--bg-primary-300);
29
+ --color: var(--text-base-main);
30
+ --focus-color: var(--line-primary-emp);
31
+ }
32
+
33
+ .Button.Button-primary-outlined {
34
+ --background-color: transparent;
35
+ --hover-background: var(--bg-primary-100);
36
+ --active-background: var(--bg-primary-200);
37
+ --color: var(--text-base-main);
38
+ --border-color: var(--line-primary);
39
+ --focus-color: var(--line-primary-emp);
40
+ }
41
+
42
+ .Button.Button-primary-emphasis {
43
+ --background-color: var(--bg-primary-emp-100);
44
+ --hover-background: var(--bg-primary-emp-200);
45
+ --active-background: var(--bg-primary-emp-300);
46
+ --color: var(--text-base-main);
47
+ }
48
+
49
+ .Button.Button-lg {
50
+ --padding-y: 7px;
51
+ --padding-x: 20px;
52
+ --font-size: 16px;
53
+ --line-height: 24px;
54
+ --border-radius: 8px;
55
+ --inner-gap: 6px;
56
+ &.Button-icon {
57
+ --padding-y: 11px;
58
+ --padding-x: 11px;
59
+ }
60
+ }
61
+ .Button.Button-md {
62
+ --padding-y: 5px;
63
+ --padding-x: 16px;
64
+ --font-size: 14px;
65
+ --line-height: 20px;
66
+ --border-radius: 8px;
67
+ --inner-gap: 5px;
68
+ &.Button-icon {
69
+ --padding-y: 8px;
70
+ --padding-x: 8px;
71
+ }
72
+ }
73
+ .Button.Button-sm {
74
+ --padding-y: 5px;
75
+ --padding-x: 10px;
76
+ --font-size: 12px;
77
+ --line-height: 14px;
78
+ --border-radius: 6px;
79
+ --inner-gap: 3px;
80
+ &.Button-icon {
81
+ --padding-y: 6px;
82
+ --padding-x: 6px;
83
+ }
84
+ }
@@ -0,0 +1,43 @@
1
+ <script lang="ts">
2
+ import { Button, type ButtonInstance } from '../..';
3
+ import type { IButtonMilkProps } from './ButtonMilk.types';
4
+ import "./ButtonMilk.scss";
5
+
6
+ const {
7
+ size = 'sm',
8
+ variant = 'primary-emphasis',
9
+ children,
10
+ ...rest
11
+ }: IButtonMilkProps = $props();
12
+
13
+ // Прокидываем фокус примитива
14
+ let buttonRef: ButtonInstance;
15
+ export const focus = () => buttonRef.focus();
16
+
17
+ let sizeClassName =
18
+ size === "sm" ? "Button-sm"
19
+ : size === "md" ? "Button-md"
20
+ : size === "lg" ? "Button-lg"
21
+ : "";
22
+
23
+ let variantClassname =
24
+ variant === "primary-emphasis" ? "Button-primary-emphasis"
25
+ : variant === "primary-outlined" ? "Button-primary-outlined"
26
+ : variant === "primary-contained" ? "Button-primary-contained"
27
+ : variant === "base-contained" ? "Button-base-contained"
28
+ : variant === "base-outlined" ? "Button-base-outlined"
29
+ : variant === "base-emphasis" ? "Button-base-emphasis" : ""
30
+
31
+ let classNames = `${sizeClassName} ${variantClassname}`;
32
+
33
+ </script>
34
+
35
+ <Button
36
+ bind:this={buttonRef}
37
+ {classNames}
38
+ {...rest}
39
+ >
40
+ {@render children?.()}
41
+ </Button>
42
+
43
+ <style></style>
@@ -0,0 +1,7 @@
1
+ import type { IButtonMilkProps } from './ButtonMilk.types';
2
+ import "./ButtonMilk.scss";
3
+ declare const ButtonMilk: import("svelte").Component<IButtonMilkProps, {
4
+ focus: () => void;
5
+ }, "">;
6
+ type ButtonMilk = ReturnType<typeof ButtonMilk>;
7
+ export default ButtonMilk;
@@ -0,0 +1,7 @@
1
+ import type { IButtonProps } from '../Button/Button.types';
2
+ export type ButtonMilkSizes = 'sm' | 'md' | 'lg';
3
+ export type ButtonMilkVariants = 'primary-emphasis' | 'primary-outlined' | 'primary-contained' | 'base-contained' | 'base-outlined' | 'base-emphasis';
4
+ export interface IButtonMilkProps extends IButtonProps {
5
+ size?: ButtonMilkSizes;
6
+ variant?: ButtonMilkVariants;
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { default as ButtonMilk } from './ButtonMilk.svelte';
2
+ export * from './ButtonMilk.types';
@@ -0,0 +1,2 @@
1
+ export { default as ButtonMilk } from './ButtonMilk.svelte';
2
+ export * from './ButtonMilk.types';
@@ -8,6 +8,7 @@ export const themeDefault = {
8
8
  '--line-control-100': '#ABABB0',
9
9
  '--line-base-emp': '#151617',
10
10
  '--line-primary': '#FFE27B',
11
+ '--line-primary-emp': '#F0C013',
11
12
  '--line-success': '#B6F7CB',
12
13
  '--line-danger': '#FBC4BF',
13
14
  '--line-secondary': '#BEB6F9',
@@ -9,6 +9,7 @@ export interface ITheme {
9
9
  '--line-control-100': string;
10
10
  '--line-base-emp': string;
11
11
  '--line-primary': string;
12
+ '--line-primary-emp': string;
12
13
  '--line-success': string;
13
14
  '--line-danger': string;
14
15
  '--line-secondary': string;
@@ -4,3 +4,4 @@ export * from './StickyHeader';
4
4
  export * from './Sidebar';
5
5
  export * from './ThemeProvider';
6
6
  export * from './Button';
7
+ export * from './ButtonMilk';
@@ -4,3 +4,4 @@ export * from './StickyHeader';
4
4
  export * from './Sidebar';
5
5
  export * from './ThemeProvider';
6
6
  export * from './Button';
7
+ export * from './ButtonMilk';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "milk-lib",
3
3
  "license": "MIT",
4
- "version": "0.0.7",
4
+ "version": "0.0.8",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
7
7
  "build": "vite build && npm run prepack",