@xmesh/system-design 0.0.4 → 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 +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 +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
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
// GENERATED by scripts/gen-styles.mjs — do not edit. Source: lit/components/chat/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
|
+
<ChatShell /> — full-viewport interactive chat layout.
|
|
12
|
+
|
|
13
|
+
Three-region grid (sidebar | top / center) that grows a fourth
|
|
14
|
+
region (artifact) when the artifact viewer opens. Owns the
|
|
15
|
+
layout, scroll regions, and composer overlay only — every
|
|
16
|
+
visual element (Bubble, Composer, BrandMark, SidebarItem,
|
|
17
|
+
Artifact) lives in its own components/<name>/index.css.
|
|
18
|
+
|
|
19
|
+
Two BEM blocks live here:
|
|
20
|
+
.chat-shell — the grid + top-bar + thread + composer overlay
|
|
21
|
+
.chat-sidebar — the left column (conversations list, search)
|
|
22
|
+
promoted to its own block so descendant names
|
|
23
|
+
stay readable.
|
|
24
|
+
.chat-empty — alternate empty-state body used in place of
|
|
25
|
+
.chat-shell__thread + chat-shell__composer.
|
|
26
|
+
|
|
27
|
+
Pairs with components/chat/index.jsx.
|
|
28
|
+
============================================================ */
|
|
29
|
+
|
|
30
|
+
/* ============================================================
|
|
31
|
+
Chat shell — three-region grid (sidebar | top / center).
|
|
32
|
+
Full-viewport: fills the window edge-to-edge.
|
|
33
|
+
============================================================ */
|
|
34
|
+
.chat-shell {
|
|
35
|
+
position: relative;
|
|
36
|
+
display: grid;
|
|
37
|
+
grid-template-columns: var(--sidebar-w, 272px) 1fr;
|
|
38
|
+
grid-template-rows: auto 1fr;
|
|
39
|
+
grid-template-areas:
|
|
40
|
+
"sidebar top"
|
|
41
|
+
"sidebar center";
|
|
42
|
+
height: 100%;
|
|
43
|
+
width: 100%;
|
|
44
|
+
background: var(--md-sys-color-surface);
|
|
45
|
+
color: var(--md-sys-color-on-surface);
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
transition: grid-template-columns var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-emphasized-decelerate);
|
|
48
|
+
}
|
|
49
|
+
/* Opt-in: pin the shell to the viewport. Used by full-bleed previews
|
|
50
|
+
(chat.html, chat-empty.html). Embedded hosts omit this and size the
|
|
51
|
+
shell via their own container. */
|
|
52
|
+
.chat-shell--full-viewport { height: 100vh; }
|
|
53
|
+
.chat-shell--collapsed { --sidebar-w: 56px; }
|
|
54
|
+
|
|
55
|
+
/* ---------- Lit shadow-boundary fixes ----------
|
|
56
|
+
In the React port these selectors had a single direct-child selector
|
|
57
|
+
in the parent's CSS (\`.chat-shell__composer > .composer-shell\`). In
|
|
58
|
+
the Lit port, <xm-composer> wraps .composer-shell with display:contents,
|
|
59
|
+
so the selector still walks the real DOM and .composer-shell is now a
|
|
60
|
+
*grand*child. The descendant variants below restore the intended sizing
|
|
61
|
+
and re-enable pointer-events on the composer (the overlay sets
|
|
62
|
+
pointer-events:none so it doesn't swallow clicks above the composer —
|
|
63
|
+
without re-enabling on .composer-shell, the textarea is unclickable).
|
|
64
|
+
Same shape for the artifact slot. */
|
|
65
|
+
.chat-shell__composer .composer-shell {
|
|
66
|
+
width: 100%;
|
|
67
|
+
max-width: 720px;
|
|
68
|
+
pointer-events: auto;
|
|
69
|
+
}
|
|
70
|
+
.chat-shell__artifact-slot .artifact { flex: 1; min-height: 0; }
|
|
71
|
+
|
|
72
|
+
/* When the artifact viewer is open, a third column appears on the
|
|
73
|
+
right and spans both rows — pushing top + center to the left.
|
|
74
|
+
Sidebar stays put. */
|
|
75
|
+
.chat-shell--has-artifact {
|
|
76
|
+
grid-template-columns: var(--sidebar-w, 272px) 3fr 2fr;
|
|
77
|
+
grid-template-areas:
|
|
78
|
+
"sidebar top artifact"
|
|
79
|
+
"sidebar center artifact";
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.chat-shell__top { grid-area: top; }
|
|
83
|
+
|
|
84
|
+
.chat-shell__center {
|
|
85
|
+
grid-area: center;
|
|
86
|
+
position: relative;
|
|
87
|
+
min-height: 0;
|
|
88
|
+
overflow: hidden;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.chat-shell__artifact-slot {
|
|
92
|
+
grid-area: artifact;
|
|
93
|
+
min-height: 0;
|
|
94
|
+
display: flex;
|
|
95
|
+
}
|
|
96
|
+
.chat-shell__artifact-slot > .artifact { flex: 1; min-height: 0; }
|
|
97
|
+
|
|
98
|
+
/* ---------- Sidebar block ----------
|
|
99
|
+
Transparent — inherits the chat-shell surface. Only the
|
|
100
|
+
right-edge hairline marks the seam to the thread. */
|
|
101
|
+
.chat-sidebar {
|
|
102
|
+
grid-area: sidebar;
|
|
103
|
+
background: transparent;
|
|
104
|
+
border-right: 1px solid var(--md-sys-color-outline);
|
|
105
|
+
display: flex;
|
|
106
|
+
flex-direction: column;
|
|
107
|
+
min-height: 0;
|
|
108
|
+
overflow: hidden;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.chat-sidebar__top {
|
|
112
|
+
margin: var(--s-3) var(--s-3) var(--s-2);
|
|
113
|
+
}
|
|
114
|
+
/* Pin the right-slot icon to the brand-mark chip's 24px height so both
|
|
115
|
+
children present the same box for the button's \`align-items: center\`,
|
|
116
|
+
keeping the X chip and panel-toggle icon on a single centerline. */
|
|
117
|
+
.chat-sidebar__top [slot="icon-right"] {
|
|
118
|
+
display: inline-flex;
|
|
119
|
+
align-items: center;
|
|
120
|
+
justify-content: center;
|
|
121
|
+
height: 24px;
|
|
122
|
+
}
|
|
123
|
+
.chat-shell--collapsed .chat-sidebar__top {
|
|
124
|
+
margin: var(--s-3) auto var(--s-2);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* New chat — xm-button host. Margin matches the sidebar column gutter. */
|
|
128
|
+
.chat-sidebar__new {
|
|
129
|
+
margin: var(--s-1) var(--s-3) var(--s-2);
|
|
130
|
+
}
|
|
131
|
+
.chat-shell--collapsed .chat-sidebar__new {
|
|
132
|
+
align-self: center;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/* Search */
|
|
136
|
+
.chat-sidebar__search { padding: 0 var(--s-3) var(--s-2); }
|
|
137
|
+
.chat-shell--collapsed .chat-sidebar__search--full { display: none; }
|
|
138
|
+
.chat-sidebar__search--icon-only {
|
|
139
|
+
display: none;
|
|
140
|
+
margin: 0 auto var(--s-2);
|
|
141
|
+
}
|
|
142
|
+
.chat-shell--collapsed .chat-sidebar__search--icon-only { display: inline-flex; }
|
|
143
|
+
|
|
144
|
+
/* Section labels + chat list */
|
|
145
|
+
.chat-sidebar__list {
|
|
146
|
+
flex: 1;
|
|
147
|
+
min-height: 0;
|
|
148
|
+
overflow-y: auto;
|
|
149
|
+
padding: var(--s-1) var(--s-2) var(--s-3-5);
|
|
150
|
+
display: flex;
|
|
151
|
+
flex-direction: column;
|
|
152
|
+
gap: var(--s-0-5);
|
|
153
|
+
}
|
|
154
|
+
.chat-shell--collapsed .chat-sidebar__list { padding: var(--s-2) 0 var(--s-3-5); align-items: center; gap: var(--s-4); }
|
|
155
|
+
.chat-shell--collapsed .sidebar-item--eyebrow { display: none; }
|
|
156
|
+
|
|
157
|
+
.chat-sidebar__divider {
|
|
158
|
+
width: 28px;
|
|
159
|
+
height: 1px;
|
|
160
|
+
background: var(--md-sys-color-outline);
|
|
161
|
+
margin: var(--s-2) auto;
|
|
162
|
+
display: none;
|
|
163
|
+
}
|
|
164
|
+
.chat-shell--collapsed .chat-sidebar__divider { display: block; }
|
|
165
|
+
|
|
166
|
+
/* ---------- Top panel ---------- */
|
|
167
|
+
.chat-shell__top {
|
|
168
|
+
display: flex;
|
|
169
|
+
align-items: center;
|
|
170
|
+
justify-content: space-between;
|
|
171
|
+
gap: var(--s-4);
|
|
172
|
+
padding: var(--s-3) var(--s-5);
|
|
173
|
+
min-height: 56px;
|
|
174
|
+
box-sizing: border-box;
|
|
175
|
+
background: var(--md-sys-color-surface);
|
|
176
|
+
z-index: 2;
|
|
177
|
+
}
|
|
178
|
+
.chat-shell__top-left { display: flex; flex-direction: column; gap: var(--s-0-5); min-width: 0; }
|
|
179
|
+
.chat-shell__top-title {
|
|
180
|
+
font: 600 14.5px/1.2 var(--md-sys-typescale-body-large-font);
|
|
181
|
+
color: var(--md-sys-color-on-surface);
|
|
182
|
+
letter-spacing: -0.005em;
|
|
183
|
+
white-space: nowrap;
|
|
184
|
+
overflow: hidden;
|
|
185
|
+
text-overflow: ellipsis;
|
|
186
|
+
}
|
|
187
|
+
.chat-shell__top-sub {
|
|
188
|
+
font: 400 11px/1 var(--xm-typescale-mono-font);
|
|
189
|
+
color: var(--xm-color-on-surface-soft);
|
|
190
|
+
font-feature-settings: "tnum";
|
|
191
|
+
display: inline-flex;
|
|
192
|
+
align-items: center;
|
|
193
|
+
gap: var(--s-1-5);
|
|
194
|
+
flex-wrap: nowrap;
|
|
195
|
+
white-space: nowrap;
|
|
196
|
+
}
|
|
197
|
+
.chat-shell__top-sub > span { white-space: nowrap; }
|
|
198
|
+
.chat-shell__top-right { display: inline-flex; align-items: center; gap: var(--s-1-5); }
|
|
199
|
+
|
|
200
|
+
/* ---------- Center panel — scrollable thread ---------- */
|
|
201
|
+
.chat-shell__thread {
|
|
202
|
+
position: absolute;
|
|
203
|
+
inset: 0;
|
|
204
|
+
overflow-y: auto;
|
|
205
|
+
scrollbar-gutter: stable both-edges;
|
|
206
|
+
padding: var(--s-6) var(--s-5) 132px; /* bottom padding clears the composer */
|
|
207
|
+
display: flex;
|
|
208
|
+
flex-direction: column;
|
|
209
|
+
align-items: center;
|
|
210
|
+
}
|
|
211
|
+
.chat-shell__thread-inner {
|
|
212
|
+
width: 100%;
|
|
213
|
+
max-width: 720px;
|
|
214
|
+
display: flex;
|
|
215
|
+
flex-direction: column;
|
|
216
|
+
/* Base gap is the tight, same-speaker rhythm; a speaker change adds
|
|
217
|
+
extra margin below so turns read as grouped utterances, not a flat
|
|
218
|
+
evenly-spaced list. */
|
|
219
|
+
gap: var(--s-2-5);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/* Bubble row alignment is page layout — the Bubble component owns
|
|
223
|
+
the visuals of each turn. */
|
|
224
|
+
.chat-shell__row { display: flex; }
|
|
225
|
+
.chat-shell__row--user { justify-content: flex-end; }
|
|
226
|
+
.chat-shell__row--bot { justify-content: flex-start; }
|
|
227
|
+
|
|
228
|
+
/* Speaker-change rhythm: when the author flips, open up the gap. */
|
|
229
|
+
.chat-shell__row--user + .chat-shell__row--bot,
|
|
230
|
+
.chat-shell__row--bot + .chat-shell__row--user {
|
|
231
|
+
margin-top: var(--s-3);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/* ---------- Empty state — centered serif greeting + composer ----------
|
|
235
|
+
Used by the chat-empty variant (passed in via the \`empty\` prop).
|
|
236
|
+
The shell renders a .chat-empty block in place of .chat-shell__thread +
|
|
237
|
+
.chat-shell__composer; the caller owns its own composer and any
|
|
238
|
+
suggestion chips. */
|
|
239
|
+
.chat-empty {
|
|
240
|
+
position: absolute;
|
|
241
|
+
inset: 0;
|
|
242
|
+
display: flex;
|
|
243
|
+
flex-direction: column;
|
|
244
|
+
align-items: center;
|
|
245
|
+
justify-content: center;
|
|
246
|
+
gap: var(--s-6);
|
|
247
|
+
padding: var(--s-6) var(--s-5) var(--s-10);
|
|
248
|
+
}
|
|
249
|
+
.chat-empty__hero {
|
|
250
|
+
width: 100%;
|
|
251
|
+
max-width: 720px;
|
|
252
|
+
display: flex;
|
|
253
|
+
flex-direction: column;
|
|
254
|
+
align-items: center;
|
|
255
|
+
gap: var(--s-1-5);
|
|
256
|
+
text-align: center;
|
|
257
|
+
}
|
|
258
|
+
.chat-empty__title {
|
|
259
|
+
font:
|
|
260
|
+
var(--md-sys-typescale-headline-medium-weight)
|
|
261
|
+
var(--md-sys-typescale-headline-medium-size) /
|
|
262
|
+
var(--md-sys-typescale-headline-medium-line-height)
|
|
263
|
+
var(--md-sys-typescale-headline-medium-font);
|
|
264
|
+
color: var(--md-sys-color-on-surface);
|
|
265
|
+
letter-spacing: -0.01em;
|
|
266
|
+
margin: 0;
|
|
267
|
+
}
|
|
268
|
+
.chat-empty__sub {
|
|
269
|
+
font:
|
|
270
|
+
var(--md-sys-typescale-body-large-weight)
|
|
271
|
+
var(--md-sys-typescale-body-large-size) /
|
|
272
|
+
var(--md-sys-typescale-body-large-line-height)
|
|
273
|
+
var(--md-sys-typescale-body-large-font);
|
|
274
|
+
color: var(--xm-color-on-surface-soft);
|
|
275
|
+
margin: 0;
|
|
276
|
+
}
|
|
277
|
+
.chat-empty__composer {
|
|
278
|
+
width: 100%;
|
|
279
|
+
max-width: 720px;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/* ---------- Bottom panel — composer overlay ----------
|
|
283
|
+
Transparent — the thread already pads its bottom by 132px so
|
|
284
|
+
bubbles never sit underneath the composer card. */
|
|
285
|
+
.chat-shell__composer {
|
|
286
|
+
position: absolute;
|
|
287
|
+
left: 0;
|
|
288
|
+
right: 0;
|
|
289
|
+
bottom: 0;
|
|
290
|
+
display: flex;
|
|
291
|
+
justify-content: center;
|
|
292
|
+
padding: var(--s-2) var(--s-5) 0;
|
|
293
|
+
pointer-events: none;
|
|
294
|
+
z-index: 2;
|
|
295
|
+
}
|
|
296
|
+
.chat-shell__composer > .composer-shell {
|
|
297
|
+
pointer-events: auto;
|
|
298
|
+
width: 100%;
|
|
299
|
+
max-width: 720px;
|
|
300
|
+
padding-bottom: var(--s-5);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
}`);
|
|
304
|
+
sheets = [sheet];
|
|
305
|
+
}
|
|
306
|
+
export default sheets;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { TemplateResult } from "lit";
|
|
2
2
|
import { XmField } from "../field/index.js";
|
|
3
3
|
export declare class XmCheckbox extends XmField {
|
|
4
|
+
static styles: CSSStyleSheet[];
|
|
4
5
|
/** Indeterminate (mixed) state — shows the dash mark on the coral fill and
|
|
5
6
|
reports aria-checked="mixed". Cleared on the first user toggle. */
|
|
6
7
|
indeterminate: boolean;
|
|
@@ -35,8 +35,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
35
35
|
import { html, nothing } from "lit";
|
|
36
36
|
import { customElement, property } from "lit/decorators.js";
|
|
37
37
|
import { XmField } from "../field/index.js";
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
import primitivesSheets from "../primitives/index.styles.js";
|
|
39
|
+
import fieldSheets from "../field/index.styles.js";
|
|
40
|
+
import checkboxSheets from "./index.styles.js";
|
|
40
41
|
let XmCheckbox = class XmCheckbox extends XmField {
|
|
41
42
|
constructor() {
|
|
42
43
|
super(...arguments);
|
|
@@ -57,6 +58,10 @@ let XmCheckbox = class XmCheckbox extends XmField {
|
|
|
57
58
|
}
|
|
58
59
|
};
|
|
59
60
|
}
|
|
61
|
+
// Adopted from build-generated sheets (gen-styles.mjs) — no runtime URL
|
|
62
|
+
// fetch (ADR 0012). Lit static styles don't merge on override, so subclasses
|
|
63
|
+
// re-include the chrome (primitives + field) sheets.
|
|
64
|
+
static { this.styles = [...primitivesSheets, ...fieldSheets, ...checkboxSheets]; }
|
|
60
65
|
/** A checkbox submits checked-state ("on"/null), not text — declare it a
|
|
61
66
|
toggle so the form value is correct from first paint, before any user
|
|
62
67
|
interaction (the base seeds `_checked` from the `checked` attribute and
|
|
@@ -78,8 +83,6 @@ let XmCheckbox = class XmCheckbox extends XmField {
|
|
|
78
83
|
const helperText = this.isError ? this.error : this.helper;
|
|
79
84
|
const ctrl = this.controlAria;
|
|
80
85
|
return html `
|
|
81
|
-
<link rel="stylesheet" href="${PRIMITIVES_CSS}" />
|
|
82
|
-
<link rel="stylesheet" href="${CHECKBOX_CSS}" />
|
|
83
86
|
<style>
|
|
84
87
|
:host {
|
|
85
88
|
display: inline-block;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// GENERATED by scripts/gen-styles.mjs — do not edit. Source: lit/components/checkbox/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-checkbox — toggle field built on XmField.
|
|
12
|
+
|
|
13
|
+
A compact, inline toggle: the box sits BESIDE the label (toggle layout),
|
|
14
|
+
not above it like the bordered text-field chrome. State machinery
|
|
15
|
+
(disabled / focus / form-association / change event) is inherited from
|
|
16
|
+
XmField; this file only styles the box, the mark, and the label row.
|
|
17
|
+
|
|
18
|
+
Surface & ink: the checkbox rides the card tier shared by every XmField
|
|
19
|
+
sibling — ink is --md-sys-color-inverse-on-surface, the box hairline is
|
|
20
|
+
--md-sys-color-outline-variant. Selected (checked OR indeterminate) fills
|
|
21
|
+
the box with the single coral accent (--md-sys-color-primary) and paints
|
|
22
|
+
the mark in --md-sys-color-on-primary. Coral signals selection only —
|
|
23
|
+
never severity (AD-11 / rule 3a). The error string in the message row
|
|
24
|
+
carries severity via copy, not color.
|
|
25
|
+
|
|
26
|
+
BEM block: \`checkbox\`. Registered in scripts/check-bem.sh STRICT_BLOCKS.
|
|
27
|
+
============================================ */
|
|
28
|
+
|
|
29
|
+
.checkbox {
|
|
30
|
+
display: inline-flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
gap: var(--s-1);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* ---------- Control row — box + label, the focusable target ---------- */
|
|
36
|
+
.checkbox__control {
|
|
37
|
+
display: inline-flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
gap: var(--s-2);
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
user-select: none;
|
|
42
|
+
border-radius: var(--md-sys-shape-corner-extra-small);
|
|
43
|
+
outline: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* ---------- Box — the 18px square that holds the mark ---------- */
|
|
47
|
+
.checkbox__box {
|
|
48
|
+
position: relative;
|
|
49
|
+
display: inline-flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
justify-content: center;
|
|
52
|
+
width: 18px;
|
|
53
|
+
height: 18px;
|
|
54
|
+
flex-shrink: 0;
|
|
55
|
+
box-sizing: border-box;
|
|
56
|
+
border: 1px solid var(--md-sys-color-outline-variant);
|
|
57
|
+
border-radius: var(--md-sys-shape-corner-extra-small);
|
|
58
|
+
background: transparent;
|
|
59
|
+
color: var(--md-sys-color-on-primary);
|
|
60
|
+
transition:
|
|
61
|
+
background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
|
|
62
|
+
border-color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
|
|
63
|
+
box-shadow var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.checkbox__control:hover .checkbox__box {
|
|
67
|
+
border-color: var(--md-sys-color-outline);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* Focus ring — the canonical 3px coral halo, never a hard-coded width. */
|
|
71
|
+
.checkbox__control:focus-visible .checkbox__box {
|
|
72
|
+
border-color: var(--md-sys-color-primary);
|
|
73
|
+
box-shadow: var(--xm-state-focus-ring);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* ---------- Mark — primitives check / indeterminate icon ---------- */
|
|
77
|
+
.checkbox__mark {
|
|
78
|
+
display: inline-flex;
|
|
79
|
+
color: var(--md-sys-color-on-primary);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* ---------- Label ---------- */
|
|
83
|
+
.checkbox__label {
|
|
84
|
+
color: var(--md-sys-color-inverse-on-surface);
|
|
85
|
+
font:
|
|
86
|
+
var(--md-sys-typescale-body-medium-weight)
|
|
87
|
+
var(--md-sys-typescale-body-medium-size) /
|
|
88
|
+
var(--md-sys-typescale-body-medium-line-height)
|
|
89
|
+
var(--md-sys-typescale-body-medium-font);
|
|
90
|
+
letter-spacing: 0;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* ---------- Selected — checked OR indeterminate ---------- */
|
|
94
|
+
.checkbox--selected .checkbox__box {
|
|
95
|
+
background: var(--md-sys-color-primary);
|
|
96
|
+
border-color: var(--md-sys-color-primary);
|
|
97
|
+
}
|
|
98
|
+
.checkbox--selected .checkbox__control:hover .checkbox__box {
|
|
99
|
+
border-color: var(--md-sys-color-primary);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* ---------- Disabled — shared reduced emphasis; hover reverted ---------- */
|
|
103
|
+
.checkbox--disabled .checkbox__control {
|
|
104
|
+
cursor: not-allowed;
|
|
105
|
+
}
|
|
106
|
+
.checkbox--disabled .checkbox__box {
|
|
107
|
+
opacity: 0.45;
|
|
108
|
+
box-shadow: none;
|
|
109
|
+
}
|
|
110
|
+
.checkbox--disabled .checkbox__label {
|
|
111
|
+
color: var(--xm-color-inverse-on-surface-disabled);
|
|
112
|
+
}
|
|
113
|
+
.checkbox--disabled .checkbox__control:hover .checkbox__box {
|
|
114
|
+
border-color: var(--md-sys-color-outline-variant);
|
|
115
|
+
}
|
|
116
|
+
.checkbox--disabled.checkbox--selected .checkbox__control:hover .checkbox__box {
|
|
117
|
+
border-color: var(--md-sys-color-primary);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* ---------- Helper / error message row ----------
|
|
121
|
+
Severity is copy, not color — the error keeps the helper ink (rule 3a). */
|
|
122
|
+
.checkbox__message {
|
|
123
|
+
padding-left: calc(var(--s-4-5) + var(--s-2));
|
|
124
|
+
font:
|
|
125
|
+
var(--md-sys-typescale-body-small-weight)
|
|
126
|
+
var(--md-sys-typescale-body-small-size) /
|
|
127
|
+
var(--md-sys-typescale-body-small-line-height)
|
|
128
|
+
var(--md-sys-typescale-body-small-font);
|
|
129
|
+
}
|
|
130
|
+
.checkbox__message--helper {
|
|
131
|
+
color: var(--xm-color-inverse-on-surface-muted);
|
|
132
|
+
}
|
|
133
|
+
.checkbox__message--error {
|
|
134
|
+
color: var(--md-sys-color-inverse-on-surface);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
}`);
|
|
138
|
+
sheets = [sheet];
|
|
139
|
+
}
|
|
140
|
+
export default sheets;
|
|
@@ -2,7 +2,12 @@ import { LitElement } from "lit";
|
|
|
2
2
|
import type { TemplateResult } from "lit";
|
|
3
3
|
type ChipSize = "xs" | "sm" | "md" | "lg";
|
|
4
4
|
type ChipCategory = "get" | "post" | "put" | "delete" | "patch" | "yml" | "json" | "";
|
|
5
|
+
/**
|
|
6
|
+
* @fires xm-chip-activate - Fired when the chip is activated.
|
|
7
|
+
* @fires xm-chip-remove - Fired when the chip's remove affordance is activated.
|
|
8
|
+
*/
|
|
5
9
|
export declare class XmChip extends LitElement {
|
|
10
|
+
static styles: CSSStyleSheet[];
|
|
6
11
|
value: string;
|
|
7
12
|
size: ChipSize;
|
|
8
13
|
selected: boolean;
|
|
@@ -42,7 +42,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
42
42
|
};
|
|
43
43
|
import { LitElement, html, nothing } from "lit";
|
|
44
44
|
import { customElement, property } from "lit/decorators.js";
|
|
45
|
-
|
|
45
|
+
import chipSheets from "./index.styles.js";
|
|
46
|
+
/**
|
|
47
|
+
* @fires xm-chip-activate - Fired when the chip is activated.
|
|
48
|
+
* @fires xm-chip-remove - Fired when the chip's remove affordance is activated.
|
|
49
|
+
*/
|
|
46
50
|
let XmChip = class XmChip extends LitElement {
|
|
47
51
|
constructor() {
|
|
48
52
|
super(...arguments);
|
|
@@ -91,6 +95,9 @@ let XmChip = class XmChip extends LitElement {
|
|
|
91
95
|
}));
|
|
92
96
|
};
|
|
93
97
|
}
|
|
98
|
+
// Adopted from the build-generated sheets (scripts/gen-styles.mjs) — no
|
|
99
|
+
// runtime URL fetch (ADR 0012). Cascade order preserved from the old <link>s.
|
|
100
|
+
static { this.styles = [...chipSheets]; }
|
|
94
101
|
get _labelText() {
|
|
95
102
|
return (this.textContent ?? "").trim();
|
|
96
103
|
}
|
|
@@ -159,7 +166,6 @@ let XmChip = class XmChip extends LitElement {
|
|
|
159
166
|
.filter(Boolean)
|
|
160
167
|
.join(" ");
|
|
161
168
|
return html `
|
|
162
|
-
<link rel="stylesheet" href="${CHIP_CSS}" />
|
|
163
169
|
<style>
|
|
164
170
|
:host {
|
|
165
171
|
display: inline-flex;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
// GENERATED by scripts/gen-styles.mjs — do not edit. Source: lit/components/chip/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 — compact label pill (tag / filter / category).
|
|
12
|
+
|
|
13
|
+
<xm-chip> is a transparent pill that sits on a surface* host, so
|
|
14
|
+
default ink is --md-sys-color-on-surface (AD-13). Selected flips
|
|
15
|
+
to the coral primary-container fill + on-primary-container ink —
|
|
16
|
+
the selected-pill pattern (UX-DR3), never a status hue (AD-11).
|
|
17
|
+
Removable chips carry a trailing x. A category chip may take a
|
|
18
|
+
saturated background ONLY via the --xm-method-* / --xm-ext-* sets
|
|
19
|
+
(category, never severity); --md-sys-color-error* is forbidden.
|
|
20
|
+
|
|
21
|
+
Sizes share the canonical xs|sm|md|lg axis (AD-9).
|
|
22
|
+
============================================ */
|
|
23
|
+
|
|
24
|
+
.chip {
|
|
25
|
+
--chip-height: 28px;
|
|
26
|
+
--chip-pad-x: var(--s-3);
|
|
27
|
+
--chip-font: var(--md-sys-typescale-label-medium-size);
|
|
28
|
+
--chip-gap: var(--s-1);
|
|
29
|
+
|
|
30
|
+
display: inline-flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
gap: var(--chip-gap);
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
height: var(--chip-height);
|
|
35
|
+
padding: 0 var(--chip-pad-x);
|
|
36
|
+
border: 1px solid var(--md-sys-color-outline-variant);
|
|
37
|
+
border-radius: var(--md-sys-shape-corner-full);
|
|
38
|
+
background: transparent;
|
|
39
|
+
color: var(--md-sys-color-on-surface);
|
|
40
|
+
font-family: var(--md-sys-typescale-label-medium-font);
|
|
41
|
+
font-size: var(--chip-font);
|
|
42
|
+
font-weight: 500;
|
|
43
|
+
line-height: 1;
|
|
44
|
+
letter-spacing: 0;
|
|
45
|
+
white-space: nowrap;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
user-select: none;
|
|
48
|
+
transition:
|
|
49
|
+
background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
|
|
50
|
+
color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
|
|
51
|
+
border-color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
|
|
52
|
+
}
|
|
53
|
+
/* The host element owns focus (role=button + tabindex on <xm-chip>) so the
|
|
54
|
+
3px ring is applied via :host(:focus-visible) .chip in the component's
|
|
55
|
+
inline <style>. The forced-state helper still previews it. */
|
|
56
|
+
.chip.is-focus {
|
|
57
|
+
box-shadow: var(--xm-state-focus-ring);
|
|
58
|
+
}
|
|
59
|
+
.chip:hover,
|
|
60
|
+
.chip.is-hover {
|
|
61
|
+
background: color-mix(in oklab, var(--md-sys-color-on-surface) var(--md-sys-state-hover-state-layer-opacity), transparent);
|
|
62
|
+
border-color: var(--md-sys-color-outline);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* ---------- Selected — coral selected-pill ---------- */
|
|
66
|
+
.chip--selected {
|
|
67
|
+
border-color: color-mix(in oklab, var(--md-sys-color-primary) 60%, transparent);
|
|
68
|
+
background: var(--md-sys-color-primary-container);
|
|
69
|
+
color: var(--md-sys-color-on-primary-container);
|
|
70
|
+
}
|
|
71
|
+
.chip--selected:hover,
|
|
72
|
+
.chip--selected.is-hover {
|
|
73
|
+
background: var(--md-sys-color-primary-container);
|
|
74
|
+
border-color: var(--md-sys-color-primary);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* ---------- Category — saturated ONLY for category (AD-11) ---------- */
|
|
78
|
+
.chip--category-get { background: var(--xm-method-get-bg); color: var(--xm-method-get-ink); border-color: transparent; }
|
|
79
|
+
.chip--category-post { background: var(--xm-method-post-bg); color: var(--xm-method-post-ink); border-color: transparent; }
|
|
80
|
+
.chip--category-put { background: var(--xm-method-put-bg); color: var(--xm-method-put-ink); border-color: transparent; }
|
|
81
|
+
.chip--category-delete { background: var(--xm-method-delete-bg); color: var(--xm-method-delete-ink); border-color: transparent; }
|
|
82
|
+
.chip--category-patch { background: var(--xm-method-patch-bg); color: var(--xm-method-patch-ink); border-color: transparent; }
|
|
83
|
+
.chip--category-yml { background: var(--xm-ext-yml-bg); color: var(--xm-ext-yml-ink); border-color: transparent; }
|
|
84
|
+
.chip--category-json { background: var(--xm-ext-json-bg); color: var(--xm-ext-json-ink); border-color: transparent; }
|
|
85
|
+
/* Category chips don't change hue on hover — the hue IS the meaning. */
|
|
86
|
+
.chip--category-get:hover, .chip--category-get.is-hover,
|
|
87
|
+
.chip--category-post:hover, .chip--category-post.is-hover,
|
|
88
|
+
.chip--category-put:hover, .chip--category-put.is-hover,
|
|
89
|
+
.chip--category-delete:hover, .chip--category-delete.is-hover,
|
|
90
|
+
.chip--category-patch:hover, .chip--category-patch.is-hover,
|
|
91
|
+
.chip--category-yml:hover, .chip--category-yml.is-hover,
|
|
92
|
+
.chip--category-json:hover, .chip--category-json.is-hover {
|
|
93
|
+
filter: none;
|
|
94
|
+
border-color: transparent;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* ---------- Disabled — shared reduced-emphasis ---------- */
|
|
98
|
+
.chip--disabled {
|
|
99
|
+
cursor: not-allowed;
|
|
100
|
+
color: var(--xm-color-on-surface-disabled);
|
|
101
|
+
border-color: var(--md-sys-color-outline-variant);
|
|
102
|
+
}
|
|
103
|
+
.chip--disabled:hover,
|
|
104
|
+
.chip--disabled.is-hover {
|
|
105
|
+
background: transparent;
|
|
106
|
+
border-color: var(--md-sys-color-outline-variant);
|
|
107
|
+
}
|
|
108
|
+
.chip--selected.chip--disabled:hover {
|
|
109
|
+
background: var(--md-sys-color-primary-container);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* ---------- Sizes ---------- */
|
|
113
|
+
.chip--xs { --chip-height: 22px; --chip-pad-x: var(--s-2); --chip-font: var(--md-sys-typescale-label-small-size); --chip-gap: 3px; }
|
|
114
|
+
.chip--sm { --chip-height: 24px; --chip-pad-x: var(--s-2); --chip-font: var(--md-sys-typescale-label-small-size); }
|
|
115
|
+
.chip--md { --chip-height: 28px; --chip-pad-x: var(--s-3); --chip-font: var(--md-sys-typescale-label-medium-size); }
|
|
116
|
+
.chip--lg { --chip-height: 34px; --chip-pad-x: var(--s-4); --chip-font: var(--md-sys-typescale-label-large-size); }
|
|
117
|
+
|
|
118
|
+
/* ---------- Inner elements ---------- */
|
|
119
|
+
.chip__icon {
|
|
120
|
+
display: inline-flex;
|
|
121
|
+
align-items: center;
|
|
122
|
+
flex-shrink: 0;
|
|
123
|
+
}
|
|
124
|
+
.chip__icon.is-empty { display: none; }
|
|
125
|
+
|
|
126
|
+
.chip__label {
|
|
127
|
+
display: inline-block;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.chip__remove {
|
|
131
|
+
appearance: none;
|
|
132
|
+
display: inline-flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
justify-content: center;
|
|
135
|
+
flex-shrink: 0;
|
|
136
|
+
width: 16px;
|
|
137
|
+
height: 16px;
|
|
138
|
+
margin-left: var(--s-0-5);
|
|
139
|
+
margin-right: -2px;
|
|
140
|
+
padding: 0;
|
|
141
|
+
border: none;
|
|
142
|
+
border-radius: var(--md-sys-shape-corner-full);
|
|
143
|
+
background: transparent;
|
|
144
|
+
color: currentColor;
|
|
145
|
+
cursor: pointer;
|
|
146
|
+
transition: background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
|
|
147
|
+
}
|
|
148
|
+
.chip__remove:hover {
|
|
149
|
+
background: color-mix(in oklab, currentColor 18%, transparent);
|
|
150
|
+
}
|
|
151
|
+
.chip__remove:focus-visible {
|
|
152
|
+
outline: none;
|
|
153
|
+
box-shadow: var(--xm-state-focus-ring);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
}`);
|
|
157
|
+
sheets = [sheet];
|
|
158
|
+
}
|
|
159
|
+
export default sheets;
|