@threadlabs/looma 0.39.1 → 0.39.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/components/ui-button/ui-button.html +24 -3
- package/components/ui-checkbox/ui-checkbox.html +34 -18
- package/components/ui-light-editor/ui-light-editor.html +26 -25
- package/dist/index.js +1 -1
- package/docs/README.md +17 -6
- package/docs/catalog.json +2 -2
- package/docs/customizer-render.mjs +37 -33
- package/docs/customizer.js +82 -47
- package/docs/site.mjs +1 -1
- package/docs/theme-session.mjs +7 -8
- package/docs/theme.mjs +2 -20
- package/package.json +1 -1
- package/styles/ui-button.css +24 -1
- package/styles/ui-checkbox.css +39 -19
- package/styles/ui-light-editor.css +111 -0
- package/tokens.css +9 -2
- package/vanilla/UiButton.js +14 -12
- package/vanilla/UiLightEditor.js +2 -2
- package/vue/UiButton.vue +28 -7
- package/vue/UiCheckbox.vue +34 -19
- package/vue/UiLightEditor.vue +156 -40
- package/vue/chunks/UiButton.js +18 -10
- package/vue/chunks/UiCheckbox.js +1 -1
- package/vue/chunks/UiLightEditor.js +66 -58
- package/vue/components.css +232 -42
- package/vue/editor/index.js +46 -36
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
from:tabindex="{ true: '0', false: null }[concat(($loading or $pending) and not $disabled)]"
|
|
97
97
|
>
|
|
98
98
|
<span $if="$loading or $pending" class="spinner-wrap"><ui-spinner size="sm"></ui-spinner></span>
|
|
99
|
-
<slot></slot>
|
|
99
|
+
<span class="label"><slot></slot></span>
|
|
100
100
|
<span class="badge"><slot name="badge"></slot></span>
|
|
101
101
|
</a>
|
|
102
102
|
<button
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
from:aria-busy="$loading or $pending"
|
|
110
110
|
>
|
|
111
111
|
<span $if="$loading or $pending" class="spinner-wrap"><ui-spinner size="sm"></ui-spinner></span>
|
|
112
|
-
<slot></slot>
|
|
112
|
+
<span class="label"><slot></slot></span>
|
|
113
113
|
<span class="badge"><slot name="badge"></slot></span>
|
|
114
114
|
</button>
|
|
115
115
|
</template>
|
|
@@ -237,6 +237,7 @@
|
|
|
237
237
|
|
|
238
238
|
:host {
|
|
239
239
|
--_button-square-size: var(--ui-button-min-block-size, var(--ui-control-size-md));
|
|
240
|
+
box-sizing: border-box !important;
|
|
240
241
|
appearance: none;
|
|
241
242
|
min-block-size: var(--ui-button-min-block-size, var(--ui-control-size-md));
|
|
242
243
|
border-style: solid;
|
|
@@ -283,6 +284,21 @@
|
|
|
283
284
|
padding-block: var(--ui-space-0-5) !important;
|
|
284
285
|
}
|
|
285
286
|
|
|
287
|
+
/* Trim the text line itself: an anonymous flex item retains font-metric space in some fonts. */
|
|
288
|
+
.label {
|
|
289
|
+
display: block !important;
|
|
290
|
+
align-content: center !important;
|
|
291
|
+
min-inline-size: 0 !important;
|
|
292
|
+
min-block-size: 1lh !important;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.label:has(svg) {
|
|
296
|
+
display: inline-flex !important;
|
|
297
|
+
align-items: center !important;
|
|
298
|
+
gap: var(--ui-space-2) !important;
|
|
299
|
+
text-box-trim: none;
|
|
300
|
+
}
|
|
301
|
+
|
|
286
302
|
.badge {
|
|
287
303
|
display: inline-flex !important;
|
|
288
304
|
align-items: center !important;
|
|
@@ -294,7 +310,7 @@
|
|
|
294
310
|
}
|
|
295
311
|
|
|
296
312
|
@supports (text-box-trim: trim-both) {
|
|
297
|
-
:
|
|
313
|
+
.label:not(:has(svg)) {
|
|
298
314
|
text-box-trim: trim-both;
|
|
299
315
|
text-box-edge: cap alphabetic;
|
|
300
316
|
}
|
|
@@ -622,6 +638,11 @@
|
|
|
622
638
|
transition: color var(--ui-motion-fast) var(--ui-motion-ease), text-decoration-color var(--ui-motion-fast) var(--ui-motion-ease);
|
|
623
639
|
}
|
|
624
640
|
|
|
641
|
+
:host[data-appearance="link"] .label {
|
|
642
|
+
display: inline !important;
|
|
643
|
+
text-box-trim: none;
|
|
644
|
+
}
|
|
645
|
+
|
|
625
646
|
:host[data-appearance="link"]:hover:not(:disabled, [aria-disabled="true"]) {
|
|
626
647
|
color: var(--ui-button-link-hover-text, var(--ui-text-primary));
|
|
627
648
|
text-decoration-color: currentColor;
|
|
@@ -142,7 +142,8 @@
|
|
|
142
142
|
|
|
143
143
|
input::after {
|
|
144
144
|
content: "";
|
|
145
|
-
position: absolute;
|
|
145
|
+
position: absolute !important;
|
|
146
|
+
transform: none !important;
|
|
146
147
|
opacity: 0;
|
|
147
148
|
transition: opacity var(--ui-motion-fast) var(--ui-motion-ease);
|
|
148
149
|
}
|
|
@@ -155,43 +156,44 @@
|
|
|
155
156
|
box-shadow: var(--ui-control-inset);
|
|
156
157
|
}
|
|
157
158
|
|
|
158
|
-
/*
|
|
159
|
+
/* The SVG's painted bounds are centred in its viewBox, including its round stroke.
|
|
160
|
+
Centre that box directly; rotated border boxes do not centre the visible check. */
|
|
159
161
|
input:checked::after {
|
|
160
|
-
inset:
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
border-style: solid;
|
|
167
|
-
border-color: var(--ui-text-on-accent);
|
|
168
|
-
border-width: 0 calc(var(--_ui-checkbox-size) * 0.125 / 1.125) calc(var(--_ui-checkbox-size) * 0.125 / 1.125) 0;
|
|
162
|
+
inset: 50% auto auto 50% !important;
|
|
163
|
+
inline-size: calc(var(--_ui-checkbox-size) * 0.7) !important;
|
|
164
|
+
block-size: calc(var(--_ui-checkbox-size) * 0.7) !important;
|
|
165
|
+
background: var(--ui-text-on-accent);
|
|
166
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 11.5 5 5 9-9'/%3E%3C/svg%3E")
|
|
167
|
+
center / contain no-repeat;
|
|
169
168
|
opacity: 1;
|
|
170
|
-
|
|
169
|
+
translate: -50% -50% !important;
|
|
171
170
|
animation: ui-checkbox-check var(--ui-motion-base) var(--ui-motion-ease-out, cubic-bezier(0.16, 1, 0.3, 1)) both;
|
|
172
171
|
}
|
|
173
172
|
|
|
174
173
|
input:indeterminate::after {
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
mask: none;
|
|
175
|
+
animation: none;
|
|
176
|
+
inset: 50% calc(var(--_ui-checkbox-size) * 0.23 / 1.125) auto !important;
|
|
177
|
+
inline-size: auto !important;
|
|
178
|
+
block-size: calc(var(--_ui-checkbox-size) * 0.125 / 1.125) !important;
|
|
177
179
|
border-radius: var(--ui-radius-round);
|
|
178
180
|
background: var(--ui-text-on-accent);
|
|
179
181
|
opacity: 1;
|
|
180
|
-
|
|
182
|
+
translate: 0 -50% !important;
|
|
181
183
|
}
|
|
182
184
|
|
|
183
185
|
@keyframes ui-checkbox-check {
|
|
184
186
|
from {
|
|
185
187
|
opacity: 0;
|
|
186
|
-
|
|
188
|
+
scale: 0.55;
|
|
187
189
|
}
|
|
188
190
|
65% {
|
|
189
191
|
opacity: 1;
|
|
190
|
-
|
|
192
|
+
scale: 1.12;
|
|
191
193
|
}
|
|
192
194
|
to {
|
|
193
195
|
opacity: 1;
|
|
194
|
-
|
|
196
|
+
scale: 1;
|
|
195
197
|
}
|
|
196
198
|
}
|
|
197
199
|
|
|
@@ -202,6 +204,20 @@
|
|
|
202
204
|
}
|
|
203
205
|
}
|
|
204
206
|
|
|
207
|
+
@media (forced-colors: active) {
|
|
208
|
+
input:checked,
|
|
209
|
+
input:indeterminate {
|
|
210
|
+
forced-color-adjust: none;
|
|
211
|
+
background: Highlight;
|
|
212
|
+
border-color: Highlight;
|
|
213
|
+
}
|
|
214
|
+
input:checked::after,
|
|
215
|
+
input:indeterminate::after {
|
|
216
|
+
forced-color-adjust: none;
|
|
217
|
+
background: HighlightText;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
205
221
|
input:hover:enabled {
|
|
206
222
|
border-color: var(--ui-accent-solid);
|
|
207
223
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<link rel="component" href="../ui-icon/ui-icon.html">
|
|
2
2
|
<link rel="component" href="../ui-number-input/ui-number-input.html">
|
|
3
|
+
<link rel="component" href="../ui-disclosure/ui-disclosure.html">
|
|
3
4
|
<template component="ui-light-editor" module="./ui-light-editor.js">
|
|
4
5
|
<defs>
|
|
5
6
|
<state name="horizontal" type="string" value="50"></state>
|
|
@@ -29,31 +30,31 @@
|
|
|
29
30
|
</button>
|
|
30
31
|
</span>
|
|
31
32
|
</span>
|
|
32
|
-
<span class="
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
33
|
+
<span class="hint">Drag or tap to move the light. Arrow keys adjust; Escape cancels.</span>
|
|
34
|
+
<ui-disclosure summary="Exact position"><span class="coordinates">
|
|
35
|
+
<ui-number-input
|
|
36
|
+
data-coordinate="x"
|
|
37
|
+
from:value="$horizontal"
|
|
38
|
+
min="0"
|
|
39
|
+
max="100"
|
|
40
|
+
step="1"
|
|
41
|
+
unit="%"
|
|
42
|
+
label="Light horizontal position"
|
|
43
|
+
from:size="$size"
|
|
44
|
+
from:disabled="$disabled"
|
|
45
|
+
></ui-number-input>
|
|
46
|
+
<ui-number-input
|
|
47
|
+
data-coordinate="y"
|
|
48
|
+
from:value="$vertical"
|
|
49
|
+
min="0"
|
|
50
|
+
max="100"
|
|
51
|
+
step="1"
|
|
52
|
+
unit="%"
|
|
53
|
+
label="Light vertical position"
|
|
54
|
+
from:size="$size"
|
|
55
|
+
from:disabled="$disabled"
|
|
56
|
+
></ui-number-input>
|
|
57
|
+
</span></ui-disclosure>
|
|
57
58
|
</span>
|
|
58
59
|
<style>
|
|
59
60
|
:host {
|