myk-library 1.0.0 → 1.1.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.
@@ -1,6 +1,6 @@
1
1
  import { ButtonHTMLAttributes, ReactNode } from 'react';
2
- export type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'destructive';
3
- export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
2
+ export type ButtonVariant = 'primary' | 'secondary' | 'danger' | 'ghost';
3
+ export type ButtonSize = 'sm' | 'md' | 'lg';
4
4
  export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
5
5
  /**
6
6
  * The content to display inside the button
package/dist/index.es.js CHANGED
@@ -38,17 +38,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import*as r from
38
38
  background-color: ${({theme:e})=>e.colors.primary[600]};
39
39
  color: ${({theme:e})=>e.colors.white};
40
40
  border: 1px solid ${({theme:e})=>e.colors.primary[600]};
41
-
41
+
42
42
  &:hover:not(:disabled) {
43
43
  background-color: ${({theme:e})=>le(.1,e.colors.primary[600])};
44
44
  border-color: ${({theme:e})=>le(.1,e.colors.primary[600])};
45
45
  }
46
-
46
+
47
47
  &:active:not(:disabled) {
48
48
  background-color: ${({theme:e})=>le(.15,e.colors.primary[600])};
49
49
  transform: translateY(1px);
50
50
  }
51
-
51
+
52
52
  &:focus {
53
53
  box-shadow: 0 0 0 3px ${({theme:e})=>e.colors.primary[200]};
54
54
  }
@@ -56,82 +56,60 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import*as r from
56
56
  background-color: ${({theme:e})=>e.colors.gray[200]};
57
57
  color: ${({theme:e})=>e.colors.gray[900]};
58
58
  border: 1px solid ${({theme:e})=>e.colors.gray[200]};
59
-
59
+
60
60
  &:hover:not(:disabled) {
61
61
  background-color: ${({theme:e})=>e.colors.gray[300]};
62
62
  border-color: ${({theme:e})=>e.colors.gray[300]};
63
63
  }
64
-
64
+
65
65
  &:active:not(:disabled) {
66
66
  background-color: ${({theme:e})=>e.colors.gray[400]};
67
67
  transform: translateY(1px);
68
68
  }
69
-
69
+
70
70
  &:focus {
71
71
  box-shadow: 0 0 0 3px ${({theme:e})=>e.colors.gray[300]};
72
72
  }
73
- `,outline:O`
74
- background-color: transparent;
75
- color: ${({theme:e})=>e.colors.primary[600]};
76
- border: 1px solid ${({theme:e})=>e.colors.primary[600]};
77
-
78
- &:hover:not(:disabled) {
79
- background-color: ${({theme:e})=>e.colors.primary[50]};
80
- color: ${({theme:e})=>e.colors.primary[700]};
81
- }
82
-
83
- &:active:not(:disabled) {
84
- background-color: ${({theme:e})=>e.colors.primary[100]};
85
- transform: translateY(1px);
86
- }
87
-
88
- &:focus {
89
- box-shadow: 0 0 0 3px ${({theme:e})=>e.colors.primary[200]};
90
- }
91
73
  `,ghost:O`
92
74
  background-color: transparent;
93
75
  color: ${({theme:e})=>e.colors.gray[700]};
94
76
  border: 1px solid transparent;
95
-
77
+
96
78
  &:hover:not(:disabled) {
97
79
  background-color: ${({theme:e})=>e.colors.gray[100]};
98
80
  color: ${({theme:e})=>e.colors.gray[800]};
99
81
  }
100
-
82
+
101
83
  &:active:not(:disabled) {
102
84
  background-color: ${({theme:e})=>e.colors.gray[200]};
103
85
  transform: translateY(1px);
104
86
  }
105
-
87
+
106
88
  &:focus {
107
89
  box-shadow: 0 0 0 3px ${({theme:e})=>e.colors.gray[300]};
108
90
  }
109
- `,destructive:O`
91
+ `,danger:O`
110
92
  background-color: ${({theme:e})=>e.colors.error[600]};
111
93
  color: ${({theme:e})=>e.colors.white};
112
94
  border: 1px solid ${({theme:e})=>e.colors.error[600]};
113
-
95
+
114
96
  &:hover:not(:disabled) {
115
97
  background-color: ${({theme:e})=>e.colors.error[700]};
116
98
  border-color: ${({theme:e})=>e.colors.error[700]};
117
99
  }
118
-
100
+
119
101
  &:active:not(:disabled) {
120
102
  background-color: ${({theme:e})=>le(.1,e.colors.error[700])};
121
103
  transform: translateY(1px);
122
104
  }
123
-
105
+
124
106
  &:focus {
125
107
  box-shadow: 0 0 0 3px ${({theme:e})=>ce(.2,e.colors.error[600])};
126
108
  }
127
109
  `}[e])}
128
110
 
129
111
  /* Size styles */
130
- ${({$size:e})=>({xs:O`
131
- padding: ${({theme:e})=>e.spacing.xs} ${({theme:e})=>e.spacing.sm};
132
- font-size: ${({theme:e})=>e.fontSize.xs};
133
- min-height: 28px;
134
- `,sm:O`
112
+ ${({$size:e})=>({sm:O`
135
113
  padding: ${({theme:e})=>e.spacing.sm} ${({theme:e})=>e.spacing.md};
136
114
  font-size: ${({theme:e})=>e.fontSize.sm};
137
115
  min-height: 32px;
@@ -143,10 +121,6 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import*as r from
143
121
  padding: ${({theme:e})=>e.spacing.md} ${({theme:e})=>e.spacing.xl};
144
122
  font-size: ${({theme:e})=>e.fontSize.md};
145
123
  min-height: 44px;
146
- `,xl:O`
147
- padding: ${({theme:e})=>e.spacing.lg} ${({theme:e})=>e.spacing["2xl"]};
148
- font-size: ${({theme:e})=>e.fontSize.lg};
149
- min-height: 52px;
150
124
  `}[e])}
151
125
 
152
126
  /* Disabled state */
@@ -158,7 +132,9 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import*as r from
158
132
 
159
133
  /* Loading state */
160
134
  ${({$loading:e})=>e&&O`
161
- color: transparent;
135
+ span {
136
+ color: transparent;
137
+ }
162
138
  `}
163
139
 
164
140
  /* Focus styles */
@@ -172,15 +148,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import*as r from
172
148
  }
173
149
  `,he=k.div`
174
150
  position: absolute;
175
- top: 50%;
176
- left: 50%;
177
- transform: translate(-50%, -50%);
178
- width: 16px;
179
- height: 16px;
180
- border: 2px solid currentColor;
181
- border-top-color: transparent;
182
- border-radius: 50%;
183
- animation: ${fe} 1s linear infinite;
151
+ top: 0;
152
+ left: 0;
153
+ right: 0;
154
+ bottom: 0;
155
+ display: flex;
156
+ align-items: center;
157
+ justify-content: center;
158
+
159
+ &::after {
160
+ content: '';
161
+ width: 16px;
162
+ height: 16px;
163
+ border: 2px solid currentColor;
164
+ border-top-color: transparent;
165
+ border-radius: 50%;
166
+ animation: ${fe} 1s linear infinite;
167
+ }
184
168
  `,ge=k.span`
185
169
  display: inline-flex;
186
170
  align-items: center;