@ctx-core/switch 11.0.96 → 11.1.1

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @ctx-core/switch
2
2
 
3
+ ## 11.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - svelte: ^3.55.1 -> ^3.56.0
8
+
9
+ ## 11.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - RoundSwitch: + types: RoundSwitch extends SvelteComponentTyped
14
+ - extract _.js & _.d.ts into directories
15
+
3
16
  ## 11.0.96
4
17
 
5
18
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctx-core/switch",
3
- "version": "11.0.96",
3
+ "version": "11.1.1",
4
4
  "description": "ctx-core switch",
5
5
  "keywords": [
6
6
  "ctx-core",
@@ -17,37 +17,33 @@
17
17
  "license": "Apache-2.0",
18
18
  "author": "Brian Takita",
19
19
  "type": "module",
20
- "types": "./lib/index.d.ts",
20
+ "types": "./src/index.d.ts",
21
+ "svelte": "./src/index.js",
21
22
  "exports": {
22
- ".": "./lib/index.js",
23
+ ".": "./src/index.js",
23
24
  "./package.json": "./package.json"
24
25
  },
26
+ "dependencies": {
27
+ "svelte": "^3.56.0"
28
+ },
25
29
  "devDependencies": {
26
- "@ctx-core/sass": "^12.2.0",
27
- "@sveltejs/adapter-auto": "next",
28
- "@sveltejs/kit": "next",
29
- "@swc/cli": "^0.1.62",
30
- "@swc/core": "^1.3.35",
31
- "rimraf": "^4.1.2",
32
- "svelte": "^3.55.1",
33
- "svelte-preprocess": "^5.0.1",
34
- "svelte2tsx": "^0.6.1",
35
- "tslib": "^2.5.0",
36
- "typescript": "next"
30
+ "c8": "^7.13.0",
31
+ "check-dts": "^0.7.0",
32
+ "tsx": "^3.12.3",
33
+ "typescript": "next",
34
+ "uvu": "^0.5.6"
37
35
  },
38
36
  "publishConfig": {
39
37
  "access": "public",
40
38
  "cache": "~/.npm"
41
39
  },
42
- "svelte": "./lib/index.js",
43
40
  "sideEffects": false,
44
41
  "scripts": {
45
- "build": "npm run compile",
46
- "clean": "rimraf lib && npm run clean:tsbuildinfo",
47
- "clean:tsbuildinfo": "rimraf tsconfig.tsbuildinfo && rimraf lib/**/*.d.ts",
48
- "compile": "npm run compile:source && npm run compile:declaration",
49
- "compile:source": "swc src --out-dir lib --copy-files --source-maps --config-file .swcrc",
50
- "compile:declaration": "npm run clean:tsbuildinfo && tsc --declaration --emitDeclarationOnly --declarationDir lib",
51
- "exec": "$@"
42
+ "build": ":",
43
+ "clean": ":",
44
+ "exec": "$@",
45
+ "test": "pnpm test-unit && check-dts",
46
+ "test-unit": "tsx node_modules/uvu/bin.js . '\\.test\\.(ts|js)$'",
47
+ "test-unit-coverage": "c8 pnpm test-unit"
52
48
  }
53
49
  }
@@ -0,0 +1,4 @@
1
+ import type { SvelteComponentTyped } from 'svelte'
2
+ export class RoundSwitch extends SvelteComponentTyped<{
3
+ id?:string
4
+ }> {}
@@ -0,0 +1,2 @@
1
+ import 'svelte'
2
+ export * as RoundSwitch from './index.svelte'
@@ -1,4 +1,4 @@
1
- <script lang="ts">
1
+ <script>
2
2
  export let id = ''
3
3
  </script>
4
4
 
@@ -7,39 +7,34 @@ export let id = ''
7
7
  <span class="slider round"></span>
8
8
  </label>
9
9
 
