@gumigumih/react-calculator-input-form 1.1.5 → 2.0.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,13 +1,13 @@
1
1
  /* 電卓入力フォーム用スタイル */
2
2
 
3
- /* 背景とレイアウト */
4
- .calculator-overlay {
3
+ /* 背景とレイアウト */
4
+ .calculator-overlay {
5
5
  position: fixed;
6
6
  top: 0;
7
7
  left: 0;
8
8
  right: 0;
9
9
  bottom: 0;
10
- background: rgba(0, 0, 0, 0.5); /* 黒の半透明 */
10
+ background: rgba(0, 0, 0, 0.5); /* 黒の半透明 */
11
11
  display: flex;
12
12
  align-items: center;
13
13
  justify-content: center;
@@ -64,8 +64,8 @@
64
64
  }
65
65
 
66
66
  /* メインカード */
67
- .calculator-modal {
68
- background: white;
67
+ .calculator-modal {
68
+ background: var(--calculator-surface, white);
69
69
  border-radius: 0.75rem;
70
70
  width: 100%;
71
71
  max-width: 24rem;
@@ -91,10 +91,10 @@
91
91
  gap: 0.75rem;
92
92
  }
93
93
 
94
- .calculator-logo {
95
- width: 2.5rem;
96
- height: 2.5rem;
97
- background-color: #60a5fa;
94
+ .calculator-logo {
95
+ width: 2.5rem;
96
+ height: 2.5rem;
97
+ background-color: var(--calculator-primary, #60a5fa);
98
98
  border-radius: 50%;
99
99
  display: flex;
100
100
  align-items: center;
@@ -131,10 +131,10 @@
131
131
  transition: all 0.2s ease-in-out;
132
132
  }
133
133
 
134
- .calculator-close-button:hover {
135
- background-color: #6b7280;
136
- color: white;
137
- }
134
+ .calculator-close-button:hover {
135
+ background-color: var(--calculator-danger, #6b7280);
136
+ color: white;
137
+ }
138
138
 
139
139
  /* 参加者セクション */
140
140
  .calculator-participants {
@@ -159,10 +159,10 @@
159
159
  border-color: #d1d5db;
160
160
  }
161
161
 
162
- .calculator-participant-row.selected {
163
- border-color: #3b82f6;
164
- background-color: #eff6ff;
165
- }
162
+ .calculator-participant-row.selected {
163
+ border-color: var(--calculator-primary, #3b82f6);
164
+ background-color: color-mix(in srgb, var(--calculator-primary, #3b82f6) 10%, white);
165
+ }
166
166
 
167
167
  .calculator-participant-info {
168
168
  display: flex;
@@ -211,10 +211,10 @@
211
211
  gap: 0.5rem;
212
212
  }
213
213
 
214
- .calculator-add-button {
214
+ .calculator-add-button {
215
215
  flex: 1;
216
216
  padding: 0.5rem 1rem;
217
- background-color: #3b82f6;
217
+ background-color: var(--calculator-primary, #3b82f6);
218
218
  color: white;
219
219
  border: none;
220
220
  border-radius: 0.5rem;
@@ -224,13 +224,13 @@
224
224
  transition: background-color 0.2s;
225
225
  }
226
226
 
227
- .calculator-add-button:hover {
228
- background-color: #2563eb;
229
- }
227
+ .calculator-add-button:hover {
228
+ background-color: color-mix(in srgb, var(--calculator-primary, #3b82f6) 85%, black);
229
+ }
230
230
 
231
- .calculator-remove-button {
231
+ .calculator-remove-button {
232
232
  padding: 0.5rem 1rem;
233
- background-color: #6b7280;
233
+ background-color: var(--calculator-danger, #6b7280);
234
234
  color: white;
235
235
  border: none;
236
236
  border-radius: 0.5rem;
@@ -240,9 +240,9 @@
240
240
  transition: background-color 0.2s;
241
241
  }
242
242
 
243
- .calculator-remove-button:hover {
244
- background-color: #4b5563;
245
- }
243
+ .calculator-remove-button:hover {
244
+ background-color: color-mix(in srgb, var(--calculator-danger, #6b7280) 85%, black);
245
+ }
246
246
 
247
247
  /* 電卓キーパッド */
248
248
  .calculator-keypad-section {
@@ -309,23 +309,23 @@
309
309
  background-color: #dbeafe;
310
310
  }
311
311
 
312
- .calculator-keypad-button.operator {
313
- background-color: #ff9f0a; /* iOS calculator orange */
312
+ .calculator-keypad-button.operator {
313
+ background-color: var(--calculator-operator, #ff9f0a); /* iOS calculator orange */
314
314
  color: #ffffff;
315
315
  }
316
316
 
317
- .calculator-keypad-button.operator:hover {
318
- background-color: #ffb340; /* lighter on hover */
319
- }
317
+ .calculator-keypad-button.operator:hover {
318
+ background-color: color-mix(in srgb, var(--calculator-operator, #ff9f0a) 85%, white); /* lighter on hover */
319
+ }
320
320
 
321
- .calculator-keypad-button.clear {
322
- background-color: #ef4444;
321
+ .calculator-keypad-button.clear {
322
+ background-color: var(--calculator-danger, #ef4444);
323
323
  color: white;
324
324
  }
325
325
 
326
- .calculator-keypad-button.clear:hover {
327
- background-color: #dc2626;
328
- }
326
+ .calculator-keypad-button.clear:hover {
327
+ background-color: color-mix(in srgb, var(--calculator-danger, #ef4444) 85%, black);
328
+ }
329
329
 
330
330
  .calculator-keypad-button.backspace {
331
331
  background-color: #a5a5a5; /* iOS-like function key gray */
@@ -349,25 +349,25 @@
349
349
  /* 税込=薄い水色系(クールで落ち着いた色) */
350
350
 
351
351
  /* 薄い水色基調(税込) */
352
- .calculator-keypad-button.include {
353
- background-color: #a5f3fc; /* cyan-200 */
352
+ .calculator-keypad-button.include {
353
+ background-color: color-mix(in srgb, var(--calculator-success, #a5f3fc) 30%, white); /* cyan-200 */
354
354
  color: #374151; /* 数字ボタンと同じ文字色 */
355
355
  }
356
356
 
357
- .calculator-keypad-button.include:hover {
358
- background-color: #67e8f9; /* cyan-300 */
359
- }
357
+ .calculator-keypad-button.include:hover {
358
+ background-color: var(--calculator-success, #67e8f9); /* cyan-300 */
359
+ }
360
360
 
361
361
  /* 税抜=薄い桃色系(温かみのある色) */
362
362
  /* 薄い桃色基調(税抜) */
363
- .calculator-keypad-button.exclude {
364
- background-color: #fce7f3; /* pink-200 */
363
+ .calculator-keypad-button.exclude {
364
+ background-color: color-mix(in srgb, var(--calculator-danger, #fce7f3) 20%, white); /* pink-200 */
365
365
  color: #374151; /* 数字ボタンと同じ文字色 */
366
366
  }
367
367
 
368
- .calculator-keypad-button.exclude:hover {
369
- background-color: #fbcfe8; /* pink-300 */
370
- }
368
+ .calculator-keypad-button.exclude:hover {
369
+ background-color: color-mix(in srgb, var(--calculator-danger, #fbcfe8) 35%, white); /* pink-300 */
370
+ }
371
371
 
372
372
  .calculator-action-buttons {
373
373
  display: grid;
@@ -375,9 +375,9 @@
375
375
  gap: 0.75rem;
376
376
  }
377
377
 
378
- .calculator-equals-button {
378
+ .calculator-equals-button {
379
379
  padding: 0.75rem;
380
- background-color: #ff9f0a; /* distinct from tax buttons, iOS-like */
380
+ background-color: var(--calculator-operator, #ff9f0a); /* distinct from tax buttons, iOS-like */
381
381
  color: #ffffff;
382
382
  font-size: 1rem;
383
383
  font-weight: 700;
@@ -388,13 +388,13 @@
388
388
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
389
389
  }
390
390
 
391
- .calculator-equals-button:hover {
392
- background-color: #ffb340;
393
- }
391
+ .calculator-equals-button:hover {
392
+ background-color: color-mix(in srgb, var(--calculator-operator, #ff9f0a) 85%, white);
393
+ }
394
394
 
395
- .calculator-decide-button {
395
+ .calculator-decide-button {
396
396
  padding: 0.75rem;
397
- background-color: #10b981;
397
+ background-color: var(--calculator-success, #10b981);
398
398
  color: white;
399
399
  font-size: 1rem;
400
400
  font-weight: 700;
@@ -406,9 +406,9 @@
406
406
  grid-column: 1 / -1; /* 横幅100%(2列分) */
407
407
  }
408
408
 
409
- .calculator-decide-button:hover {
410
- background-color: #059669;
411
- }
409
+ .calculator-decide-button:hover {
410
+ background-color: color-mix(in srgb, var(--calculator-success, #10b981) 85%, black);
411
+ }
412
412
 
413
413
  /* 合計と計算ボタン */
414
414
  .calculator-total-section {
@@ -435,14 +435,14 @@
435
435
  color: #111827;
436
436
  }
437
437
 
438
- .calculator-per-person {
439
- color: #2563eb;
440
- }
438
+ .calculator-per-person {
439
+ color: var(--calculator-primary, #2563eb);
440
+ }
441
441
 
442
- .calculator-calculate-button {
442
+ .calculator-calculate-button {
443
443
  width: 100%;
444
444
  padding: 1rem;
445
- background-color: #10b981;
445
+ background-color: var(--calculator-success, #10b981);
446
446
  color: white;
447
447
  font-size: 1.125rem;
448
448
  font-weight: bold;
@@ -453,9 +453,9 @@
453
453
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
454
454
  }
455
455
 
456
- .calculator-calculate-button:hover {
457
- background-color: #059669;
458
- }
456
+ .calculator-calculate-button:hover {
457
+ background-color: color-mix(in srgb, var(--calculator-success, #10b981) 85%, black);
458
+ }
459
459
 
460
460
  /* レスポンシブ対応 */
461
461
  @media (max-width: 640px) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gumigumih/react-calculator-input-form",
3
- "version": "1.1.5",
3
+ "version": "2.0.0",
4
4
  "description": "React電卓入力フォームプラグイン - 税込税抜計算機能付き",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -9,6 +9,10 @@
9
9
  "files": [
10
10
  "dist"
11
11
  ],
12
+ "sideEffects": [
13
+ "*.css",
14
+ "dist/styles/*.css"
15
+ ],
12
16
  "exports": {
13
17
  ".": {
14
18
  "import": "./dist/index.esm.js",
@@ -16,19 +20,18 @@
16
20
  "types": "./dist/index.d.ts"
17
21
  },
18
22
  "./styles": {
19
- "import": "./src/styles/calculator.css",
20
- "require": "./src/styles/calculator.css"
23
+ "default": "./dist/styles/calculator.css"
21
24
  }
22
25
  },
23
26
  "scripts": {
24
- "build": "rollup -c",
27
+ "build": "npm run clean && rollup -c",
25
28
  "dev": "rollup -c -w",
26
- "test": "jest --runInBand",
27
- "test:watch": "jest --watch --runInBand",
28
- "test:coverage": "jest --coverage --runInBand",
29
+ "test": "jest --runInBand",
30
+ "test:watch": "jest --watch --runInBand",
31
+ "test:coverage": "jest --coverage --runInBand",
29
32
  "lint": "eslint src --ext .ts,.tsx",
30
33
  "typecheck": "tsc -p tsconfig.json --noEmit",
31
- "clean": "rm -rf dist",
34
+ "clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
32
35
  "docs:dev": "cd docs && npm run dev",
33
36
  "docs:build": "cd docs && npm run build",
34
37
  "docs:preview": "cd docs && npm run preview",
@@ -64,12 +67,8 @@
64
67
  },
65
68
  "peerDependencies": {
66
69
  "react": ">=16.8.0",
67
- "react-dom": ">=16.8.0"
68
- },
69
- "dependencies": {
70
- "@types/styled-components": "^5.1.34",
71
- "react-number-format": "^5.4.4",
72
- "styled-components": "^6.1.19"
70
+ "react-dom": ">=16.8.0",
71
+ "react-number-format": "^5.4.4"
73
72
  },
74
73
  "devDependencies": {
75
74
  "@eslint/js": "^9.34.0",
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- import '@testing-library/jest-dom';
@@ -1 +0,0 @@
1
-