elements-kit 0.7.1 → 0.7.2
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/dist/ui/checkbox/checkbox.css +108 -0
- package/dist/ui/radio/radio.css +89 -0
- package/package.json +1 -1
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
.x-checkbox {
|
|
2
|
+
appearance: none;
|
|
3
|
+
vertical-align: text-bottom;
|
|
4
|
+
width: var(--checkbox-size);
|
|
5
|
+
height: var(--checkbox-size);
|
|
6
|
+
border-radius: var(--checkbox-border-radius);
|
|
7
|
+
cursor: var(--cursor-checkbox);
|
|
8
|
+
flex-shrink: 0;
|
|
9
|
+
margin: 0;
|
|
10
|
+
padding: 0;
|
|
11
|
+
transition: background-color 80ms, box-shadow 80ms;
|
|
12
|
+
display: inline-block;
|
|
13
|
+
position: relative;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.x-checkbox:where([data-disabled], :disabled) {
|
|
17
|
+
cursor: var(--cursor-disabled);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.x-checkbox:before {
|
|
21
|
+
content: "";
|
|
22
|
+
position: absolute;
|
|
23
|
+
top: 50%;
|
|
24
|
+
left: 50%;
|
|
25
|
+
transform: translate(-50%, -50%);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.x-checkbox:where(:checked):before {
|
|
29
|
+
content: "✓";
|
|
30
|
+
font-family: var(--default-font-family);
|
|
31
|
+
font-size: var(--checkbox-indicator-size);
|
|
32
|
+
color: currentColor;
|
|
33
|
+
font-weight: 700;
|
|
34
|
+
line-height: 1;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.x-checkbox:where(:indeterminate):before {
|
|
38
|
+
content: "";
|
|
39
|
+
width: calc(var(--checkbox-indicator-size) * .7);
|
|
40
|
+
height: max(1.5px, calc(var(--checkbox-indicator-size) * .15));
|
|
41
|
+
background-color: currentColor;
|
|
42
|
+
border-radius: 1px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.x-checkbox:where(:focus-visible) {
|
|
46
|
+
outline: 2px solid var(--focus-8);
|
|
47
|
+
outline-offset: 2px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.x-checkbox:where([data-size="1"]) {
|
|
51
|
+
--checkbox-size: calc(var(--space-4) * .875);
|
|
52
|
+
--checkbox-indicator-size: calc(9px * var(--scaling));
|
|
53
|
+
--checkbox-border-radius: calc(var(--radius-1) * .875);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.x-checkbox:where([data-size="2"]) {
|
|
57
|
+
--checkbox-size: var(--space-4);
|
|
58
|
+
--checkbox-indicator-size: calc(10px * var(--scaling));
|
|
59
|
+
--checkbox-border-radius: var(--radius-1);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.x-checkbox:where([data-size="3"]) {
|
|
63
|
+
--checkbox-size: calc(var(--space-4) * 1.25);
|
|
64
|
+
--checkbox-indicator-size: calc(12px * var(--scaling));
|
|
65
|
+
--checkbox-border-radius: calc(var(--radius-1) * 1.25);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.x-checkbox:where(:not([data-size])) {
|
|
69
|
+
--checkbox-size: var(--space-4);
|
|
70
|
+
--checkbox-indicator-size: calc(10px * var(--scaling));
|
|
71
|
+
--checkbox-border-radius: var(--radius-1);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.x-checkbox:where(:not([data-variant="soft"])) {
|
|
75
|
+
background-color: var(--color-surface);
|
|
76
|
+
box-shadow: inset 0 0 0 1px var(--base-color-a7);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.x-checkbox:where(:not([data-variant="soft"])):where(:checked, :indeterminate) {
|
|
80
|
+
background-color: var(--color-9);
|
|
81
|
+
color: var(--accent-contrast);
|
|
82
|
+
box-shadow: none;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.x-checkbox:where(:not([data-variant="soft"])):where([data-high-contrast]):where(:checked, :indeterminate) {
|
|
86
|
+
background-color: var(--color-12);
|
|
87
|
+
color: var(--base-color-1);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.x-checkbox:where(:not([data-variant="soft"])):where([data-disabled], :disabled) {
|
|
91
|
+
box-shadow: inset 0 0 0 1px var(--base-color-a6);
|
|
92
|
+
color: var(--base-color-a8);
|
|
93
|
+
background-color: #0000;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.x-checkbox:where([data-variant="soft"]) {
|
|
97
|
+
background-color: var(--color-a5);
|
|
98
|
+
color: var(--color-a11);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.x-checkbox:where([data-variant="soft"]):where([data-high-contrast]):where(:checked, :indeterminate) {
|
|
102
|
+
color: var(--color-12);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.x-checkbox:where([data-variant="soft"]):where([data-disabled], :disabled) {
|
|
106
|
+
background-color: var(--base-color-a3);
|
|
107
|
+
color: var(--base-color-a8);
|
|
108
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
.x-radio {
|
|
2
|
+
appearance: none;
|
|
3
|
+
vertical-align: text-bottom;
|
|
4
|
+
width: var(--radio-size);
|
|
5
|
+
height: var(--radio-size);
|
|
6
|
+
cursor: var(--cursor-radio);
|
|
7
|
+
border-radius: 100%;
|
|
8
|
+
flex-shrink: 0;
|
|
9
|
+
margin: 0;
|
|
10
|
+
padding: 0;
|
|
11
|
+
transition: background-color 80ms, box-shadow 80ms;
|
|
12
|
+
display: inline-block;
|
|
13
|
+
position: relative;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.x-radio:where([data-disabled], :disabled) {
|
|
17
|
+
cursor: var(--cursor-disabled);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.x-radio:after {
|
|
21
|
+
content: "";
|
|
22
|
+
background-color: currentColor;
|
|
23
|
+
border-radius: 100%;
|
|
24
|
+
transition: transform 80ms;
|
|
25
|
+
position: absolute;
|
|
26
|
+
inset: 0;
|
|
27
|
+
transform: scale(0);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.x-radio:where(:checked):after {
|
|
31
|
+
transform: scale(.4);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.x-radio:where(:focus-visible) {
|
|
35
|
+
outline: 2px solid var(--focus-8);
|
|
36
|
+
outline-offset: 2px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.x-radio:where([data-size="1"]) {
|
|
40
|
+
--radio-size: calc(var(--space-4) * .875);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.x-radio:where([data-size="2"]) {
|
|
44
|
+
--radio-size: var(--space-4);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.x-radio:where([data-size="3"]) {
|
|
48
|
+
--radio-size: calc(var(--space-4) * 1.25);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.x-radio:where(:not([data-size])) {
|
|
52
|
+
--radio-size: var(--space-4);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.x-radio:where(:not([data-variant="soft"])) {
|
|
56
|
+
background-color: var(--color-surface);
|
|
57
|
+
box-shadow: inset 0 0 0 1px var(--base-color-a7);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.x-radio:where(:not([data-variant="soft"])):where(:checked) {
|
|
61
|
+
background-color: var(--color-9);
|
|
62
|
+
color: var(--accent-contrast);
|
|
63
|
+
box-shadow: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.x-radio:where(:not([data-variant="soft"])):where([data-high-contrast]):where(:checked) {
|
|
67
|
+
background-color: var(--color-12);
|
|
68
|
+
color: var(--base-color-1);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.x-radio:where(:not([data-variant="soft"])):where([data-disabled], :disabled) {
|
|
72
|
+
background-color: var(--base-color-a3);
|
|
73
|
+
box-shadow: inset 0 0 0 1px var(--base-color-a6);
|
|
74
|
+
color: var(--base-color-a8);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.x-radio:where([data-variant="soft"]) {
|
|
78
|
+
background-color: var(--color-a4);
|
|
79
|
+
color: var(--color-a11);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.x-radio:where([data-variant="soft"]):where([data-high-contrast]):where(:checked) {
|
|
83
|
+
color: var(--color-12);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.x-radio:where([data-variant="soft"]):where([data-disabled], :disabled) {
|
|
87
|
+
background-color: var(--base-color-a3);
|
|
88
|
+
color: var(--base-color-a8);
|
|
89
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "elements-kit",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.2",
|
|
5
5
|
"description": "A lightweight reactive UI library that transforms native HTMLElements into reactive components with signals. Ideal for framework-agnostic applications and web components.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"webcomponents",
|