@xmesh/system-design 0.0.4 → 0.0.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/README.md +2 -1
- package/custom-elements.json +18382 -0
- package/dist/lit/components/alert/index.d.ts +5 -0
- package/dist/lit/components/alert/index.js +8 -2
- package/dist/lit/components/alert/index.styles.js +215 -0
- package/dist/lit/components/app-bar/index.d.ts +1 -0
- package/dist/lit/components/app-bar/index.js +4 -2
- package/dist/lit/components/app-bar/index.styles.js +94 -0
- package/dist/lit/components/artifact/index.d.ts +5 -0
- package/dist/lit/components/artifact/index.js +14 -10
- package/dist/lit/components/artifact/index.styles.js +180 -0
- package/dist/lit/components/autocomplete/index.d.ts +5 -0
- package/dist/lit/components/autocomplete/index.js +11 -2
- package/dist/lit/components/autocomplete/index.styles.js +185 -0
- package/dist/lit/components/avatar/index.d.ts +1 -0
- package/dist/lit/components/avatar/index.js +4 -2
- package/dist/lit/components/avatar/index.styles.js +76 -0
- package/dist/lit/components/avatar-group/index.d.ts +1 -0
- package/dist/lit/components/avatar-group/index.js +4 -2
- package/dist/lit/components/avatar-group/index.styles.js +74 -0
- package/dist/lit/components/badge/index.d.ts +1 -0
- package/dist/lit/components/badge/index.js +4 -2
- package/dist/lit/components/badge/index.styles.js +86 -0
- package/dist/lit/components/brand-mark/index.js +8 -9
- package/dist/lit/components/brand-mark/index.styles.js +123 -0
- package/dist/lit/components/breadcrumbs/index.d.ts +1 -0
- package/dist/lit/components/breadcrumbs/index.js +5 -4
- package/dist/lit/components/breadcrumbs/index.styles.js +105 -0
- package/dist/lit/components/bubble/index.d.ts +4 -0
- package/dist/lit/components/bubble/index.js +14 -11
- package/dist/lit/components/bubble/index.styles.js +196 -0
- package/dist/lit/components/button/index.d.ts +1 -0
- package/dist/lit/components/button/index.js +6 -13
- package/dist/lit/components/button/index.styles.js +356 -0
- package/dist/lit/components/card/index.d.ts +1 -0
- package/dist/lit/components/card/index.js +4 -2
- package/dist/lit/components/card/index.styles.js +113 -0
- package/dist/lit/components/chat/index.d.ts +6 -0
- package/dist/lit/components/chat/index.js +15 -10
- package/dist/lit/components/chat/index.styles.js +306 -0
- package/dist/lit/components/checkbox/index.d.ts +1 -0
- package/dist/lit/components/checkbox/index.js +7 -4
- package/dist/lit/components/checkbox/index.styles.js +140 -0
- package/dist/lit/components/chip/index.d.ts +5 -0
- package/dist/lit/components/chip/index.js +8 -2
- package/dist/lit/components/chip/index.styles.js +159 -0
- package/dist/lit/components/chip-group/index.d.ts +4 -0
- package/dist/lit/components/chip-group/index.js +7 -2
- package/dist/lit/components/chip-group/index.styles.js +33 -0
- package/dist/lit/components/code/index.d.ts +1 -0
- package/dist/lit/components/code/index.js +4 -3
- package/dist/lit/components/code/index.styles.js +56 -0
- package/dist/lit/components/composer/index.d.ts +6 -0
- package/dist/lit/components/composer/index.js +15 -10
- package/dist/lit/components/composer/index.styles.js +562 -0
- package/dist/lit/components/data-table/index.css +18 -0
- package/dist/lit/components/data-table/index.d.ts +30 -0
- package/dist/lit/components/data-table/index.js +120 -34
- package/dist/lit/components/data-table/index.styles.js +198 -0
- package/dist/lit/components/date-range/index.d.ts +4 -0
- package/dist/lit/components/date-range/index.js +7 -2
- package/dist/lit/components/date-range/index.styles.js +338 -0
- package/dist/lit/components/dialog/index.d.ts +4 -0
- package/dist/lit/components/dialog/index.js +7 -2
- package/dist/lit/components/dialog/index.styles.js +138 -0
- package/dist/lit/components/divider/index.d.ts +1 -0
- package/dist/lit/components/divider/index.js +4 -2
- package/dist/lit/components/divider/index.styles.js +41 -0
- package/dist/lit/components/empty-state/index.d.ts +1 -0
- package/dist/lit/components/empty-state/index.js +4 -2
- package/dist/lit/components/empty-state/index.styles.js +83 -0
- package/dist/lit/components/expansion-panel/index.d.ts +5 -0
- package/dist/lit/components/expansion-panel/index.js +8 -2
- package/dist/lit/components/expansion-panel/index.styles.js +134 -0
- package/dist/lit/components/field/index.d.ts +4 -0
- package/dist/lit/components/field/index.js +9 -4
- package/dist/lit/components/field/index.styles.js +237 -0
- package/dist/lit/components/file-input/index.d.ts +4 -0
- package/dist/lit/components/file-input/index.js +10 -4
- package/dist/lit/components/file-input/index.styles.js +271 -0
- package/dist/lit/components/form/index.d.ts +4 -0
- package/dist/lit/components/form/index.js +7 -2
- package/dist/lit/components/form/index.styles.js +43 -0
- package/dist/lit/components/grid/index.d.ts +1 -0
- package/dist/lit/components/grid/index.js +4 -2
- package/dist/lit/components/grid/index.styles.js +67 -0
- package/dist/lit/components/kbd/index.d.ts +1 -0
- package/dist/lit/components/kbd/index.js +4 -2
- package/dist/lit/components/kbd/index.styles.js +49 -0
- package/dist/lit/components/list/index.d.ts +4 -0
- package/dist/lit/components/list/index.js +7 -2
- package/dist/lit/components/list/index.styles.js +29 -0
- package/dist/lit/components/list-item/index.d.ts +1 -0
- package/dist/lit/components/list-item/index.js +4 -2
- package/dist/lit/components/list-item/index.styles.js +133 -0
- package/dist/lit/components/menu/index.d.ts +8 -0
- package/dist/lit/components/menu/index.js +11 -3
- package/dist/lit/components/menu/index.styles.js +108 -0
- package/dist/lit/components/multi-select/index.css +156 -0
- package/dist/lit/components/multi-select/index.d.ts +70 -0
- package/dist/lit/components/multi-select/index.js +497 -0
- package/dist/lit/components/multi-select/index.styles.js +170 -0
- package/dist/lit/components/navigation-drawer/index.d.ts +4 -0
- package/dist/lit/components/navigation-drawer/index.js +7 -2
- package/dist/lit/components/navigation-drawer/index.styles.js +128 -0
- package/dist/lit/components/overlay/index.d.ts +5 -0
- package/dist/lit/components/overlay/index.js +8 -2
- package/dist/lit/components/overlay/index.styles.js +185 -0
- package/dist/lit/components/pagination/index.d.ts +17 -0
- package/dist/lit/components/pagination/index.js +53 -8
- package/dist/lit/components/pagination/index.styles.js +116 -0
- package/dist/lit/components/popover/index.d.ts +5 -0
- package/dist/lit/components/popover/index.js +8 -2
- package/dist/lit/components/popover/index.styles.js +48 -0
- package/dist/lit/components/primitives/index.js +8 -9
- package/dist/lit/components/primitives/index.styles.js +518 -0
- package/dist/lit/components/progress/index.d.ts +1 -0
- package/dist/lit/components/progress/index.js +4 -2
- package/dist/lit/components/progress/index.styles.js +157 -0
- package/dist/lit/components/radio-group/index.d.ts +5 -0
- package/dist/lit/components/radio-group/index.js +10 -6
- package/dist/lit/components/radio-group/index.styles.js +192 -0
- package/dist/lit/components/select/index.d.ts +4 -0
- package/dist/lit/components/select/index.js +10 -2
- package/dist/lit/components/select/index.styles.js +165 -0
- package/dist/lit/components/sidebar-item/index.js +8 -9
- package/dist/lit/components/sidebar-item/index.styles.js +147 -0
- package/dist/lit/components/skeleton/index.d.ts +1 -0
- package/dist/lit/components/skeleton/index.js +4 -2
- package/dist/lit/components/skeleton/index.styles.js +95 -0
- package/dist/lit/components/slider/index.d.ts +5 -0
- package/dist/lit/components/slider/index.js +11 -4
- package/dist/lit/components/slider/index.styles.js +185 -0
- package/dist/lit/components/snackbar/index.d.ts +4 -0
- package/dist/lit/components/snackbar/index.js +14 -10
- package/dist/lit/components/snackbar/index.styles.js +293 -0
- package/dist/lit/components/stack/index.d.ts +1 -0
- package/dist/lit/components/stack/index.js +4 -2
- package/dist/lit/components/stack/index.styles.js +55 -0
- package/dist/lit/components/switch/index.d.ts +1 -0
- package/dist/lit/components/switch/index.js +7 -4
- package/dist/lit/components/switch/index.styles.js +140 -0
- package/dist/lit/components/table/index.d.ts +1 -0
- package/dist/lit/components/table/index.js +4 -2
- package/dist/lit/components/table/index.styles.js +99 -0
- package/dist/lit/components/tabs/index.d.ts +4 -0
- package/dist/lit/components/tabs/index.js +8 -4
- package/dist/lit/components/tabs/index.styles.js +130 -0
- package/dist/lit/components/text-field/index.d.ts +1 -0
- package/dist/lit/components/text-field/index.js +7 -2
- package/dist/lit/components/text-field/index.styles.js +104 -0
- package/dist/lit/components/textarea/index.d.ts +1 -0
- package/dist/lit/components/textarea/index.js +7 -2
- package/dist/lit/components/textarea/index.styles.js +69 -0
- package/dist/lit/components/tooltip/index.d.ts +1 -0
- package/dist/lit/components/tooltip/index.js +4 -2
- package/dist/lit/components/tooltip/index.styles.js +51 -0
- package/dist/lit/components/validation/index.d.ts +6 -0
- package/dist/lit/components/validation/index.js +15 -10
- package/dist/lit/components/validation/index.styles.js +400 -0
- package/dist/lit/index.d.ts +1 -0
- package/dist/lit/index.js +1 -0
- package/dist/react/XmAlert.d.ts +99 -0
- package/dist/react/XmAlert.js +47 -0
- package/dist/react/XmAppBar.d.ts +59 -0
- package/dist/react/XmAppBar.js +34 -0
- package/dist/react/XmArtifact.d.ts +113 -0
- package/dist/react/XmArtifact.js +48 -0
- package/dist/react/XmArtifactChip.d.ts +56 -0
- package/dist/react/XmArtifactChip.js +32 -0
- package/dist/react/XmAutocomplete.d.ts +153 -0
- package/dist/react/XmAutocomplete.js +70 -0
- package/dist/react/XmAvatar.d.ts +71 -0
- package/dist/react/XmAvatar.js +40 -0
- package/dist/react/XmAvatarGroup.d.ts +59 -0
- package/dist/react/XmAvatarGroup.js +34 -0
- package/dist/react/XmBadge.d.ts +67 -0
- package/dist/react/XmBadge.js +38 -0
- package/dist/react/XmBrandGlyph.d.ts +46 -0
- package/dist/react/XmBrandGlyph.js +24 -0
- package/dist/react/XmBrandMark.d.ts +71 -0
- package/dist/react/XmBrandMark.js +40 -0
- package/dist/react/XmBreadcrumbs.d.ts +56 -0
- package/dist/react/XmBreadcrumbs.js +32 -0
- package/dist/react/XmBubble.d.ts +69 -0
- package/dist/react/XmBubble.js +38 -0
- package/dist/react/XmBubbleActions.d.ts +59 -0
- package/dist/react/XmBubbleActions.js +34 -0
- package/dist/react/XmBubbleGroup.d.ts +82 -0
- package/dist/react/XmBubbleGroup.js +38 -0
- package/dist/react/XmButton.d.ts +89 -0
- package/dist/react/XmButton.js +48 -0
- package/dist/react/XmCard.d.ts +59 -0
- package/dist/react/XmCard.js +34 -0
- package/dist/react/XmChatShell.d.ts +110 -0
- package/dist/react/XmChatShell.js +48 -0
- package/dist/react/XmCheckbox.d.ts +145 -0
- package/dist/react/XmCheckbox.js +60 -0
- package/dist/react/XmChip.d.ts +99 -0
- package/dist/react/XmChip.js +48 -0
- package/dist/react/XmChipGroup.d.ts +79 -0
- package/dist/react/XmChipGroup.js +36 -0
- package/dist/react/XmCode.d.ts +55 -0
- package/dist/react/XmCode.js +32 -0
- package/dist/react/XmComposer.d.ts +123 -0
- package/dist/react/XmComposer.js +56 -0
- package/dist/react/XmDataTable.d.ts +125 -0
- package/dist/react/XmDataTable.js +66 -0
- package/dist/react/XmDateRange.d.ts +93 -0
- package/dist/react/XmDateRange.js +42 -0
- package/dist/react/XmDialog.d.ts +87 -0
- package/dist/react/XmDialog.js +41 -0
- package/dist/react/XmDivider.d.ts +55 -0
- package/dist/react/XmDivider.js +32 -0
- package/dist/react/XmEmptyState.d.ts +61 -0
- package/dist/react/XmEmptyState.js +34 -0
- package/dist/react/XmExpansionPanel.d.ts +101 -0
- package/dist/react/XmExpansionPanel.js +49 -0
- package/dist/react/XmFileInput.d.ts +151 -0
- package/dist/react/XmFileInput.js +70 -0
- package/dist/react/XmFileValidationBlock.d.ts +111 -0
- package/dist/react/XmFileValidationBlock.js +50 -0
- package/dist/react/XmForm.d.ts +91 -0
- package/dist/react/XmForm.js +38 -0
- package/dist/react/XmGrid.d.ts +59 -0
- package/dist/react/XmGrid.js +34 -0
- package/dist/react/XmKbd.d.ts +46 -0
- package/dist/react/XmKbd.js +24 -0
- package/dist/react/XmList.d.ts +83 -0
- package/dist/react/XmList.js +38 -0
- package/dist/react/XmListItem.d.ts +67 -0
- package/dist/react/XmListItem.js +38 -0
- package/dist/react/XmMenu.d.ts +98 -0
- package/dist/react/XmMenu.js +46 -0
- package/dist/react/XmMenuItem.d.ts +63 -0
- package/dist/react/XmMenuItem.js +36 -0
- package/dist/react/XmMultiSelect.d.ts +161 -0
- package/dist/react/XmMultiSelect.js +74 -0
- package/dist/react/XmNavigationDrawer.d.ts +93 -0
- package/dist/react/XmNavigationDrawer.js +42 -0
- package/dist/react/XmOverlay.d.ts +120 -0
- package/dist/react/XmOverlay.js +56 -0
- package/dist/react/XmPagination.d.ts +117 -0
- package/dist/react/XmPagination.js +58 -0
- package/dist/react/XmPopover.d.ts +90 -0
- package/dist/react/XmPopover.js +42 -0
- package/dist/react/XmProgress.d.ts +75 -0
- package/dist/react/XmProgress.js +42 -0
- package/dist/react/XmRadio.d.ts +88 -0
- package/dist/react/XmRadio.js +42 -0
- package/dist/react/XmRadioGroup.d.ts +139 -0
- package/dist/react/XmRadioGroup.js +58 -0
- package/dist/react/XmSelect.d.ts +152 -0
- package/dist/react/XmSelect.js +70 -0
- package/dist/react/XmSidebarItem.d.ts +75 -0
- package/dist/react/XmSidebarItem.js +42 -0
- package/dist/react/XmSkeleton.d.ts +71 -0
- package/dist/react/XmSkeleton.js +40 -0
- package/dist/react/XmSlider.d.ts +160 -0
- package/dist/react/XmSlider.js +76 -0
- package/dist/react/XmSnackbar.d.ts +110 -0
- package/dist/react/XmSnackbar.js +51 -0
- package/dist/react/XmStack.d.ts +71 -0
- package/dist/react/XmStack.js +40 -0
- package/dist/react/XmSwitch.d.ts +136 -0
- package/dist/react/XmSwitch.js +58 -0
- package/dist/react/XmTab.d.ts +79 -0
- package/dist/react/XmTab.js +38 -0
- package/dist/react/XmTabPanel.d.ts +55 -0
- package/dist/react/XmTabPanel.js +32 -0
- package/dist/react/XmTable.d.ts +57 -0
- package/dist/react/XmTable.js +32 -0
- package/dist/react/XmTabs.d.ts +82 -0
- package/dist/react/XmTabs.js +38 -0
- package/dist/react/XmTextField.d.ts +147 -0
- package/dist/react/XmTextField.js +62 -0
- package/dist/react/XmTextarea.d.ts +155 -0
- package/dist/react/XmTextarea.js +66 -0
- package/dist/react/XmTooltip.d.ts +67 -0
- package/dist/react/XmTooltip.js +38 -0
- package/dist/react/index.d.ts +59 -0
- package/dist/react/index.js +59 -0
- package/dist/react/react-utils.js +67 -0
- package/package.json +37 -9
- package/styles/_base-typography.css +86 -0
- package/styles/_primitives.css +54 -0
- package/styles/_reset.css +58 -0
- package/styles/base.css +23 -0
- package/vscode.css-custom-data.json +6 -0
- package/vscode.html-custom-data.json +979 -0
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import type { TemplateResult } from "lit";
|
|
3
3
|
type Primitive = string | number;
|
|
4
|
+
/**
|
|
5
|
+
* @fires change - Fired on commit with the new value in `detail`.
|
|
6
|
+
*/
|
|
4
7
|
export declare class XmChipGroup extends LitElement {
|
|
8
|
+
static styles: CSSStyleSheet[];
|
|
5
9
|
multiple: boolean;
|
|
6
10
|
value: Primitive | Primitive[] | null;
|
|
7
11
|
connectedCallback(): void;
|
|
@@ -39,7 +39,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
39
39
|
};
|
|
40
40
|
import { LitElement, html } from "lit";
|
|
41
41
|
import { customElement, property } from "lit/decorators.js";
|
|
42
|
-
|
|
42
|
+
import chipGroupSheets from "./index.styles.js";
|
|
43
|
+
/**
|
|
44
|
+
* @fires change - Fired on commit with the new value in `detail`.
|
|
45
|
+
*/
|
|
43
46
|
let XmChipGroup = class XmChipGroup extends LitElement {
|
|
44
47
|
constructor() {
|
|
45
48
|
super(...arguments);
|
|
@@ -100,6 +103,9 @@ let XmChipGroup = class XmChipGroup extends LitElement {
|
|
|
100
103
|
this._updateRovingTabindex();
|
|
101
104
|
};
|
|
102
105
|
}
|
|
106
|
+
// Adopted from the build-generated sheets (scripts/gen-styles.mjs) — no
|
|
107
|
+
// runtime URL fetch (ADR 0012). Cascade order preserved from the old <link>s.
|
|
108
|
+
static { this.styles = [...chipGroupSheets]; }
|
|
103
109
|
connectedCallback() {
|
|
104
110
|
super.connectedCallback();
|
|
105
111
|
this.addEventListener("xm-chip-activate", this._onChipActivate);
|
|
@@ -145,7 +151,6 @@ let XmChipGroup = class XmChipGroup extends LitElement {
|
|
|
145
151
|
}
|
|
146
152
|
render() {
|
|
147
153
|
return html `
|
|
148
|
-
<link rel="stylesheet" href="${GROUP_CSS}" />
|
|
149
154
|
<style>
|
|
150
155
|
:host {
|
|
151
156
|
display: block;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// GENERATED by scripts/gen-styles.mjs — do not edit. Source: lit/components/chip-group/index.css
|
|
2
|
+
// SSR-safe: constructable stylesheets need the DOM, so in a non-DOM context
|
|
3
|
+
// (Node/SSR import) this exports [] instead of throwing. The CSS self-declares
|
|
4
|
+
// the @layer order so the override contract holds even without ./base (AD-2).
|
|
5
|
+
let sheets = [];
|
|
6
|
+
if (typeof CSSStyleSheet !== "undefined") {
|
|
7
|
+
const sheet = new CSSStyleSheet();
|
|
8
|
+
sheet.replaceSync(`@layer reset, base, tokens, components, utilities;
|
|
9
|
+
@layer components {
|
|
10
|
+
/* ============================================
|
|
11
|
+
Chip group — selection container for chips.
|
|
12
|
+
|
|
13
|
+
<xm-chip-group> lays slotted <xm-chip> children in a wrapping
|
|
14
|
+
row and owns selection (single by default, multi with \`multiple\`).
|
|
15
|
+
Layout only — the chips own all chrome. Sits on a surface* host,
|
|
16
|
+
so it adds no surface of its own.
|
|
17
|
+
============================================ */
|
|
18
|
+
|
|
19
|
+
.chip-group {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-wrap: wrap;
|
|
22
|
+
align-items: center;
|
|
23
|
+
gap: var(--s-2);
|
|
24
|
+
/* The group sits on a surface* host; establish on-surface as the
|
|
25
|
+
inherited ink so any chip that resolves currentColor against the
|
|
26
|
+
group reads correctly on the desk (AD-13). */
|
|
27
|
+
color: var(--md-sys-color-on-surface);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
}`);
|
|
31
|
+
sheets = [sheet];
|
|
32
|
+
}
|
|
33
|
+
export default sheets;
|
|
@@ -28,12 +28,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
28
28
|
};
|
|
29
29
|
import { LitElement, html } from "lit";
|
|
30
30
|
import { customElement, property } from "lit/decorators.js";
|
|
31
|
-
|
|
31
|
+
import codeSheets from "./index.styles.js";
|
|
32
32
|
let XmCode = class XmCode extends LitElement {
|
|
33
33
|
constructor() {
|
|
34
34
|
super(...arguments);
|
|
35
35
|
this.block = false;
|
|
36
36
|
}
|
|
37
|
+
// Adopted from the build-generated sheets (scripts/gen-styles.mjs) — no
|
|
38
|
+
// runtime URL fetch (ADR 0012). Cascade order preserved from the old <link>s.
|
|
39
|
+
static { this.styles = [...codeSheets]; }
|
|
37
40
|
render() {
|
|
38
41
|
const styleHost = html `
|
|
39
42
|
<style>
|
|
@@ -48,13 +51,11 @@ let XmCode = class XmCode extends LitElement {
|
|
|
48
51
|
`;
|
|
49
52
|
if (this.block) {
|
|
50
53
|
return html `
|
|
51
|
-
<link rel="stylesheet" href="${CODE_CSS}" />
|
|
52
54
|
${styleHost}
|
|
53
55
|
<pre class="code code--block"><code><slot></slot></code></pre>
|
|
54
56
|
`;
|
|
55
57
|
}
|
|
56
58
|
return html `
|
|
57
|
-
<link rel="stylesheet" href="${CODE_CSS}" />
|
|
58
59
|
${styleHost}
|
|
59
60
|
<code class="code"><slot></slot></code>
|
|
60
61
|
`;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// GENERATED by scripts/gen-styles.mjs — do not edit. Source: lit/components/code/index.css
|
|
2
|
+
// SSR-safe: constructable stylesheets need the DOM, so in a non-DOM context
|
|
3
|
+
// (Node/SSR import) this exports [] instead of throwing. The CSS self-declares
|
|
4
|
+
// the @layer order so the override contract holds even without ./base (AD-2).
|
|
5
|
+
let sheets = [];
|
|
6
|
+
if (typeof CSSStyleSheet !== "undefined") {
|
|
7
|
+
const sheet = new CSSStyleSheet();
|
|
8
|
+
sheet.replaceSync(`@layer reset, base, tokens, components, utilities;
|
|
9
|
+
@layer components {
|
|
10
|
+
/* ============================================
|
|
11
|
+
Code — inline / block code display primitive.
|
|
12
|
+
|
|
13
|
+
<xm-code> presents code verbatim using the JetBrains Mono
|
|
14
|
+
typescale (--xm-typescale-mono-*). Inline by default; the
|
|
15
|
+
\`block\` modifier wraps it in a <pre> for a small code block.
|
|
16
|
+
|
|
17
|
+
A recessed surface-container-* backplate raised off the host,
|
|
18
|
+
a hairline 1px outline-variant border, ink --md-sys-color-on-surface
|
|
19
|
+
matched to the backplate (AD-13). Presentational chrome — never a
|
|
20
|
+
status hue (AD-11).
|
|
21
|
+
============================================ */
|
|
22
|
+
|
|
23
|
+
.code {
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
padding: 1px var(--s-2);
|
|
26
|
+
border: 1px solid var(--md-sys-color-outline-variant);
|
|
27
|
+
border-radius: var(--md-sys-shape-corner-extra-small);
|
|
28
|
+
background: var(--md-sys-color-surface-container-low);
|
|
29
|
+
color: var(--md-sys-color-on-surface);
|
|
30
|
+
font-family: var(--xm-typescale-mono-font);
|
|
31
|
+
font-size: var(--xm-typescale-mono-size);
|
|
32
|
+
font-weight: var(--xm-typescale-mono-weight);
|
|
33
|
+
line-height: var(--xm-typescale-mono-line-height);
|
|
34
|
+
letter-spacing: var(--xm-typescale-mono-tracking);
|
|
35
|
+
white-space: nowrap;
|
|
36
|
+
vertical-align: baseline;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* Block — recessed code panel. Wraps, scrolls horizontally if needed,
|
|
40
|
+
and uses the small corner + more padding of a panel rather than an
|
|
41
|
+
inline token. */
|
|
42
|
+
.code--block {
|
|
43
|
+
display: block;
|
|
44
|
+
margin: 0;
|
|
45
|
+
padding: var(--s-3) var(--s-4);
|
|
46
|
+
border-radius: var(--md-sys-shape-corner-small);
|
|
47
|
+
background: var(--md-sys-color-surface-container-low);
|
|
48
|
+
white-space: pre;
|
|
49
|
+
overflow-x: auto;
|
|
50
|
+
tab-size: 2;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
}`);
|
|
54
|
+
sheets = [sheet];
|
|
55
|
+
}
|
|
56
|
+
export default sheets;
|
|
@@ -12,6 +12,12 @@ export interface ComposerAttachment {
|
|
|
12
12
|
pages?: number;
|
|
13
13
|
dims?: string;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* @fires attachments-change - Fired when the attachment set changes.
|
|
17
|
+
* @fires cancel - Fired when the action is cancelled.
|
|
18
|
+
* @fires send - Fired when the user sends the composed content.
|
|
19
|
+
* @fires value-change - Fired when the value changes (`detail.value`).
|
|
20
|
+
*/
|
|
15
21
|
export declare class XmComposer extends LitElement {
|
|
16
22
|
initialValue: string;
|
|
17
23
|
initialFocus: boolean;
|
|
@@ -36,17 +36,16 @@ import { LitElement, html, svg, nothing } from "lit";
|
|
|
36
36
|
import { customElement, property, state } from "lit/decorators.js";
|
|
37
37
|
// Side-effect import: registers <xm-button> for use in the toolbar.
|
|
38
38
|
import "../button/index.js";
|
|
39
|
+
import composerSheets from "./index.styles.js";
|
|
40
|
+
import primitivesSheets from "../primitives/index.styles.js";
|
|
41
|
+
// Light DOM: adopt the build-generated sheets into the document — no runtime
|
|
42
|
+
// URL fetch (ADR 0012). Deduped by sheet identity (the generated modules are
|
|
43
|
+
// singletons); the CSS is wrapped in @layer components (spine AD-2).
|
|
39
44
|
if (typeof document !== "undefined") {
|
|
40
|
-
for (const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (document.querySelector(`link[rel="stylesheet"][href="${href}"]`))
|
|
45
|
-
continue;
|
|
46
|
-
const link = document.createElement("link");
|
|
47
|
-
link.rel = "stylesheet";
|
|
48
|
-
link.href = href;
|
|
49
|
-
document.head.appendChild(link);
|
|
45
|
+
for (const sheet of [...composerSheets, ...primitivesSheets]) {
|
|
46
|
+
if (!document.adoptedStyleSheets.includes(sheet)) {
|
|
47
|
+
document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];
|
|
48
|
+
}
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
51
|
/* ---------- attachment helpers (verbatim from JSX) ---------- */
|
|
@@ -120,6 +119,12 @@ const I_CARET = (size = 12) => svg `
|
|
|
120
119
|
<polyline points="6 9 12 15 18 9" />
|
|
121
120
|
</svg>
|
|
122
121
|
`;
|
|
122
|
+
/**
|
|
123
|
+
* @fires attachments-change - Fired when the attachment set changes.
|
|
124
|
+
* @fires cancel - Fired when the action is cancelled.
|
|
125
|
+
* @fires send - Fired when the user sends the composed content.
|
|
126
|
+
* @fires value-change - Fired when the value changes (`detail.value`).
|
|
127
|
+
*/
|
|
123
128
|
let XmComposer = class XmComposer extends LitElement {
|
|
124
129
|
constructor() {
|
|
125
130
|
super(...arguments);
|