@threadlabs/looma 0.23.4 → 0.23.6
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/shared/icons.js +1 -0
- package/components/ui-badge/ui-badge.html +37 -3
- package/components/ui-icon/ui-icon.html +1 -0
- package/components/ui-list-item/ui-list-item.html +16 -1
- package/dist/index.js +1 -1
- package/editor/icons.d.ts +1 -0
- package/editor/index.js +2 -1
- package/package.json +1 -1
- package/styles/ui-badge.css +35 -0
- package/styles/ui-list-item.css +11 -1
- package/vanilla/UiBadge.d.ts +1 -1
- package/vanilla/UiBadge.js +5 -2
- package/vanilla/UiIcon.js +1 -1
- package/vanilla/UiListItem.d.ts +2 -0
- package/vanilla/UiListItem.js +5 -1
- package/vue/UiBadge.d.ts +3 -3
- package/vue/UiBadge.vue +39 -6
- package/vue/UiIcon.vue +4 -0
- package/vue/UiListItem.d.ts +18 -0
- package/vue/UiListItem.vue +53 -2
- package/vue/chunks/UiBadge.js +10 -5
- package/vue/chunks/UiIcon.js +8 -1
- package/vue/chunks/UiListItem.js +48 -4
- package/vue/components.css +94 -55
|
@@ -4,6 +4,7 @@ export const icons = {
|
|
|
4
4
|
"align-left": [["path",{"d":"M21 5H3"}],["path",{"d":"M15 12H3"}],["path",{"d":"M17 19H3"}]],
|
|
5
5
|
"align-right": [["path",{"d":"M21 5H3"}],["path",{"d":"M21 12H9"}],["path",{"d":"M21 19H7"}]],
|
|
6
6
|
"arrow-left": [["path",{"d":"m12 19-7-7 7-7"}],["path",{"d":"M19 12H5"}]],
|
|
7
|
+
"bell": [["path",{"d":"M10.268 21a2 2 0 0 0 3.464 0"}],["path",{"d":"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326"}]],
|
|
7
8
|
"bold": [["path",{"d":"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8"}]],
|
|
8
9
|
"book-user": [["path",{"d":"M15 13a3 3 0 1 0-6 0"}],["path",{"d":"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20"}],["circle",{"cx":"12","cy":"8","r":"2"}]],
|
|
9
10
|
"braces": [["path",{"d":"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1"}],["path",{"d":"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1"}]],
|
|
@@ -7,17 +7,22 @@
|
|
|
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" default="pill"
|
|
11
|
-
>Silhouette. pill is rounded at both ends; tag is a label
|
|
10
|
+
<prop name="shape" type="keyword" values="pill, tag, dot" default="pill"
|
|
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.</prop>
|
|
12
13
|
<prop name="size" type="keyword" values="xs, md" default="md">Scale. xs is a compact count beside small controls; md is the usual text badge.</prop>
|
|
13
14
|
</defs>
|
|
14
|
-
<span><slot></slot></span>
|
|
15
|
+
<span><span class="label"><slot></slot></span></span>
|
|
15
16
|
<style>
|
|
16
17
|
/* This component's hooks style the element they are set on, and never a nested one. */
|
|
17
18
|
@property --ui-badge-border {
|
|
18
19
|
syntax: "*";
|
|
19
20
|
inherits: false;
|
|
20
21
|
}
|
|
22
|
+
@property --ui-badge-dot-size {
|
|
23
|
+
syntax: "*";
|
|
24
|
+
inherits: false;
|
|
25
|
+
}
|
|
21
26
|
@property --ui-badge-color {
|
|
22
27
|
syntax: "*";
|
|
23
28
|
inherits: false;
|
|
@@ -216,6 +221,29 @@
|
|
|
216
221
|
--_badge-text: var(--ui-info-subtle-text, var(--ui-info-solid));
|
|
217
222
|
}
|
|
218
223
|
|
|
224
|
+
/* A dot uses the badge's tone recipe; only its silhouette and visible label change. */
|
|
225
|
+
:host-state([shape="dot"]) {
|
|
226
|
+
position: relative;
|
|
227
|
+
box-sizing: border-box;
|
|
228
|
+
flex: none;
|
|
229
|
+
inline-size: var(--ui-badge-dot-size, var(--ui-space-2));
|
|
230
|
+
block-size: var(--ui-badge-dot-size, var(--ui-space-2));
|
|
231
|
+
min-inline-size: var(--ui-badge-dot-size, var(--ui-space-2));
|
|
232
|
+
min-block-size: var(--ui-badge-dot-size, var(--ui-space-2));
|
|
233
|
+
padding: 0;
|
|
234
|
+
border-radius: var(--ui-radius-round);
|
|
235
|
+
text-box-trim: none;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
:host-state([shape="dot"]) .label {
|
|
239
|
+
position: absolute;
|
|
240
|
+
inline-size: 1px;
|
|
241
|
+
block-size: 1px;
|
|
242
|
+
overflow: hidden;
|
|
243
|
+
clip-path: inset(50%);
|
|
244
|
+
white-space: nowrap;
|
|
245
|
+
}
|
|
246
|
+
|
|
219
247
|
/* The clipped point needs an inset surface over an outer border-colour shape: a native border
|
|
220
248
|
has no diagonal edge to follow. Keep this edge for every tag variant. */
|
|
221
249
|
:host-state([shape="tag"]) {
|
|
@@ -251,6 +279,12 @@
|
|
|
251
279
|
}
|
|
252
280
|
|
|
253
281
|
@media (forced-colors: active) {
|
|
282
|
+
:host-state([shape="dot"]) {
|
|
283
|
+
forced-color-adjust: none;
|
|
284
|
+
border-color: CanvasText;
|
|
285
|
+
background: CanvasText;
|
|
286
|
+
}
|
|
287
|
+
|
|
254
288
|
:host-state([shape="tag"]) {
|
|
255
289
|
forced-color-adjust: none;
|
|
256
290
|
background: CanvasText;
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
'align-left': [{ tag: 'path', d: 'M21 5H3' }, { tag: 'path', d: 'M15 12H3' }, { tag: 'path', d: 'M17 19H3' }],
|
|
12
12
|
'align-right': [{ tag: 'path', d: 'M21 5H3' }, { tag: 'path', d: 'M21 12H9' }, { tag: 'path', d: 'M21 19H7' }],
|
|
13
13
|
'arrow-left': [{ tag: 'path', d: 'm12 19-7-7 7-7' }, { tag: 'path', d: 'M19 12H5' }],
|
|
14
|
+
'bell': [{ tag: 'path', d: 'M10.268 21a2 2 0 0 0 3.464 0' }, { tag: 'path', d: 'M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326' }],
|
|
14
15
|
'bold': [{ tag: 'path', d: 'M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8' }],
|
|
15
16
|
'book-user': [{ tag: 'path', d: 'M15 13a3 3 0 1 0-6 0' }, { tag: 'path', d: 'M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20' }, { tag: 'circle', cx: '12', cy: '8', r: '2' }],
|
|
16
17
|
'braces': [{ tag: 'path', d: 'M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1' }, { tag: 'path', d: 'M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1' }],
|
|
@@ -3,9 +3,14 @@
|
|
|
3
3
|
<prop name="variant" type="keyword" values="row, card" default="row"
|
|
4
4
|
>How the item is drawn. A row is flat and takes a hover surface when it is a link, for items read down a list. A card sits on a raised, bordered surface,
|
|
5
5
|
for items set in a grid (a List with layout="grid"). Both have the same parts: leading, title, description, and trailing.</prop>
|
|
6
|
+
<prop name="wrap" type="boolean" default="false"
|
|
7
|
+
>Lets the title and description wrap so explanatory text stays readable on narrow screens. Omit it for the default equal-height, one-line rows.</prop>
|
|
6
8
|
<prop name="current" type="boolean" default="false"
|
|
7
9
|
>Marks the item as the current one, such as the site you are in: it takes the selected surface and aria-current="true", which assistive technology
|
|
8
10
|
announces. Set it on one item at a time.</prop>
|
|
11
|
+
<prop name="highlighted" type="boolean" default="false"
|
|
12
|
+
>Gives an item a quiet accent wash without changing its text or announcing selection. Several items may be highlighted, such as new messages. Describe the
|
|
13
|
+
reason in the item's text; use current only for the current destination.</prop>
|
|
9
14
|
</defs>
|
|
10
15
|
<li from:aria-current="current">
|
|
11
16
|
<span class="leading"><slot name="leading"></slot></span>
|
|
@@ -77,6 +82,10 @@
|
|
|
77
82
|
border-color: var(--ui-border-strong);
|
|
78
83
|
}
|
|
79
84
|
|
|
85
|
+
:host-state([highlighted]) {
|
|
86
|
+
background: var(--ui-selection-surface);
|
|
87
|
+
}
|
|
88
|
+
|
|
80
89
|
:host-state([current]) {
|
|
81
90
|
background: var(--ui-selection-surface);
|
|
82
91
|
color: var(--ui-selection-text);
|
|
@@ -128,6 +137,12 @@
|
|
|
128
137
|
white-space: nowrap;
|
|
129
138
|
}
|
|
130
139
|
|
|
140
|
+
:host-state([wrap]) .title,
|
|
141
|
+
:host-state([wrap]) .description {
|
|
142
|
+
white-space: normal;
|
|
143
|
+
overflow-wrap: anywhere;
|
|
144
|
+
}
|
|
145
|
+
|
|
131
146
|
.title {
|
|
132
147
|
font-size: var(--ui-font-size-md);
|
|
133
148
|
font-weight: var(--_ui-list-item-title-weight, var(--ui-font-medium));
|
|
@@ -169,7 +184,7 @@
|
|
|
169
184
|
outline: var(--ui-focus-width) solid Highlight;
|
|
170
185
|
outline-offset: calc(-1 * var(--ui-focus-width));
|
|
171
186
|
}
|
|
172
|
-
:host-state([current]):not(:has(a:focus-visible)) {
|
|
187
|
+
:is(:host-state([current]), :host-state([highlighted])):not(:has(a:focus-visible)) {
|
|
173
188
|
outline: var(--ui-border-width) solid Highlight;
|
|
174
189
|
outline-offset: calc(-1 * var(--ui-border-width));
|
|
175
190
|
}
|