@xmesh/system-design 0.0.3 → 0.0.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/README.md +2 -1
- package/custom-elements.json +18382 -0
- package/dist/lit/components/alert/index.d.ts +6 -1
- package/dist/lit/components/alert/index.js +9 -2
- package/dist/lit/components/alert/index.styles.js +215 -0
- package/dist/lit/components/app-bar/index.d.ts +2 -1
- package/dist/lit/components/app-bar/index.js +5 -2
- package/dist/lit/components/app-bar/index.styles.js +94 -0
- package/dist/lit/components/artifact/index.d.ts +6 -1
- package/dist/lit/components/artifact/index.js +20 -2
- 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 +2 -1
- package/dist/lit/components/avatar/index.js +5 -2
- package/dist/lit/components/avatar/index.styles.js +76 -0
- package/dist/lit/components/avatar-group/index.d.ts +2 -1
- package/dist/lit/components/avatar-group/index.js +5 -2
- package/dist/lit/components/avatar-group/index.styles.js +74 -0
- package/dist/lit/components/badge/index.d.ts +2 -2
- package/dist/lit/components/badge/index.js +5 -2
- package/dist/lit/components/badge/index.styles.js +86 -0
- package/dist/lit/components/brand-mark/index.d.ts +2 -2
- package/dist/lit/components/brand-mark/index.js +13 -0
- package/dist/lit/components/brand-mark/index.styles.js +123 -0
- package/dist/lit/components/breadcrumbs/index.d.ts +2 -1
- package/dist/lit/components/breadcrumbs/index.js +6 -4
- package/dist/lit/components/breadcrumbs/index.styles.js +105 -0
- package/dist/lit/components/bubble/index.d.ts +8 -4
- package/dist/lit/components/bubble/index.js +21 -0
- package/dist/lit/components/bubble/index.styles.js +196 -0
- package/dist/lit/components/button/index.d.ts +2 -1
- package/dist/lit/components/button/index.js +7 -13
- package/dist/lit/components/button/index.styles.js +356 -0
- package/dist/lit/components/card/index.d.ts +2 -1
- package/dist/lit/components/card/index.js +5 -2
- package/dist/lit/components/card/index.styles.js +113 -0
- package/dist/lit/components/chat/index.d.ts +7 -2
- package/dist/lit/components/chat/index.js +21 -2
- package/dist/lit/components/chat/index.styles.js +306 -0
- package/dist/lit/components/checkbox/index.d.ts +2 -2
- package/dist/lit/components/checkbox/index.js +8 -4
- package/dist/lit/components/checkbox/index.styles.js +140 -0
- package/dist/lit/components/chip/index.d.ts +6 -1
- package/dist/lit/components/chip/index.js +9 -2
- package/dist/lit/components/chip/index.styles.js +159 -0
- package/dist/lit/components/chip-group/index.d.ts +5 -1
- package/dist/lit/components/chip-group/index.js +8 -2
- package/dist/lit/components/chip-group/index.styles.js +33 -0
- package/dist/lit/components/code/index.d.ts +2 -2
- package/dist/lit/components/code/index.js +5 -3
- package/dist/lit/components/code/index.styles.js +56 -0
- package/dist/lit/components/composer/index.d.ts +7 -2
- package/dist/lit/components/composer/index.js +19 -0
- 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 +2 -1
- package/dist/lit/components/divider/index.js +5 -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 +6 -2
- package/dist/lit/components/expansion-panel/index.js +9 -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 +2 -1
- package/dist/lit/components/grid/index.js +5 -2
- package/dist/lit/components/grid/index.styles.js +67 -0
- package/dist/lit/components/kbd/index.d.ts +2 -2
- package/dist/lit/components/kbd/index.js +5 -2
- package/dist/lit/components/kbd/index.styles.js +49 -0
- package/dist/lit/components/list/index.d.ts +5 -1
- package/dist/lit/components/list/index.js +8 -2
- package/dist/lit/components/list/index.styles.js +29 -0
- package/dist/lit/components/list-item/index.d.ts +2 -2
- package/dist/lit/components/list-item/index.js +5 -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 +5 -2
- package/dist/lit/components/navigation-drawer/index.js +8 -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 +18 -1
- package/dist/lit/components/pagination/index.js +54 -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.d.ts +2 -2
- package/dist/lit/components/primitives/index.js +13 -0
- 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.d.ts +1 -1
- package/dist/lit/components/sidebar-item/index.js +12 -0
- 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 +5 -2
- package/dist/lit/components/snackbar/index.js +20 -2
- package/dist/lit/components/snackbar/index.styles.js +293 -0
- package/dist/lit/components/stack/index.d.ts +2 -1
- package/dist/lit/components/stack/index.js +5 -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 +2 -2
- package/dist/lit/components/table/index.js +5 -2
- package/dist/lit/components/table/index.styles.js +99 -0
- package/dist/lit/components/tabs/index.d.ts +7 -3
- package/dist/lit/components/tabs/index.js +11 -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 +7 -2
- package/dist/lit/components/validation/index.js +21 -1
- 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 +45 -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 +45 -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 +68 -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 +36 -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 +44 -0
- package/dist/react/XmCheckbox.d.ts +145 -0
- package/dist/react/XmCheckbox.js +58 -0
- package/dist/react/XmChip.d.ts +99 -0
- package/dist/react/XmChip.js +46 -0
- package/dist/react/XmChipGroup.d.ts +79 -0
- package/dist/react/XmChipGroup.js +35 -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 +52 -0
- package/dist/react/XmDataTable.d.ts +125 -0
- package/dist/react/XmDataTable.js +65 -0
- package/dist/react/XmDateRange.d.ts +93 -0
- package/dist/react/XmDateRange.js +41 -0
- package/dist/react/XmDialog.d.ts +87 -0
- package/dist/react/XmDialog.js +40 -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 +48 -0
- package/dist/react/XmFileInput.d.ts +151 -0
- package/dist/react/XmFileInput.js +68 -0
- package/dist/react/XmFileValidationBlock.d.ts +111 -0
- package/dist/react/XmFileValidationBlock.js +45 -0
- package/dist/react/XmForm.d.ts +91 -0
- package/dist/react/XmForm.js +37 -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 +37 -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 +42 -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 +72 -0
- package/dist/react/XmNavigationDrawer.d.ts +93 -0
- package/dist/react/XmNavigationDrawer.js +41 -0
- package/dist/react/XmOverlay.d.ts +120 -0
- package/dist/react/XmOverlay.js +54 -0
- package/dist/react/XmPagination.d.ts +117 -0
- package/dist/react/XmPagination.js +57 -0
- package/dist/react/XmPopover.d.ts +90 -0
- package/dist/react/XmPopover.js +40 -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 +41 -0
- package/dist/react/XmRadioGroup.d.ts +139 -0
- package/dist/react/XmRadioGroup.js +56 -0
- package/dist/react/XmSelect.d.ts +152 -0
- package/dist/react/XmSelect.js +68 -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 +74 -0
- package/dist/react/XmSnackbar.d.ts +110 -0
- package/dist/react/XmSnackbar.js +49 -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 +56 -0
- package/dist/react/XmTab.d.ts +79 -0
- package/dist/react/XmTab.js +37 -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 +37 -0
- package/dist/react/XmTextField.d.ts +147 -0
- package/dist/react/XmTextField.js +60 -0
- package/dist/react/XmTextarea.d.ts +155 -0
- package/dist/react/XmTextarea.js +64 -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
|
@@ -37,7 +37,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
37
37
|
import { html, nothing } from "lit";
|
|
38
38
|
import { customElement, property, state, query } from "lit/decorators.js";
|
|
39
39
|
import { XmField } from "../field/index.js";
|
|
40
|
-
|
|
40
|
+
import primitivesSheets from "../primitives/index.styles.js";
|
|
41
|
+
import fieldSheets from "../field/index.styles.js";
|
|
42
|
+
import autocompleteSheets from "./index.styles.js";
|
|
43
|
+
/**
|
|
44
|
+
* @fires change - Fired on commit with the new value in `detail`.
|
|
45
|
+
* @fires input - Fired on each edit with the current value in `detail`.
|
|
46
|
+
*/
|
|
41
47
|
let XmAutocomplete = class XmAutocomplete extends XmField {
|
|
42
48
|
constructor() {
|
|
43
49
|
super(...arguments);
|
|
@@ -123,6 +129,10 @@ let XmAutocomplete = class XmAutocomplete extends XmField {
|
|
|
123
129
|
}
|
|
124
130
|
};
|
|
125
131
|
}
|
|
132
|
+
// Adopted from build-generated sheets (gen-styles.mjs) — no runtime URL
|
|
133
|
+
// fetch (ADR 0012). Lit static styles don't merge on override, so subclasses
|
|
134
|
+
// re-include the chrome (primitives + field) sheets.
|
|
135
|
+
static { this.styles = [...primitivesSheets, ...fieldSheets, ...autocompleteSheets]; }
|
|
126
136
|
connectedCallback() {
|
|
127
137
|
super.connectedCallback();
|
|
128
138
|
if (this.initialValue !== "" && this._selectedValue === null) {
|
|
@@ -245,7 +255,6 @@ let XmAutocomplete = class XmAutocomplete extends XmField {
|
|
|
245
255
|
? `${a.id}-opt-${this._activeIndex}`
|
|
246
256
|
: nothing;
|
|
247
257
|
return html `
|
|
248
|
-
<link rel="stylesheet" href="${AUTOCOMPLETE_CSS}" />
|
|
249
258
|
<div class="autocomplete__control">
|
|
250
259
|
<input
|
|
251
260
|
class="autocomplete__input"
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
// GENERATED by scripts/gen-styles.mjs — do not edit. Source: lit/components/autocomplete/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
|
+
xm-autocomplete — filtering select for XmField (Story 2.4).
|
|
12
|
+
|
|
13
|
+
Same composition as xm-select: XmField (chrome) + xm-overlay (anchored
|
|
14
|
+
listbox). This file styles ONLY the bespoke parts — the text-input control
|
|
15
|
+
row + chevron, the option rows + match highlight, and the inline no-match
|
|
16
|
+
empty-state. Positioning / elevation of the panel surface is owned by
|
|
17
|
+
xm-overlay.
|
|
18
|
+
|
|
19
|
+
Surface & ink (AD-13): control + panel ride the inverse-surface card tier →
|
|
20
|
+
inverse-on-surface ink, on-surface-variant placeholder. The SELECTED option
|
|
21
|
+
tints coral primary-container + on-primary-container ink. The match highlight
|
|
22
|
+
carries coral ink AND an underline so the cue survives grayscale — color is
|
|
23
|
+
never the sole carrier (NFR-15). Coral = selection / match, never severity
|
|
24
|
+
(AD-11).
|
|
25
|
+
|
|
26
|
+
BEM block: \`autocomplete\`. Registered in scripts/check-bem.sh STRICT_BLOCKS.
|
|
27
|
+
============================================ */
|
|
28
|
+
|
|
29
|
+
/* ---------- Control row — text input + chevron in the field wrapper ---------- */
|
|
30
|
+
.autocomplete__control {
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
flex: 1;
|
|
34
|
+
min-width: 0;
|
|
35
|
+
width: 100%;
|
|
36
|
+
height: 100%;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* The native <input> is already transparent / full-bleed via the base
|
|
40
|
+
\`.field__control input\` rule; here only the trailing chevron needs room. */
|
|
41
|
+
.autocomplete__input {
|
|
42
|
+
flex: 1;
|
|
43
|
+
min-width: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.autocomplete__chevron {
|
|
47
|
+
display: inline-flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
flex-shrink: 0;
|
|
50
|
+
padding-right: var(--s-3);
|
|
51
|
+
color: var(--md-sys-color-inverse-on-surface);
|
|
52
|
+
transition: transform var(--md-sys-motion-duration-short3)
|
|
53
|
+
var(--md-sys-motion-easing-standard);
|
|
54
|
+
}
|
|
55
|
+
.autocomplete__chevron--open {
|
|
56
|
+
transform: rotate(180deg);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* ---------- Listbox panel content (inside the overlay) ---------- */
|
|
60
|
+
.autocomplete__listbox {
|
|
61
|
+
list-style: none;
|
|
62
|
+
margin: 0;
|
|
63
|
+
padding: 0;
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
gap: var(--s-0-5);
|
|
67
|
+
min-width: 220px;
|
|
68
|
+
max-height: 320px;
|
|
69
|
+
overflow-y: auto;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.autocomplete__option {
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
gap: var(--s-2);
|
|
76
|
+
padding: var(--s-2) var(--s-3);
|
|
77
|
+
border-radius: var(--md-sys-shape-corner-small);
|
|
78
|
+
color: var(--md-sys-color-inverse-on-surface);
|
|
79
|
+
font:
|
|
80
|
+
var(--md-sys-typescale-body-medium-weight)
|
|
81
|
+
var(--md-sys-typescale-body-medium-size) /
|
|
82
|
+
var(--md-sys-typescale-body-medium-line-height)
|
|
83
|
+
var(--md-sys-typescale-body-medium-font);
|
|
84
|
+
cursor: pointer;
|
|
85
|
+
user-select: none;
|
|
86
|
+
}
|
|
87
|
+
.autocomplete__option-label {
|
|
88
|
+
flex: 1;
|
|
89
|
+
min-width: 0;
|
|
90
|
+
overflow: hidden;
|
|
91
|
+
white-space: nowrap;
|
|
92
|
+
text-overflow: ellipsis;
|
|
93
|
+
}
|
|
94
|
+
.autocomplete__option-check {
|
|
95
|
+
display: inline-flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
flex-shrink: 0;
|
|
98
|
+
color: var(--md-sys-color-primary);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* Match highlight — coral ink + underline (dual cue, NFR-15). Background stays
|
|
102
|
+
transparent so it reads on both the panel ink and the selected coral tint. */
|
|
103
|
+
.autocomplete__mark {
|
|
104
|
+
background: transparent;
|
|
105
|
+
color: var(--md-sys-color-primary);
|
|
106
|
+
font-weight: 600;
|
|
107
|
+
text-decoration: underline;
|
|
108
|
+
text-underline-offset: 2px;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* Active (keyboard / hover) — MD3 state layer over the panel ink. */
|
|
112
|
+
.autocomplete__option--active {
|
|
113
|
+
background: color-mix(
|
|
114
|
+
in oklab,
|
|
115
|
+
var(--md-sys-color-inverse-on-surface)
|
|
116
|
+
var(--md-sys-state-hover-state-layer-opacity),
|
|
117
|
+
transparent
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* Selected — coral primary-container tint + paired ink (AD-13). */
|
|
122
|
+
.autocomplete__option--selected {
|
|
123
|
+
background: var(--md-sys-color-primary-container);
|
|
124
|
+
color: var(--md-sys-color-on-primary-container);
|
|
125
|
+
}
|
|
126
|
+
.autocomplete__option--selected .autocomplete__option-check {
|
|
127
|
+
color: var(--md-sys-color-on-primary-container);
|
|
128
|
+
}
|
|
129
|
+
.autocomplete__option--selected .autocomplete__mark {
|
|
130
|
+
color: var(--md-sys-color-on-primary-container);
|
|
131
|
+
}
|
|
132
|
+
.autocomplete__option--selected.autocomplete__option--active {
|
|
133
|
+
background: color-mix(
|
|
134
|
+
in oklab,
|
|
135
|
+
var(--md-sys-color-on-primary-container)
|
|
136
|
+
var(--md-sys-state-hover-state-layer-opacity),
|
|
137
|
+
var(--md-sys-color-primary-container)
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.autocomplete__option--disabled {
|
|
142
|
+
opacity: 0.4;
|
|
143
|
+
cursor: not-allowed;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* ---------- No-match empty-state (inline; → xm-empty-state in Epic 4) ---------- */
|
|
147
|
+
.autocomplete__empty {
|
|
148
|
+
display: flex;
|
|
149
|
+
flex-direction: column;
|
|
150
|
+
align-items: center;
|
|
151
|
+
text-align: center;
|
|
152
|
+
gap: var(--s-1);
|
|
153
|
+
padding: var(--s-5) var(--s-4);
|
|
154
|
+
min-width: 220px;
|
|
155
|
+
}
|
|
156
|
+
.autocomplete__empty-icon {
|
|
157
|
+
display: inline-flex;
|
|
158
|
+
align-items: center;
|
|
159
|
+
justify-content: center;
|
|
160
|
+
margin-bottom: var(--s-1);
|
|
161
|
+
color: var(--xm-color-inverse-on-surface-muted);
|
|
162
|
+
}
|
|
163
|
+
.autocomplete__empty-title {
|
|
164
|
+
margin: 0;
|
|
165
|
+
color: var(--md-sys-color-inverse-on-surface);
|
|
166
|
+
font:
|
|
167
|
+
var(--md-sys-typescale-title-small-weight)
|
|
168
|
+
var(--md-sys-typescale-title-small-size) /
|
|
169
|
+
var(--md-sys-typescale-title-small-line-height)
|
|
170
|
+
var(--md-sys-typescale-title-small-font);
|
|
171
|
+
}
|
|
172
|
+
.autocomplete__empty-copy {
|
|
173
|
+
margin: 0;
|
|
174
|
+
color: var(--xm-color-inverse-on-surface-muted);
|
|
175
|
+
font:
|
|
176
|
+
var(--md-sys-typescale-body-small-weight)
|
|
177
|
+
var(--md-sys-typescale-body-small-size) /
|
|
178
|
+
var(--md-sys-typescale-body-small-line-height)
|
|
179
|
+
var(--md-sys-typescale-body-small-font);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
}`);
|
|
183
|
+
sheets = [sheet];
|
|
184
|
+
}
|
|
185
|
+
export default sheets;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import type { TemplateResult } from "lit";
|
|
3
3
|
type AvatarSize = "xs" | "sm" | "md" | "lg";
|
|
4
|
-
declare class XmAvatar extends LitElement {
|
|
4
|
+
export declare class XmAvatar extends LitElement {
|
|
5
|
+
static styles: CSSStyleSheet[];
|
|
5
6
|
title: string;
|
|
6
7
|
name: string;
|
|
7
8
|
initials: string;
|
|
@@ -27,7 +27,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
27
27
|
};
|
|
28
28
|
import { LitElement, html, nothing } from "lit";
|
|
29
29
|
import { customElement, property } from "lit/decorators.js";
|
|
30
|
-
|
|
30
|
+
import avatarSheets from "./index.styles.js";
|
|
31
31
|
const deriveInitials = (name) => {
|
|
32
32
|
const parts = name.trim().split(/\s+/).filter(Boolean);
|
|
33
33
|
if (parts.length === 0)
|
|
@@ -47,6 +47,9 @@ let XmAvatar = class XmAvatar extends LitElement {
|
|
|
47
47
|
this.src = "";
|
|
48
48
|
this.size = "md";
|
|
49
49
|
}
|
|
50
|
+
// Adopted from the build-generated sheets (scripts/gen-styles.mjs) — no
|
|
51
|
+
// runtime URL fetch (ADR 0012). Cascade order preserved from the old <link>s.
|
|
52
|
+
static { this.styles = [...avatarSheets]; }
|
|
50
53
|
get _initials() {
|
|
51
54
|
return (this.initials || deriveInitials(this.name)).toUpperCase();
|
|
52
55
|
}
|
|
@@ -75,7 +78,6 @@ let XmAvatar = class XmAvatar extends LitElement {
|
|
|
75
78
|
`;
|
|
76
79
|
}
|
|
77
80
|
return html `
|
|
78
|
-
<link rel="stylesheet" href="${AVATAR_CSS}" />
|
|
79
81
|
<style>
|
|
80
82
|
:host {
|
|
81
83
|
display: inline-flex;
|
|
@@ -110,3 +112,4 @@ __decorate([
|
|
|
110
112
|
XmAvatar = __decorate([
|
|
111
113
|
customElement("xm-avatar")
|
|
112
114
|
], XmAvatar);
|
|
115
|
+
export { XmAvatar };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// GENERATED by scripts/gen-styles.mjs — do not edit. Source: lit/components/avatar/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
|
+
Avatar — circular identity token.
|
|
12
|
+
|
|
13
|
+
<xm-avatar> renders a circular identity chip: initials first,
|
|
14
|
+
then a Lucide-style person line-icon fallback, with an optional
|
|
15
|
+
image. No imagery is ever required (UX-DR8). The chip is an
|
|
16
|
+
opaque raise of the desk — it sits on a surface-container-* tier
|
|
17
|
+
(NOT a third surface family) with ink --md-sys-color-on-surface
|
|
18
|
+
matched to that backplate (AD-13). No gradient, no status hue.
|
|
19
|
+
|
|
20
|
+
Sizes share the canonical xs|sm|md|lg axis so an avatar lines up
|
|
21
|
+
with a same-size button / list row (AD-9).
|
|
22
|
+
============================================ */
|
|
23
|
+
|
|
24
|
+
.avatar {
|
|
25
|
+
--avatar-size: 32px;
|
|
26
|
+
--avatar-font: var(--md-sys-typescale-label-large-size);
|
|
27
|
+
|
|
28
|
+
position: relative;
|
|
29
|
+
display: inline-flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
width: var(--avatar-size);
|
|
34
|
+
height: var(--avatar-size);
|
|
35
|
+
flex-shrink: 0;
|
|
36
|
+
border-radius: var(--md-sys-shape-corner-full);
|
|
37
|
+
border: 1px solid var(--md-sys-color-outline-variant);
|
|
38
|
+
background: var(--md-sys-color-surface-container-high);
|
|
39
|
+
color: var(--md-sys-color-on-surface);
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
user-select: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.avatar__initials {
|
|
45
|
+
font-family: var(--md-sys-typescale-label-large-font);
|
|
46
|
+
font-size: var(--avatar-font);
|
|
47
|
+
font-weight: 600;
|
|
48
|
+
line-height: 1;
|
|
49
|
+
letter-spacing: 0;
|
|
50
|
+
text-transform: uppercase;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.avatar__icon {
|
|
54
|
+
display: inline-flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.avatar__img {
|
|
61
|
+
width: 100%;
|
|
62
|
+
height: 100%;
|
|
63
|
+
object-fit: cover;
|
|
64
|
+
display: block;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* ---------- Sizes — one diameter per shared size axis ---------- */
|
|
68
|
+
.avatar--xs { --avatar-size: 22px; --avatar-font: var(--md-sys-typescale-label-small-size); }
|
|
69
|
+
.avatar--sm { --avatar-size: 28px; --avatar-font: var(--md-sys-typescale-label-medium-size); }
|
|
70
|
+
.avatar--md { --avatar-size: 32px; --avatar-font: var(--md-sys-typescale-label-large-size); }
|
|
71
|
+
.avatar--lg { --avatar-size: 40px; --avatar-font: var(--md-sys-typescale-title-small-size); }
|
|
72
|
+
|
|
73
|
+
}`);
|
|
74
|
+
sheets = [sheet];
|
|
75
|
+
}
|
|
76
|
+
export default sheets;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import type { TemplateResult } from "lit";
|
|
3
3
|
type AvatarSize = "xs" | "sm" | "md" | "lg";
|
|
4
|
-
declare class XmAvatarGroup extends LitElement {
|
|
4
|
+
export declare class XmAvatarGroup extends LitElement {
|
|
5
|
+
static styles: CSSStyleSheet[];
|
|
5
6
|
max: number;
|
|
6
7
|
size: AvatarSize;
|
|
7
8
|
private _overflow;
|
|
@@ -30,7 +30,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
30
30
|
};
|
|
31
31
|
import { LitElement, html, nothing } from "lit";
|
|
32
32
|
import { customElement, property, state } from "lit/decorators.js";
|
|
33
|
-
|
|
33
|
+
import avatarGroupSheets from "./index.styles.js";
|
|
34
34
|
let XmAvatarGroup = class XmAvatarGroup extends LitElement {
|
|
35
35
|
constructor() {
|
|
36
36
|
super(...arguments);
|
|
@@ -41,6 +41,9 @@ let XmAvatarGroup = class XmAvatarGroup extends LitElement {
|
|
|
41
41
|
this._applyChildren();
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
+
// Adopted from the build-generated sheets (scripts/gen-styles.mjs) — no
|
|
45
|
+
// runtime URL fetch (ADR 0012). Cascade order preserved from the old <link>s.
|
|
46
|
+
static { this.styles = [...avatarGroupSheets]; }
|
|
44
47
|
updated() {
|
|
45
48
|
this._applyChildren();
|
|
46
49
|
}
|
|
@@ -60,7 +63,6 @@ let XmAvatarGroup = class XmAvatarGroup extends LitElement {
|
|
|
60
63
|
render() {
|
|
61
64
|
const cls = `avatar-group avatar-group--${this.size}`;
|
|
62
65
|
return html `
|
|
63
|
-
<link rel="stylesheet" href="${GROUP_CSS}" />
|
|
64
66
|
<style>
|
|
65
67
|
:host {
|
|
66
68
|
display: inline-flex;
|
|
@@ -95,3 +97,4 @@ __decorate([
|
|
|
95
97
|
XmAvatarGroup = __decorate([
|
|
96
98
|
customElement("xm-avatar-group")
|
|
97
99
|
], XmAvatarGroup);
|
|
100
|
+
export { XmAvatarGroup };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// GENERATED by scripts/gen-styles.mjs — do not edit. Source: lit/components/avatar-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
|
+
Avatar group — overlapped stack with +N overflow.
|
|
12
|
+
|
|
13
|
+
<xm-avatar-group> lays slotted <xm-avatar> children in an
|
|
14
|
+
overlapped row (consistent negative offset) and, past \`max\`,
|
|
15
|
+
renders a neutral "+N" overflow token in the same circular
|
|
16
|
+
avatar shape. The overflow ink is the plain on-surface neutral
|
|
17
|
+
— never coral, never a status hue (AD-11). Each avatar keeps a
|
|
18
|
+
thin ring so the stack reads as discrete chips, not a blob.
|
|
19
|
+
============================================ */
|
|
20
|
+
|
|
21
|
+
.avatar-group {
|
|
22
|
+
--avatar-group-overlap: 8px;
|
|
23
|
+
--avatar-group-size: 32px;
|
|
24
|
+
--avatar-group-font: var(--md-sys-typescale-label-large-size);
|
|
25
|
+
|
|
26
|
+
display: inline-flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* The ring + overlap on each stacked avatar. ::slotted reaches the
|
|
31
|
+
light-DOM <xm-avatar> children; the ring uses the host surface so
|
|
32
|
+
the chips separate cleanly on whatever desk tier they sit on. */
|
|
33
|
+
.avatar-group ::slotted(xm-avatar) {
|
|
34
|
+
margin-left: calc(var(--avatar-group-overlap) * -1);
|
|
35
|
+
border-radius: var(--md-sys-shape-corner-full);
|
|
36
|
+
box-shadow: 0 0 0 2px var(--md-sys-color-surface);
|
|
37
|
+
}
|
|
38
|
+
.avatar-group ::slotted(xm-avatar:first-child) {
|
|
39
|
+
margin-left: 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* +N overflow token — same circle, neutral surface ink. */
|
|
43
|
+
.avatar-group__overflow {
|
|
44
|
+
display: inline-flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
box-sizing: border-box;
|
|
48
|
+
width: var(--avatar-group-size);
|
|
49
|
+
height: var(--avatar-group-size);
|
|
50
|
+
margin-left: calc(var(--avatar-group-overlap) * -1);
|
|
51
|
+
flex-shrink: 0;
|
|
52
|
+
border-radius: var(--md-sys-shape-corner-full);
|
|
53
|
+
border: 1px solid var(--md-sys-color-outline-variant);
|
|
54
|
+
box-shadow: 0 0 0 2px var(--md-sys-color-surface);
|
|
55
|
+
background: var(--md-sys-color-surface-container-highest);
|
|
56
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
57
|
+
font-family: var(--md-sys-typescale-label-large-font);
|
|
58
|
+
font-size: var(--avatar-group-font);
|
|
59
|
+
font-weight: 600;
|
|
60
|
+
line-height: 1;
|
|
61
|
+
letter-spacing: 0;
|
|
62
|
+
white-space: nowrap;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* ---------- Sizes — match xm-avatar diameters + scale overlap ---------- */
|
|
66
|
+
.avatar-group--xs { --avatar-group-size: 22px; --avatar-group-font: var(--md-sys-typescale-label-small-size); --avatar-group-overlap: 6px; }
|
|
67
|
+
.avatar-group--sm { --avatar-group-size: 28px; --avatar-group-font: var(--md-sys-typescale-label-medium-size); --avatar-group-overlap: 7px; }
|
|
68
|
+
.avatar-group--md { --avatar-group-size: 32px; --avatar-group-font: var(--md-sys-typescale-label-large-size); --avatar-group-overlap: 8px; }
|
|
69
|
+
.avatar-group--lg { --avatar-group-size: 40px; --avatar-group-font: var(--md-sys-typescale-title-small-size); --avatar-group-overlap: 10px; }
|
|
70
|
+
|
|
71
|
+
}`);
|
|
72
|
+
sheets = [sheet];
|
|
73
|
+
}
|
|
74
|
+
export default sheets;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import type { TemplateResult } from "lit";
|
|
3
|
-
declare class XmBadge extends LitElement {
|
|
3
|
+
export declare class XmBadge extends LitElement {
|
|
4
|
+
static styles: CSSStyleSheet[];
|
|
4
5
|
count: number | null;
|
|
5
6
|
dot: boolean;
|
|
6
7
|
max: number;
|
|
@@ -15,4 +16,3 @@ declare global {
|
|
|
15
16
|
"xm-badge": XmBadge;
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
|
-
export {};
|
|
@@ -37,7 +37,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
37
37
|
};
|
|
38
38
|
import { LitElement, html, nothing } from "lit";
|
|
39
39
|
import { customElement, property } from "lit/decorators.js";
|
|
40
|
-
|
|
40
|
+
import badgeSheets from "./index.styles.js";
|
|
41
41
|
let XmBadge = class XmBadge extends LitElement {
|
|
42
42
|
constructor() {
|
|
43
43
|
super(...arguments);
|
|
@@ -46,6 +46,9 @@ let XmBadge = class XmBadge extends LitElement {
|
|
|
46
46
|
this.max = 99;
|
|
47
47
|
this.label = "";
|
|
48
48
|
}
|
|
49
|
+
// Adopted from the build-generated sheets (scripts/gen-styles.mjs) — no
|
|
50
|
+
// runtime URL fetch (ADR 0012). Cascade order preserved from the old <link>s.
|
|
51
|
+
static { this.styles = [...badgeSheets]; }
|
|
49
52
|
get _hasCount() {
|
|
50
53
|
return typeof this.count === "number" && this.count > 0;
|
|
51
54
|
}
|
|
@@ -82,7 +85,6 @@ let XmBadge = class XmBadge extends LitElement {
|
|
|
82
85
|
>`
|
|
83
86
|
: nothing;
|
|
84
87
|
return html `
|
|
85
|
-
<link rel="stylesheet" href="${BADGE_CSS}" />
|
|
86
88
|
<style>
|
|
87
89
|
:host {
|
|
88
90
|
display: inline-flex;
|
|
@@ -113,3 +115,4 @@ __decorate([
|
|
|
113
115
|
XmBadge = __decorate([
|
|
114
116
|
customElement("xm-badge")
|
|
115
117
|
], XmBadge);
|
|
118
|
+
export { XmBadge };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// GENERATED by scripts/gen-styles.mjs — do not edit. Source: lit/components/badge/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
|
+
Badge — small count / dot anchored to a child.
|
|
12
|
+
|
|
13
|
+
<xm-badge> floats a coral count or a minimal dot at the
|
|
14
|
+
top-right corner of whatever it wraps (an icon button, an
|
|
15
|
+
avatar, a label). The coral fill (--md-sys-color-primary /
|
|
16
|
+
--md-sys-color-on-primary) means "count / attention" — the
|
|
17
|
+
same functional coral as a selected pill or the active-tab
|
|
18
|
+
indicator. It is NEVER a severity palette and never references
|
|
19
|
+
--md-sys-color-error*. Severity is communicated by icon + copy
|
|
20
|
+
elsewhere, never by this badge's hue.
|
|
21
|
+
|
|
22
|
+
The badge paints its own coral surface, so it pairs primary
|
|
23
|
+
with on-primary independent of the host's surface family
|
|
24
|
+
(AD-13) — it stays legible floating over any surface.
|
|
25
|
+
============================================ */
|
|
26
|
+
|
|
27
|
+
.badge {
|
|
28
|
+
position: relative;
|
|
29
|
+
display: inline-flex;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* The wrapper the badged child projects into. Establishes the
|
|
33
|
+
positioning context for the absolutely-placed count/dot. */
|
|
34
|
+
.badge__anchor {
|
|
35
|
+
display: inline-flex;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* Shared corner-floated chip — both count and dot inherit this. */
|
|
39
|
+
.badge__count {
|
|
40
|
+
position: absolute;
|
|
41
|
+
top: 0;
|
|
42
|
+
right: 0;
|
|
43
|
+
transform: translate(35%, -35%);
|
|
44
|
+
z-index: 1;
|
|
45
|
+
display: inline-flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
box-sizing: border-box;
|
|
49
|
+
min-width: 18px;
|
|
50
|
+
height: 18px;
|
|
51
|
+
padding: 0 var(--s-1);
|
|
52
|
+
border-radius: var(--md-sys-shape-corner-full);
|
|
53
|
+
/* Hairline halo so the chip separates from a same-hued host
|
|
54
|
+
(e.g. a coral primary button) without a hard border. */
|
|
55
|
+
border: 1px solid var(--md-sys-color-surface);
|
|
56
|
+
background: var(--xm-color-primary-fill);
|
|
57
|
+
color: var(--md-sys-color-on-primary);
|
|
58
|
+
font-family: var(--md-sys-typescale-label-small-font);
|
|
59
|
+
font-size: var(--md-sys-typescale-label-small-size);
|
|
60
|
+
font-weight: var(--md-sys-typescale-label-small-weight);
|
|
61
|
+
line-height: 1;
|
|
62
|
+
letter-spacing: var(--md-sys-typescale-label-small-tracking);
|
|
63
|
+
white-space: nowrap;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* Dot — no count, just a presence marker. Collapses to a small
|
|
67
|
+
circle in the same corner. */
|
|
68
|
+
.badge--dot .badge__count {
|
|
69
|
+
min-width: 0;
|
|
70
|
+
width: 10px;
|
|
71
|
+
height: 10px;
|
|
72
|
+
padding: 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* Standalone badge (no anchored child) — drops the absolute
|
|
76
|
+
positioning so the chip flows inline beside text. */
|
|
77
|
+
.badge--standalone .badge__count {
|
|
78
|
+
position: static;
|
|
79
|
+
transform: none;
|
|
80
|
+
border: none;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
}`);
|
|
84
|
+
sheets = [sheet];
|
|
85
|
+
}
|
|
86
|
+
export default sheets;
|
|
@@ -4,10 +4,10 @@ type BrandSize = "sm" | "md" | "lg";
|
|
|
4
4
|
declare class LightElement extends LitElement {
|
|
5
5
|
createRenderRoot(): HTMLElement | DocumentFragment;
|
|
6
6
|
}
|
|
7
|
-
declare class XmBrandGlyph extends LightElement {
|
|
7
|
+
export declare class XmBrandGlyph extends LightElement {
|
|
8
8
|
render(): TemplateResult;
|
|
9
9
|
}
|
|
10
|
-
declare class XmBrandMark extends LightElement {
|
|
10
|
+
export declare class XmBrandMark extends LightElement {
|
|
11
11
|
size: BrandSize;
|
|
12
12
|
showGlyph: boolean;
|
|
13
13
|
showWordmark: boolean;
|
|
@@ -23,6 +23,17 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
23
23
|
};
|
|
24
24
|
import { LitElement, html, nothing } from "lit";
|
|
25
25
|
import { customElement, property } from "lit/decorators.js";
|
|
26
|
+
import brandMarkSheets from "./index.styles.js";
|
|
27
|
+
// Light DOM: adopt the build-generated sheets into the document — no runtime
|
|
28
|
+
// URL fetch (ADR 0012). Deduped by sheet identity (the generated modules are
|
|
29
|
+
// singletons); the CSS is wrapped in @layer components (spine AD-2).
|
|
30
|
+
if (typeof document !== "undefined") {
|
|
31
|
+
for (const sheet of [...brandMarkSheets]) {
|
|
32
|
+
if (!document.adoptedStyleSheets.includes(sheet)) {
|
|
33
|
+
document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
26
37
|
const DEFAULT_TAGLINE = "Smart-routing AI chat. The mark is an X-mesh — four nodes routing to a single hub through the letterform itself.";
|
|
27
38
|
class LightElement extends LitElement {
|
|
28
39
|
createRenderRoot() {
|
|
@@ -59,6 +70,7 @@ let XmBrandGlyph = class XmBrandGlyph extends LightElement {
|
|
|
59
70
|
XmBrandGlyph = __decorate([
|
|
60
71
|
customElement("xm-brand-glyph")
|
|
61
72
|
], XmBrandGlyph);
|
|
73
|
+
export { XmBrandGlyph };
|
|
62
74
|
let XmBrandMark = class XmBrandMark extends LightElement {
|
|
63
75
|
constructor() {
|
|
64
76
|
super(...arguments);
|
|
@@ -114,3 +126,4 @@ __decorate([
|
|
|
114
126
|
XmBrandMark = __decorate([
|
|
115
127
|
customElement("xm-brand-mark")
|
|
116
128
|
], XmBrandMark);
|
|
129
|
+
export { XmBrandMark };
|