@threadlabs/looma 0.23.6 → 0.23.7
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 +34 -3
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/styles/ui-badge.css +31 -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 +38 -6
- package/vue/chunks/UiBadge.js +5 -4
- package/vue/components.css +57 -30
|
@@ -7,10 +7,12 @@
|
|
|
7
7
|
>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
|
|
8
8
|
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
|
|
9
9
|
colour, which overrides the tone.</prop>
|
|
10
|
-
<prop name="shape" type="keyword" values="pill, tag, dot" default="pill"
|
|
10
|
+
<prop name="shape" type="keyword" values="pill, tag, dot, square" default="pill"
|
|
11
11
|
>Silhouette. pill is rounded at both ends; tag is a pointed label. dot is a compact circular signal with visually hidden text: include a state label, or set
|
|
12
|
-
aria-hidden when the surrounding control already names that state
|
|
13
|
-
|
|
12
|
+
aria-hidden when the surrounding control already names that state. square is a fixed rounded square for an icon or single glyph beside a heading; hide a
|
|
13
|
+
decorative icon when adjacent words name it.</prop>
|
|
14
|
+
<prop name="size" type="keyword" values="xs, md" default="md"
|
|
15
|
+
>Scale. xs is a compact count beside small controls; md is the usual text badge. A square is 24px at xs and 32px at md with default spacing.</prop>
|
|
14
16
|
</defs>
|
|
15
17
|
<span><span class="label"><slot></slot></span></span>
|
|
16
18
|
<style>
|
|
@@ -19,6 +21,10 @@
|
|
|
19
21
|
syntax: "*";
|
|
20
22
|
inherits: false;
|
|
21
23
|
}
|
|
24
|
+
@property --ui-badge-square-size {
|
|
25
|
+
syntax: "*";
|
|
26
|
+
inherits: false;
|
|
27
|
+
}
|
|
22
28
|
@property --ui-badge-dot-size {
|
|
23
29
|
syntax: "*";
|
|
24
30
|
inherits: false;
|
|
@@ -221,6 +227,31 @@
|
|
|
221
227
|
--_badge-text: var(--ui-info-subtle-text, var(--ui-info-solid));
|
|
222
228
|
}
|
|
223
229
|
|
|
230
|
+
/* An icon mark keeps the existing tone recipe and follows the global spacing and radius. */
|
|
231
|
+
:host-state([shape="square"]) {
|
|
232
|
+
--_badge-square-size: var(--ui-badge-square-size, calc(var(--ui-space-4) * 2));
|
|
233
|
+
display: inline-flex;
|
|
234
|
+
box-sizing: border-box;
|
|
235
|
+
flex: none;
|
|
236
|
+
inline-size: var(--_badge-square-size);
|
|
237
|
+
block-size: var(--_badge-square-size);
|
|
238
|
+
min-inline-size: var(--_badge-square-size);
|
|
239
|
+
min-block-size: var(--_badge-square-size);
|
|
240
|
+
padding: 0;
|
|
241
|
+
border-radius: var(--ui-radius-md);
|
|
242
|
+
text-box-trim: none;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
:host-state([shape="square"][size="xs"]) {
|
|
246
|
+
--_badge-square-size: var(--ui-badge-square-size, calc(var(--ui-space-3) * 2));
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
:host-state([shape="square"]) .label {
|
|
250
|
+
display: inline-flex;
|
|
251
|
+
align-items: center;
|
|
252
|
+
justify-content: center;
|
|
253
|
+
}
|
|
254
|
+
|
|
224
255
|
/* A dot uses the badge's tone recipe; only its silhouette and visible label change. */
|
|
225
256
|
:host-state([shape="dot"]) {
|
|
226
257
|
position: relative;
|