@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.
Files changed (293) hide show
  1. package/README.md +2 -1
  2. package/custom-elements.json +18382 -0
  3. package/dist/lit/components/alert/index.d.ts +6 -1
  4. package/dist/lit/components/alert/index.js +9 -2
  5. package/dist/lit/components/alert/index.styles.js +215 -0
  6. package/dist/lit/components/app-bar/index.d.ts +2 -1
  7. package/dist/lit/components/app-bar/index.js +5 -2
  8. package/dist/lit/components/app-bar/index.styles.js +94 -0
  9. package/dist/lit/components/artifact/index.d.ts +6 -1
  10. package/dist/lit/components/artifact/index.js +20 -2
  11. package/dist/lit/components/artifact/index.styles.js +180 -0
  12. package/dist/lit/components/autocomplete/index.d.ts +5 -0
  13. package/dist/lit/components/autocomplete/index.js +11 -2
  14. package/dist/lit/components/autocomplete/index.styles.js +185 -0
  15. package/dist/lit/components/avatar/index.d.ts +2 -1
  16. package/dist/lit/components/avatar/index.js +5 -2
  17. package/dist/lit/components/avatar/index.styles.js +76 -0
  18. package/dist/lit/components/avatar-group/index.d.ts +2 -1
  19. package/dist/lit/components/avatar-group/index.js +5 -2
  20. package/dist/lit/components/avatar-group/index.styles.js +74 -0
  21. package/dist/lit/components/badge/index.d.ts +2 -2
  22. package/dist/lit/components/badge/index.js +5 -2
  23. package/dist/lit/components/badge/index.styles.js +86 -0
  24. package/dist/lit/components/brand-mark/index.d.ts +2 -2
  25. package/dist/lit/components/brand-mark/index.js +13 -0
  26. package/dist/lit/components/brand-mark/index.styles.js +123 -0
  27. package/dist/lit/components/breadcrumbs/index.d.ts +2 -1
  28. package/dist/lit/components/breadcrumbs/index.js +6 -4
  29. package/dist/lit/components/breadcrumbs/index.styles.js +105 -0
  30. package/dist/lit/components/bubble/index.d.ts +8 -4
  31. package/dist/lit/components/bubble/index.js +21 -0
  32. package/dist/lit/components/bubble/index.styles.js +196 -0
  33. package/dist/lit/components/button/index.d.ts +2 -1
  34. package/dist/lit/components/button/index.js +7 -13
  35. package/dist/lit/components/button/index.styles.js +356 -0
  36. package/dist/lit/components/card/index.d.ts +2 -1
  37. package/dist/lit/components/card/index.js +5 -2
  38. package/dist/lit/components/card/index.styles.js +113 -0
  39. package/dist/lit/components/chat/index.d.ts +7 -2
  40. package/dist/lit/components/chat/index.js +21 -2
  41. package/dist/lit/components/chat/index.styles.js +306 -0
  42. package/dist/lit/components/checkbox/index.d.ts +2 -2
  43. package/dist/lit/components/checkbox/index.js +8 -4
  44. package/dist/lit/components/checkbox/index.styles.js +140 -0
  45. package/dist/lit/components/chip/index.d.ts +6 -1
  46. package/dist/lit/components/chip/index.js +9 -2
  47. package/dist/lit/components/chip/index.styles.js +159 -0
  48. package/dist/lit/components/chip-group/index.d.ts +5 -1
  49. package/dist/lit/components/chip-group/index.js +8 -2
  50. package/dist/lit/components/chip-group/index.styles.js +33 -0
  51. package/dist/lit/components/code/index.d.ts +2 -2
  52. package/dist/lit/components/code/index.js +5 -3
  53. package/dist/lit/components/code/index.styles.js +56 -0
  54. package/dist/lit/components/composer/index.d.ts +7 -2
  55. package/dist/lit/components/composer/index.js +19 -0
  56. package/dist/lit/components/composer/index.styles.js +562 -0
  57. package/dist/lit/components/data-table/index.css +18 -0
  58. package/dist/lit/components/data-table/index.d.ts +30 -0
  59. package/dist/lit/components/data-table/index.js +120 -34
  60. package/dist/lit/components/data-table/index.styles.js +198 -0
  61. package/dist/lit/components/date-range/index.d.ts +4 -0
  62. package/dist/lit/components/date-range/index.js +7 -2
  63. package/dist/lit/components/date-range/index.styles.js +338 -0
  64. package/dist/lit/components/dialog/index.d.ts +4 -0
  65. package/dist/lit/components/dialog/index.js +7 -2
  66. package/dist/lit/components/dialog/index.styles.js +138 -0
  67. package/dist/lit/components/divider/index.d.ts +2 -1
  68. package/dist/lit/components/divider/index.js +5 -2
  69. package/dist/lit/components/divider/index.styles.js +41 -0
  70. package/dist/lit/components/empty-state/index.d.ts +1 -0
  71. package/dist/lit/components/empty-state/index.js +4 -2
  72. package/dist/lit/components/empty-state/index.styles.js +83 -0
  73. package/dist/lit/components/expansion-panel/index.d.ts +6 -2
  74. package/dist/lit/components/expansion-panel/index.js +9 -2
  75. package/dist/lit/components/expansion-panel/index.styles.js +134 -0
  76. package/dist/lit/components/field/index.d.ts +4 -0
  77. package/dist/lit/components/field/index.js +9 -4
  78. package/dist/lit/components/field/index.styles.js +237 -0
  79. package/dist/lit/components/file-input/index.d.ts +4 -0
  80. package/dist/lit/components/file-input/index.js +10 -4
  81. package/dist/lit/components/file-input/index.styles.js +271 -0
  82. package/dist/lit/components/form/index.d.ts +4 -0
  83. package/dist/lit/components/form/index.js +7 -2
  84. package/dist/lit/components/form/index.styles.js +43 -0
  85. package/dist/lit/components/grid/index.d.ts +2 -1
  86. package/dist/lit/components/grid/index.js +5 -2
  87. package/dist/lit/components/grid/index.styles.js +67 -0
  88. package/dist/lit/components/kbd/index.d.ts +2 -2
  89. package/dist/lit/components/kbd/index.js +5 -2
  90. package/dist/lit/components/kbd/index.styles.js +49 -0
  91. package/dist/lit/components/list/index.d.ts +5 -1
  92. package/dist/lit/components/list/index.js +8 -2
  93. package/dist/lit/components/list/index.styles.js +29 -0
  94. package/dist/lit/components/list-item/index.d.ts +2 -2
  95. package/dist/lit/components/list-item/index.js +5 -2
  96. package/dist/lit/components/list-item/index.styles.js +133 -0
  97. package/dist/lit/components/menu/index.d.ts +8 -0
  98. package/dist/lit/components/menu/index.js +11 -3
  99. package/dist/lit/components/menu/index.styles.js +108 -0
  100. package/dist/lit/components/multi-select/index.css +156 -0
  101. package/dist/lit/components/multi-select/index.d.ts +70 -0
  102. package/dist/lit/components/multi-select/index.js +497 -0
  103. package/dist/lit/components/multi-select/index.styles.js +170 -0
  104. package/dist/lit/components/navigation-drawer/index.d.ts +5 -2
  105. package/dist/lit/components/navigation-drawer/index.js +8 -2
  106. package/dist/lit/components/navigation-drawer/index.styles.js +128 -0
  107. package/dist/lit/components/overlay/index.d.ts +5 -0
  108. package/dist/lit/components/overlay/index.js +8 -2
  109. package/dist/lit/components/overlay/index.styles.js +185 -0
  110. package/dist/lit/components/pagination/index.d.ts +18 -1
  111. package/dist/lit/components/pagination/index.js +54 -8
  112. package/dist/lit/components/pagination/index.styles.js +116 -0
  113. package/dist/lit/components/popover/index.d.ts +5 -0
  114. package/dist/lit/components/popover/index.js +8 -2
  115. package/dist/lit/components/popover/index.styles.js +48 -0
  116. package/dist/lit/components/primitives/index.d.ts +2 -2
  117. package/dist/lit/components/primitives/index.js +13 -0
  118. package/dist/lit/components/primitives/index.styles.js +518 -0
  119. package/dist/lit/components/progress/index.d.ts +1 -0
  120. package/dist/lit/components/progress/index.js +4 -2
  121. package/dist/lit/components/progress/index.styles.js +157 -0
  122. package/dist/lit/components/radio-group/index.d.ts +5 -0
  123. package/dist/lit/components/radio-group/index.js +10 -6
  124. package/dist/lit/components/radio-group/index.styles.js +192 -0
  125. package/dist/lit/components/select/index.d.ts +4 -0
  126. package/dist/lit/components/select/index.js +10 -2
  127. package/dist/lit/components/select/index.styles.js +165 -0
  128. package/dist/lit/components/sidebar-item/index.d.ts +1 -1
  129. package/dist/lit/components/sidebar-item/index.js +12 -0
  130. package/dist/lit/components/sidebar-item/index.styles.js +147 -0
  131. package/dist/lit/components/skeleton/index.d.ts +1 -0
  132. package/dist/lit/components/skeleton/index.js +4 -2
  133. package/dist/lit/components/skeleton/index.styles.js +95 -0
  134. package/dist/lit/components/slider/index.d.ts +5 -0
  135. package/dist/lit/components/slider/index.js +11 -4
  136. package/dist/lit/components/slider/index.styles.js +185 -0
  137. package/dist/lit/components/snackbar/index.d.ts +5 -2
  138. package/dist/lit/components/snackbar/index.js +20 -2
  139. package/dist/lit/components/snackbar/index.styles.js +293 -0
  140. package/dist/lit/components/stack/index.d.ts +2 -1
  141. package/dist/lit/components/stack/index.js +5 -2
  142. package/dist/lit/components/stack/index.styles.js +55 -0
  143. package/dist/lit/components/switch/index.d.ts +1 -0
  144. package/dist/lit/components/switch/index.js +7 -4
  145. package/dist/lit/components/switch/index.styles.js +140 -0
  146. package/dist/lit/components/table/index.d.ts +2 -2
  147. package/dist/lit/components/table/index.js +5 -2
  148. package/dist/lit/components/table/index.styles.js +99 -0
  149. package/dist/lit/components/tabs/index.d.ts +7 -3
  150. package/dist/lit/components/tabs/index.js +11 -4
  151. package/dist/lit/components/tabs/index.styles.js +130 -0
  152. package/dist/lit/components/text-field/index.d.ts +1 -0
  153. package/dist/lit/components/text-field/index.js +7 -2
  154. package/dist/lit/components/text-field/index.styles.js +104 -0
  155. package/dist/lit/components/textarea/index.d.ts +1 -0
  156. package/dist/lit/components/textarea/index.js +7 -2
  157. package/dist/lit/components/textarea/index.styles.js +69 -0
  158. package/dist/lit/components/tooltip/index.d.ts +1 -0
  159. package/dist/lit/components/tooltip/index.js +4 -2
  160. package/dist/lit/components/tooltip/index.styles.js +51 -0
  161. package/dist/lit/components/validation/index.d.ts +7 -2
  162. package/dist/lit/components/validation/index.js +21 -1
  163. package/dist/lit/components/validation/index.styles.js +400 -0
  164. package/dist/lit/index.d.ts +1 -0
  165. package/dist/lit/index.js +1 -0
  166. package/dist/react/XmAlert.d.ts +99 -0
  167. package/dist/react/XmAlert.js +45 -0
  168. package/dist/react/XmAppBar.d.ts +59 -0
  169. package/dist/react/XmAppBar.js +34 -0
  170. package/dist/react/XmArtifact.d.ts +113 -0
  171. package/dist/react/XmArtifact.js +45 -0
  172. package/dist/react/XmArtifactChip.d.ts +56 -0
  173. package/dist/react/XmArtifactChip.js +32 -0
  174. package/dist/react/XmAutocomplete.d.ts +153 -0
  175. package/dist/react/XmAutocomplete.js +68 -0
  176. package/dist/react/XmAvatar.d.ts +71 -0
  177. package/dist/react/XmAvatar.js +40 -0
  178. package/dist/react/XmAvatarGroup.d.ts +59 -0
  179. package/dist/react/XmAvatarGroup.js +34 -0
  180. package/dist/react/XmBadge.d.ts +67 -0
  181. package/dist/react/XmBadge.js +38 -0
  182. package/dist/react/XmBrandGlyph.d.ts +46 -0
  183. package/dist/react/XmBrandGlyph.js +24 -0
  184. package/dist/react/XmBrandMark.d.ts +71 -0
  185. package/dist/react/XmBrandMark.js +40 -0
  186. package/dist/react/XmBreadcrumbs.d.ts +56 -0
  187. package/dist/react/XmBreadcrumbs.js +32 -0
  188. package/dist/react/XmBubble.d.ts +69 -0
  189. package/dist/react/XmBubble.js +38 -0
  190. package/dist/react/XmBubbleActions.d.ts +59 -0
  191. package/dist/react/XmBubbleActions.js +34 -0
  192. package/dist/react/XmBubbleGroup.d.ts +82 -0
  193. package/dist/react/XmBubbleGroup.js +36 -0
  194. package/dist/react/XmButton.d.ts +89 -0
  195. package/dist/react/XmButton.js +48 -0
  196. package/dist/react/XmCard.d.ts +59 -0
  197. package/dist/react/XmCard.js +34 -0
  198. package/dist/react/XmChatShell.d.ts +110 -0
  199. package/dist/react/XmChatShell.js +44 -0
  200. package/dist/react/XmCheckbox.d.ts +145 -0
  201. package/dist/react/XmCheckbox.js +58 -0
  202. package/dist/react/XmChip.d.ts +99 -0
  203. package/dist/react/XmChip.js +46 -0
  204. package/dist/react/XmChipGroup.d.ts +79 -0
  205. package/dist/react/XmChipGroup.js +35 -0
  206. package/dist/react/XmCode.d.ts +55 -0
  207. package/dist/react/XmCode.js +32 -0
  208. package/dist/react/XmComposer.d.ts +123 -0
  209. package/dist/react/XmComposer.js +52 -0
  210. package/dist/react/XmDataTable.d.ts +125 -0
  211. package/dist/react/XmDataTable.js +65 -0
  212. package/dist/react/XmDateRange.d.ts +93 -0
  213. package/dist/react/XmDateRange.js +41 -0
  214. package/dist/react/XmDialog.d.ts +87 -0
  215. package/dist/react/XmDialog.js +40 -0
  216. package/dist/react/XmDivider.d.ts +55 -0
  217. package/dist/react/XmDivider.js +32 -0
  218. package/dist/react/XmEmptyState.d.ts +61 -0
  219. package/dist/react/XmEmptyState.js +34 -0
  220. package/dist/react/XmExpansionPanel.d.ts +101 -0
  221. package/dist/react/XmExpansionPanel.js +48 -0
  222. package/dist/react/XmFileInput.d.ts +151 -0
  223. package/dist/react/XmFileInput.js +68 -0
  224. package/dist/react/XmFileValidationBlock.d.ts +111 -0
  225. package/dist/react/XmFileValidationBlock.js +45 -0
  226. package/dist/react/XmForm.d.ts +91 -0
  227. package/dist/react/XmForm.js +37 -0
  228. package/dist/react/XmGrid.d.ts +59 -0
  229. package/dist/react/XmGrid.js +34 -0
  230. package/dist/react/XmKbd.d.ts +46 -0
  231. package/dist/react/XmKbd.js +24 -0
  232. package/dist/react/XmList.d.ts +83 -0
  233. package/dist/react/XmList.js +37 -0
  234. package/dist/react/XmListItem.d.ts +67 -0
  235. package/dist/react/XmListItem.js +38 -0
  236. package/dist/react/XmMenu.d.ts +98 -0
  237. package/dist/react/XmMenu.js +42 -0
  238. package/dist/react/XmMenuItem.d.ts +63 -0
  239. package/dist/react/XmMenuItem.js +36 -0
  240. package/dist/react/XmMultiSelect.d.ts +161 -0
  241. package/dist/react/XmMultiSelect.js +72 -0
  242. package/dist/react/XmNavigationDrawer.d.ts +93 -0
  243. package/dist/react/XmNavigationDrawer.js +41 -0
  244. package/dist/react/XmOverlay.d.ts +120 -0
  245. package/dist/react/XmOverlay.js +54 -0
  246. package/dist/react/XmPagination.d.ts +117 -0
  247. package/dist/react/XmPagination.js +57 -0
  248. package/dist/react/XmPopover.d.ts +90 -0
  249. package/dist/react/XmPopover.js +40 -0
  250. package/dist/react/XmProgress.d.ts +75 -0
  251. package/dist/react/XmProgress.js +42 -0
  252. package/dist/react/XmRadio.d.ts +88 -0
  253. package/dist/react/XmRadio.js +41 -0
  254. package/dist/react/XmRadioGroup.d.ts +139 -0
  255. package/dist/react/XmRadioGroup.js +56 -0
  256. package/dist/react/XmSelect.d.ts +152 -0
  257. package/dist/react/XmSelect.js +68 -0
  258. package/dist/react/XmSidebarItem.d.ts +75 -0
  259. package/dist/react/XmSidebarItem.js +42 -0
  260. package/dist/react/XmSkeleton.d.ts +71 -0
  261. package/dist/react/XmSkeleton.js +40 -0
  262. package/dist/react/XmSlider.d.ts +160 -0
  263. package/dist/react/XmSlider.js +74 -0
  264. package/dist/react/XmSnackbar.d.ts +110 -0
  265. package/dist/react/XmSnackbar.js +49 -0
  266. package/dist/react/XmStack.d.ts +71 -0
  267. package/dist/react/XmStack.js +40 -0
  268. package/dist/react/XmSwitch.d.ts +136 -0
  269. package/dist/react/XmSwitch.js +56 -0
  270. package/dist/react/XmTab.d.ts +79 -0
  271. package/dist/react/XmTab.js +37 -0
  272. package/dist/react/XmTabPanel.d.ts +55 -0
  273. package/dist/react/XmTabPanel.js +32 -0
  274. package/dist/react/XmTable.d.ts +57 -0
  275. package/dist/react/XmTable.js +32 -0
  276. package/dist/react/XmTabs.d.ts +82 -0
  277. package/dist/react/XmTabs.js +37 -0
  278. package/dist/react/XmTextField.d.ts +147 -0
  279. package/dist/react/XmTextField.js +60 -0
  280. package/dist/react/XmTextarea.d.ts +155 -0
  281. package/dist/react/XmTextarea.js +64 -0
  282. package/dist/react/XmTooltip.d.ts +67 -0
  283. package/dist/react/XmTooltip.js +38 -0
  284. package/dist/react/index.d.ts +59 -0
  285. package/dist/react/index.js +59 -0
  286. package/dist/react/react-utils.js +67 -0
  287. package/package.json +37 -9
  288. package/styles/_base-typography.css +86 -0
  289. package/styles/_primitives.css +54 -0
  290. package/styles/_reset.css +58 -0
  291. package/styles/base.css +23 -0
  292. package/vscode.css-custom-data.json +6 -0
  293. package/vscode.html-custom-data.json +979 -0
