elements-kit 0.9.1 → 0.10.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,259 @@
1
+ .x-segmented-control {
2
+ vertical-align: top;
3
+ isolation: isolate;
4
+ min-width: max-content;
5
+ color: var(--base-color-12);
6
+ background-color: var(--color-surface);
7
+ background-image: linear-gradient(var(--base-color-a3),
8
+ var(--base-color-a3));
9
+ font-family: var(--default-font-family);
10
+ text-align: center;
11
+ --seg-inset: 1px;
12
+ --seg-transition-duration: .1s;
13
+ --seg-track-radius: max(var(--radius-2), var(--radius-pill));
14
+ --seg-indicator-radius: max(.5px,
15
+ calc(var(--seg-track-radius) - var(--seg-inset)));
16
+ border-radius: var(--seg-track-radius);
17
+ border: 0;
18
+ grid-auto-columns: minmax(0, 1fr);
19
+ grid-auto-flow: column;
20
+ align-items: stretch;
21
+ margin: 0;
22
+ padding: 0;
23
+ font-style: normal;
24
+ display: inline-grid;
25
+ position: relative;
26
+ }
27
+
28
+ .x-segmented-control > label {
29
+ justify-content: center;
30
+ align-items: center;
31
+ gap: var(--space-1);
32
+ -webkit-user-select: none;
33
+ user-select: none;
34
+ cursor: var(--cursor-button);
35
+ color: var(--base-color-a11);
36
+ font-weight: var(--font-weight-regular);
37
+ letter-spacing: var(--tab-inactive-letter-spacing);
38
+ transition: color var(--seg-transition-duration);
39
+ display: flex;
40
+ position: relative;
41
+ }
42
+
43
+ .x-segmented-control > label:where(:first-child) {
44
+ border-top-left-radius: inherit;
45
+ border-bottom-left-radius: inherit;
46
+ }
47
+
48
+ .x-segmented-control > label:where(:last-child) {
49
+ border-top-right-radius: inherit;
50
+ border-bottom-right-radius: inherit;
51
+ }
52
+
53
+ .x-segmented-control :where(input[type="radio"]) {
54
+ white-space: nowrap;
55
+ clip-path: inset(50%);
56
+ pointer-events: none;
57
+ appearance: none;
58
+ border: 0;
59
+ width: 1px;
60
+ height: 1px;
61
+ margin: -1px;
62
+ padding: 0;
63
+ position: absolute;
64
+ overflow: hidden;
65
+ }
66
+
67
+ .x-segmented-control > label:where(:has(:checked)) {
68
+ color: var(--base-color-12);
69
+ }
70
+
71
+ .x-segmented-control > label:where(:has(:focus-visible)) {
72
+ outline: 2px solid var(--focus-8);
73
+ outline-offset: -1px;
74
+ border-radius: inherit;
75
+ }
76
+
77
+ @media (hover: hover) {
78
+ .x-segmented-control > label:where(:not(:has(:checked, :disabled)):hover) {
79
+ background-color: var(--base-color-a2);
80
+ }
81
+ }
82
+
83
+ .x-segmented-control > label + label:after {
84
+ content: "";
85
+ inset-inline-start: 0;
86
+ top: var(--seg-inset);
87
+ bottom: var(--seg-inset);
88
+ background-color: var(--base-color-a4);
89
+ z-index: -1;
90
+ width: 1px;
91
+ transition: opacity var(--seg-transition-duration) ease-out;
92
+ margin-inline-start: -.5px;
93
+ position: absolute;
94
+ }
95
+
96
+ .x-segmented-control > label:where(:has(:checked, :focus-visible)):after, .x-segmented-control > label:where(:has(:checked, :focus-visible)) + label:after {
97
+ opacity: 0;
98
+ }
99
+
100
+ .x-segmented-control > label:before {
101
+ content: "";
102
+ inset: var(--seg-inset);
103
+ z-index: -1;
104
+ background-color: var(--color-background);
105
+ border-radius: var(--seg-indicator-radius);
106
+ box-shadow: 0 0 0 .5px var(--base-color-a3),
107
+ 0 1px 2px var(--base-color-a4);
108
+ opacity: 0;
109
+ transition: opacity var(--seg-transition-duration) ease-out;
110
+ position: absolute;
111
+ }
112
+
113
+ .x-segmented-control > label:where(:has(:checked)):before {
114
+ opacity: 1;
115
+ }
116
+
117
+ @supports (anchor-name: --x) {
118
+ .x-segmented-control > label:before {
119
+ display: none;
120
+ }
121
+
122
+ .x-segmented-control > label:where(:has(:checked)) {
123
+ anchor-name: --x-seg-active;
124
+ }
125
+
126
+ .x-segmented-control:after {
127
+ content: "";
128
+ z-index: -1;
129
+ top: var(--seg-inset);
130
+ bottom: var(--seg-inset);
131
+ left: anchor(--x-seg-active left);
132
+ right: anchor(--x-seg-active right);
133
+ background-color: var(--color-background);
134
+ border-radius: var(--seg-indicator-radius);
135
+ width: auto;
136
+ box-shadow: 0 0 0 .5px var(--base-color-a3),
137
+ 0 1px 2px var(--base-color-a4);
138
+ transition: left var(--seg-transition-duration) cubic-bezier(.45, .05, .55, .95),
139
+ right var(--seg-transition-duration) cubic-bezier(.45, .05, .55, .95);
140
+ position: absolute;
141
+ }
142
+
143
+ .x-segmented-control:not(:has(:checked)):after {
144
+ display: none;
145
+ }
146
+ }
147
+
148
+ .x-segmented-control:where(:disabled, [data-disabled]) {
149
+ color: var(--base-color-a8);
150
+ background-image: linear-gradient(var(--base-color-a2),
151
+ var(--base-color-a2));
152
+ }
153
+
154
+ .x-segmented-control:where(:disabled, [data-disabled]) > label, .x-segmented-control > label:where(:has(:disabled)) {
155
+ cursor: var(--cursor-disabled);
156
+ color: var(--base-color-a8);
157
+ }
158
+
159
+ .x-segmented-control:where(:disabled, [data-disabled]) > label:before, .x-segmented-control > label:where(:has(:disabled)):before {
160
+ background-color: var(--base-color-a3);
161
+ box-shadow: none;
162
+ }
163
+
164
+ @supports (anchor-name: --x) {
165
+ .x-segmented-control:where(:disabled, [data-disabled]):after, .x-segmented-control:where(:has( > label:where(:has(:disabled)):has(:checked))):after {
166
+ background-color: var(--base-color-a3);
167
+ box-shadow: none;
168
+ }
169
+ }
170
+
171
+ @media (prefers-reduced-motion: reduce) {
172
+ .x-segmented-control, .x-segmented-control > label, .x-segmented-control > label:before, .x-segmented-control > label + label:after, .x-segmented-control:after {
173
+ transition: none;
174
+ }
175
+ }
176
+
177
+ @media (forced-colors: active) {
178
+ .x-segmented-control {
179
+ background-image: none;
180
+ border: 1px solid buttontext;
181
+ }
182
+
183
+ .x-segmented-control > label {
184
+ color: buttontext;
185
+ }
186
+
187
+ .x-segmented-control > label:where(:has(:checked)) {
188
+ color: highlighttext;
189
+ }
190
+
191
+ .x-segmented-control > label:before, .x-segmented-control:after {
192
+ box-shadow: none;
193
+ background-color: highlight;
194
+ border: 1px solid highlighttext;
195
+ }
196
+
197
+ .x-segmented-control > label:where(:has(:focus-visible)) {
198
+ outline-color: highlight;
199
+ }
200
+ }
201
+
202
+ .x-segmented-control:where(:not([data-size])), .x-segmented-control:where([data-size="2"]) {
203
+ height: var(--space-6);
204
+ --seg-track-radius: max(var(--radius-2), var(--radius-pill));
205
+ font-size: var(--font-size-2);
206
+ line-height: var(--line-height-2);
207
+ }
208
+
209
+ :is(.x-segmented-control:where(:not([data-size])), .x-segmented-control:where([data-size="2"])) > label {
210
+ padding-inline: var(--space-3);
211
+ }
212
+
213
+ .x-segmented-control:where([data-size="1"]) {
214
+ height: var(--space-5);
215
+ --seg-track-radius: max(var(--radius-1), var(--radius-pill));
216
+ font-size: var(--font-size-1);
217
+ line-height: var(--line-height-1);
218
+ }
219
+
220
+ .x-segmented-control:where([data-size="1"]) > label {
221
+ padding-inline: var(--space-2);
222
+ gap: var(--space-1);
223
+ }
224
+
225
+ .x-segmented-control:where([data-size="3"]) {
226
+ height: var(--space-7);
227
+ --seg-track-radius: max(var(--radius-3), var(--radius-pill));
228
+ font-size: var(--font-size-3);
229
+ line-height: var(--line-height-3);
230
+ }
231
+
232
+ .x-segmented-control:where([data-size="3"]) > label {
233
+ padding-inline: var(--space-4);
234
+ gap: var(--space-2);
235
+ }
236
+
237
+ .x-segmented-control:where([data-variant="soft"]) {
238
+ background-image: linear-gradient(var(--color-a3), var(--color-a3));
239
+ }
240
+
241
+ .x-segmented-control:where([data-variant="soft"]) > label {
242
+ color: var(--color-a11);
243
+ }
244
+
245
+ .x-segmented-control:where([data-variant="soft"]) > label:where(:has(:checked)) {
246
+ color: var(--color-a12, var(--color-12));
247
+ }
248
+
249
+ .x-segmented-control:where([data-variant="soft"]) > label + label:after {
250
+ background-color: var(--color-a4);
251
+ }
252
+
253
+ .x-segmented-control:where([data-high-contrast]) > label:where(:has(:checked)) {
254
+ color: var(--base-color-12);
255
+ }
256
+
257
+ .x-segmented-control:where([data-high-contrast][data-variant="soft"]) > label:where(:has(:checked)) {
258
+ color: var(--color-12);
259
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "elements-kit",
3
3
  "type": "module",
4
- "version": "0.9.1",
4
+ "version": "0.10.0",
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",