10
- <style lang="scss">
10
+ <style>
11
11
  .Switch {
12
12
  position: relative;
13
13
  display: inline-block;
14
14
  width: 60px;
15
15
  height: 34px;
16
- input {
16
+ }
17
+ .Switch input {
17
18
  display: none;
18
- &:checked {
19
- + .slider {
19
+ }
20
+ .Switch input:checked + .slider {
20
21
  background-color: #3EBBC0;
21
- &:before {
22
+ }
23
+ .Switch input:checked + .slider:before {
22
24
  -webkit-transform: translateX(26px);
23
25
  -ms-transform: translateX(26px);
24
26
  transform: translateX(26px);
25
27
  }
26
- }
27
- }
28
- &:focused {
29
- + .slider {
28
+ .Switch input:focused + .slider {
30
29
  box-shadow: 0 0 1px #2196F3;
31
30
  }
32
- }
33
- + .slider {
34
- &.round {
31
+ .Switch input + .slider.round {
35
32
  border-radius: 34px;
36
- &:before {
33
+ }
34
+ .Switch input + .slider.round:before {
37
35
  border-radius: 50%;
38
36
  }
39
- }
40
- }
41
- }
42
- .slider {
37
+ .Switch .slider {
43
38
  position: absolute;
44
39
  cursor: pointer;
45
40
  top: 0;
@@ -49,7 +44,8 @@ export let id = ''
49
44
  background-color: #ccc;
50
45
  -webkit-transition: .4s;
51
46
  transition: .4s;
52
- &:before {
47
+ }
48
+ .Switch .slider:before {
53
49
  position: absolute;
54
50
  content: "";
55
51
  height: 26px;
@@ -60,6 +56,4 @@ export let id = ''
60
56
  -webkit-transition: .4s;
61
57
  transition: .4s;
62
58
  }
63
- }
64
- }
65
59
  </style>
package/src/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './RoundSwitch/index.js'
package/src/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from './RoundSwitch/index.js'
package/.swcrc DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "jsc": {
3
- "target": "es2020",
4
- "parser": {
5
- "syntax": "typescript",
6
- "tsx": true,
7
- "dynamicImport": true
8
- }
9
- }
10
- }
@@ -1,65 +0,0 @@
1
- <script lang="ts">
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 lang="scss">
11
- .Switch {
12
- position: relative;
13
- display: inline-block;
14
- width: 60px;
15
- height: 34px;
16
- input {
17
- display: none;
18
- &:checked {
19
- + .slider {
20
- background-color: #3EBBC0;
21
- &:before {
22
- -webkit-transform: translateX(26px);
23
- -ms-transform: translateX(26px);
24
- transform: translateX(26px);
25
- }
26
- }
27
- }
28
- &:focused {
29
- + .slider {
30
- box-shadow: 0 0 1px #2196F3;
31
- }
32
- }
33
- + .slider {
34
- &.round {
35
- border-radius: 34px;
36
- &:before {
37
- border-radius: 50%;
38
- }
39
- }
40
- }
41
- }
42
- .slider {
43
- position: absolute;
44
- cursor: pointer;
45
- top: 0;
46
- left: 0;
47
- right: 0;
48
- bottom: 0;
49
- background-color: #ccc;
50
- -webkit-transition: .4s;
51
- transition: .4s;
52
- &:before {
53
- position: absolute;
54
- content: "";
55
- height: 26px;
56
- width: 26px;
57
- left: 4px;
58
- bottom: 4px;
59
- background-color: white;
60
- -webkit-transition: .4s;
61
- transition: .4s;
62
- }
63
- }
64
- }
65
- </style>
package/lib/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import 'svelte';
2
- export * as RoundSwitch from './RoundSwitch.svelte';
package/lib/index.js DELETED
@@ -1,4 +0,0 @@
1
- import 'svelte';
2
- export * as RoundSwitch from './RoundSwitch.svelte';
3
-
4
- //# sourceMappingURL=index.js.map
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import 'svelte'\nexport * as RoundSwitch from './RoundSwitch.svelte'\n"],"names":["RoundSwitch"],"mappings":"AAAA,OAAO,SAAQ;AACf,OAAO,KAAKA,WAAW,MAAM,uBAAsB"}
package/src/index.ts DELETED
@@ -1,2 +0,0 @@
1
- import 'svelte'
2
- export * as RoundSwitch from './RoundSwitch.svelte'