@ctx-core/switch 11.1.35 → 11.2.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.
@@ -0,0 +1,5 @@
1
+ import type { SvelteComponent } from 'svelte'
2
+ export class RoundSwitch extends SvelteComponent<{
3
+ id?:string
4
+ }> {
5
+ }
@@ -0,0 +1,59 @@
1
+ <script>
2
+ export let id = ''
3
+ </script>
4
+
5
+ <label class="Switch Round_Switch">
6
+ <input {id} type="checkbox" on:change>
7
+ <span class="slider round"></span>
8
+ </label>
9
+
10
+ <style>
11
+ .Switch {
12
+ position: relative;
13
+ display: inline-block;
14
+ width: 60px;
15
+ height: 34px;
16
+ }
17
+ .Switch input {
18
+ display: none;
19
+ }
20
+ .Switch input:checked + .slider {
21
+ background-color: #3EBBC0;
22
+ }
23
+ .Switch input:checked + .slider:before {
24
+ -webkit-transform: translateX(26px);
25
+ -ms-transform: translateX(26px);
26
+ transform: translateX(26px);
27
+ }
28
+ .Switch input:focused + .slider {
29
+ box-shadow: 0 0 1px #2196F3;
30
+ }
31
+ .Switch input + .slider.round {
32
+ border-radius: 34px;
33
+ }
34
+ .Switch input + .slider.round:before {
35
+ border-radius: 50%;
36
+ }
37
+ .Switch .slider {
38
+ position: absolute;
39
+ cursor: pointer;
40
+ top: 0;
41
+ left: 0;
42
+ right: 0;
43
+ bottom: 0;
44
+ background-color: #ccc;
45
+ -webkit-transition: .4s;
46
+ transition: .4s;
47
+ }
48
+ .Switch .slider:before {
49
+ position: absolute;
50
+ content: "";
51
+ height: 26px;
52
+ width: 26px;
53
+ left: 4px;
54
+ bottom: 4px;
55
+ background-color: white;
56
+ -webkit-transition: .4s;
57
+ transition: .4s;
58
+ }
59
+ </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctx-core/switch",
3
- "version": "11.1.35",
3
+ "version": "11.2.0",
4
4
  "description": "ctx-core switch",
5
5
  "keywords": [
6
6
  "ctx-core",
@@ -17,10 +17,13 @@
17
17
  "license": "Apache-2.0",
18
18
  "author": "Brian Takita",
19
19
  "type": "module",
20
- "types": "./src/index.d.ts",
21
- "svelte": "./src/index.js",
20
+ "files": [
21
+ "*.d.ts",
22
+ "./RoundSwitch"
23
+ ],
24
+ "types": "./index.d.ts",
22
25
  "exports": {
23
- ".": "./src/index.js",
26
+ ".": "./index.js",
24
27
  "./package.json": "./package.json"
25
28
  },
26
29
  "dependencies": {
@@ -29,7 +32,7 @@
29
32
  "devDependencies": {
30
33
  "c8": "^8.0.1",
31
34
  "check-dts": "^0.7.2",
32
- "tsx": "^3.14.0",
35
+ "tsx": "^4.0.0",
33
36
  "typescript": "next",
34
37
  "uvu": "^0.5.6"
35
38
  },