@@ -2,7 +2,12 @@ import { LitElement } from "lit";
2
2
  import type { TemplateResult } from "lit";
3
3
  type AlertSeverity = "info" | "success" | "warning" | "critical";
4
4
  type AlertVariant = "inline" | "banner";
5
- declare class XmAlert extends LitElement {
5
+ /**
6
+ * @fires alert-action - Fired when the alert's action is activated.
7
+ * @fires alert-dismiss - Fired when the alert is dismissed.
8
+ */
9
+ export declare class XmAlert extends LitElement {
10
+ static styles: CSSStyleSheet[];
6
11
  severity: AlertSeverity;
7
12
  heading: string;
8
13
  dismissible: boolean;
@@ -45,10 +45,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
45
45
  };
46
46
  import { LitElement, html, svg, nothing } from "lit";
47
47
  import { customElement, property } from "lit/decorators.js";
48
+ import alertSheets from "./index.styles.js";
48
49
  // Resolve CSS path relative to the *built* file location:
49
50
  // `lit/build/components/alert/index.js` — 3 levels up reach `lit/`,
50
51
  // then into `components/`. Mirrors button/index.ts.
51
- const ALERT_CSS = new URL("../alert/index.css", import.meta.url).href;
52
52
  const SHELL = (paths, size = 18, strokeWidth = 1.8) => svg `
53
53
  <svg width="${size}" height="${size}" viewBox="0 0 24 24"
54
54
  fill="none" stroke="currentColor" stroke-width="${strokeWidth}"
@@ -85,6 +85,10 @@ const SEVERITY_LABEL = {
85
85
  warning: "Warning",
86
86
  critical: "Critical",
87
87
  };
88
+ /**
89
+ * @fires alert-action - Fired when the alert's action is activated.
90
+ * @fires alert-dismiss - Fired when the alert is dismissed.
91
+ */
88
92
  let XmAlert = class XmAlert extends LitElement {
89
93
  constructor() {
90
94
  super(...arguments);
@@ -126,6 +130,9 @@ let XmAlert = class XmAlert extends LitElement {
126
130
  this.dispatchEvent(new CustomEvent("alert-dismiss", { bubbles: true, composed: true }));
127
131
  };
128
132
  }
133
+ // Adopted from the build-generated sheets (scripts/gen-styles.mjs) — no
134
+ // runtime URL fetch (ADR 0012). Cascade order preserved from the old <link>s.
135
+ static { this.styles = [...alertSheets]; }
129
136
  render() {
130
137
  const sev = this.severity === "success" || this.severity === "warning" || this.severity === "critical"
131
138
  ? this.severity
@@ -133,7 +140,6 @@ let XmAlert = class XmAlert extends LitElement {
133
140
  const isProminent = this.prominent || this.variant === "banner";
134
141
  const cls = `alert alert--${sev}${this.static ? " alert--static" : ""}${isProminent ? " alert--prominent" : ""}`;
135
142
  return html `
136
- <link rel="stylesheet" href="${ALERT_CSS}">
137
143
  <style>
138
144
  :host { display: block; }
139
145
  :host([hidden]) { display: none; }
@@ -189,3 +195,4 @@ __decorate([
189
195
  XmAlert = __decorate([
190
196
  customElement("xm-alert")
191
197
  ], XmAlert);
198
+ export { XmAlert };
@@ -0,0 +1,215 @@
1
+ // GENERATED by scripts/gen-styles.mjs — do not edit. Source: lit/components/alert/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
+ Alert — inline notification banner.
12
+
13
+ Lightweight inline surface for notice/warning/success/critical
14
+ context. Sits between snackbar (modal-ish backend-error tunnel)
15
+ and a plain message: the host drops it inline in a chat thread,
16
+ a settings pane, or any content surface.
17
+
18
+ Severity is communicated by the icon glyph and copy ONLY — every
19
+ variant uses the same neutral surface and ink. \`--md-sys-color-error*\`
20
+ is forbidden in components (POLICIES.md rule 3a); status pastels
21
+ are not part of this design system.
22
+
23
+ Grid:
24
+ icon · body · action-slot · close
25
+ The icon column and close column are auto-sized; the body fills.
26
+ ============================================ */
27
+
28
+ .alert {
29
+ /* Component-local vars — neutral surface, border, and ink for every
30
+ severity (matches the rest of the design system). Severity carries
31
+ hue ONLY on the icon and its chip — this is the targeted exception
32
+ to the "no hue for severity" rule, scoped tightly so the alert
33
+ reads as chrome with a glanceable severity marker, not a loud
34
+ full-banner tint. Defaults are info; .alert--{severity} swaps the
35
+ icon vars. */
36
+ --alert-bg: var(--md-sys-color-surface-container-high);
37
+ --alert-border: var(--md-sys-color-outline-variant);
38
+ --alert-ink: var(--md-sys-color-on-surface);
39
+ --alert-ink-soft: var(--md-sys-color-on-surface-variant);
40
+ --alert-icon-ink: var(--xm-alert-info-ink);
41
+ --alert-icon-chip: var(--xm-alert-info-chip);
42
+
43
+ position: relative;
44
+ display: grid;
45
+ grid-template-columns: auto 1fr auto auto;
46
+ align-items: center;
47
+ gap: var(--s-3);
48
+ width: 100%;
49
+ padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4);
50
+ background: var(--alert-bg);
51
+ border: 1px solid var(--alert-border);
52
+ border-radius: var(--md-sys-shape-corner-medium);
53
+ color: var(--alert-ink);
54
+ font-family: var(--md-sys-typescale-body-medium-font);
55
+ animation: alert-in var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard) both;
56
+ }
57
+ .alert--static { animation: none; }
58
+
59
+ @keyframes alert-in {
60
+ from {
61
+ opacity: 0;
62
+ transform: translateY(4px);
63
+ }
64
+ to {
65
+ opacity: 1;
66
+ transform: translateY(0);
67
+ }
68
+ }
69
+
70
+ /* Severity modifiers — swap ONLY the icon's ink and chip. Surface,
71
+ border, and body text stay neutral. */
72
+ .alert--info {
73
+ --alert-icon-ink: var(--xm-alert-info-ink);
74
+ --alert-icon-chip: var(--xm-alert-info-chip);
75
+ }
76
+ .alert--success {
77
+ --alert-icon-ink: var(--xm-alert-success-ink);
78
+ --alert-icon-chip: var(--xm-alert-success-chip);
79
+ }
80
+ .alert--warning {
81
+ --alert-icon-ink: var(--xm-alert-warning-ink);
82
+ --alert-icon-chip: var(--xm-alert-warning-chip);
83
+ }
84
+ .alert--critical {
85
+ --alert-icon-ink: var(--xm-alert-critical-ink);
86
+ --alert-icon-chip: var(--xm-alert-critical-chip);
87
+ }
88
+
89
+ /* ── Prominent / banner modifier (Story 4.6) ───────────────────────────
90
+ A high-importance, persistent layout. Changes PROMINENCE / LAYOUT ONLY:
91
+ wider full-width feel, larger padding, a left severity accent rail, and a
92
+ larger icon chip — while the body surface stays NEUTRAL and the per-severity
93
+ hue stays scoped to the icon chip + ink + the rail (the same --alert-icon-*
94
+ mechanism, the sole sanctioned severity-hue exception). No new severity
95
+ hues, no --md-sys-color-error*, no full-banner tint. The contract (severity
96
+ model, slots, events) is unchanged. */
97
+ .alert--prominent {
98
+ padding: var(--s-5) var(--s-5) var(--s-5) var(--s-6);
99
+ border-radius: var(--md-sys-shape-corner-large);
100
+ /* The left severity rail — a hairline-respecting accent band drawn from the
101
+ per-severity chip, scoped to the edge so the body reads neutral. 3px is a
102
+ decorative rail, not a border (borders stay hairline; 2px is focus/drag). */
103
+ border-left: 3px solid var(--alert-icon-chip);
104
+ column-gap: var(--s-4);
105
+ }
106
+ .alert--prominent .alert__icon {
107
+ width: 40px;
108
+ height: 40px;
109
+ align-self: start;
110
+ }
111
+ .alert--prominent .alert__heading {
112
+ font-size: var(--md-sys-typescale-body-large-size);
113
+ }
114
+ .alert--prominent .alert__text {
115
+ font-size: var(--md-sys-typescale-body-medium-size);
116
+ }
117
+ /* In the banner layout the action drops below the body so the message has the
118
+ full row width — a persistent banner reads as a block, not a one-liner. */
119
+ .alert--prominent .alert__action {
120
+ grid-column: 2 / 3;
121
+ grid-row: 2;
122
+ justify-content: flex-start;
123
+ margin-top: var(--s-1);
124
+ }
125
+
126
+ .alert__icon {
127
+ display: inline-flex;
128
+ align-items: center;
129
+ justify-content: center;
130
+ width: 32px;
131
+ height: 32px;
132
+ border-radius: var(--md-sys-shape-corner-small);
133
+ /* Per-severity tint chip behind the glyph — the ONLY hued region in
134
+ the alert. Sits on top of the neutral alert surface. */
135
+ background: color-mix(in oklab, var(--alert-icon-chip) 38%, transparent);
136
+ color: var(--alert-icon-ink);
137
+ flex-shrink: 0;
138
+ }
139
+
140
+ .alert__body {
141
+ min-width: 0;
142
+ display: flex;
143
+ flex-direction: column;
144
+ gap: var(--s-0-5);
145
+ }
146
+ .alert__heading {
147
+ font-size: var(--md-sys-typescale-body-medium-size);
148
+ font-weight: 600;
149
+ color: var(--alert-ink);
150
+ /* Heading wraps when narrow rather than truncating — alerts are read,
151
+ not glanced at like snackbars. */
152
+ text-wrap: pretty;
153
+ }
154
+ .alert__text {
155
+ font-size: var(--md-sys-typescale-body-medium-size);
156
+ line-height: 1.45;
157
+ color: var(--alert-ink-soft);
158
+ text-wrap: pretty;
159
+ }
160
+ .alert__text.is-empty { display: none; }
161
+ .alert__heading.is-empty { display: none; }
162
+
163
+ .alert__action {
164
+ display: inline-flex;
165
+ align-items: center;
166
+ flex-shrink: 0;
167
+ }
168
+ .alert__action.is-empty { display: none; }
169
+
170
+ .alert__close {
171
+ appearance: none;
172
+ border: none;
173
+ background: transparent;
174
+ color: var(--alert-ink-soft);
175
+ width: 28px;
176
+ height: 28px;
177
+ border-radius: var(--md-sys-shape-corner-small);
178
+ cursor: pointer;
179
+ display: inline-flex;
180
+ align-items: center;
181
+ justify-content: center;
182
+ transition:
183
+ background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
184
+ color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
185
+ flex-shrink: 0;
186
+ }
187
+ .alert__close:hover {
188
+ background: color-mix(in oklab, var(--alert-ink) 10%, transparent);
189
+ color: var(--alert-ink);
190
+ }
191
+ .alert__close:focus-visible {
192
+ outline: none;
193
+ box-shadow: var(--xm-state-focus-ring);
194
+ }
195
+
196
+ /* Compact: when the row gets narrow, drop the action below the body
197
+ so nothing wraps awkwardly. The dismiss stays inline. The 520px literal
198
+ mirrors --xm-breakpoint-sm (styles/_layout.css) — @media can't read the
199
+ token (docs/adr/0001), so the literal is the source-of-truth's echo. */
200
+ @media (max-width: 520px) {
201
+ .alert {
202
+ grid-template-columns: auto 1fr auto;
203
+ grid-template-rows: auto auto;
204
+ row-gap: var(--s-2);
205
+ }
206
+ .alert__action {
207
+ grid-column: 2 / -1;
208
+ justify-content: flex-end;
209
+ }
210
+ }
211
+
212
+ }`);
213
+ sheets = [sheet];
214
+ }
215
+ export default sheets;
@@ -1,7 +1,8 @@
1
1
  import { LitElement } from "lit";
2
2
  import type { TemplateResult } from "lit";
3
3
  type AppBarSize = "xs" | "sm" | "md" | "lg";
4
- declare class XmAppBar extends LitElement {
4
+ export declare class XmAppBar extends LitElement {
5
+ static styles: CSSStyleSheet[];
5
6
  size: AppBarSize;
6
7
  sticky: boolean;
7
8
  private _mo;
@@ -34,9 +34,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
34
34
  };
35
35
  import { LitElement, html } from "lit";
36
36
  import { customElement, property } from "lit/decorators.js";
37
+ import appBarSheets from "./index.styles.js";
37
38
  // Resolve CSS relative to the *built* file:
38
39
  // lit/build/components/app-bar/index.js → ../app-bar/index.css.
39
- const APP_BAR_CSS = new URL("../app-bar/index.css", import.meta.url).href;
40
40
  let XmAppBar = class XmAppBar extends LitElement {
41
41
  constructor() {
42
42
  super(...arguments);
@@ -47,6 +47,9 @@ let XmAppBar = class XmAppBar extends LitElement {
47
47
  this.requestUpdate();
48
48
  };
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 = [...appBarSheets]; }
50
53
  render() {
51
54
  const size = ["xs", "sm", "md", "lg"].includes(this.size)
52
55
  ? this.size
@@ -54,7 +57,6 @@ let XmAppBar = class XmAppBar extends LitElement {
54
57
  const leadingEmpty = this._slotEmpty("leading");
55
58
  const actionEmpty = this._slotEmpty("action");
56
59
  return html `
57
- <link rel="stylesheet" href="${APP_BAR_CSS}" />
58
60
  <style>
59
61
  :host {
60
62
  display: block;
@@ -118,3 +120,4 @@ __decorate([
118
120
  XmAppBar = __decorate([
119
121
  customElement("xm-app-bar")
120
122
  ], XmAppBar);
123
+ export { XmAppBar };
@@ -0,0 +1,94 @@
1
+ // GENERATED by scripts/gen-styles.mjs — do not edit. Source: lit/components/app-bar/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-app-bar> — screen header on the desk surface.
12
+
13
+ Surface / ink (AD-13): the app bar belongs to the DESK family —
14
+ background var(--md-sys-color-surface), title ink var(--md-sys-color-on-surface),
15
+ secondary var(--md-sys-color-on-surface-variant). NOT the inverse-surface ink
16
+ used by cards / drawers.
17
+
18
+ Hairline: a single 1px bottom border (--md-sys-color-outline-variant).
19
+ Never 2px.
20
+
21
+ BEM: block \`app-bar\`; elements \`__leading\` \`__title\` \`__action\`;
22
+ modifiers \`--xs|--sm|--md|--lg\`. Sticky is driven from :host([sticky]).
23
+ ============================================ */
24
+
25
+ .app-bar {
26
+ display: flex;
27
+ align-items: center;
28
+ gap: var(--s-3);
29
+ box-sizing: border-box;
30
+ width: 100%;
31
+ padding: 0 var(--s-4);
32
+ background: var(--md-sys-color-surface);
33
+ color: var(--md-sys-color-on-surface);
34
+ border-bottom: 1px solid var(--md-sys-color-outline-variant);
35
+ }
36
+
37
+ /* ---------- Sizes — one shared bar height per size ---------- */
38
+ .app-bar--xs { min-height: 40px; }
39
+ .app-bar--sm { min-height: 48px; }
40
+ .app-bar--md { min-height: 56px; }
41
+ .app-bar--lg { min-height: 64px; }
42
+
43
+ /* ---------- Leading ---------- */
44
+ .app-bar__leading {
45
+ display: inline-flex;
46
+ align-items: center;
47
+ gap: var(--s-2);
48
+ flex-shrink: 0;
49
+ }
50
+ .app-bar__leading.is-empty {
51
+ display: none;
52
+ }
53
+
54
+ /* ---------- Title ---------- */
55
+ .app-bar__title {
56
+ flex: 1 1 auto;
57
+ min-width: 0;
58
+ display: flex;
59
+ align-items: center;
60
+ gap: var(--s-2);
61
+ font-family: var(--md-sys-typescale-title-medium-font);
62
+ font-size: var(--md-sys-typescale-title-medium-size);
63
+ line-height: var(--md-sys-typescale-title-medium-line-height);
64
+ font-weight: var(--md-sys-typescale-title-medium-weight);
65
+ letter-spacing: var(--md-sys-typescale-title-medium-tracking);
66
+ color: var(--md-sys-color-on-surface);
67
+ overflow: hidden;
68
+ white-space: nowrap;
69
+ text-overflow: ellipsis;
70
+ }
71
+
72
+ /* ---------- Action (singular trailing region) ---------- */
73
+ .app-bar__action {
74
+ display: inline-flex;
75
+ align-items: center;
76
+ gap: var(--s-2);
77
+ flex-shrink: 0;
78
+ margin-inline-start: auto;
79
+ }
80
+ .app-bar__action.is-empty {
81
+ display: none;
82
+ }
83
+
84
+ /* ---------- Sticky ---------- */
85
+ :host([sticky]) .app-bar {
86
+ position: sticky;
87
+ top: 0;
88
+ z-index: 1;
89
+ }
90
+
91
+ }`);
92
+ sheets = [sheet];
93
+ }
94
+ export default sheets;
@@ -2,7 +2,12 @@ import { LitElement } from "lit";
2
2
  import type { TemplateResult } from "lit";
3
3
  import "../button/index.js";
4
4
  type ArtifactView = "preview" | "code";
5
- declare class XmArtifact extends LitElement {
5
+ /**
6
+ * @fires close - Fired when the element requests to close.
7
+ * @fires refresh - Fired when a refresh is requested.
8
+ * @fires view-change - Fired when the active view changes.
9
+ */
10
+ export declare class XmArtifact extends LitElement {
6
11
  title: string;
7
12
  sub: string[] | null;
8
13
  subCsv: string;
@@ -29,8 +29,8 @@
29
29
  refresh
30
30
  close
31
31
 
32
- Light DOM. components/artifact/index.css + components/button/index.css +
33
- components/primitives/index.css must be loaded in the host page.
32
+ Light DOM. This module appends its stylesheets (artifact + primitives) to
33
+ document.head on import; <xm-button> brings its own CSS via its shadow root.
34
34
  */
35
35
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
36
36
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -42,6 +42,18 @@ import { LitElement, html, svg, nothing } from "lit";
42
42
  import { customElement, property, state } from "lit/decorators.js";
43
43
  // Side-effect import: registers <xm-button> for use in the head toolbar.
44
44
  import "../button/index.js";
45
+ import artifactSheets from "./index.styles.js";
46
+ import primitivesSheets from "../primitives/index.styles.js";
47
+ // Light DOM: adopt the build-generated sheets into the document — no runtime
48
+ // URL fetch (ADR 0012). Deduped by sheet identity (the generated modules are
49
+ // singletons); the CSS is wrapped in @layer components (spine AD-2).
50
+ if (typeof document !== "undefined") {
51
+ for (const sheet of [...artifactSheets, ...primitivesSheets]) {
52
+ if (!document.adoptedStyleSheets.includes(sheet)) {
53
+ document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];
54
+ }
55
+ }
56
+ }
45
57
  const ICON_EYE = (size = 14) => svg `
46
58
  <svg width="${size}" height="${size}" viewBox="0 0 24 24" fill="none"
47
59
  stroke="currentColor" stroke-width="1.8" stroke-linecap="round"
@@ -74,6 +86,11 @@ const ICON_CLOSE = () => svg `
74
86
  </svg>
75
87
  `;
76
88
  let artifactInstance = 0;
89
+ /**
90
+ * @fires close - Fired when the element requests to close.
91
+ * @fires refresh - Fired when a refresh is requested.
92
+ * @fires view-change - Fired when the active view changes.
93
+ */
77
94
  let XmArtifact = class XmArtifact extends LitElement {
78
95
  constructor() {
79
96
  super(...arguments);
@@ -292,3 +309,4 @@ __decorate([
292
309
  XmArtifact = __decorate([
293
310
  customElement("xm-artifact")
294
311
  ], XmArtifact);
312
+ export { XmArtifact };
@@ -0,0 +1,180 @@
1
+ // GENERATED by scripts/gen-styles.mjs — do not edit. Source: lit/components/artifact/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
+ Artifact — Claude-style side-panel viewer.
12
+
13
+ Canvas-surface panel that lives in the artifact
14
+ column of chat.html, or standalone in
15
+ preview/artifact.html. Header (provider chip +
16
+ segmented eye/code toggle + title/sub +
17
+ action cluster) over a scrollable body.
18
+
19
+ The panel rides \`surface-container-high\` in both
20
+ themes — same family as the chat shell's sidebar/
21
+ topbar. Surface-rooted means text tokens come
22
+ from \`on-surface*\` (POLICIES rule 7a). The
23
+ primitives flip in light theme via
24
+ _primitives.css, so a single set of rules covers
25
+ both modes. Mirrors the .bubble.bot pattern.
26
+ ============================================ */
27
+
28
+ .artifact {
29
+ background: var(--md-sys-color-surface-container-high);
30
+ border: 0;
31
+ border-left: 1px solid var(--md-sys-color-outline);
32
+ border-radius: 0;
33
+ display: flex;
34
+ flex-direction: column;
35
+ min-height: 0;
36
+ overflow: hidden;
37
+ color: var(--md-sys-color-on-surface);
38
+ }
39
+
40
+ /* ---------- Head ----------
41
+ Padding + min-height match preview/chat.html \`.top\` so the chat
42
+ topbar and artifact head render at identical heights when both
43
+ are visible. */
44
+ .artifact__head {
45
+ display: flex;
46
+ align-items: center;
47
+ gap: var(--s-3);
48
+ padding: var(--s-3) var(--s-5);
49
+ min-height: 56px;
50
+ box-sizing: border-box;
51
+ flex-shrink: 0;
52
+ /* Hairline seam so the header reads as a band over the body instead of
53
+ floating; outline-variant is the soft internal divider weight. */
54
+ border-bottom: 1px solid var(--md-sys-color-outline-variant);
55
+ }
56
+
57
+ .artifact__head-left {
58
+ display: inline-flex;
59
+ align-items: center;
60
+ gap: var(--s-2);
61
+ flex-shrink: 0;
62
+ }
63
+
64
+ .artifact__head-mid {
65
+ display: flex;
66
+ flex-direction: column;
67
+ gap: var(--s-1);
68
+ min-width: 0;
69
+ flex: 1;
70
+ }
71
+
72
+ .artifact__head-right {
73
+ display: inline-flex;
74
+ align-items: center;
75
+ gap: var(--s-1-5);
76
+ flex-shrink: 0;
77
+ }
78
+
79
+ .artifact__title {
80
+ font: 600 15px/1.2 var(--md-sys-typescale-body-large-font);
81
+ color: var(--md-sys-color-on-surface);
82
+ letter-spacing: -0.01em;
83
+ white-space: nowrap;
84
+ overflow: hidden;
85
+ text-overflow: ellipsis;
86
+ }
87
+
88
+ .artifact__sub {
89
+ font: 400 11px/1 var(--xm-typescale-mono-font);
90
+ color: var(--xm-color-on-surface-soft);
91
+ font-feature-settings: "tnum";
92
+ display: inline-flex;
93
+ align-items: center;
94
+ gap: var(--s-1-5);
95
+ flex-wrap: nowrap;
96
+ white-space: nowrap;
97
+ }
98
+ .artifact__sub > span { white-space: nowrap; }
99
+ /* Inline middot dividers come from the .ds-sep primitive (primitives/index.css);
100
+ no per-component override needed. */
101
+
102
+ /* ---------- View toggle (eye / code) ---------- */
103
+ .artifact__view-toggle {
104
+ display: inline-flex;
105
+ align-items: center;
106
+ padding: var(--s-0-5);
107
+ background: color-mix(in oklab, var(--md-sys-color-on-surface) 8%, transparent);
108
+ border-radius: 8px;
109
+ gap: var(--s-0-5);
110
+ }
111
+
112
+ /* ---------- Body ---------- */
113
+ .artifact__body {
114
+ flex: 1;
115
+ min-height: 0;
116
+ overflow-y: auto;
117
+ scrollbar-gutter: stable;
118
+ /* Horizontal inset matches .artifact__head (--s-5) so the title and the
119
+ first line of body copy share one left edge. */
120
+ padding: var(--s-5) var(--s-5) var(--s-6);
121
+ font:
122
+ var(--md-sys-typescale-body-large-weight)
123
+ var(--md-sys-typescale-body-large-size) /
124
+ var(--md-sys-typescale-body-large-line-height)
125
+ var(--md-sys-typescale-body-large-font);
126
+ color: var(--md-sys-color-on-surface);
127
+ }
128
+
129
+ .artifact__body :where(h1, h2, h3, h4) {
130
+ color: var(--md-sys-color-on-surface);
131
+ letter-spacing: -0.01em;
132
+ margin: var(--s-4-5) 0 var(--s-2);
133
+ }
134
+ .artifact__body h1 { font: 600 20px/1.25 var(--md-sys-typescale-body-large-font); }
135
+ .artifact__body h2 { font: 600 16px/1.3 var(--md-sys-typescale-body-large-font); }
136
+ .artifact__body h3 { font: 600 14px/1.3 var(--md-sys-typescale-body-large-font); }
137
+ .artifact__body :where(h1, h2, h3, h4):first-child { margin-top: 0; }
138
+
139
+ .artifact__body p { margin: 0 0 var(--s-3); }
140
+ .artifact__body ul,
141
+ .artifact__body ol { margin: 0 0 var(--s-3); padding-left: var(--s-5-5); }
142
+ .artifact__body li { margin: var(--s-1) 0; }
143
+ .artifact__body strong { color: var(--md-sys-color-on-surface); font-weight: 600; }
144
+ .artifact__body em { font-style: italic; color: var(--md-sys-color-on-surface); }
145
+ .artifact__body code {
146
+ font: 500 12.5px/1.4 var(--xm-typescale-mono-font);
147
+ padding: 0;
148
+ background: transparent;
149
+ color: var(--md-sys-color-on-surface);
150
+ }
151
+
152
+ .artifact__body pre {
153
+ font: 500 12.5px/1.55 var(--xm-typescale-mono-font);
154
+ color: var(--md-sys-color-on-surface);
155
+ background: color-mix(in oklab, var(--md-sys-color-on-surface) 6%, transparent);
156
+ border: 1px solid color-mix(in oklab, var(--md-sys-color-on-surface) 10%, transparent);
157
+ border-radius: var(--md-sys-shape-corner-extra-small);
158
+ padding: var(--s-3) var(--s-4);
159
+ margin: var(--s-3) 0;
160
+ white-space: pre-wrap;
161
+ overflow-x: auto;
162
+ font-feature-settings: "tnum";
163
+ }
164
+ .artifact__body pre code {
165
+ font: inherit;
166
+ color: inherit;
167
+ }
168
+
169
+ .artifact__body blockquote {
170
+ margin: var(--s-3) 0;
171
+ padding-left: var(--s-3);
172
+ border-left: 2px solid color-mix(in oklab, var(--md-sys-color-on-surface) 30%, transparent);
173
+ color: var(--xm-color-on-surface-soft);
174
+ font-style: italic;
175
+ }
176
+
177
+ }`);
178
+ sheets = [sheet];
179
+ }
180
+ export default sheets;
@@ -2,7 +2,12 @@ import type { PropertyValues, TemplateResult } from "lit";
2
2
  import { XmField } from "../field/index.js";
3
3
  import type { SelectOption } from "../select/index.js";
4
4
  import type { XmOverlay } from "../overlay/index.js";
5
+ /**
6
+ * @fires change - Fired on commit with the new value in `detail`.
7
+ * @fires input - Fired on each edit with the current value in `detail`.
8
+ */
5
9
  export declare class XmAutocomplete extends XmField {
10
+ static styles: CSSStyleSheet[];
6
11
  /** Shared option model — `{ label, value, disabled? }` (AD-8a). */
7
12
  options: SelectOption[];
8
13
  /** Native placeholder shown when the query is empty. */