ehscan-react-components 0.1.9 → 0.1.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.
@@ -1,42 +1,44 @@
1
- /* EHSCAN Base Button */
1
+ /* EHSCAN Base Button - Refactored */
2
2
  .ext-btn {
3
- /* Button default variables */
4
- --btn-bg: #007aff;
3
+ /* Core variables with fallbacks */
4
+ /* --btn-bg: #007aff;
5
5
  --btn-color: #fff;
6
6
  --btn-radius: 18px;
7
- --btn-padding-y: 0.5rem;
8
- --btn-padding-x: 1rem;
7
+ --btn-padding: 0.5rem;
9
8
  --btn-width: fit-content;
10
9
  --btn-height: auto;
11
10
  --btn-font-size: 1rem;
12
11
  --btn-font-weight: 500;
13
12
  --btn-transition: all 0.2s ease;
14
13
  --btn-line-height: 1.5;
14
+ --btn-gap: 0.5rem;
15
15
  --ripple-box-shadow: rgb(100 100 111 / 20%) 0px 7px 29px 0px;
16
- --ripple-effect-bck: rgb(0 0 0 / 15%);
16
+ --ripple-effect-bck: rgb(0 0 0 / 15%); */
17
+
17
18
  display: inline-flex;
18
19
  align-items: center;
19
20
  justify-content: center;
20
- gap: 0.5rem;
21
+ gap: var(--btn-gap, 0.5rem);
21
22
  font-family: inherit;
22
- font-size: var(--btn-font-size);
23
- font-weight: var(--btn-font-weight);
24
- color: var(--btn-color);
25
- background-color: var(--btn-bg);
23
+ font-size: var(--btn-font-size, 1rem);
24
+ font-weight: var(--btn-font-weight, 500);
25
+ color: var(--btn-color, #fff);
26
+ background-color: var(--btn-bg, #007aff);
26
27
  border: none;
27
- border-radius: var(--btn-radius);
28
- padding: var(--btn-padding-y) var(--btn-padding-x);
29
- width: var(--btn-width);
30
- height: var(--btn-height);
28
+ border-radius: var(--btn-radius, 18px);
29
+ padding: var(--btn-padding, 0.5rem);
30
+ width: var(--btn-width, fit-content);
31
+ height: var(--btn-height, auto);
31
32
  cursor: pointer;
32
- transition: var(--btn-transition);
33
+ transition: var(--btn-transition, all 0.2s ease);
33
34
  text-align: center;
34
35
  text-decoration: none;
35
36
  user-select: none;
37
+ line-height: var(--btn-line-height, 1.5);
36
38
  }
37
39
 
38
40
  .ext-btn:focus-visible {
39
- outline: 2px solid #007aff;
41
+ outline: 2px solid var(--btn-bg, #007aff);
40
42
  outline-offset: 2px;
41
43
  }
42
44
 
@@ -54,24 +56,7 @@
54
56
  transform: scale(0.97);
55
57
  }
56
58
 
57
- .ext-btn--sm {
58
- --btn-padding-y: 0.25rem;
59
- --btn-padding-x: 0.75rem;
60
- --btn-font-size: 0.85rem;
61
- }
62
-
63
- .ext-btn--md {
64
- --btn-padding-y: 0.5rem;
65
- --btn-padding-x: 1rem;
66
- --btn-font-size: 1rem;
67
- }
68
-
69
- .ext-btn--lg {
70
- --btn-padding-y: 0.75rem;
71
- --btn-padding-x: 1.5rem;
72
- --btn-font-size: 1.1rem;
73
- }
74
-
59
+ /* Variants */
75
60
  .ext-btn--primary {
76
61
  --btn-bg: #007aff;
77
62
  --btn-color: #fff;
@@ -97,11 +82,13 @@
97
82
  --btn-color: #fff;
98
83
  }
99
84
 
85
+ /* Loading state */
100
86
  .ext-btn--loading {
101
87
  pointer-events: none;
102
88
  opacity: 0.8;
103
89
  }
104
90
 
91
+ /* Icon and label wrappers */
105
92
  .ext-btn-icon {
106
93
  display: flex;
107
94
  align-items: center;
@@ -114,43 +101,20 @@
114
101
  white-space: nowrap;
115
102
  }
116
103
 
117
- /* Button Types */
118
- .closeBtn {
119
- --btn-width: 35px;
120
- --btn-height: 35px;
121
- padding: 0;
122
- --btn-bg: lightgray;
123
- }
124
-
125
- .saveBtn {
126
- --btn-height: 35px;
127
- --btn-padding-x: 30px;
128
- --btn-bg: #007aff;
129
- }
130
-
131
- .trashBtn {
132
- --btn-height: 35px;
133
- --btn-padding-x: 10px;
134
- --btn-radius: 4px;
135
- --btn-bg: lightgray;
136
- }
137
-
138
- /* Ripple Effect */
104
+ /* Ripple effect */
139
105
  ._ripple {
140
- line-height: var(--btn-line-height);
141
- font-weight: var(--btn-font-weight);
142
- box-shadow: var(--ripple-box-shadow);
106
+ font-weight: var(--btn-font-weight, 500);
107
+ box-shadow: var(--ripple-box-shadow, rgb(100 100 111 / 20%) 0px 7px 29px 0px);
143
108
  position: relative;
144
109
  overflow: hidden;
145
- -webkit-user-select: none;
146
- user-select: none;
147
110
  display: flex;
148
111
  align-items: center;
149
112
  justify-content: center;
113
+ user-select: none;
150
114
  }
151
115
 
152
116
  .ripple {
153
- background: var(--ripple-effect-bck);
117
+ background: var(--ripple-effect-bck, rgb(0 0 0 / 15%));
154
118
  position: absolute;
155
119
  border-radius: 50%;
156
120
  transform: scale(0);
@@ -160,75 +124,9 @@
160
124
  will-change: transform, opacity;
161
125
  }
162
126
 
163
- @media (hover: hover) and (pointer: fine) {
164
- ._ripple {
165
- cursor: pointer;
166
- }
167
- }
168
-
169
-
170
127
  @keyframes ripple-animation {
171
128
  to {
172
129
  transform: scale(4);
173
130
  opacity: 0;
174
131
  }
175
- }
176
-
177
- .lds-ripple,
178
- .lds-ripple div {
179
- box-sizing: border-box;
180
- }
181
-
182
- .lds-ripple {
183
- --image-sync-wh: 100%;
184
- --bw: 5px;
185
- position: absolute;
186
- top: 50%;
187
- left: 50%;
188
- transform: translate(-50%, -50%);
189
- height: var(--image-sync-wh);
190
- width: var(--image-sync-wh);
191
- z-index: 9999;
192
- }
193
-
194
- .lds-ripple div {
195
- position: absolute;
196
- border: var(--bw) solid white;
197
- opacity: 1;
198
- border-radius: 50%;
199
- animation: lds-ripple 1s cubic-bezier(0, 0.4, 0.8, 1) infinite;
200
- }
201
-
202
- .lds-ripple div:nth-child(2) {
203
- animation-delay: -0.5s;
204
- border: var(--bw) solid whitesmoke;
205
- }
206
-
207
- @keyframes lds-ripple {
208
- 0% {
209
- top: 50%;
210
- left: 50%;
211
- width: 8%;
212
- height: 8%;
213
- opacity: .2;
214
- transform: translate(-50%, -50%);
215
- }
216
-
217
- 5% {
218
- top: 50%;
219
- left: 50%;
220
- width: 8%;
221
- height: 8%;
222
- opacity: 1;
223
- transform: translate(-50%, -50%);
224
- }
225
-
226
- 100% {
227
- top: 50%;
228
- left: 50%;
229
- width: var(--image-sync-wh);
230
- height: var(--image-sync-wh);
231
- opacity: .2;
232
- transform: translate(-50%, -50%);
233
- }
234
132
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "ehscan-react-components",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "components",
5
5
  "main": "dist/Components.js",
6
6
  "types": "dist/Components.d.ts",
7
7
  "scripts": {
8
8
  "build": "tsc && npm run copy-css",
9
- "copy-css": "cp -r src/style dist/style",
9
+ "copy-css": "rsync -a src/style/ dist/style/",
10
10
  "prepublishOnly": "npm run build"
11
11
  },
12
12
  "keywords": [
@@ -1,219 +0,0 @@
1
- /* EHSCAN Base Button */
2
- .ext-btn {
3
- display: inline-flex;
4
- align-items: center;
5
- justify-content: center;
6
- gap: 0.5rem;
7
- font-family: inherit;
8
- font-size: var(--btn-font-size, 1rem);
9
- font-weight: var(--btn-font-weight, 500);
10
- color: var(--btn-color, #fff);
11
- background-color: var(--btn-bg, #007aff);
12
- border: none;
13
- border-radius: var(--btn-radius, 18px);
14
- padding: var(--btn-padding-y, 0.5rem) var(--btn-padding-x, 1rem);
15
- width: var(--btn-width, fit-content);
16
- height: var(--btn-height, auto);
17
- cursor: pointer;
18
- transition: var(--btn-transition, all 0.2s ease);
19
- text-align: center;
20
- text-decoration: none;
21
- user-select: none;
22
- line-height: var(--btn-line-height, 1.5);
23
- }
24
-
25
- .ext-btn:focus-visible {
26
- outline: 2px solid var(--btn-bg, #007aff);
27
- outline-offset: 2px;
28
- }
29
-
30
- .ext-btn:disabled,
31
- .ext-btn[aria-disabled="true"] {
32
- opacity: 0.6;
33
- cursor: not-allowed;
34
- }
35
-
36
- .ext-btn:hover:not(:disabled):not([aria-disabled="true"]) {
37
- filter: brightness(0.9);
38
- }
39
-
40
- .ext-btn:active:not(:disabled):not([aria-disabled="true"]) {
41
- transform: scale(0.97);
42
- }
43
-
44
- /* Sizes */
45
- .ext-btn--sm {
46
- padding: var(--btn-padding-y-sm, 0.25rem) var(--btn-padding-x-sm, 0.75rem);
47
- font-size: var(--btn-font-size-sm, 0.85rem);
48
- }
49
-
50
- .ext-btn--md {
51
- padding: var(--btn-padding-y-md, 0.5rem) var(--btn-padding-x-md, 1rem);
52
- font-size: var(--btn-font-size-md, 1rem);
53
- }
54
-
55
- .ext-btn--lg {
56
- padding: var(--btn-padding-y-lg, 0.75rem) var(--btn-padding-x-lg, 1.5rem);
57
- font-size: var(--btn-font-size-lg, 1.1rem);
58
- }
59
-
60
- /* Variants */
61
- .ext-btn--primary {
62
- color: var(--btn-color-primary, #fff);
63
- background-color: var(--btn-bg-primary, #007aff);
64
- }
65
-
66
- .ext-btn--secondary {
67
- color: var(--btn-color-secondary, #111);
68
- background-color: var(--btn-bg-secondary, #e5e5ea);
69
- }
70
-
71
- .ext-btn--outline {
72
- color: var(--btn-color-outline, #007aff);
73
- background-color: var(--btn-bg-outline, transparent);
74
- }
75
-
76
- .ext-btn--ghost {
77
- color: var(--btn-color-ghost, #007aff);
78
- background-color: var(--btn-bg-ghost, transparent);
79
- }
80
-
81
- .ext-btn--danger {
82
- color: var(--btn-color-danger, #fff);
83
- background-color: var(--btn-bg-danger, #ff3b30);
84
- }
85
-
86
- .ext-btn--loading {
87
- pointer-events: none;
88
- opacity: 0.8;
89
- }
90
-
91
- /* Icons and labels */
92
- .ext-btn-icon {
93
- display: flex;
94
- align-items: center;
95
- justify-content: center;
96
- font-size: 1.1em;
97
- }
98
-
99
- .ext-btn-label {
100
- display: inline-block;
101
- white-space: nowrap;
102
- }
103
-
104
- /* Specific buttons */
105
- .closeBtn {
106
- width: var(--btn-width-close, 35px);
107
- height: var(--btn-height-close, 35px);
108
- padding: 0;
109
- background-color: var(--btn-bg-close, lightgray);
110
- }
111
-
112
- .saveBtn {
113
- height: var(--btn-height-save, 35px);
114
- padding-left: var(--btn-padding-x-save, 30px);
115
- padding-right: var(--btn-padding-x-save, 30px);
116
- background-color: var(--btn-bg-save, #007aff);
117
- }
118
-
119
- .trashBtn {
120
- height: var(--btn-height-trash, 35px);
121
- padding-left: var(--btn-padding-x-trash, 10px);
122
- padding-right: var(--btn-padding-x-trash, 10px);
123
- border-radius: var(--btn-radius-trash, 4px);
124
- background-color: var(--btn-bg-trash, lightgray);
125
- }
126
-
127
- /* Ripple Effect */
128
- ._ripple {
129
- font-weight: var(--btn-font-weight, 500);
130
- box-shadow: var(--ripple-box-shadow, rgb(100 100 111 / 20%) 0px 7px 29px 0px);
131
- position: relative;
132
- overflow: hidden;
133
- display: flex;
134
- align-items: center;
135
- justify-content: center;
136
- user-select: none;
137
- }
138
-
139
- .ripple {
140
- background: var(--ripple-effect-bck, rgb(0 0 0 / 15%));
141
- position: absolute;
142
- border-radius: 50%;
143
- transform: scale(0);
144
- animation: ripple-animation 0.6s linear;
145
- pointer-events: none;
146
- transform-origin: center center;
147
- will-change: transform, opacity;
148
- }
149
-
150
- @media (hover: hover) and (pointer: fine) {
151
- ._ripple {
152
- cursor: pointer;
153
- }
154
- }
155
-
156
- @keyframes ripple-animation {
157
- to {
158
- transform: scale(4);
159
- opacity: 0;
160
- }
161
- }
162
-
163
- /* Loader */
164
- .lds-ripple,
165
- .lds-ripple div {
166
- box-sizing: border-box;
167
- }
168
-
169
- .lds-ripple {
170
- position: absolute;
171
- top: 50%;
172
- left: 50%;
173
- transform: translate(-50%, -50%);
174
- height: var(--image-sync-wh, 100%);
175
- width: var(--image-sync-wh, 100%);
176
- z-index: 9999;
177
- }
178
-
179
- .lds-ripple div {
180
- position: absolute;
181
- border: var(--bw, 5px) solid white;
182
- opacity: 1;
183
- border-radius: 50%;
184
- animation: lds-ripple 1s cubic-bezier(0, 0.4, 0.8, 1) infinite;
185
- }
186
-
187
- .lds-ripple div:nth-child(2) {
188
- animation-delay: -0.5s;
189
- border: var(--bw, 5px) solid whitesmoke;
190
- }
191
-
192
- @keyframes lds-ripple {
193
- 0% {
194
- top: 50%;
195
- left: 50%;
196
- width: 8%;
197
- height: 8%;
198
- opacity: 0.2;
199
- transform: translate(-50%, -50%);
200
- }
201
-
202
- 5% {
203
- top: 50%;
204
- left: 50%;
205
- width: 8%;
206
- height: 8%;
207
- opacity: 1;
208
- transform: translate(-50%, -50%);
209
- }
210
-
211
- 100% {
212
- top: 50%;
213
- left: 50%;
214
- width: var(--image-sync-wh, 100%);
215
- height: var(--image-sync-wh, 100%);
216
- opacity: 0.2;
217
- transform: translate(-50%, -50%);
218
- }
219
- }