@threadlabs/looma 0.10.12 → 0.11.1
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/editor.js +2 -26
- package/components/shared/icons.js +53 -0
- package/components/ui-action-bar/ui-action-bar.html +72 -0
- package/components/ui-avatar-group/ui-avatar-group.html +6 -6
- package/components/ui-avatar-group/ui-avatar-group.js +1 -1
- package/components/ui-breadcrumb-item/ui-breadcrumb-item.html +60 -0
- package/components/ui-breadcrumbs/ui-breadcrumbs.html +31 -0
- package/components/ui-card/ui-card.html +55 -0
- package/components/ui-combobox/ui-combobox.js +2 -2
- package/components/ui-context-menu/ui-context-menu.js +4 -4
- package/components/ui-cover/ui-cover.html +36 -0
- package/components/ui-description-item/ui-description-item.html +46 -0
- package/components/ui-description-list/ui-description-list.html +37 -0
- package/components/ui-icon/ui-icon.js +1 -1
- package/components/ui-menu/ui-menu.js +3 -3
- package/components/ui-page-header/ui-page-header.html +97 -0
- package/components/ui-radio/ui-radio.js +1 -1
- package/components/ui-radio-group/ui-radio-group.js +1 -1
- package/components/ui-section/ui-section.html +108 -0
- package/components/ui-spinner/ui-spinner.html +48 -0
- package/components/ui-status-message/ui-status-message.html +84 -0
- package/components/ui-text/ui-text.html +96 -0
- package/components/ui-tree/ui-tree.js +2 -2
- package/components/ui-tree-item/ui-tree-item.js +3 -3
- package/dist/index.js +1 -1
- package/editor/icons.d.ts +5 -0
- package/editor/index.js +6 -1
- package/package.json +1 -1
- package/styles/ui-action-bar.css +77 -0
- package/styles/ui-avatar-group.css +6 -6
- package/styles/ui-breadcrumb-item.css +57 -0
- package/styles/ui-breadcrumbs.css +32 -0
- package/styles/ui-card.css +51 -0
- package/styles/ui-cover.css +35 -0
- package/styles/ui-description-item.css +43 -0
- package/styles/ui-description-list.css +38 -0
- package/styles/ui-page-header.css +89 -0
- package/styles/ui-section.css +94 -0
- package/styles/ui-spinner.css +42 -0
- package/styles/ui-status-message.css +72 -0
- package/styles/ui-text.css +85 -0
- package/vanilla/UiActionBar.d.ts +13 -0
- package/vanilla/UiActionBar.js +59 -0
- package/vanilla/UiBreadcrumbItem.d.ts +14 -0
- package/vanilla/UiBreadcrumbItem.js +38 -0
- package/vanilla/UiBreadcrumbs.d.ts +14 -0
- package/vanilla/UiBreadcrumbs.js +39 -0
- package/vanilla/UiCard.d.ts +17 -0
- package/vanilla/UiCard.js +32 -0
- package/vanilla/UiCover.d.ts +14 -0
- package/vanilla/UiCover.js +28 -0
- package/vanilla/UiDescriptionItem.d.ts +14 -0
- package/vanilla/UiDescriptionItem.js +39 -0
- package/vanilla/UiDescriptionList.d.ts +14 -0
- package/vanilla/UiDescriptionList.js +28 -0
- package/vanilla/UiPageHeader.d.ts +14 -0
- package/vanilla/UiPageHeader.js +78 -0
- package/vanilla/UiSection.d.ts +16 -0
- package/vanilla/UiSection.js +64 -0
- package/vanilla/UiSpinner.d.ts +15 -0
- package/vanilla/UiSpinner.js +23 -0
- package/vanilla/UiStatusMessage.d.ts +16 -0
- package/vanilla/UiStatusMessage.js +53 -0
- package/vanilla/UiText.d.ts +20 -0
- package/vanilla/UiText.js +38 -0
- package/vanilla/index.js +12 -0
- package/vue/UiActionBar.d.ts +19 -0
- package/vue/UiActionBar.js +2 -0
- package/vue/UiActionBar.vue +77 -0
- package/vue/UiAvatarGroup.vue +6 -6
- package/vue/UiBreadcrumbItem.d.ts +18 -0
- package/vue/UiBreadcrumbItem.js +2 -0
- package/vue/UiBreadcrumbItem.vue +101 -0
- package/vue/UiBreadcrumbs.d.ts +18 -0
- package/vue/UiBreadcrumbs.js +2 -0
- package/vue/UiBreadcrumbs.vue +45 -0
- package/vue/UiCard.d.ts +24 -0
- package/vue/UiCard.js +2 -0
- package/vue/UiCard.vue +82 -0
- package/vue/UiCombobox.d.ts +1 -1
- package/vue/UiCover.d.ts +18 -0
- package/vue/UiCover.js +2 -0
- package/vue/UiCover.vue +57 -0
- package/vue/UiDescriptionItem.d.ts +18 -0
- package/vue/UiDescriptionItem.js +2 -0
- package/vue/UiDescriptionItem.vue +58 -0
- package/vue/UiDescriptionList.d.ts +18 -0
- package/vue/UiDescriptionList.js +2 -0
- package/vue/UiDescriptionList.vue +62 -0
- package/vue/UiIconButton.d.ts +1 -1
- package/vue/UiPageHeader.d.ts +26 -0
- package/vue/UiPageHeader.js +2 -0
- package/vue/UiPageHeader.vue +118 -0
- package/vue/UiRadioGroup.d.ts +1 -1
- package/vue/UiSection.d.ts +26 -0
- package/vue/UiSection.js +2 -0
- package/vue/UiSection.vue +128 -0
- package/vue/UiSpinner.d.ts +10 -0
- package/vue/UiSpinner.js +2 -0
- package/vue/UiSpinner.vue +87 -0
- package/vue/UiStatusMessage.d.ts +24 -0
- package/vue/UiStatusMessage.js +2 -0
- package/vue/UiStatusMessage.vue +121 -0
- package/vue/UiText.d.ts +30 -0
- package/vue/UiText.js +2 -0
- package/vue/UiText.vue +125 -0
- package/vue/chunks/UiActionBar.js +24 -0
- package/vue/chunks/UiAffordanceScope.js +1 -1
- package/vue/chunks/UiAvatar.js +1 -1
- package/vue/chunks/UiAvatarGroup.js +2 -2
- package/vue/chunks/UiBreadcrumbItem.js +50 -0
- package/vue/chunks/UiBreadcrumbs.js +19 -0
- package/vue/chunks/UiCard.js +31 -0
- package/vue/chunks/UiCheckbox.js +1 -1
- package/vue/chunks/UiCombobox.js +1 -1
- package/vue/chunks/UiContextMenu.js +1 -1
- package/vue/chunks/UiCover.js +21 -0
- package/vue/chunks/UiDescriptionItem.js +16 -0
- package/vue/chunks/UiDescriptionList.js +21 -0
- package/vue/chunks/UiDialog.js +1 -1
- package/vue/chunks/UiDisclosure.js +1 -1
- package/vue/chunks/UiEditable.js +1 -1
- package/vue/chunks/UiEditorInsertTableGrid.js +1 -1
- package/vue/chunks/UiEditorMentionMenu.js +1 -1
- package/vue/chunks/UiEditorSlashMenu.js +1 -1
- package/vue/chunks/UiEditorTableContextMenu.js +1 -1
- package/vue/chunks/UiEditorTableOverlay.js +1 -1
- package/vue/chunks/UiEditorTableToolbar.js +1 -1
- package/vue/chunks/UiFormField.js +1 -1
- package/vue/chunks/UiIcon.js +1 -1
- package/vue/chunks/UiIconButton.js +1 -1
- package/vue/chunks/UiInput.js +1 -1
- package/vue/chunks/UiMenu.js +1 -1
- package/vue/chunks/UiPageHeader.js +35 -0
- package/vue/chunks/UiPopover.js +1 -1
- package/vue/chunks/UiRadio.js +1 -1
- package/vue/chunks/UiRadioGroup.js +1 -1
- package/vue/chunks/UiSearchShell.js +1 -1
- package/vue/chunks/UiSection.js +34 -0
- package/vue/chunks/UiSelect.js +1 -1
- package/vue/chunks/UiSidebar.js +1 -1
- package/vue/chunks/UiSpinner.js +64 -0
- package/vue/chunks/UiStatusMessage.js +54 -0
- package/vue/chunks/UiSwitch.js +1 -1
- package/vue/chunks/UiTabs.js +1 -1
- package/vue/chunks/UiText.js +40 -0
- package/vue/chunks/UiTextarea.js +1 -1
- package/vue/chunks/UiToastRegion.js +1 -1
- package/vue/chunks/UiTooltip.js +1 -1
- package/vue/chunks/UiTree.js +1 -1
- package/vue/chunks/UiTreeItem.js +1 -1
- package/vue/components.css +577 -29
- package/vue/index.d.ts +12 -0
- package/vue/index.js +14 -2
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
|
|
2
|
+
import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
3
|
+
import "../styles/ui-section.css";
|
|
4
|
+
|
|
5
|
+
const definition = {...{"contract":{"tag":"ui-section","props":{"heading":{"type":"string","required":false,"target":{"attribute":"heading"},"default":""},"tone":{"type":{"enum":["neutral","danger"]},"required":false,"target":{"attribute":"tone"},"default":"neutral"},"variant":{"type":{"enum":["plain","card","divided"]},"required":false,"target":{"attribute":"variant"},"default":"plain"}}},"template":{"kind":"element","name":"section","attributes":[],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"head"}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"copy"}],"children":[{"kind":"element","name":"h2","attributes":[{"kind":"literal","name":"class","value":"heading"},{"kind":"attribute","name":"hidden","expression":"not heading","expressionPlan":{"source":"not heading","ast":{"kind":"unary","op":"not","operand":{"kind":"id","name":"heading"}},"dependencies":["heading"]}}],"children":[{"kind":"element","name":"template","attributes":[{"kind":"directive","name":"value","expression":"heading","expressionPlan":{"source":"heading","ast":{"kind":"id","name":"heading"},"dependencies":["heading"]}}],"children":[]}]},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"description"}],"children":[{"kind":"slot","fallback":[],"name":"description"}]}]},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"actions"}],"children":[{"kind":"slot","fallback":[],"name":"actions"}]}]},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"body"}],"children":[{"kind":"slot"}]}]},"declarations":[],"root":{"kind":"native","element":"section","choices":["section"]}},source:{file:import.meta.url},css:""};
|
|
6
|
+
|
|
7
|
+
export function createUiSection(options = {}) {
|
|
8
|
+
const { attributes = {}, children = [], slots = {}, as, ...componentProps } = options;
|
|
9
|
+
const projected = [];
|
|
10
|
+
const element = document.createElement("section");
|
|
11
|
+
for (const [name, value] of Object.entries(attributes)) {
|
|
12
|
+
if (value === null || value === undefined || value === false) continue;
|
|
13
|
+
element.setAttribute(name, value === true ? "" : String(value));
|
|
14
|
+
}
|
|
15
|
+
element.setAttribute("data-component", "ui-section");
|
|
16
|
+
const element0 = document.createElement("span");
|
|
17
|
+
element0.setAttribute("class", "head");
|
|
18
|
+
const element1 = document.createElement("span");
|
|
19
|
+
element1.setAttribute("class", "copy");
|
|
20
|
+
const element2 = document.createElement("h2");
|
|
21
|
+
element2.setAttribute("class", "heading");
|
|
22
|
+
const element3 = document.createElement("template");
|
|
23
|
+
element2.append(element3);
|
|
24
|
+
element1.append(element2);
|
|
25
|
+
const element4 = document.createElement("span");
|
|
26
|
+
element4.setAttribute("class", "description");
|
|
27
|
+
if (slots["description"] ?? [].length > 0) {
|
|
28
|
+
for (const child of slots["description"] ?? []) {
|
|
29
|
+
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
30
|
+
projected.push([node, "description"]);
|
|
31
|
+
element4.append(node);
|
|
32
|
+
}
|
|
33
|
+
} else {
|
|
34
|
+
}
|
|
35
|
+
element1.append(element4);
|
|
36
|
+
element0.append(element1);
|
|
37
|
+
const element5 = document.createElement("span");
|
|
38
|
+
element5.setAttribute("class", "actions");
|
|
39
|
+
if (slots["actions"] ?? [].length > 0) {
|
|
40
|
+
for (const child of slots["actions"] ?? []) {
|
|
41
|
+
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
42
|
+
projected.push([node, "actions"]);
|
|
43
|
+
element5.append(node);
|
|
44
|
+
}
|
|
45
|
+
} else {
|
|
46
|
+
}
|
|
47
|
+
element0.append(element5);
|
|
48
|
+
element.append(element0);
|
|
49
|
+
const element6 = document.createElement("span");
|
|
50
|
+
element6.setAttribute("class", "body");
|
|
51
|
+
if (children.length > 0) {
|
|
52
|
+
for (const child of children) {
|
|
53
|
+
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
54
|
+
projected.push([node, ""]);
|
|
55
|
+
element6.append(node);
|
|
56
|
+
}
|
|
57
|
+
} else {
|
|
58
|
+
}
|
|
59
|
+
element.append(element6);
|
|
60
|
+
manageComponentLifecycle(element, definition, { props: componentProps, projected,
|
|
61
|
+
});
|
|
62
|
+
return element;
|
|
63
|
+
}
|
|
64
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
|
|
2
|
+
export interface UiSpinnerEventMap {
|
|
3
|
+
}
|
|
4
|
+
export interface UiSpinnerElement extends HTMLSpanElement {
|
|
5
|
+
addEventListener<K extends keyof UiSpinnerEventMap>(type: K, listener: (this: UiSpinnerElement, event: UiSpinnerEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
6
|
+
removeEventListener<K extends keyof UiSpinnerEventMap>(type: K, listener: (this: UiSpinnerElement, event: UiSpinnerEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
7
|
+
}
|
|
8
|
+
export interface UiSpinnerProps {
|
|
9
|
+
label?: string | null;
|
|
10
|
+
size?: "sm" | "md" | null;
|
|
11
|
+
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
|
12
|
+
children?: readonly (string | Node)[];
|
|
13
|
+
slots?: Readonly<Record<string, readonly (string | Node)[]>>;
|
|
14
|
+
}
|
|
15
|
+
export declare function createUiSpinner(props?: UiSpinnerProps): UiSpinnerElement;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
|
|
2
|
+
import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
3
|
+
import "../styles/ui-spinner.css";
|
|
4
|
+
|
|
5
|
+
const definition = {...{"contract":{"tag":"ui-spinner","props":{"label":{"type":"string","required":false,"target":{"attribute":"label"},"default":""},"size":{"type":{"enum":["sm","md"]},"required":false,"target":{"attribute":"size"},"default":"md"}}},"template":{"kind":"element","name":"span","attributes":[{"kind":"attribute","name":"role","expression":"{ true: 'status', false: null }[format('%s', label != '')]","expressionPlan":{"source":"{ true: 'status', false: null }[format('%s', label != '')]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"literal","value":"status"}},{"key":"false","value":{"kind":"literal","value":null}}]},"index":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"%s"},{"kind":"binary","op":"!=","left":{"kind":"id","name":"label"},"right":{"kind":"literal","value":""}}]}},"dependencies":["label"]}},{"kind":"attribute","name":"aria-label","expression":"{ true: label, false: null }[format('%s', label != '')]","expressionPlan":{"source":"{ true: label, false: null }[format('%s', label != '')]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"id","name":"label"}},{"key":"false","value":{"kind":"literal","value":null}}]},"index":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"%s"},{"kind":"binary","op":"!=","left":{"kind":"id","name":"label"},"right":{"kind":"literal","value":""}}]}},"dependencies":["label"]}},{"kind":"attribute","name":"aria-hidden","expression":"{ true: null, false: 'true' }[format('%s', label != '')]","expressionPlan":{"source":"{ true: null, false: 'true' }[format('%s', label != '')]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"literal","value":null}},{"key":"false","value":{"kind":"literal","value":"true"}}]},"index":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"%s"},{"kind":"binary","op":"!=","left":{"kind":"id","name":"label"},"right":{"kind":"literal","value":""}}]}},"dependencies":["label"]}}],"children":[{"kind":"element","name":"ui-icon","attributes":[{"kind":"literal","name":"name","value":"loader"}],"children":[]}]},"declarations":[],"root":{"kind":"native","element":"span","choices":["span"]}},source:{file:import.meta.url},css:""};
|
|
6
|
+
|
|
7
|
+
export function createUiSpinner(options = {}) {
|
|
8
|
+
const { attributes = {}, children = [], slots = {}, as, ...componentProps } = options;
|
|
9
|
+
const projected = [];
|
|
10
|
+
const element = document.createElement("span");
|
|
11
|
+
for (const [name, value] of Object.entries(attributes)) {
|
|
12
|
+
if (value === null || value === undefined || value === false) continue;
|
|
13
|
+
element.setAttribute(name, value === true ? "" : String(value));
|
|
14
|
+
}
|
|
15
|
+
element.setAttribute("data-component", "ui-spinner");
|
|
16
|
+
const element0 = document.createElement("ui-icon");
|
|
17
|
+
element0.setAttribute("name", "loader");
|
|
18
|
+
element.append(element0);
|
|
19
|
+
manageComponentLifecycle(element, definition, { props: componentProps, projected,
|
|
20
|
+
});
|
|
21
|
+
return element;
|
|
22
|
+
}
|
|
23
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
|
|
2
|
+
export interface UiStatusMessageEventMap {
|
|
3
|
+
}
|
|
4
|
+
export interface UiStatusMessageElement extends HTMLDivElement {
|
|
5
|
+
addEventListener<K extends keyof UiStatusMessageEventMap>(type: K, listener: (this: UiStatusMessageElement, event: UiStatusMessageEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
6
|
+
removeEventListener<K extends keyof UiStatusMessageEventMap>(type: K, listener: (this: UiStatusMessageElement, event: UiStatusMessageEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
7
|
+
}
|
|
8
|
+
export interface UiStatusMessageProps {
|
|
9
|
+
heading?: string | null;
|
|
10
|
+
kind?: "empty" | "loading" | "error" | null;
|
|
11
|
+
layout?: "inline" | "panel" | "fill" | null;
|
|
12
|
+
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
|
13
|
+
children?: readonly (string | Node)[];
|
|
14
|
+
slots?: Readonly<Record<string, readonly (string | Node)[]>>;
|
|
15
|
+
}
|
|
16
|
+
export declare function createUiStatusMessage(props?: UiStatusMessageProps): UiStatusMessageElement;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
|
|
2
|
+
import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
3
|
+
import "../styles/ui-status-message.css";
|
|
4
|
+
|
|
5
|
+
const definition = {...{"contract":{"tag":"ui-status-message","props":{"heading":{"type":"string","required":false,"target":{"attribute":"heading"},"default":""},"kind":{"type":{"enum":["empty","loading","error"]},"required":false,"target":{"attribute":"kind"},"default":"empty"},"layout":{"type":{"enum":["inline","panel","fill"]},"required":false,"target":{"attribute":"layout"},"default":"inline"}}},"template":{"kind":"element","name":"div","attributes":[{"kind":"attribute","name":"role","expression":"{ true: 'alert', false: 'status' }[format('%s', kind = 'error')]","expressionPlan":{"source":"{ true: 'alert', false: 'status' }[format('%s', kind = 'error')]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"literal","value":"alert"}},{"key":"false","value":{"kind":"literal","value":"status"}}]},"index":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"%s"},{"kind":"binary","op":"=","left":{"kind":"id","name":"kind"},"right":{"kind":"literal","value":"error"}}]}},"dependencies":["kind"]}}],"children":[{"kind":"element","name":"ui-spinner","attributes":[{"kind":"literal","name":"size","value":"sm"},{"kind":"attribute","name":"hidden","expression":"kind != 'loading'","expressionPlan":{"source":"kind != 'loading'","ast":{"kind":"binary","op":"!=","left":{"kind":"id","name":"kind"},"right":{"kind":"literal","value":"loading"}},"dependencies":["kind"]}}],"children":[]},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"copy"}],"children":[{"kind":"element","name":"strong","attributes":[{"kind":"literal","name":"class","value":"heading"},{"kind":"attribute","name":"hidden","expression":"not heading","expressionPlan":{"source":"not heading","ast":{"kind":"unary","op":"not","operand":{"kind":"id","name":"heading"}},"dependencies":["heading"]}}],"children":[{"kind":"element","name":"template","attributes":[{"kind":"directive","name":"value","expression":"heading","expressionPlan":{"source":"heading","ast":{"kind":"id","name":"heading"},"dependencies":["heading"]}}],"children":[]}]},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"message"}],"children":[{"kind":"slot"}]}]},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"action"}],"children":[{"kind":"slot","fallback":[],"name":"action"}]}]},"declarations":[],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
|
|
6
|
+
|
|
7
|
+
export function createUiStatusMessage(options = {}) {
|
|
8
|
+
const { attributes = {}, children = [], slots = {}, as, ...componentProps } = options;
|
|
9
|
+
const projected = [];
|
|
10
|
+
const element = document.createElement("div");
|
|
11
|
+
for (const [name, value] of Object.entries(attributes)) {
|
|
12
|
+
if (value === null || value === undefined || value === false) continue;
|
|
13
|
+
element.setAttribute(name, value === true ? "" : String(value));
|
|
14
|
+
}
|
|
15
|
+
element.setAttribute("data-component", "ui-status-message");
|
|
16
|
+
const element0 = document.createElement("ui-spinner");
|
|
17
|
+
element0.setAttribute("size", "sm");
|
|
18
|
+
element.append(element0);
|
|
19
|
+
const element1 = document.createElement("span");
|
|
20
|
+
element1.setAttribute("class", "copy");
|
|
21
|
+
const element2 = document.createElement("strong");
|
|
22
|
+
element2.setAttribute("class", "heading");
|
|
23
|
+
const element3 = document.createElement("template");
|
|
24
|
+
element2.append(element3);
|
|
25
|
+
element1.append(element2);
|
|
26
|
+
const element4 = document.createElement("span");
|
|
27
|
+
element4.setAttribute("class", "message");
|
|
28
|
+
if (children.length > 0) {
|
|
29
|
+
for (const child of children) {
|
|
30
|
+
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
31
|
+
projected.push([node, ""]);
|
|
32
|
+
element4.append(node);
|
|
33
|
+
}
|
|
34
|
+
} else {
|
|
35
|
+
}
|
|
36
|
+
element1.append(element4);
|
|
37
|
+
element.append(element1);
|
|
38
|
+
const element5 = document.createElement("span");
|
|
39
|
+
element5.setAttribute("class", "action");
|
|
40
|
+
if (slots["action"] ?? [].length > 0) {
|
|
41
|
+
for (const child of slots["action"] ?? []) {
|
|
42
|
+
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
43
|
+
projected.push([node, "action"]);
|
|
44
|
+
element5.append(node);
|
|
45
|
+
}
|
|
46
|
+
} else {
|
|
47
|
+
}
|
|
48
|
+
element.append(element5);
|
|
49
|
+
manageComponentLifecycle(element, definition, { props: componentProps, projected,
|
|
50
|
+
});
|
|
51
|
+
return element;
|
|
52
|
+
}
|
|
53
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
|
|
2
|
+
export interface UiTextEventMap {
|
|
3
|
+
}
|
|
4
|
+
export interface UiTextElement extends HTMLParagraphElement {
|
|
5
|
+
addEventListener<K extends keyof UiTextEventMap>(type: K, listener: (this: UiTextElement, event: UiTextEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
6
|
+
removeEventListener<K extends keyof UiTextEventMap>(type: K, listener: (this: UiTextElement, event: UiTextEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
7
|
+
}
|
|
8
|
+
export interface UiTextProps {
|
|
9
|
+
align?: "start" | "center" | null;
|
|
10
|
+
size?: "inherit" | "xs" | "sm" | "md" | "lg" | null;
|
|
11
|
+
tone?: "default" | "secondary" | "muted" | "accent" | "danger" | "success" | null;
|
|
12
|
+
truncate?: boolean | null;
|
|
13
|
+
variant?: "body" | "eyebrow" | "code" | null;
|
|
14
|
+
weight?: "inherit" | "normal" | "medium" | "semibold" | null;
|
|
15
|
+
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
|
16
|
+
children?: readonly (string | Node)[];
|
|
17
|
+
slots?: Readonly<Record<string, readonly (string | Node)[]>>;
|
|
18
|
+
as?: "p" | "span" | "div" | "small" | "strong" | "label";
|
|
19
|
+
}
|
|
20
|
+
export declare function createUiText(props?: UiTextProps): UiTextElement;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
|
|
2
|
+
import { manageGeneratedProps } from "@nextwebwg/html-next/generated-runtime";
|
|
3
|
+
import "../styles/ui-text.css";
|
|
4
|
+
|
|
5
|
+
export function createUiText(options = {}) {
|
|
6
|
+
const { attributes = {}, children = [], slots = {}, as, ...componentProps } = options;
|
|
7
|
+
const projected = [];
|
|
8
|
+
const prop0 = componentProps["align"] === undefined ? "start" : componentProps["align"];
|
|
9
|
+
const prop1 = componentProps["size"] === undefined ? "inherit" : componentProps["size"];
|
|
10
|
+
const prop2 = componentProps["tone"] === undefined ? "default" : componentProps["tone"];
|
|
11
|
+
const prop3 = componentProps["truncate"] === undefined ? false : componentProps["truncate"];
|
|
12
|
+
const prop4 = componentProps["variant"] === undefined ? "body" : componentProps["variant"];
|
|
13
|
+
const prop5 = componentProps["weight"] === undefined ? "inherit" : componentProps["weight"];
|
|
14
|
+
const element = document.createElement(as ?? "p");
|
|
15
|
+
for (const [name, value] of Object.entries(attributes)) {
|
|
16
|
+
if (value === null || value === undefined || value === false) continue;
|
|
17
|
+
element.setAttribute(name, value === true ? "" : String(value));
|
|
18
|
+
}
|
|
19
|
+
element.setAttribute("data-component", "ui-text");
|
|
20
|
+
if (children.length > 0) {
|
|
21
|
+
for (const child of children) {
|
|
22
|
+
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
23
|
+
projected.push([node, ""]);
|
|
24
|
+
element.append(node);
|
|
25
|
+
}
|
|
26
|
+
} else {
|
|
27
|
+
}
|
|
28
|
+
manageGeneratedProps(element, [
|
|
29
|
+
{ name: "align", attribute: "data-align", value: componentProps["align"], default: "start", type: ["start","center"], required: false },
|
|
30
|
+
{ name: "size", attribute: "data-size", value: componentProps["size"], default: "inherit", type: ["inherit","xs","sm","md","lg"], required: false },
|
|
31
|
+
{ name: "tone", attribute: "data-tone", value: componentProps["tone"], default: "default", type: ["default","secondary","muted","accent","danger","success"], required: false },
|
|
32
|
+
{ name: "truncate", attribute: "data-truncate", value: componentProps["truncate"], default: false, type: "boolean", required: false },
|
|
33
|
+
{ name: "variant", attribute: "data-variant", value: componentProps["variant"], default: "body", type: ["body","eyebrow","code"], required: false },
|
|
34
|
+
{ name: "weight", attribute: "data-weight", value: componentProps["weight"], default: "inherit", type: ["inherit","normal","medium","semibold"], required: false },
|
|
35
|
+
]);
|
|
36
|
+
return element;
|
|
37
|
+
}
|
|
38
|
+
|
package/vanilla/index.js
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
|
+
export * from "./UiActionBar.js";
|
|
1
2
|
export * from "./UiAffordanceScope.js";
|
|
2
3
|
export * from "./UiAvatar.js";
|
|
3
4
|
export * from "./UiAvatarGroup.js";
|
|
4
5
|
export * from "./UiBadge.js";
|
|
6
|
+
export * from "./UiBreadcrumbItem.js";
|
|
7
|
+
export * from "./UiBreadcrumbs.js";
|
|
5
8
|
export * from "./UiButton.js";
|
|
6
9
|
export * from "./UiCallout.js";
|
|
10
|
+
export * from "./UiCard.js";
|
|
7
11
|
export * from "./UiCheckbox.js";
|
|
8
12
|
export * from "./UiCluster.js";
|
|
9
13
|
export * from "./UiCombobox.js";
|
|
10
14
|
export * from "./UiContainer.js";
|
|
11
15
|
export * from "./UiContextMenu.js";
|
|
16
|
+
export * from "./UiCover.js";
|
|
17
|
+
export * from "./UiDescriptionItem.js";
|
|
18
|
+
export * from "./UiDescriptionList.js";
|
|
12
19
|
export * from "./UiDialog.js";
|
|
13
20
|
export * from "./UiDisclosure.js";
|
|
14
21
|
export * from "./UiEditable.js";
|
|
@@ -29,6 +36,7 @@ export * from "./UiList.js";
|
|
|
29
36
|
export * from "./UiListItem.js";
|
|
30
37
|
export * from "./UiMenu.js";
|
|
31
38
|
export * from "./UiMenuItem.js";
|
|
39
|
+
export * from "./UiPageHeader.js";
|
|
32
40
|
export * from "./UiPopover.js";
|
|
33
41
|
export * from "./UiRadio.js";
|
|
34
42
|
export * from "./UiRadioGroup.js";
|
|
@@ -36,13 +44,17 @@ export * from "./UiReel.js";
|
|
|
36
44
|
export * from "./UiScrollArea.js";
|
|
37
45
|
export * from "./UiSearchResultRow.js";
|
|
38
46
|
export * from "./UiSearchShell.js";
|
|
47
|
+
export * from "./UiSection.js";
|
|
39
48
|
export * from "./UiSelect.js";
|
|
40
49
|
export * from "./UiSeparator.js";
|
|
41
50
|
export * from "./UiSidebar.js";
|
|
51
|
+
export * from "./UiSpinner.js";
|
|
42
52
|
export * from "./UiStack.js";
|
|
53
|
+
export * from "./UiStatusMessage.js";
|
|
43
54
|
export * from "./UiSwitch.js";
|
|
44
55
|
export * from "./UiSwitcher.js";
|
|
45
56
|
export * from "./UiTabs.js";
|
|
57
|
+
export * from "./UiText.js";
|
|
46
58
|
export * from "./UiTextarea.js";
|
|
47
59
|
export * from "./UiToastRegion.js";
|
|
48
60
|
export * from "./UiTooltip.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {}, __VLS_7: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
tertiary?: (props: typeof __VLS_1) => any;
|
|
4
|
+
} & {
|
|
5
|
+
secondary?: (props: typeof __VLS_3) => any;
|
|
6
|
+
} & {
|
|
7
|
+
default?: (props: typeof __VLS_5) => any;
|
|
8
|
+
} & {
|
|
9
|
+
primary?: (props: typeof __VLS_7) => any;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
12
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
16
|
+
new (): {
|
|
17
|
+
$slots: S;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<!-- Generated by HTML Next 1.0.0-alpha.5 for Vue 3.5. Do not edit. -->
|
|
2
|
+
<script setup lang="ts">
|
|
3
|
+
defineOptions({ inheritAttrs: false })
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<template>
|
|
7
|
+
<div data-component="ui-action-bar" v-bind="$attrs">
|
|
8
|
+
<div class="bar">
|
|
9
|
+
<span class="tertiary"><slot name="tertiary" /></span>
|
|
10
|
+
<span class="secondary"><slot name="secondary" />
|
|
11
|
+
<slot /></span>
|
|
12
|
+
<span class="primary"><slot name="primary" /></span>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<style scoped>
|
|
18
|
+
/* The action row of a form or dialog. Tertiary actions (Back, Cancel, Discard) sit at the start
|
|
19
|
+
edge; secondary actions (Save as draft, Preview) sit just before the primary one, which ends the
|
|
20
|
+
row. The bar arranges its actions and leaves their look to them. */
|
|
21
|
+
[data-component~="ui-action-bar"] {
|
|
22
|
+
--_gap: var(--ui-space-2);
|
|
23
|
+
display: block;
|
|
24
|
+
/* A size container sizes itself from its container, never its content. */
|
|
25
|
+
container-type: inline-size;
|
|
26
|
+
inline-size: 100%;
|
|
27
|
+
min-inline-size: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.bar,
|
|
31
|
+
.tertiary,
|
|
32
|
+
.secondary,
|
|
33
|
+
.primary {
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-wrap: wrap;
|
|
36
|
+
align-items: center;
|
|
37
|
+
gap: var(--ui-action-bar-gap, var(--_gap));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* The tertiary group takes the spare space, pushing the rest to the end edge; without it, the
|
|
41
|
+
rest still ends the row. */
|
|
42
|
+
.bar {
|
|
43
|
+
justify-content: flex-end;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.tertiary {
|
|
47
|
+
flex: 1 1 auto;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.tertiary:empty,
|
|
51
|
+
.secondary:empty,
|
|
52
|
+
.primary:empty {
|
|
53
|
+
display: none;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* A narrow container stacks the actions full width, primary on top: the row turned on its end,
|
|
57
|
+
read from its end edge. Container queries cannot read custom properties, so the width is fixed. */
|
|
58
|
+
@container (inline-size < 24rem) {
|
|
59
|
+
.bar,
|
|
60
|
+
.tertiary,
|
|
61
|
+
.secondary,
|
|
62
|
+
.primary {
|
|
63
|
+
flex-direction: column-reverse;
|
|
64
|
+
flex-wrap: nowrap;
|
|
65
|
+
align-items: stretch;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.tertiary {
|
|
69
|
+
flex: none;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* A component that sets its display still honours the hidden attribute on its root. */
|
|
74
|
+
[data-component~="ui-action-bar"][hidden] {
|
|
75
|
+
display: none;
|
|
76
|
+
}
|
|
77
|
+
</style>
|
package/vue/UiAvatarGroup.vue
CHANGED
|
@@ -47,10 +47,10 @@ useComponentHost(controllerModule.default, {
|
|
|
47
47
|
|
|
48
48
|
<style scoped>
|
|
49
49
|
[data-component~="ui-avatar-group"] {
|
|
50
|
-
/*
|
|
51
|
-
*
|
|
52
|
-
--_overlap-shadow:
|
|
53
|
-
--_edge-ring: 0 0 0
|
|
50
|
+
/* Each avatar is ringed in the surface colour, so where one overlaps the next it reads as a
|
|
51
|
+
* whole circle set on top, not a shape cut into the one beneath. */
|
|
52
|
+
--_overlap-shadow: 0 0 0 0 transparent;
|
|
53
|
+
--_edge-ring: 0 0 0 2px var(--ui-surface);
|
|
54
54
|
|
|
55
55
|
display: flex;
|
|
56
56
|
align-items: center;
|
|
@@ -61,7 +61,7 @@ useComponentHost(controllerModule.default, {
|
|
|
61
61
|
/* Overlap and the separating shadow are applied by the controller: slotted avatars are nested
|
|
62
62
|
* component roots outside this style scope. */
|
|
63
63
|
:slotted(*) {
|
|
64
|
-
margin-inline-start: -0.
|
|
64
|
+
margin-inline-start: -0.5rem;
|
|
65
65
|
flex-shrink: 0;
|
|
66
66
|
border-radius: 999px;
|
|
67
67
|
}
|
|
@@ -71,7 +71,7 @@ useComponentHost(controllerModule.default, {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
.overflow {
|
|
74
|
-
margin-inline-start: -0.
|
|
74
|
+
margin-inline-start: -0.5rem;
|
|
75
75
|
display: inline-flex;
|
|
76
76
|
align-items: center;
|
|
77
77
|
justify-content: center;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
current?: boolean;
|
|
3
|
+
};
|
|
4
|
+
declare var __VLS_6: {};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
default?: (props: typeof __VLS_6) => any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
9
|
+
current: boolean;
|
|
10
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
<!-- Generated by HTML Next 1.0.0-alpha.5 for Vue 3.5. Do not edit. -->
|
|
2
|
+
<script setup lang="ts">
|
|
3
|
+
import { computed } from 'vue'
|
|
4
|
+
import UiIcon from './UiIcon.vue'
|
|
5
|
+
|
|
6
|
+
defineOptions({ inheritAttrs: false })
|
|
7
|
+
|
|
8
|
+
const props = withDefaults(
|
|
9
|
+
defineProps<{
|
|
10
|
+
current?: boolean
|
|
11
|
+
}>(),
|
|
12
|
+
{
|
|
13
|
+
current: false,
|
|
14
|
+
},
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
/** The values the styles' :host-state() rules test. */
|
|
18
|
+
const hostState = computed(() =>
|
|
19
|
+
[
|
|
20
|
+
props.current && 'current',
|
|
21
|
+
].filter(Boolean).join(' ')
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
function text(value: unknown): string {
|
|
25
|
+
if (Array.isArray(value)) return value.map(text).join(' ')
|
|
26
|
+
return value === null || value === undefined || typeof value === 'object' ? '' : String(value)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function attribute(value: unknown): any {
|
|
30
|
+
if (
|
|
31
|
+
value === null || value === undefined || value === false
|
|
32
|
+
|| (typeof value === 'object' && !Array.isArray(value))
|
|
33
|
+
) return undefined
|
|
34
|
+
return value === true ? '' : text(value)
|
|
35
|
+
}
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<template>
|
|
39
|
+
<li
|
|
40
|
+
data-component="ui-breadcrumb-item"
|
|
41
|
+
v-bind="$attrs"
|
|
42
|
+
:aria-current="typeof (({ true: 'page', false: null })[`${current}`]) === 'boolean'
|
|
43
|
+
? String(({ true: 'page', false: null })[`${current}`])
|
|
44
|
+
: attribute(({ true: 'page', false: null })[`${current}`])"
|
|
45
|
+
:data-ui-breadcrumb-item-state="hostState || undefined"
|
|
46
|
+
>
|
|
47
|
+
<span class="separator" aria-hidden="true"><UiIcon name="chevron-right" /></span>
|
|
48
|
+
<span class="content"><slot /></span>
|
|
49
|
+
</li>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<style scoped>
|
|
53
|
+
/* One step in a ui-breadcrumbs trail: a link up to that place, or the current view. A chevron leads
|
|
54
|
+
every step but the first. An icon slotted before the name sits with it. */
|
|
55
|
+
[data-component~="ui-breadcrumb-item"] {
|
|
56
|
+
display: inline-flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
gap: var(--ui-space-2);
|
|
59
|
+
min-inline-size: 0;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.separator {
|
|
63
|
+
display: inline-flex;
|
|
64
|
+
color: var(--ui-text-muted);
|
|
65
|
+
font-size: var(--ui-font-size-xs);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
[data-component~="ui-breadcrumb-item"]:first-child .separator {
|
|
69
|
+
display: none;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.content {
|
|
73
|
+
display: inline-flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
gap: var(--ui-space-1);
|
|
76
|
+
min-inline-size: 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.content > :slotted(a) {
|
|
80
|
+
display: inline-flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
gap: var(--ui-space-1);
|
|
83
|
+
color: var(--ui-text-secondary);
|
|
84
|
+
text-decoration: none;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.content > :slotted(a:hover) {
|
|
88
|
+
color: var(--ui-text-primary);
|
|
89
|
+
text-decoration: underline;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
[data-component~="ui-breadcrumb-item"][data-ui-breadcrumb-item-state~="current"] .content {
|
|
93
|
+
color: var(--ui-text-primary);
|
|
94
|
+
font-weight: var(--ui-font-medium);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* A component that sets its display still honours the hidden attribute on its root. */
|
|
98
|
+
[data-component~="ui-breadcrumb-item"][hidden] {
|
|
99
|
+
display: none;
|
|
100
|
+
}
|
|
101
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
label?: string;
|
|
3
|
+
};
|
|
4
|
+
declare var __VLS_1: {};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
default?: (props: typeof __VLS_1) => any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
9
|
+
label: string;
|
|
10
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<!-- Generated by HTML Next 1.0.0-alpha.5 for Vue 3.5. Do not edit. -->
|
|
2
|
+
<script setup lang="ts">
|
|
3
|
+
defineOptions({ inheritAttrs: false })
|
|
4
|
+
|
|
5
|
+
withDefaults(
|
|
6
|
+
defineProps<{
|
|
7
|
+
label?: string
|
|
8
|
+
}>(),
|
|
9
|
+
{
|
|
10
|
+
label: 'Breadcrumb',
|
|
11
|
+
},
|
|
12
|
+
)
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<nav data-component="ui-breadcrumbs" v-bind="$attrs" :aria-label="label">
|
|
17
|
+
<ol role="list"><slot /></ol>
|
|
18
|
+
</nav>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<style scoped>
|
|
22
|
+
/* Where a view sits: a trail of ui-breadcrumb-item, from the top down to the current view. It wraps
|
|
23
|
+
rather than scrolls, so every step stays reachable. */
|
|
24
|
+
[data-component~="ui-breadcrumbs"] {
|
|
25
|
+
display: block;
|
|
26
|
+
min-inline-size: 0;
|
|
27
|
+
color: var(--ui-text-muted);
|
|
28
|
+
font-size: var(--ui-font-size-sm);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
ol {
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-wrap: wrap;
|
|
34
|
+
align-items: center;
|
|
35
|
+
gap: var(--ui-space-1) var(--ui-space-2);
|
|
36
|
+
margin: 0;
|
|
37
|
+
padding: 0;
|
|
38
|
+
list-style: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* A component that sets its display still honours the hidden attribute on its root. */
|
|
42
|
+
[data-component~="ui-breadcrumbs"][hidden] {
|
|
43
|
+
display: none;
|
|
44
|
+
}
|
|
45
|
+
</style>
|