@threadlabs/looma 0.23.4 → 0.23.5
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 +37 -3
- package/components/ui-list-item/ui-list-item.html +8 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/styles/ui-badge.css +35 -0
- package/styles/ui-list-item.css +5 -1
- package/vanilla/UiBadge.d.ts +1 -1
- package/vanilla/UiBadge.js +5 -2
- package/vanilla/UiListItem.d.ts +1 -0
- package/vanilla/UiListItem.js +3 -1
- package/vue/UiBadge.d.ts +3 -3
- package/vue/UiBadge.vue +39 -6
- package/vue/UiListItem.d.ts +9 -0
- package/vue/UiListItem.vue +28 -2
- package/vue/chunks/UiBadge.js +10 -5
- package/vue/chunks/UiListItem.js +23 -1
- package/vue/components.css +86 -52
package/package.json
CHANGED
package/styles/ui-badge.css
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
syntax: "*";
|
|
4
4
|
inherits: false;
|
|
5
5
|
}
|
|
6
|
+
@property --ui-badge-dot-size {
|
|
7
|
+
syntax: "*";
|
|
8
|
+
inherits: false;
|
|
9
|
+
}
|
|
6
10
|
@property --ui-badge-color {
|
|
7
11
|
syntax: "*";
|
|
8
12
|
inherits: false;
|
|
@@ -203,6 +207,29 @@
|
|
|
203
207
|
--_badge-text: var(--ui-info-subtle-text, var(--ui-info-solid));
|
|
204
208
|
}
|
|
205
209
|
|
|
210
|
+
/* A dot uses the badge's tone recipe; only its silhouette and visible label change. */
|
|
211
|
+
:scope[data-ui-badge-state~="shape=dot"] {
|
|
212
|
+
position: relative;
|
|
213
|
+
box-sizing: border-box;
|
|
214
|
+
flex: none;
|
|
215
|
+
inline-size: var(--ui-badge-dot-size, var(--ui-space-2));
|
|
216
|
+
block-size: var(--ui-badge-dot-size, var(--ui-space-2));
|
|
217
|
+
min-inline-size: var(--ui-badge-dot-size, var(--ui-space-2));
|
|
218
|
+
min-block-size: var(--ui-badge-dot-size, var(--ui-space-2));
|
|
219
|
+
padding: 0;
|
|
220
|
+
border-radius: var(--ui-radius-round);
|
|
221
|
+
text-box-trim: none;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
:scope[data-ui-badge-state~="shape=dot"] .label {
|
|
225
|
+
position: absolute;
|
|
226
|
+
inline-size: 1px;
|
|
227
|
+
block-size: 1px;
|
|
228
|
+
overflow: hidden;
|
|
229
|
+
clip-path: inset(50%);
|
|
230
|
+
white-space: nowrap;
|
|
231
|
+
}
|
|
232
|
+
|
|
206
233
|
/* The clipped point needs an inset surface over an outer border-colour shape: a native border
|
|
207
234
|
has no diagonal edge to follow. Keep this edge for every tag variant. */
|
|
208
235
|
:scope[data-ui-badge-state~="shape=tag"] {
|
|
@@ -238,6 +265,12 @@
|
|
|
238
265
|
}
|
|
239
266
|
|
|
240
267
|
@media (forced-colors: active) {
|
|
268
|
+
:scope[data-ui-badge-state~="shape=dot"] {
|
|
269
|
+
forced-color-adjust: none;
|
|
270
|
+
border-color: CanvasText;
|
|
271
|
+
background: CanvasText;
|
|
272
|
+
}
|
|
273
|
+
|
|
241
274
|
:scope[data-ui-badge-state~="shape=tag"] {
|
|
242
275
|
forced-color-adjust: none;
|
|
243
276
|
background: CanvasText;
|
|
@@ -266,6 +299,8 @@
|
|
|
266
299
|
/* A solid colour fills with the ink. Its text is the page surface, mixed at 0% only so that it too is
|
|
267
300
|
invalid while the hook is unset. */
|
|
268
301
|
|
|
302
|
+
/* A dot uses the badge's tone recipe; only its silhouette and visible label change. */
|
|
303
|
+
|
|
269
304
|
/* The clipped point needs an inset surface over an outer border-colour shape: a native border
|
|
270
305
|
has no diagonal edge to follow. Keep this edge for every tag variant. */
|
|
271
306
|
|
package/styles/ui-list-item.css
CHANGED
|
@@ -61,6 +61,10 @@
|
|
|
61
61
|
border-color: var(--ui-border-strong);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
:scope[data-ui-list-item-state~="highlighted"] {
|
|
65
|
+
background: var(--ui-selection-surface);
|
|
66
|
+
}
|
|
67
|
+
|
|
64
68
|
:scope[data-ui-list-item-state~="current"] {
|
|
65
69
|
background: var(--ui-selection-surface);
|
|
66
70
|
color: var(--ui-selection-text);
|
|
@@ -136,7 +140,7 @@
|
|
|
136
140
|
outline: var(--ui-focus-width) solid Highlight;
|
|
137
141
|
outline-offset: calc(-1 * var(--ui-focus-width));
|
|
138
142
|
}
|
|
139
|
-
:scope[data-ui-list-item-state~="current"]:not(:has(a:focus-visible)) {
|
|
143
|
+
:is(:scope[data-ui-list-item-state~="current"], :scope[data-ui-list-item-state~="highlighted"]):not(:has(a:focus-visible)) {
|
|
140
144
|
outline: var(--ui-border-width) solid Highlight;
|
|
141
145
|
outline-offset: calc(-1 * var(--ui-border-width));
|
|
142
146
|
}
|
package/vanilla/UiBadge.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export interface UiBadgeElement extends HTMLSpanElement {
|
|
|
6
6
|
removeEventListener<K extends keyof UiBadgeEventMap>(type: K, listener: (this: UiBadgeElement, event: UiBadgeEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
7
7
|
}
|
|
8
8
|
export interface UiBadgeProps {
|
|
9
|
-
shape?: "pill" | "tag" | null;
|
|
9
|
+
shape?: "pill" | "tag" | "dot" | null;
|
|
10
10
|
size?: "xs" | "md" | null;
|
|
11
11
|
tone?: "neutral" | "accent" | "info" | "success" | "warning" | "danger" | null;
|
|
12
12
|
variant?: "solid" | "subtle" | "outline" | null;
|
package/vanilla/UiBadge.js
CHANGED
|
@@ -15,17 +15,20 @@ export function createUiBadge(options = {}) {
|
|
|
15
15
|
element.setAttribute(name, value === true ? "" : String(value));
|
|
16
16
|
}
|
|
17
17
|
element.setAttribute("data-component", "ui-badge");
|
|
18
|
+
const element0 = document.createElement("span");
|
|
19
|
+
element0.setAttribute("class", "label");
|
|
18
20
|
if (children.length > 0) {
|
|
19
21
|
for (const child of children) {
|
|
20
22
|
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
21
23
|
if (node.nodeType === 1) node.setAttribute("data-slotted", "");
|
|
22
24
|
projected.push([node, ""]);
|
|
23
|
-
|
|
25
|
+
element0.append(node);
|
|
24
26
|
}
|
|
25
27
|
} else {
|
|
26
28
|
}
|
|
29
|
+
element.append(element0);
|
|
27
30
|
manageGeneratedProps(element, [
|
|
28
|
-
{ name: "shape", attribute: "data-shape", value: componentProps["shape"], default: "pill", type: ["pill","tag"], required: false },
|
|
31
|
+
{ name: "shape", attribute: "data-shape", value: componentProps["shape"], default: "pill", type: ["pill","tag","dot"], required: false },
|
|
29
32
|
{ name: "size", attribute: "data-size", value: componentProps["size"], default: "md", type: ["xs","md"], required: false },
|
|
30
33
|
{ name: "tone", attribute: "data-tone", value: componentProps["tone"], default: "neutral", type: ["neutral","accent","info","success","warning","danger"], required: false },
|
|
31
34
|
{ name: "variant", attribute: "data-variant", value: componentProps["variant"], default: "subtle", type: ["solid","subtle","outline"], required: false },
|
package/vanilla/UiListItem.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export interface UiListItemElement extends HTMLLIElement {
|
|
|
7
7
|
}
|
|
8
8
|
export interface UiListItemProps {
|
|
9
9
|
current?: boolean | null;
|
|
10
|
+
highlighted?: boolean | null;
|
|
10
11
|
variant?: "row" | "card" | null;
|
|
11
12
|
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
|
12
13
|
children?: readonly (string | Node)[];
|
package/vanilla/UiListItem.js
CHANGED
|
@@ -6,7 +6,8 @@ export function createUiListItem(options = {}) {
|
|
|
6
6
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
7
7
|
const projected = [];
|
|
8
8
|
const prop0 = componentProps["current"] === undefined ? false : componentProps["current"];
|
|
9
|
-
const prop1 = componentProps["
|
|
9
|
+
const prop1 = componentProps["highlighted"] === undefined ? false : componentProps["highlighted"];
|
|
10
|
+
const prop2 = componentProps["variant"] === undefined ? "row" : componentProps["variant"];
|
|
10
11
|
const element = document.createElement("li");
|
|
11
12
|
for (const [name, value] of Object.entries(attributes)) {
|
|
12
13
|
if (value === null || value === undefined || value === false) continue;
|
|
@@ -69,6 +70,7 @@ export function createUiListItem(options = {}) {
|
|
|
69
70
|
element.append(element4);
|
|
70
71
|
manageGeneratedProps(element, [
|
|
71
72
|
{ name: "current", attribute: "data-current", value: componentProps["current"], default: false, type: "boolean", required: false },
|
|
73
|
+
{ name: "highlighted", attribute: "data-highlighted", value: componentProps["highlighted"], default: false, type: "boolean", required: false },
|
|
72
74
|
{ name: "variant", attribute: "data-variant", value: componentProps["variant"], default: "row", type: ["row","card"], required: false },
|
|
73
75
|
], (name, value) => {
|
|
74
76
|
if (name === "current") {
|
package/vue/UiBadge.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ type __VLS_Slots = {} & {
|
|
|
5
5
|
};
|
|
6
6
|
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
7
7
|
shape: {
|
|
8
|
-
type: PropType<"pill" | "tag" | null>;
|
|
8
|
+
type: PropType<"pill" | "tag" | "dot" | null>;
|
|
9
9
|
default: string;
|
|
10
10
|
};
|
|
11
11
|
size: {
|
|
@@ -22,7 +22,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
22
22
|
};
|
|
23
23
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
24
24
|
shape: {
|
|
25
|
-
type: PropType<"pill" | "tag" | null>;
|
|
25
|
+
type: PropType<"pill" | "tag" | "dot" | null>;
|
|
26
26
|
default: string;
|
|
27
27
|
};
|
|
28
28
|
size: {
|
|
@@ -38,7 +38,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
38
38
|
default: string;
|
|
39
39
|
};
|
|
40
40
|
}>> & Readonly<{}>, {
|
|
41
|
-
shape: "tag" | "pill" | null;
|
|
41
|
+
shape: "dot" | "tag" | "pill" | null;
|
|
42
42
|
size: "xs" | "md" | null;
|
|
43
43
|
tone: "info" | "neutral" | "accent" | "success" | "warning" | "danger" | null;
|
|
44
44
|
variant: "solid" | "subtle" | "outline" | null;
|
package/vue/UiBadge.vue
CHANGED
|
@@ -13,8 +13,8 @@ const propValidityContract = {
|
|
|
13
13
|
required: false,
|
|
14
14
|
target: { attribute: 'shape' },
|
|
15
15
|
description:
|
|
16
|
-
'Silhouette. pill is rounded at both ends; tag is a label
|
|
17
|
-
values: ['pill', 'tag'],
|
|
16
|
+
'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\n aria-hidden when the surrounding control already names that state.',
|
|
17
|
+
values: ['pill', 'tag', 'dot'],
|
|
18
18
|
default: 'pill',
|
|
19
19
|
},
|
|
20
20
|
size: {
|
|
@@ -47,7 +47,7 @@ const propValidityContract = {
|
|
|
47
47
|
},
|
|
48
48
|
} as const
|
|
49
49
|
const props = defineProps({
|
|
50
|
-
shape: { type: null as unknown as PropType<'pill' | 'tag' | null>, default: 'pill' },
|
|
50
|
+
shape: { type: null as unknown as PropType<'pill' | 'tag' | 'dot' | null>, default: 'pill' },
|
|
51
51
|
size: { type: null as unknown as PropType<'xs' | 'md' | null>, default: 'md' },
|
|
52
52
|
tone: {
|
|
53
53
|
type: null as unknown as PropType<
|
|
@@ -67,13 +67,13 @@ const acceptedProps: Record<string, unknown> = {
|
|
|
67
67
|
variant: 'subtle',
|
|
68
68
|
}
|
|
69
69
|
const checkedProps = computed(() => ({
|
|
70
|
-
shape: checkedProp<'pill' | 'tag'>(
|
|
70
|
+
shape: checkedProp<'pill' | 'tag' | 'dot'>(
|
|
71
71
|
props['shape'],
|
|
72
72
|
{ kind: 'terminal', name: 'keyword' },
|
|
73
73
|
false,
|
|
74
74
|
'shape',
|
|
75
75
|
acceptedProps,
|
|
76
|
-
) as 'pill' | 'tag',
|
|
76
|
+
) as 'pill' | 'tag' | 'dot',
|
|
77
77
|
size: checkedProp<'xs' | 'md'>(
|
|
78
78
|
props['size'],
|
|
79
79
|
{ kind: 'terminal', name: 'keyword' },
|
|
@@ -174,7 +174,7 @@ const hostState = computed(() =>
|
|
|
174
174
|
:data-tone="reflectedProp('tone', 'tone', checkedProps.tone, undefined, false)"
|
|
175
175
|
:data-variant="reflectedProp('variant', 'variant', checkedProps.variant, undefined, false)"
|
|
176
176
|
:data-ui-badge-state="hostState || undefined"
|
|
177
|
-
><slot /></span>
|
|
177
|
+
><span class="label"><slot /></span></span>
|
|
178
178
|
</template>
|
|
179
179
|
|
|
180
180
|
<style scoped>
|
|
@@ -183,6 +183,10 @@ const hostState = computed(() =>
|
|
|
183
183
|
syntax: "*";
|
|
184
184
|
inherits: false;
|
|
185
185
|
}
|
|
186
|
+
@property --ui-badge-dot-size {
|
|
187
|
+
syntax: "*";
|
|
188
|
+
inherits: false;
|
|
189
|
+
}
|
|
186
190
|
@property --ui-badge-color {
|
|
187
191
|
syntax: "*";
|
|
188
192
|
inherits: false;
|
|
@@ -390,6 +394,29 @@ const hostState = computed(() =>
|
|
|
390
394
|
--_badge-text: var(--ui-info-subtle-text, var(--ui-info-solid));
|
|
391
395
|
}
|
|
392
396
|
|
|
397
|
+
/* A dot uses the badge's tone recipe; only its silhouette and visible label change. */
|
|
398
|
+
[data-component~="ui-badge"][data-ui-badge-state~="shape=dot"] {
|
|
399
|
+
position: relative;
|
|
400
|
+
box-sizing: border-box;
|
|
401
|
+
flex: none;
|
|
402
|
+
inline-size: var(--ui-badge-dot-size, var(--ui-space-2));
|
|
403
|
+
block-size: var(--ui-badge-dot-size, var(--ui-space-2));
|
|
404
|
+
min-inline-size: var(--ui-badge-dot-size, var(--ui-space-2));
|
|
405
|
+
min-block-size: var(--ui-badge-dot-size, var(--ui-space-2));
|
|
406
|
+
padding: 0;
|
|
407
|
+
border-radius: var(--ui-radius-round);
|
|
408
|
+
text-box-trim: none;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
[data-component~="ui-badge"][data-ui-badge-state~="shape=dot"] .label {
|
|
412
|
+
position: absolute;
|
|
413
|
+
inline-size: 1px;
|
|
414
|
+
block-size: 1px;
|
|
415
|
+
overflow: hidden;
|
|
416
|
+
clip-path: inset(50%);
|
|
417
|
+
white-space: nowrap;
|
|
418
|
+
}
|
|
419
|
+
|
|
393
420
|
/* The clipped point needs an inset surface over an outer border-colour shape: a native border
|
|
394
421
|
has no diagonal edge to follow. Keep this edge for every tag variant. */
|
|
395
422
|
[data-component~="ui-badge"][data-ui-badge-state~="shape=tag"] {
|
|
@@ -439,6 +466,12 @@ const hostState = computed(() =>
|
|
|
439
466
|
}
|
|
440
467
|
|
|
441
468
|
@media (forced-colors: active) {
|
|
469
|
+
[data-component~="ui-badge"][data-ui-badge-state~="shape=dot"] {
|
|
470
|
+
forced-color-adjust: none;
|
|
471
|
+
border-color: CanvasText;
|
|
472
|
+
background: CanvasText;
|
|
473
|
+
}
|
|
474
|
+
|
|
442
475
|
[data-component~="ui-badge"][data-ui-badge-state~="shape=tag"] {
|
|
443
476
|
forced-color-adjust: none;
|
|
444
477
|
background: CanvasText;
|
package/vue/UiListItem.d.ts
CHANGED
|
@@ -14,6 +14,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
14
14
|
type: PropType<boolean | null>;
|
|
15
15
|
default: boolean;
|
|
16
16
|
};
|
|
17
|
+
highlighted: {
|
|
18
|
+
type: PropType<boolean | null>;
|
|
19
|
+
default: boolean;
|
|
20
|
+
};
|
|
17
21
|
variant: {
|
|
18
22
|
type: PropType<"row" | "card" | null>;
|
|
19
23
|
default: string;
|
|
@@ -23,6 +27,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
23
27
|
type: PropType<boolean | null>;
|
|
24
28
|
default: boolean;
|
|
25
29
|
};
|
|
30
|
+
highlighted: {
|
|
31
|
+
type: PropType<boolean | null>;
|
|
32
|
+
default: boolean;
|
|
33
|
+
};
|
|
26
34
|
variant: {
|
|
27
35
|
type: PropType<"row" | "card" | null>;
|
|
28
36
|
default: string;
|
|
@@ -30,6 +38,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
30
38
|
}>> & Readonly<{}>, {
|
|
31
39
|
variant: "row" | "card" | null;
|
|
32
40
|
current: boolean | null;
|
|
41
|
+
highlighted: boolean | null;
|
|
33
42
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
34
43
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
35
44
|
declare const _default: typeof __VLS_export;
|
package/vue/UiListItem.vue
CHANGED
|
@@ -16,6 +16,14 @@ const propValidityContract = {
|
|
|
16
16
|
'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\n announces. Set it on one item at a time.',
|
|
17
17
|
default: false,
|
|
18
18
|
},
|
|
19
|
+
highlighted: {
|
|
20
|
+
type: { kind: 'terminal', name: 'boolean' },
|
|
21
|
+
required: false,
|
|
22
|
+
target: { attribute: 'highlighted' },
|
|
23
|
+
description:
|
|
24
|
+
'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\n reason in the item\'s text; use current only for the current destination.',
|
|
25
|
+
default: false,
|
|
26
|
+
},
|
|
19
27
|
variant: {
|
|
20
28
|
type: { kind: 'terminal', name: 'keyword' },
|
|
21
29
|
required: false,
|
|
@@ -29,9 +37,14 @@ const propValidityContract = {
|
|
|
29
37
|
} as const
|
|
30
38
|
const props = defineProps({
|
|
31
39
|
current: { type: null as unknown as PropType<boolean | null>, default: false },
|
|
40
|
+
highlighted: { type: null as unknown as PropType<boolean | null>, default: false },
|
|
32
41
|
variant: { type: null as unknown as PropType<'row' | 'card' | null>, default: 'row' },
|
|
33
42
|
})
|
|
34
|
-
const acceptedProps: Record<string, unknown> = {
|
|
43
|
+
const acceptedProps: Record<string, unknown> = {
|
|
44
|
+
current: false,
|
|
45
|
+
highlighted: false,
|
|
46
|
+
variant: 'row',
|
|
47
|
+
}
|
|
35
48
|
const checkedProps = computed(() => ({
|
|
36
49
|
current: checkedProp<boolean>(
|
|
37
50
|
props['current'],
|
|
@@ -40,6 +53,13 @@ const checkedProps = computed(() => ({
|
|
|
40
53
|
'current',
|
|
41
54
|
acceptedProps,
|
|
42
55
|
) as boolean,
|
|
56
|
+
highlighted: checkedProp<boolean>(
|
|
57
|
+
props['highlighted'],
|
|
58
|
+
{ kind: 'terminal', name: 'boolean' },
|
|
59
|
+
false,
|
|
60
|
+
'highlighted',
|
|
61
|
+
acceptedProps,
|
|
62
|
+
) as boolean,
|
|
43
63
|
variant: checkedProp<'row' | 'card'>(
|
|
44
64
|
props['variant'],
|
|
45
65
|
{ kind: 'terminal', name: 'keyword' },
|
|
@@ -109,6 +129,7 @@ const hostState = computed(() =>
|
|
|
109
129
|
checkedProps.value.variant && 'variant',
|
|
110
130
|
checkedProps.value.variant != null
|
|
111
131
|
&& `variant=${encodeURIComponent(checkedProps.value.variant)}`,
|
|
132
|
+
checkedProps.value.highlighted && 'highlighted',
|
|
112
133
|
checkedProps.value.current && 'current',
|
|
113
134
|
].filter(Boolean).join(' ')
|
|
114
135
|
)
|
|
@@ -121,6 +142,7 @@ const hostState = computed(() =>
|
|
|
121
142
|
:aria-current="checkedProps.current ?? undefined"
|
|
122
143
|
v-prop-validity="{ contract: propValidityContract, values: { ...props } }"
|
|
123
144
|
:data-current="reflectedProp('current', 'current', checkedProps.current, undefined, false)"
|
|
145
|
+
:data-highlighted="reflectedProp('highlighted', 'highlighted', checkedProps.highlighted, undefined, false)"
|
|
124
146
|
:data-variant="reflectedProp('variant', 'variant', checkedProps.variant, undefined, false)"
|
|
125
147
|
:data-ui-list-item-state="hostState || undefined"
|
|
126
148
|
>
|
|
@@ -202,6 +224,10 @@ const hostState = computed(() =>
|
|
|
202
224
|
border-color: var(--ui-border-strong);
|
|
203
225
|
}
|
|
204
226
|
|
|
227
|
+
[data-component~="ui-list-item"][data-ui-list-item-state~="highlighted"] {
|
|
228
|
+
background: var(--ui-selection-surface);
|
|
229
|
+
}
|
|
230
|
+
|
|
205
231
|
[data-component~="ui-list-item"][data-ui-list-item-state~="current"] {
|
|
206
232
|
background: var(--ui-selection-surface);
|
|
207
233
|
color: var(--ui-selection-text);
|
|
@@ -294,7 +320,7 @@ const hostState = computed(() =>
|
|
|
294
320
|
outline: var(--ui-focus-width) solid Highlight;
|
|
295
321
|
outline-offset: calc(-1 * var(--ui-focus-width));
|
|
296
322
|
}
|
|
297
|
-
[data-component~="ui-list-item"][data-ui-list-item-state~="current"]:not(:has(a:focus-visible)) {
|
|
323
|
+
:is([data-component~="ui-list-item"][data-ui-list-item-state~="current"], [data-component~="ui-list-item"][data-ui-list-item-state~="highlighted"]):not(:has(a:focus-visible)) {
|
|
298
324
|
outline: var(--ui-border-width) solid Highlight;
|
|
299
325
|
outline-offset: calc(-1 * var(--ui-border-width));
|
|
300
326
|
}
|
package/vue/chunks/UiBadge.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
2
2
|
import { i as vPropValidity, t as checkedProp } from "./props.js";
|
|
3
|
-
import { computed, createElementBlock, defineComponent, getCurrentInstance, mergeProps, openBlock, renderSlot, unref, watchSyncEffect, withDirectives } from "vue";
|
|
3
|
+
import { computed, createElementBlock, createElementVNode, defineComponent, getCurrentInstance, mergeProps, openBlock, renderSlot, unref, watchSyncEffect, withDirectives } from "vue";
|
|
4
4
|
//#region .build/vue/UiBadge.vue?vue&type=script&setup=true&lang.ts
|
|
5
5
|
var _hoisted_1 = [
|
|
6
6
|
"data-shape",
|
|
@@ -9,6 +9,7 @@ var _hoisted_1 = [
|
|
|
9
9
|
"data-variant",
|
|
10
10
|
"data-ui-badge-state"
|
|
11
11
|
];
|
|
12
|
+
var _hoisted_2 = { class: "label" };
|
|
12
13
|
//#endregion
|
|
13
14
|
//#region .build/vue/UiBadge.vue
|
|
14
15
|
var UiBadge_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
@@ -41,8 +42,12 @@ var UiBadge_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE
|
|
|
41
42
|
},
|
|
42
43
|
required: false,
|
|
43
44
|
target: { attribute: "shape" },
|
|
44
|
-
description: "Silhouette. pill is rounded at both ends; tag is a label
|
|
45
|
-
values: [
|
|
45
|
+
description: "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\n aria-hidden when the surrounding control already names that state.",
|
|
46
|
+
values: [
|
|
47
|
+
"pill",
|
|
48
|
+
"tag",
|
|
49
|
+
"dot"
|
|
50
|
+
],
|
|
46
51
|
default: "pill"
|
|
47
52
|
},
|
|
48
53
|
size: {
|
|
@@ -157,12 +162,12 @@ var UiBadge_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE
|
|
|
157
162
|
"data-tone": reflectedProp("tone", "tone", checkedProps.value.tone, void 0, false),
|
|
158
163
|
"data-variant": reflectedProp("variant", "variant", checkedProps.value.variant, void 0, false),
|
|
159
164
|
"data-ui-badge-state": hostState.value || void 0
|
|
160
|
-
}), [renderSlot(_ctx.$slots, "default", {}, void 0, true)], 16, _hoisted_1)), [[unref(vPropValidity), {
|
|
165
|
+
}), [createElementVNode("span", _hoisted_2, [renderSlot(_ctx.$slots, "default", {}, void 0, true)])], 16, _hoisted_1)), [[unref(vPropValidity), {
|
|
161
166
|
contract: propValidityContract,
|
|
162
167
|
values: { ...props }
|
|
163
168
|
}]]);
|
|
164
169
|
};
|
|
165
170
|
}
|
|
166
|
-
}), [["__scopeId", "data-v-
|
|
171
|
+
}), [["__scopeId", "data-v-84736a7c"]]);
|
|
167
172
|
//#endregion
|
|
168
173
|
export { UiBadge_default as t };
|
package/vue/chunks/UiListItem.js
CHANGED
|
@@ -5,6 +5,7 @@ import { computed, createElementBlock, createElementVNode, defineComponent, getC
|
|
|
5
5
|
var _hoisted_1 = [
|
|
6
6
|
"aria-current",
|
|
7
7
|
"data-current",
|
|
8
|
+
"data-highlighted",
|
|
8
9
|
"data-variant",
|
|
9
10
|
"data-ui-list-item-state"
|
|
10
11
|
];
|
|
@@ -23,6 +24,10 @@ var UiListItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
23
24
|
type: null,
|
|
24
25
|
default: false
|
|
25
26
|
},
|
|
27
|
+
highlighted: {
|
|
28
|
+
type: null,
|
|
29
|
+
default: false
|
|
30
|
+
},
|
|
26
31
|
variant: {
|
|
27
32
|
type: null,
|
|
28
33
|
default: "row"
|
|
@@ -40,6 +45,16 @@ var UiListItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
40
45
|
description: "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\n announces. Set it on one item at a time.",
|
|
41
46
|
default: false
|
|
42
47
|
},
|
|
48
|
+
highlighted: {
|
|
49
|
+
type: {
|
|
50
|
+
kind: "terminal",
|
|
51
|
+
name: "boolean"
|
|
52
|
+
},
|
|
53
|
+
required: false,
|
|
54
|
+
target: { attribute: "highlighted" },
|
|
55
|
+
description: "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\n reason in the item's text; use current only for the current destination.",
|
|
56
|
+
default: false
|
|
57
|
+
},
|
|
43
58
|
variant: {
|
|
44
59
|
type: {
|
|
45
60
|
kind: "terminal",
|
|
@@ -55,6 +70,7 @@ var UiListItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
55
70
|
const props = __props;
|
|
56
71
|
const acceptedProps = {
|
|
57
72
|
current: false,
|
|
73
|
+
highlighted: false,
|
|
58
74
|
variant: "row"
|
|
59
75
|
};
|
|
60
76
|
const checkedProps = computed(() => ({
|
|
@@ -62,6 +78,10 @@ var UiListItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
62
78
|
kind: "terminal",
|
|
63
79
|
name: "boolean"
|
|
64
80
|
}, false, "current", acceptedProps),
|
|
81
|
+
highlighted: checkedProp(props["highlighted"], {
|
|
82
|
+
kind: "terminal",
|
|
83
|
+
name: "boolean"
|
|
84
|
+
}, false, "highlighted", acceptedProps),
|
|
65
85
|
variant: checkedProp(props["variant"], {
|
|
66
86
|
kind: "terminal",
|
|
67
87
|
name: "keyword"
|
|
@@ -95,12 +115,14 @@ var UiListItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
95
115
|
const hostState = computed(() => [
|
|
96
116
|
checkedProps.value.variant && "variant",
|
|
97
117
|
checkedProps.value.variant != null && `variant=${encodeURIComponent(checkedProps.value.variant)}`,
|
|
118
|
+
checkedProps.value.highlighted && "highlighted",
|
|
98
119
|
checkedProps.value.current && "current"
|
|
99
120
|
].filter(Boolean).join(" "));
|
|
100
121
|
return (_ctx, _cache) => {
|
|
101
122
|
return withDirectives((openBlock(), createElementBlock("li", mergeProps({ "data-component": "ui-list-item" }, nativeAttrs(_ctx.$attrs), {
|
|
102
123
|
"aria-current": checkedProps.value.current ?? void 0,
|
|
103
124
|
"data-current": reflectedProp("current", "current", checkedProps.value.current, void 0, false),
|
|
125
|
+
"data-highlighted": reflectedProp("highlighted", "highlighted", checkedProps.value.highlighted, void 0, false),
|
|
104
126
|
"data-variant": reflectedProp("variant", "variant", checkedProps.value.variant, void 0, false),
|
|
105
127
|
"data-ui-list-item-state": hostState.value || void 0
|
|
106
128
|
}), [
|
|
@@ -113,6 +135,6 @@ var UiListItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
113
135
|
}]]);
|
|
114
136
|
};
|
|
115
137
|
}
|
|
116
|
-
}), [["__scopeId", "data-v-
|
|
138
|
+
}), [["__scopeId", "data-v-e7ecd203"]]);
|
|
117
139
|
//#endregion
|
|
118
140
|
export { UiListItem_default as t };
|