@esportsplus/ui 0.33.4 → 0.34.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.
- package/build/components/checkbox/index.d.ts +2 -2
- package/build/components/radio/index.d.ts +1 -1
- package/build/components/range/index.d.ts +3 -1
- package/build/components/range/index.js +1 -0
- package/build/components/range/scss/index.scss +1 -1
- package/build/components/switch/index.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/checkbox/index.ts +1 -1
- package/src/components/range/index.ts +3 -2
- package/src/components/range/scss/variables.scss +1 -1
|
@@ -2,7 +2,7 @@ import { type Attributes } from '@esportsplus/template';
|
|
|
2
2
|
import './scss/index.scss';
|
|
3
3
|
declare const factory: (type: string) => (this: {
|
|
4
4
|
attributes?: Attributes;
|
|
5
|
-
}, attributes?: Attributes & {
|
|
5
|
+
} | any, attributes?: Attributes & {
|
|
6
6
|
state?: {
|
|
7
7
|
active: boolean;
|
|
8
8
|
error: string;
|
|
@@ -10,7 +10,7 @@ declare const factory: (type: string) => (this: {
|
|
|
10
10
|
}) => Node;
|
|
11
11
|
declare const _default: (this: {
|
|
12
12
|
attributes?: Attributes;
|
|
13
|
-
}, attributes?: Attributes & {
|
|
13
|
+
} | any, attributes?: Attributes & {
|
|
14
14
|
state?: {
|
|
15
15
|
active: boolean;
|
|
16
16
|
error: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './scss/index.scss';
|
|
2
2
|
declare const _default: (this: {
|
|
3
3
|
attributes?: import("@esportsplus/template").Attributes;
|
|
4
|
-
}, attributes?: import("@esportsplus/template").Attributes & {
|
|
4
|
+
} | any, attributes?: import("@esportsplus/template").Attributes & {
|
|
5
5
|
state?: {
|
|
6
6
|
active: boolean;
|
|
7
7
|
error: string;
|
|
@@ -2,7 +2,9 @@ import { type Attributes } from '@esportsplus/template';
|
|
|
2
2
|
import './scss/index.scss';
|
|
3
3
|
export default function (this: {
|
|
4
4
|
attributes?: Attributes;
|
|
5
|
-
}, attributes: Attributes & {
|
|
5
|
+
} | any, attributes: Attributes & {
|
|
6
|
+
min: number;
|
|
7
|
+
max: number;
|
|
6
8
|
state?: {
|
|
7
9
|
active: boolean;
|
|
8
10
|
error: string;
|
|
@@ -14,6 +14,7 @@ export default function (attributes) {
|
|
|
14
14
|
return html `
|
|
15
15
|
<input
|
|
16
16
|
class='range --border-state --border-black'
|
|
17
|
+
style='${() => `--thumb-position: ${((state.value - attributes.min) / (attributes.max - attributes.min)) * 100}%`}'
|
|
17
18
|
type='range'
|
|
18
19
|
${this?.attributes}
|
|
19
20
|
${attributes}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@layer components {.range{--background:var(--background-default);--background-active:var(--background-default);--background-default:var(--color-black-300);--background-hover:var(--background-default);--background-pressed:var(--background-default);--border-width:var(--border-width-700);--height:var(--size-200);--margin-horizontal:0px;--margin-vertical:0px;--thumb-background:var(--color-white-400);--thumb-size:var(--size-400);--width:100%}.range label:not(.--active):not(.--active):hover,.range:not(.--active):not(.--active):hover{--background:var(--background-hover)}.range label:not(.--active):not(.--active):active,.range:not(.--active):not(.--active):active{--background:var(--background-pressed)}.range.--active{--background:var(--background-active)}.range{background:var(--background);height:var(--height);margin:calc(var(--margin-vertical) + (var(--thumb-size) - var(--height))/2)var(--margin-horizontal);transition:background var(--transition-duration)ease-in-out,border-color var(--transition-duration)ease-in-out,box-shadow var(--transition-duration)ease-in-out,opacity var(--transition-duration)ease-in-out,transform var(--transition-duration)ease-in-out;width:var(--width);border:0;border-radius:240px}.range::-moz-range-thumb{background:var(--thumb-background);border:var(--border-width)solid var(--border-color);cursor:pointer;height:var(--thumb-size);width:var(--thumb-size);border-radius:100%}.range::-webkit-slider-thumb{background:var(--thumb-background);border:var(--border-width)solid var(--border-color);cursor:pointer;height:var(--thumb-size);width:var(--thumb-size);border-radius:100%}.range{appearance:none;outline:none}.range::-moz-range-thumb{appearance:none;outline:none}.range::-webkit-slider-thumb{appearance:none;outline:none}}
|
|
1
|
+
@layer components {.range{--background:var(--background-default);--background-active:var(--background-default);--background-default:linear-gradient(to right,var(--thumb-background)var(--thumb-position),var(--color-black-300)var(--thumb-position));--background-hover:var(--background-default);--background-pressed:var(--background-default);--border-width:var(--border-width-700);--height:var(--size-200);--margin-horizontal:0px;--margin-vertical:0px;--thumb-background:var(--color-white-400);--thumb-size:var(--size-400);--width:100%}.range label:not(.--active):not(.--active):hover,.range:not(.--active):not(.--active):hover{--background:var(--background-hover)}.range label:not(.--active):not(.--active):active,.range:not(.--active):not(.--active):active{--background:var(--background-pressed)}.range.--active{--background:var(--background-active)}.range{background:var(--background);height:var(--height);margin:calc(var(--margin-vertical) + (var(--thumb-size) - var(--height))/2)var(--margin-horizontal);transition:background var(--transition-duration)ease-in-out,border-color var(--transition-duration)ease-in-out,box-shadow var(--transition-duration)ease-in-out,opacity var(--transition-duration)ease-in-out,transform var(--transition-duration)ease-in-out;width:var(--width);border:0;border-radius:240px}.range::-moz-range-thumb{background:var(--thumb-background);border:var(--border-width)solid var(--border-color);cursor:pointer;height:var(--thumb-size);width:var(--thumb-size);border-radius:100%}.range::-webkit-slider-thumb{background:var(--thumb-background);border:var(--border-width)solid var(--border-color);cursor:pointer;height:var(--thumb-size);width:var(--thumb-size);border-radius:100%}.range{appearance:none;outline:none}.range::-moz-range-thumb{appearance:none;outline:none}.range::-webkit-slider-thumb{appearance:none;outline:none}}
|
|
2
2
|
/*$vite$:1*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './scss/index.scss';
|
|
2
2
|
declare const _default: (this: {
|
|
3
3
|
attributes?: import("@esportsplus/template").Attributes;
|
|
4
|
-
}, attributes?: import("@esportsplus/template").Attributes & {
|
|
4
|
+
} | any, attributes?: import("@esportsplus/template").Attributes & {
|
|
5
5
|
state?: {
|
|
6
6
|
active: boolean;
|
|
7
7
|
error: string;
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"glob": "^11.0.3",
|
|
16
16
|
"lightningcss": "^1.30.1",
|
|
17
17
|
"npm-run-all": "^4.1.5",
|
|
18
|
-
"sass": "^1.
|
|
18
|
+
"sass": "^1.92.0",
|
|
19
19
|
"vite": "^7.1.4"
|
|
20
20
|
},
|
|
21
21
|
"exports": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"private": false,
|
|
49
49
|
"sideEffects": false,
|
|
50
50
|
"type": "module",
|
|
51
|
-
"version": "0.
|
|
51
|
+
"version": "0.34.0",
|
|
52
52
|
"scripts": {
|
|
53
53
|
"build": "run-s build:vite build:ts",
|
|
54
54
|
"build:ts": "tsc && tsc-alias",
|
|
@@ -10,7 +10,7 @@ const OMIT = ['checked', 'value'];
|
|
|
10
10
|
|
|
11
11
|
const factory = (type: string) => {
|
|
12
12
|
function template(
|
|
13
|
-
this: { attributes?: Attributes },
|
|
13
|
+
this: { attributes?: Attributes } | any,
|
|
14
14
|
attributes?: Attributes & { state?: { active: boolean, error: string } }
|
|
15
15
|
) {
|
|
16
16
|
let state = attributes?.state || reactive({
|
|
@@ -5,8 +5,8 @@ import './scss/index.scss';
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
export default function(
|
|
8
|
-
this: { attributes?: Attributes },
|
|
9
|
-
attributes: Attributes & { state?: { active: boolean, error: string, value: number } }
|
|
8
|
+
this: { attributes?: Attributes } | any,
|
|
9
|
+
attributes: Attributes & { min: number, max: number, state?: { active: boolean, error: string, value: number } }
|
|
10
10
|
) {
|
|
11
11
|
let state = attributes.state || reactive({
|
|
12
12
|
active: false,
|
|
@@ -21,6 +21,7 @@ export default function(
|
|
|
21
21
|
return html`
|
|
22
22
|
<input
|
|
23
23
|
class='range --border-state --border-black'
|
|
24
|
+
style='${() => `--thumb-position: ${((state.value - attributes.min) / (attributes.max - attributes.min)) * 100}%`}'
|
|
24
25
|
type='range'
|
|
25
26
|
${this?.attributes}
|
|
26
27
|
${attributes}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
.range {
|
|
4
4
|
--background: var(--background-default);
|
|
5
5
|
--background-active: var(--background-default);
|
|
6
|
-
--background-default: var(--color-black-300);
|
|
6
|
+
--background-default: linear-gradient(to right, var(--thumb-background) var(--thumb-position), var(--color-black-300) var(--thumb-position));
|
|
7
7
|
--background-hover: var(--background-default);
|
|
8
8
|
--background-pressed: var(--background-default);
|
|
9
9
|
--border-width: var(--border-width-700);
|