@threadlabs/looma 0.27.0 → 0.27.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-badge/ui-badge.html +17 -3
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/styles/ui-badge.css +16 -0
- package/vanilla/UiBadge.d.ts +1 -1
- package/vanilla/UiBadge.js +1 -1
- package/vue/UiBadge.d.ts +3 -3
- package/vue/UiBadge.vue +24 -6
- package/vue/chunks/UiBadge.js +5 -4
- package/vue/components.css +74 -59
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<template component="ui-badge">
|
|
2
2
|
<defs>
|
|
3
|
-
<prop name="variant" type="keyword" values="solid, subtle, outline, inverse" default="subtle"
|
|
3
|
+
<prop name="variant" type="keyword" values="solid, subtle, outline, inverse, overlay" default="subtle"
|
|
4
4
|
>Emphasis. subtle sets toned text over a soft wash; solid fills with the tone and uses contrasting text; outline keeps the surface with a toned edge.
|
|
5
5
|
inverse uses a translucent contrasting surface and toned ink for a count or label on a filled control of that tone. Neutral looks the same in solid and
|
|
6
|
-
subtle.
|
|
6
|
+
subtle. overlay inherits the containing filled control's text colour on a faint translucent fill, without a visible rim or shadow. Its small circle is
|
|
7
|
+
20px. When space is constrained, the label truncates with an ellipsis while its full text remains available.</prop>
|
|
7
8
|
<prop name="tone" type="keyword" values="neutral, accent, info, success, warning, danger" default="neutral"
|
|
8
9
|
>Which colour the badge speaks in. neutral is a quiet grey for plain labels; accent draws the eye in the accent colour; info, success, warning, and danger
|
|
9
10
|
mark a status, so match the tone to what the badge says. For a category rather than a status, set the --ui-badge-color hook on the badge instead: any CSS
|
|
@@ -16,7 +17,7 @@
|
|
|
16
17
|
<prop name="size" type="keyword" values="xs, sm, md, lg" default="md"
|
|
17
18
|
>Scale. xs is compact; sm keeps the usual badge geometry with compact text, fitting short counts such as 99+ inside a 24px circle. md is the usual text
|
|
18
19
|
badge; lg adds room to fixed marks while retaining the usual text size. A square is 24px at xs, 32px at sm and md, and 40px at lg. A circle is 16px at xs,
|
|
19
|
-
24px at sm and md, and 32px at lg.</prop>
|
|
20
|
+
24px at sm and md, and 32px at lg. A small overlay circle is 20px.</prop>
|
|
20
21
|
</defs>
|
|
21
22
|
<span>
|
|
22
23
|
<span class="icon" aria-hidden="true"><slot name="icon"></slot></span>
|
|
@@ -315,6 +316,15 @@
|
|
|
315
316
|
box-shadow: 0 1px 1px light-dark(rgb(0 0 0 / 0.08), rgb(0 0 0 / 0.12));
|
|
316
317
|
}
|
|
317
318
|
|
|
319
|
+
/* A count can keep its containing control's contrasting ink instead of reversing it.
|
|
320
|
+
The faint fill is painted over that control; no second rim or shadow competes with it. */
|
|
321
|
+
:host([variant="overlay"]) {
|
|
322
|
+
--_badge-outline-surface: var(--ui-badge-surface, color-mix(in srgb, currentColor 6%, transparent));
|
|
323
|
+
color: var(--ui-badge-text, inherit);
|
|
324
|
+
border-color: var(--ui-badge-border, transparent);
|
|
325
|
+
box-shadow: none;
|
|
326
|
+
}
|
|
327
|
+
|
|
318
328
|
/* Neutral reverses a subtle surface/ink pair rather than a strong tone. Keep its original
|
|
319
329
|
surface ink: moving it toward dark-theme primary text would reduce overlay contrast. */
|
|
320
330
|
:host([variant="inverse"][tone="neutral"]) {
|
|
@@ -406,6 +416,10 @@
|
|
|
406
416
|
text-box-trim: none;
|
|
407
417
|
}
|
|
408
418
|
|
|
419
|
+
:host([shape="circle"][size="sm"][variant="overlay"]) {
|
|
420
|
+
--_badge-circle-size: var(--ui-badge-circle-size, calc(var(--ui-space-4) + var(--ui-space-1)));
|
|
421
|
+
}
|
|
422
|
+
|
|
409
423
|
:host([shape="circle"][size="xs"]) {
|
|
410
424
|
--_badge-circle-size: var(--ui-badge-circle-size, var(--ui-space-4));
|
|
411
425
|
}
|