@xmesh/system-design 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (290) hide show
  1. package/README.md +2 -1
  2. package/custom-elements.json +18382 -0
  3. package/dist/lit/components/alert/index.d.ts +5 -0
  4. package/dist/lit/components/alert/index.js +8 -2
  5. package/dist/lit/components/alert/index.styles.js +215 -0
  6. package/dist/lit/components/app-bar/index.d.ts +1 -0
  7. package/dist/lit/components/app-bar/index.js +4 -2
  8. package/dist/lit/components/app-bar/index.styles.js +94 -0
  9. package/dist/lit/components/artifact/index.d.ts +5 -0
  10. package/dist/lit/components/artifact/index.js +14 -10
  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 +1 -0
  16. package/dist/lit/components/avatar/index.js +4 -2
  17. package/dist/lit/components/avatar/index.styles.js +76 -0
  18. package/dist/lit/components/avatar-group/index.d.ts +1 -0
  19. package/dist/lit/components/avatar-group/index.js +4 -2
  20. package/dist/lit/components/avatar-group/index.styles.js +74 -0
  21. package/dist/lit/components/badge/index.d.ts +1 -0
  22. package/dist/lit/components/badge/index.js +4 -2
  23. package/dist/lit/components/badge/index.styles.js +86 -0
  24. package/dist/lit/components/brand-mark/index.js +8 -9
  25. package/dist/lit/components/brand-mark/index.styles.js +123 -0
  26. package/dist/lit/components/breadcrumbs/index.d.ts +1 -0
  27. package/dist/lit/components/breadcrumbs/index.js +5 -4
  28. package/dist/lit/components/breadcrumbs/index.styles.js +105 -0
  29. package/dist/lit/components/bubble/index.d.ts +4 -0
  30. package/dist/lit/components/bubble/index.js +14 -11
  31. package/dist/lit/components/bubble/index.styles.js +196 -0
  32. package/dist/lit/components/button/index.d.ts +1 -0
  33. package/dist/lit/components/button/index.js +6 -13
  34. package/dist/lit/components/button/index.styles.js +356 -0
  35. package/dist/lit/components/card/index.d.ts +1 -0
  36. package/dist/lit/components/card/index.js +4 -2
  37. package/dist/lit/components/card/index.styles.js +113 -0
  38. package/dist/lit/components/chat/index.d.ts +6 -0
  39. package/dist/lit/components/chat/index.js +15 -10
  40. package/dist/lit/components/chat/index.styles.js +306 -0
  41. package/dist/lit/components/checkbox/index.d.ts +1 -0
  42. package/dist/lit/components/checkbox/index.js +7 -4
  43. package/dist/lit/components/checkbox/index.styles.js +140 -0
  44. package/dist/lit/components/chip/index.d.ts +5 -0
  45. package/dist/lit/components/chip/index.js +8 -2
  46. package/dist/lit/components/chip/index.styles.js +159 -0
  47. package/dist/lit/components/chip-group/index.d.ts +4 -0
  48. package/dist/lit/components/chip-group/index.js +7 -2
  49. package/dist/lit/components/chip-group/index.styles.js +33 -0
  50. package/dist/lit/components/code/index.d.ts +1 -0
  51. package/dist/lit/components/code/index.js +4 -3
  52. package/dist/lit/components/code/index.styles.js +56 -0
  53. package/dist/lit/components/composer/index.d.ts +6 -0
  54. package/dist/lit/components/composer/index.js +15 -10
  55. package/dist/lit/components/composer/index.styles.js +562 -0
  56. package/dist/lit/components/data-table/index.css +18 -0
  57. package/dist/lit/components/data-table/index.d.ts +30 -0
  58. package/dist/lit/components/data-table/index.js +120 -34
  59. package/dist/lit/components/data-table/index.styles.js +198 -0
  60. package/dist/lit/components/date-range/index.d.ts +4 -0
  61. package/dist/lit/components/date-range/index.js +7 -2
  62. package/dist/lit/components/date-range/index.styles.js +338 -0
  63. package/dist/lit/components/dialog/index.d.ts +4 -0
  64. package/dist/lit/components/dialog/index.js +7 -2
  65. package/dist/lit/components/dialog/index.styles.js +138 -0
  66. package/dist/lit/components/divider/index.d.ts +1 -0
  67. package/dist/lit/components/divider/index.js +4 -2
  68. package/dist/lit/components/divider/index.styles.js +41 -0
  69. package/dist/lit/components/empty-state/index.d.ts +1 -0
  70. package/dist/lit/components/empty-state/index.js +4 -2
  71. package/dist/lit/components/empty-state/index.styles.js +83 -0
  72. package/dist/lit/components/expansion-panel/index.d.ts +5 -0
  73. package/dist/lit/components/expansion-panel/index.js +8 -2
  74. package/dist/lit/components/expansion-panel/index.styles.js +134 -0
  75. package/dist/lit/components/field/index.d.ts +4 -0
  76. package/dist/lit/components/field/index.js +9 -4
  77. package/dist/lit/components/field/index.styles.js +237 -0
  78. package/dist/lit/components/file-input/index.d.ts +4 -0
  79. package/dist/lit/components/file-input/index.js +10 -4
  80. package/dist/lit/components/file-input/index.styles.js +271 -0
  81. package/dist/lit/components/form/index.d.ts +4 -0
  82. package/dist/lit/components/form/index.js +7 -2
  83. package/dist/lit/components/form/index.styles.js +43 -0
  84. package/dist/lit/components/grid/index.d.ts +1 -0
  85. package/dist/lit/components/grid/index.js +4 -2
  86. package/dist/lit/components/grid/index.styles.js +67 -0
  87. package/dist/lit/components/kbd/index.d.ts +1 -0
  88. package/dist/lit/components/kbd/index.js +4 -2
  89. package/dist/lit/components/kbd/index.styles.js +49 -0
  90. package/dist/lit/components/list/index.d.ts +4 -0
  91. package/dist/lit/components/list/index.js +7 -2
  92. package/dist/lit/components/list/index.styles.js +29 -0
  93. package/dist/lit/components/list-item/index.d.ts +1 -0
  94. package/dist/lit/components/list-item/index.js +4 -2
  95. package/dist/lit/components/list-item/index.styles.js +133 -0
  96. package/dist/lit/components/menu/index.d.ts +8 -0
  97. package/dist/lit/components/menu/index.js +11 -3
  98. package/dist/lit/components/menu/index.styles.js +108 -0
  99. package/dist/lit/components/multi-select/index.css +156 -0
  100. package/dist/lit/components/multi-select/index.d.ts +70 -0
  101. package/dist/lit/components/multi-select/index.js +497 -0
  102. package/dist/lit/components/multi-select/index.styles.js +170 -0
  103. package/dist/lit/components/navigation-drawer/index.d.ts +4 -0
  104. package/dist/lit/components/navigation-drawer/index.js +7 -2
  105. package/dist/lit/components/navigation-drawer/index.styles.js +128 -0
  106. package/dist/lit/components/overlay/index.d.ts +5 -0
  107. package/dist/lit/components/overlay/index.js +8 -2
  108. package/dist/lit/components/overlay/index.styles.js +185 -0
  109. package/dist/lit/components/pagination/index.d.ts +17 -0
  110. package/dist/lit/components/pagination/index.js +53 -8
  111. package/dist/lit/components/pagination/index.styles.js +116 -0
  112. package/dist/lit/components/popover/index.d.ts +5 -0
  113. package/dist/lit/components/popover/index.js +8 -2
  114. package/dist/lit/components/popover/index.styles.js +48 -0
  115. package/dist/lit/components/primitives/index.js +8 -9
  116. package/dist/lit/components/primitives/index.styles.js +518 -0
  117. package/dist/lit/components/progress/index.d.ts +1 -0
  118. package/dist/lit/components/progress/index.js +4 -2
  119. package/dist/lit/components/progress/index.styles.js +157 -0
  120. package/dist/lit/components/radio-group/index.d.ts +5 -0
  121. package/dist/lit/components/radio-group/index.js +10 -6
  122. package/dist/lit/components/radio-group/index.styles.js +192 -0
  123. package/dist/lit/components/select/index.d.ts +4 -0
  124. package/dist/lit/components/select/index.js +10 -2
  125. package/dist/lit/components/select/index.styles.js +165 -0
  126. package/dist/lit/components/sidebar-item/index.js +8 -9
  127. package/dist/lit/components/sidebar-item/index.styles.js +147 -0
  128. package/dist/lit/components/skeleton/index.d.ts +1 -0
  129. package/dist/lit/components/skeleton/index.js +4 -2
  130. package/dist/lit/components/skeleton/index.styles.js +95 -0
  131. package/dist/lit/components/slider/index.d.ts +5 -0
  132. package/dist/lit/components/slider/index.js +11 -4
  133. package/dist/lit/components/slider/index.styles.js +185 -0
  134. package/dist/lit/components/snackbar/index.d.ts +4 -0
  135. package/dist/lit/components/snackbar/index.js +14 -10
  136. package/dist/lit/components/snackbar/index.styles.js +293 -0
  137. package/dist/lit/components/stack/index.d.ts +1 -0
  138. package/dist/lit/components/stack/index.js +4 -2
  139. package/dist/lit/components/stack/index.styles.js +55 -0
  140. package/dist/lit/components/switch/index.d.ts +1 -0
  141. package/dist/lit/components/switch/index.js +7 -4
  142. package/dist/lit/components/switch/index.styles.js +140 -0
  143. package/dist/lit/components/table/index.d.ts +1 -0
  144. package/dist/lit/components/table/index.js +4 -2
  145. package/dist/lit/components/table/index.styles.js +99 -0
  146. package/dist/lit/components/tabs/index.d.ts +4 -0
  147. package/dist/lit/components/tabs/index.js +8 -4
  148. package/dist/lit/components/tabs/index.styles.js +130 -0
  149. package/dist/lit/components/text-field/index.d.ts +1 -0
  150. package/dist/lit/components/text-field/index.js +7 -2
  151. package/dist/lit/components/text-field/index.styles.js +104 -0
  152. package/dist/lit/components/textarea/index.d.ts +1 -0
  153. package/dist/lit/components/textarea/index.js +7 -2
  154. package/dist/lit/components/textarea/index.styles.js +69 -0
  155. package/dist/lit/components/tooltip/index.d.ts +1 -0
  156. package/dist/lit/components/tooltip/index.js +4 -2
  157. package/dist/lit/components/tooltip/index.styles.js +51 -0
  158. package/dist/lit/components/validation/index.d.ts +6 -0
  159. package/dist/lit/components/validation/index.js +15 -10
  160. package/dist/lit/components/validation/index.styles.js +400 -0
  161. package/dist/lit/index.d.ts +1 -0
  162. package/dist/lit/index.js +1 -0
  163. package/dist/react/XmAlert.d.ts +99 -0
  164. package/dist/react/XmAlert.js +47 -0
  165. package/dist/react/XmAppBar.d.ts +59 -0
  166. package/dist/react/XmAppBar.js +34 -0
  167. package/dist/react/XmArtifact.d.ts +113 -0
  168. package/dist/react/XmArtifact.js +48 -0
  169. package/dist/react/XmArtifactChip.d.ts +56 -0
  170. package/dist/react/XmArtifactChip.js +32 -0
  171. package/dist/react/XmAutocomplete.d.ts +153 -0
  172. package/dist/react/XmAutocomplete.js +70 -0
  173. package/dist/react/XmAvatar.d.ts +71 -0
  174. package/dist/react/XmAvatar.js +40 -0
  175. package/dist/react/XmAvatarGroup.d.ts +59 -0
  176. package/dist/react/XmAvatarGroup.js +34 -0
  177. package/dist/react/XmBadge.d.ts +67 -0
  178. package/dist/react/XmBadge.js +38 -0
  179. package/dist/react/XmBrandGlyph.d.ts +46 -0
  180. package/dist/react/XmBrandGlyph.js +24 -0
  181. package/dist/react/XmBrandMark.d.ts +71 -0
  182. package/dist/react/XmBrandMark.js +40 -0
  183. package/dist/react/XmBreadcrumbs.d.ts +56 -0
  184. package/dist/react/XmBreadcrumbs.js +32 -0
  185. package/dist/react/XmBubble.d.ts +69 -0
  186. package/dist/react/XmBubble.js +38 -0
  187. package/dist/react/XmBubbleActions.d.ts +59 -0
  188. package/dist/react/XmBubbleActions.js +34 -0
  189. package/dist/react/XmBubbleGroup.d.ts +82 -0
  190. package/dist/react/XmBubbleGroup.js +38 -0
  191. package/dist/react/XmButton.d.ts +89 -0
  192. package/dist/react/XmButton.js +48 -0
  193. package/dist/react/XmCard.d.ts +59 -0
  194. package/dist/react/XmCard.js +34 -0
  195. package/dist/react/XmChatShell.d.ts +110 -0
  196. package/dist/react/XmChatShell.js +48 -0
  197. package/dist/react/XmCheckbox.d.ts +145 -0
  198. package/dist/react/XmCheckbox.js +60 -0
  199. package/dist/react/XmChip.d.ts +99 -0
  200. package/dist/react/XmChip.js +48 -0
  201. package/dist/react/XmChipGroup.d.ts +79 -0
  202. package/dist/react/XmChipGroup.js +36 -0
  203. package/dist/react/XmCode.d.ts +55 -0
  204. package/dist/react/XmCode.js +32 -0
  205. package/dist/react/XmComposer.d.ts +123 -0
  206. package/dist/react/XmComposer.js +56 -0
  207. package/dist/react/XmDataTable.d.ts +125 -0
  208. package/dist/react/XmDataTable.js +66 -0
  209. package/dist/react/XmDateRange.d.ts +93 -0
  210. package/dist/react/XmDateRange.js +42 -0
  211. package/dist/react/XmDialog.d.ts +87 -0
  212. package/dist/react/XmDialog.js +41 -0
  213. package/dist/react/XmDivider.d.ts +55 -0
  214. package/dist/react/XmDivider.js +32 -0
  215. package/dist/react/XmEmptyState.d.ts +61 -0
  216. package/dist/react/XmEmptyState.js +34 -0
  217. package/dist/react/XmExpansionPanel.d.ts +101 -0
  218. package/dist/react/XmExpansionPanel.js +49 -0
  219. package/dist/react/XmFileInput.d.ts +151 -0
  220. package/dist/react/XmFileInput.js +70 -0
  221. package/dist/react/XmFileValidationBlock.d.ts +111 -0
  222. package/dist/react/XmFileValidationBlock.js +50 -0
  223. package/dist/react/XmForm.d.ts +91 -0
  224. package/dist/react/XmForm.js +38 -0
  225. package/dist/react/XmGrid.d.ts +59 -0
  226. package/dist/react/XmGrid.js +34 -0
  227. package/dist/react/XmKbd.d.ts +46 -0
  228. package/dist/react/XmKbd.js +24 -0
  229. package/dist/react/XmList.d.ts +83 -0
  230. package/dist/react/XmList.js +38 -0
  231. package/dist/react/XmListItem.d.ts +67 -0
  232. package/dist/react/XmListItem.js +38 -0
  233. package/dist/react/XmMenu.d.ts +98 -0
  234. package/dist/react/XmMenu.js +46 -0
  235. package/dist/react/XmMenuItem.d.ts +63 -0
  236. package/dist/react/XmMenuItem.js +36 -0
  237. package/dist/react/XmMultiSelect.d.ts +161 -0
  238. package/dist/react/XmMultiSelect.js +74 -0
  239. package/dist/react/XmNavigationDrawer.d.ts +93 -0
  240. package/dist/react/XmNavigationDrawer.js +42 -0
  241. package/dist/react/XmOverlay.d.ts +120 -0
  242. package/dist/react/XmOverlay.js +56 -0
  243. package/dist/react/XmPagination.d.ts +117 -0
  244. package/dist/react/XmPagination.js +58 -0
  245. package/dist/react/XmPopover.d.ts +90 -0
  246. package/dist/react/XmPopover.js +42 -0
  247. package/dist/react/XmProgress.d.ts +75 -0
  248. package/dist/react/XmProgress.js +42 -0
  249. package/dist/react/XmRadio.d.ts +88 -0
  250. package/dist/react/XmRadio.js +42 -0
  251. package/dist/react/XmRadioGroup.d.ts +139 -0
  252. package/dist/react/XmRadioGroup.js +58 -0
  253. package/dist/react/XmSelect.d.ts +152 -0
  254. package/dist/react/XmSelect.js +70 -0
  255. package/dist/react/XmSidebarItem.d.ts +75 -0
  256. package/dist/react/XmSidebarItem.js +42 -0
  257. package/dist/react/XmSkeleton.d.ts +71 -0
  258. package/dist/react/XmSkeleton.js +40 -0
  259. package/dist/react/XmSlider.d.ts +160 -0
  260. package/dist/react/XmSlider.js +76 -0
  261. package/dist/react/XmSnackbar.d.ts +110 -0
  262. package/dist/react/XmSnackbar.js +51 -0
  263. package/dist/react/XmStack.d.ts +71 -0
  264. package/dist/react/XmStack.js +40 -0
  265. package/dist/react/XmSwitch.d.ts +136 -0
  266. package/dist/react/XmSwitch.js +58 -0
  267. package/dist/react/XmTab.d.ts +79 -0
  268. package/dist/react/XmTab.js +38 -0
  269. package/dist/react/XmTabPanel.d.ts +55 -0
  270. package/dist/react/XmTabPanel.js +32 -0
  271. package/dist/react/XmTable.d.ts +57 -0
  272. package/dist/react/XmTable.js +32 -0
  273. package/dist/react/XmTabs.d.ts +82 -0
  274. package/dist/react/XmTabs.js +38 -0
  275. package/dist/react/XmTextField.d.ts +147 -0
  276. package/dist/react/XmTextField.js +62 -0
  277. package/dist/react/XmTextarea.d.ts +155 -0
  278. package/dist/react/XmTextarea.js +66 -0
  279. package/dist/react/XmTooltip.d.ts +67 -0
  280. package/dist/react/XmTooltip.js +38 -0
  281. package/dist/react/index.d.ts +59 -0
  282. package/dist/react/index.js +59 -0
  283. package/dist/react/react-utils.js +67 -0
  284. package/package.json +37 -9
  285. package/styles/_base-typography.css +86 -0
  286. package/styles/_primitives.css +54 -0
  287. package/styles/_reset.css +58 -0
  288. package/styles/base.css +23 -0
  289. package/vscode.css-custom-data.json +6 -0
  290. package/vscode.html-custom-data.json +979 -0
@@ -0,0 +1,356 @@
1
+ // GENERATED by scripts/gen-styles.mjs — do not edit. Source: lit/components/button/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
+ <Button /> — shared chrome and variants
12
+
13
+ Pairs with components/button/index.jsx. Variants are BEM modifiers:
14
+ .btn--primary / .btn--secondary / .btn--outline / .btn--ghost
15
+ .btn--danger / .btn--ghost-accent / .btn--ghost-outline
16
+ .btn--ghost.btn--danger ghost-danger compound (two orthogonal
17
+ modifiers; severity carried by icon
18
+ + label, not color).
19
+
20
+ Sizes are an orthogonal modifier:
21
+ .btn--xs 22px height, 11px text (toolbar chrome on dark surfaces)
22
+ .btn--sm 26px height, 12px text
23
+ .btn--md 32px height, 13px text (default)
24
+ .btn--lg 42px height, 14px text
25
+
26
+ Dark-surface variants (paired with the same neutral chrome but using the
27
+ canvas ink palette + canvas borders) — for buttons that sit on canvas,
28
+ sidebar, composer, or bubble surfaces:
29
+ .btn--outline-canvas hairline border, transparent fill
30
+ .btn--ghost-canvas borderless, soft hover fill
31
+ .btn--ghost-accent-canvas accent-tinted ghost on dark
32
+
33
+ Forced-state helpers (.is-hover / .is-focus / .is-active) preview
34
+ pseudo-class visuals in design canvases without requiring real
35
+ keyboard/mouse focus.
36
+ ============================================ */
37
+
38
+ /* ---------- Shared chrome ---------- */
39
+ .btn {
40
+ appearance: none;
41
+ display: inline-flex;
42
+ align-items: center;
43
+ justify-content: center;
44
+ gap: var(--s-1-5);
45
+ font-family: var(--md-sys-typescale-label-large-font);
46
+ line-height: 1;
47
+ user-select: none;
48
+ white-space: nowrap;
49
+ cursor: pointer;
50
+ transition:
51
+ background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
52
+ color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
53
+ border-color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
54
+ box-shadow var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
55
+ }
56
+ .btn svg { flex-shrink: 0; }
57
+ .btn:focus { outline: none; }
58
+ .btn:focus-visible,
59
+ .btn.is-focus {
60
+ outline: none;
61
+ box-shadow: var(--xm-state-focus-ring);
62
+ }
63
+
64
+ /* ---------- Sizes ---------- */
65
+ .btn--xs { padding: 3px 7px; font: 600 11px/1 var(--md-sys-typescale-label-large-font); border-radius: 5px; gap: var(--s-1); }
66
+ .btn--sm { padding: 5px var(--s-2-5); font: 600 12px/1 var(--md-sys-typescale-label-large-font); border-radius: 6px; }
67
+ .btn--md { padding: 9px var(--s-3-5); font: 600 13px/1 var(--md-sys-typescale-label-large-font); border-radius: var(--md-sys-shape-corner-button); }
68
+ .btn--lg { padding: var(--s-3) var(--s-4-5); font: 600 14px/1 var(--md-sys-typescale-label-large-font); border-radius: var(--md-sys-shape-corner-button); }
69
+
70
+ /* ---------- Variants ---------- */
71
+
72
+ /* primary — accent fill, the workhorse CTA. Uses --xm-color-primary-fill
73
+ (a darker coral) rather than --md-sys-color-primary so white-on-fill
74
+ clears WCAG AA; the lighter primary role stays for accent text/border. */
75
+ .btn--primary {
76
+ border: 1px solid var(--xm-color-primary-pressed);
77
+ background: var(--xm-color-primary-fill);
78
+ color: var(--md-sys-color-on-primary);
79
+ box-shadow: var(--md-sys-elevation-level0);
80
+ }
81
+ .btn--primary:hover,
82
+ .btn--primary.is-hover { background: var(--xm-color-primary-pressed); }
83
+ .btn--primary:active,
84
+ .btn--primary.is-active { box-shadow: var(--xm-elevation-pressed); transform: translateY(1px); }
85
+
86
+ /* secondary — solid neutral, used for non-destructive secondary CTAs */
87
+ .btn--secondary {
88
+ border: 1px solid var(--md-sys-color-secondary);
89
+ background: var(--md-sys-color-secondary);
90
+ color: var(--md-sys-color-on-secondary);
91
+ }
92
+ .btn--secondary:hover,
93
+ .btn--secondary.is-hover {
94
+ background: color-mix(in oklab, var(--md-sys-color-on-secondary) var(--md-sys-state-hover-state-layer-opacity), var(--md-sys-color-secondary));
95
+ }
96
+
97
+ /* outline — bordered card, used for cancel / pair-actions */
98
+ .btn--outline {
99
+ border: 1px solid var(--md-sys-color-outline-variant);
100
+ background: var(--md-sys-color-inverse-surface);
101
+ color: var(--md-sys-color-inverse-on-surface);
102
+ }
103
+ .btn--outline:hover,
104
+ .btn--outline.is-hover {
105
+ background: color-mix(in oklab, var(--md-sys-color-inverse-on-surface) var(--md-sys-state-hover-state-layer-opacity), var(--md-sys-color-inverse-surface));
106
+ border-color: var(--md-sys-color-outline);
107
+ }
108
+ .btn--outline:focus-visible,
109
+ .btn--outline.is-focus { border-color: var(--md-sys-color-primary); }
110
+
111
+ /* ghost — transparent, sits on the dark canvas (sidebar, top bar) */
112
+ .btn--ghost {
113
+ border: 1px solid transparent;
114
+ background: transparent;
115
+ color: var(--md-sys-color-on-surface);
116
+ }
117
+ .btn--ghost:hover,
118
+ .btn--ghost.is-hover {
119
+ background: color-mix(in oklab, var(--md-sys-color-on-surface) var(--md-sys-state-hover-state-layer-opacity), transparent);
120
+ color: var(--md-sys-color-on-surface);
121
+ }
122
+ /* ghost selected — used by toggle/tab buttons. Persistent fill + hairline
123
+ to stand out next to inactive siblings in a segmented group. */
124
+ .btn--ghost.is-active {
125
+ background: var(--md-sys-color-surface-container-lowest);
126
+ border-color: var(--md-sys-color-outline);
127
+ color: var(--md-sys-color-on-surface);
128
+ }
129
+
130
+ /* ghost-danger — neutral ghost; severity carried by trash/x icon + label.
131
+ Composes with .btn--ghost: <button class="btn btn--ghost btn--danger"> */
132
+ .btn--ghost.btn--danger {
133
+ color: var(--md-sys-color-on-surface);
134
+ border-color: var(--md-sys-color-outline);
135
+ }
136
+ .btn--ghost.btn--danger:hover,
137
+ .btn--ghost.btn--danger.is-hover {
138
+ background: var(--md-sys-color-surface-container-lowest);
139
+ color: var(--md-sys-color-on-surface);
140
+ }
141
+
142
+ /* ghost-outline — transparent fill + hairline border on card surfaces.
143
+ Sits between .btn--outline (filled card) and .btn--ghost (no chrome):
144
+ the rest border outlines the affordance without lifting it onto a new
145
+ surface. Used when a ghost needs a quiet anchor in busy layouts
146
+ (toolbars on cards, secondary actions next to a primary CTA). */
147
+ .btn--ghost-outline {
148
+ border: 1px solid var(--md-sys-color-outline-variant);
149
+ background: transparent;
150
+ color: var(--md-sys-color-inverse-on-surface);
151
+ }
152
+ .btn--ghost-outline:hover,
153
+ .btn--ghost-outline.is-hover {
154
+ background: color-mix(in oklab, var(--md-sys-color-inverse-on-surface) var(--md-sys-state-hover-state-layer-opacity), var(--md-sys-color-inverse-surface));
155
+ border-color: var(--md-sys-color-outline);
156
+ }
157
+ .btn--ghost-outline:focus-visible,
158
+ .btn--ghost-outline.is-focus { border-color: var(--md-sys-color-primary); }
159
+
160
+ /* ghost-accent — accent-tinted secondary, used by file pills etc. One tone,
161
+ not a stack — written as a single hyphenated modifier per BEM. The resting
162
+ fill is the accent wash over the card; since the card tier is theme-following
163
+ (ADR 0006) that wash is dark in dark theme, so the resting ink is the card's
164
+ inverse-on-surface (light there). On hover the fill becomes the full coral
165
+ primary-container, so the ink steps to on-primary-container (dark). */
166
+ .btn--ghost-accent {
167
+ border-color: color-mix(in oklab, var(--md-sys-color-primary-container) 80%, transparent);
168
+ color: var(--md-sys-color-inverse-on-surface);
169
+ background: color-mix(in oklch, var(--md-sys-color-primary-container) 30%, var(--md-sys-color-inverse-surface));
170
+ }
171
+ .btn--ghost-accent:hover,
172
+ .btn--ghost-accent.is-hover {
173
+ background: var(--md-sys-color-primary-container);
174
+ border-color: var(--md-sys-color-primary);
175
+ color: var(--md-sys-color-on-primary-container);
176
+ }
177
+
178
+ /* outline-canvas — hairline + transparent fill, canvas ink palette.
179
+ Used by artifact "Download" pills inside bubbles, and any outline action
180
+ that sits on canvas / composer / sidebar surfaces. */
181
+ .btn--outline-canvas {
182
+ border: 1px solid color-mix(in oklab, var(--md-sys-color-on-surface) 32%, transparent);
183
+ background: transparent;
184
+ color: var(--md-sys-color-on-surface);
185
+ }
186
+ .btn--outline-canvas:hover,
187
+ .btn--outline-canvas.is-hover {
188
+ background: color-mix(in oklab, var(--md-sys-color-on-surface) 10%, transparent);
189
+ border-color: var(--xm-color-on-surface-soft);
190
+ }
191
+ .btn--outline-canvas:focus-visible,
192
+ .btn--outline-canvas.is-focus { border-color: var(--md-sys-color-primary); }
193
+
194
+ /* ghost-canvas — borderless toolbar chrome on dark surfaces. Mirrors
195
+ .btn--ghost but uses the canvas ink palette and the composer/canvas
196
+ hover fill so it works consistently across composer, bubble actions,
197
+ and chat hover toolbars. */
198
+ .btn--ghost-canvas {
199
+ border: 1px solid transparent;
200
+ background: transparent;
201
+ color: var(--md-sys-color-on-surface);
202
+ }
203
+ .btn--ghost-canvas:hover,
204
+ .btn--ghost-canvas.is-hover {
205
+ background: color-mix(in oklab, var(--md-sys-color-on-surface) var(--md-sys-state-hover-state-layer-opacity), transparent);
206
+ color: var(--md-sys-color-on-surface);
207
+ }
208
+ .btn--ghost-canvas.is-active {
209
+ background: var(--md-sys-color-surface-container-lowest);
210
+ border-color: var(--md-sys-color-outline);
211
+ color: var(--md-sys-color-on-surface);
212
+ }
213
+
214
+ /* ghost-accent-canvas — accent-tinted ghost on dark surfaces. */
215
+ .btn--ghost-accent-canvas {
216
+ border: 1px solid transparent;
217
+ background: transparent;
218
+ color: var(--md-sys-color-primary);
219
+ }
220
+ .btn--ghost-accent-canvas:hover,
221
+ .btn--ghost-accent-canvas.is-hover {
222
+ background: color-mix(in oklab, var(--md-sys-color-primary) 14%, transparent);
223
+ color: var(--xm-color-primary-pressed);
224
+ }
225
+
226
+ /* danger — neutral solid; destructive intent expressed by trash icon + label.
227
+ Rides the surface family (surface-container-high), so the ink is on-surface
228
+ (rule 7a). Hover darkens within the surface ramp rather than jumping to the
229
+ card tier, keeping the ink anchored to one surface family. */
230
+ .btn--danger {
231
+ border: 1px solid var(--md-sys-color-outline);
232
+ background: var(--md-sys-color-surface-container-high);
233
+ color: var(--md-sys-color-on-surface);
234
+ }
235
+ .btn--danger:hover,
236
+ .btn--danger.is-hover {
237
+ background: var(--md-sys-color-surface-container-highest);
238
+ border-color: var(--md-sys-color-on-surface);
239
+ }
240
+ .btn--danger:focus-visible,
241
+ .btn--danger.is-focus {
242
+ box-shadow: var(--xm-state-focus-ring);
243
+ }
244
+
245
+ /* ---------- Icon-only ---------- */
246
+ /* Square chip variant. Composes with any tone: pass an iconLeft and
247
+ no children, or use .btn__icon directly. Sizes are square. */
248
+ .btn--icon-only {
249
+ padding: 0;
250
+ gap: 0;
251
+ }
252
+ .btn--icon-only.btn--xs { width: 22px; height: 22px; }
253
+ .btn--icon-only.btn--sm { width: 28px; height: 28px; }
254
+ .btn--icon-only.btn--md { width: 32px; height: 32px; }
255
+ .btn--icon-only.btn--lg { width: 38px; height: 38px; }
256
+
257
+ /* ---------- Full-width ---------- */
258
+ /* Stretches the button to fill its container. The label hugs the leading
259
+ edge (next to icon-left) and \`margin-inline-end: auto\` pushes any
260
+ icon-right slot (e.g. a kbd hint) to the trailing edge. */
261
+ .btn--full-width {
262
+ width: 100%;
263
+ }
264
+ .btn--full-width .btn__label {
265
+ margin-inline-end: auto;
266
+ text-align: start;
267
+ }
268
+
269
+ /* ---------- Disabled / loading ----------
270
+ No blanket opacity: dimming the whole control fades ink AND surface
271
+ together and drops the label below WCAG AA (POLICIES 7a). Instead each
272
+ variant swaps to a validated disabled ink (filled variants also flatten
273
+ to the disabled container) so the label stays legible. */
274
+ .btn[disabled],
275
+ .btn[aria-busy="true"],
276
+ .btn.is-disabled {
277
+ cursor: not-allowed;
278
+ box-shadow: none;
279
+ }
280
+ /* filled variants — flatten fill to the disabled container + muted ink */
281
+ .btn--primary[disabled], .btn--primary.is-disabled,
282
+ .btn--secondary[disabled], .btn--secondary.is-disabled,
283
+ .btn--danger[disabled], .btn--danger.is-disabled {
284
+ background: var(--xm-state-disabled-container);
285
+ border-color: var(--md-sys-color-outline-variant);
286
+ color: var(--xm-color-on-surface-disabled);
287
+ }
288
+ /* surface-ink variants (ghost / outline-canvas / ghost-canvas on the canvas) */
289
+ .btn--ghost[disabled], .btn--ghost.is-disabled,
290
+ .btn--ghost-canvas[disabled], .btn--ghost-canvas.is-disabled,
291
+ .btn--ghost-accent-canvas[disabled], .btn--ghost-accent-canvas.is-disabled,
292
+ .btn--outline-canvas[disabled], .btn--outline-canvas.is-disabled {
293
+ color: var(--xm-color-on-surface-disabled);
294
+ }
295
+ /* card-ink variants (outline / ghost-outline / ghost-accent on the card tier) */
296
+ .btn--outline[disabled], .btn--outline.is-disabled,
297
+ .btn--ghost-outline[disabled], .btn--ghost-outline.is-disabled,
298
+ .btn--ghost-accent[disabled], .btn--ghost-accent.is-disabled {
299
+ color: var(--xm-color-inverse-on-surface-disabled);
300
+ }
301
+ .btn[disabled]:hover,
302
+ .btn[aria-busy="true"]:hover,
303
+ .btn.is-disabled:hover {
304
+ filter: none;
305
+ transform: none;
306
+ }
307
+ /* Disabled :hover is a no-op — hold the disabled fill/ink set above so
308
+ hovering a disabled control doesn't restore the enabled (and contrast-
309
+ failing) appearance. */
310
+ .btn--primary[disabled]:hover, .btn--primary.is-disabled:hover,
311
+ .btn--secondary[disabled]:hover, .btn--secondary.is-disabled:hover,
312
+ .btn--danger[disabled]:hover, .btn--danger.is-disabled:hover {
313
+ background: var(--xm-state-disabled-container);
314
+ border-color: var(--md-sys-color-outline-variant);
315
+ color: var(--xm-color-on-surface-disabled);
316
+ }
317
+ .btn--ghost[disabled]:hover, .btn--ghost.is-disabled:hover,
318
+ .btn--ghost-canvas[disabled]:hover, .btn--ghost-canvas.is-disabled:hover,
319
+ .btn--outline-canvas[disabled]:hover, .btn--outline-canvas.is-disabled:hover,
320
+ .btn--ghost-accent-canvas[disabled]:hover, .btn--ghost-accent-canvas.is-disabled:hover {
321
+ background: transparent;
322
+ color: var(--xm-color-on-surface-disabled);
323
+ }
324
+ .btn--outline[disabled]:hover, .btn--outline.is-disabled:hover,
325
+ .btn--ghost-outline[disabled]:hover, .btn--ghost-outline.is-disabled:hover,
326
+ .btn--ghost-accent[disabled]:hover, .btn--ghost-accent.is-disabled:hover {
327
+ background: var(--md-sys-color-inverse-surface);
328
+ border-color: var(--md-sys-color-outline-variant);
329
+ color: var(--xm-color-inverse-on-surface-disabled);
330
+ }
331
+
332
+ /* ---------- Inner slots ---------- */
333
+ .btn__icon { display: inline-flex; align-items: center; }
334
+ .btn__label { display: inline-block; }
335
+
336
+ /* ---------- Loading spinner ---------- */
337
+ .btn__spinner {
338
+ display: inline-block;
339
+ width: 12px;
340
+ height: 12px;
341
+ border: 1.6px solid currentColor;
342
+ border-top-color: transparent;
343
+ border-right-color: transparent;
344
+ border-radius: 50%;
345
+ animation: btn-spin 0.7s linear infinite;
346
+ flex-shrink: 0;
347
+ opacity: 0.85;
348
+ }
349
+ @keyframes btn-spin {
350
+ to { transform: rotate(360deg); }
351
+ }
352
+
353
+ }`);
354
+ sheets = [sheet];
355
+ }
356
+ export default sheets;
@@ -3,6 +3,7 @@ import type { TemplateResult } from "lit";
3
3
  type CardSize = "xs" | "sm" | "md" | "lg";
4
4
  type CardElevation = 0 | 1 | 2 | 3 | 4 | 5;
5
5
  export declare class XmCard extends LitElement {
6
+ static styles: CSSStyleSheet[];
6
7
  elevation: CardElevation;
7
8
  size: CardSize;
8
9
  private _mo;
@@ -37,9 +37,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
37
37
  };
38
38
  import { LitElement, html } from "lit";
39
39
  import { customElement, property } from "lit/decorators.js";
40
+ import cardSheets from "./index.styles.js";
40
41
  // Resolve CSS relative to the *built* file:
41
42
  // lit/build/components/card/index.js → ../card/index.css.
42
- const CARD_CSS = new URL("../card/index.css", import.meta.url).href;
43
43
  let XmCard = class XmCard extends LitElement {
44
44
  constructor() {
45
45
  super(...arguments);
@@ -50,6 +50,9 @@ let XmCard = class XmCard extends LitElement {
50
50
  this.requestUpdate();
51
51
  };
52
52
  }
53
+ // Adopted from the build-generated sheets (scripts/gen-styles.mjs) — no
54
+ // runtime URL fetch (ADR 0012). Cascade order preserved from the old <link>s.
55
+ static { this.styles = [...cardSheets]; }
53
56
  render() {
54
57
  const elevation = [0, 1, 2, 3, 4, 5].includes(this.elevation)
55
58
  ? this.elevation
@@ -62,7 +65,6 @@ let XmCard = class XmCard extends LitElement {
62
65
  const actionEmpty = this._slotEmpty("action");
63
66
  const footerHidden = footerEmpty && actionEmpty;
64
67
  return html `
65
- <link rel="stylesheet" href="${CARD_CSS}" />
66
68
  <style>
67
69
  :host {
68
70
  display: block;
@@ -0,0 +1,113 @@
1
+ // GENERATED by scripts/gen-styles.mjs — do not edit. Source: lit/components/card/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-card> — general-purpose containment surface.
12
+
13
+ Surface / ink (AD-13; ADR 0006): the CARD-STACK family — background
14
+ var(--md-sys-color-inverse-surface), ink var(--md-sys-color-inverse-on-surface).
15
+ The card tier is theme-following: a lifted dark surface in dark theme, white
16
+ in light; the ink follows (light on the dark card, dark on the white one).
17
+
18
+ Spec (DESIGN components.card): 1px outline-variant border, 14px medium
19
+ corner, level2 elevation (1px brightening top edge + soft 24px drop).
20
+ Header / footer split from the body by a 1px rule — not padding alone.
21
+ Header padding 22px 24px 14px; footer 14px 24px 18px.
22
+
23
+ BEM: block \`card\`; elements \`__header\` \`__body\` \`__footer\`
24
+ \`__footer-content\` \`__action\`; modifiers \`--elevation-0..5\`, \`--xs|sm|md|lg\`.
25
+ ============================================ */
26
+
27
+ .card {
28
+ display: flex;
29
+ flex-direction: column;
30
+ box-sizing: border-box;
31
+ background: var(--md-sys-color-inverse-surface);
32
+ color: var(--md-sys-color-inverse-on-surface);
33
+ border: 1px solid var(--md-sys-color-outline-variant);
34
+ border-radius: var(--md-sys-shape-corner-medium);
35
+ box-shadow: var(--md-sys-elevation-level2);
36
+ overflow: hidden;
37
+ }
38
+
39
+ /* ---------- Elevation ---------- */
40
+ .card--elevation-0 { box-shadow: var(--md-sys-elevation-level0); }
41
+ .card--elevation-1 { box-shadow: var(--md-sys-elevation-level1); }
42
+ .card--elevation-2 { box-shadow: var(--md-sys-elevation-level2); }
43
+ .card--elevation-3 { box-shadow: var(--md-sys-elevation-level3); }
44
+ .card--elevation-4 { box-shadow: var(--md-sys-elevation-level4); }
45
+ .card--elevation-5 { box-shadow: var(--md-sys-elevation-level5); }
46
+
47
+ /* ---------- Header ---------- */
48
+ .card__header {
49
+ display: flex;
50
+ align-items: center;
51
+ gap: var(--s-2);
52
+ padding: var(--s-5) var(--s-6) var(--s-3);
53
+ border-bottom: 1px solid var(--md-sys-color-outline-variant);
54
+ font-family: var(--md-sys-typescale-title-medium-font);
55
+ font-size: var(--md-sys-typescale-title-medium-size);
56
+ line-height: var(--md-sys-typescale-title-medium-line-height);
57
+ font-weight: var(--md-sys-typescale-title-medium-weight);
58
+ letter-spacing: var(--md-sys-typescale-title-medium-tracking);
59
+ color: var(--md-sys-color-inverse-on-surface);
60
+ }
61
+ .card__header.is-empty {
62
+ display: none;
63
+ }
64
+
65
+ /* ---------- Body ---------- */
66
+ .card__body {
67
+ flex: 1 1 auto;
68
+ padding: var(--s-5) var(--s-6);
69
+ font-family: var(--md-sys-typescale-body-medium-font);
70
+ font-size: var(--md-sys-typescale-body-medium-size);
71
+ line-height: var(--md-sys-typescale-body-medium-line-height);
72
+ letter-spacing: var(--md-sys-typescale-body-medium-tracking);
73
+ color: var(--md-sys-color-inverse-on-surface);
74
+ }
75
+
76
+ /* ---------- Footer ---------- */
77
+ .card__footer {
78
+ display: flex;
79
+ align-items: center;
80
+ gap: var(--s-3);
81
+ padding: var(--s-3) var(--s-6) var(--s-4);
82
+ border-top: 1px solid var(--md-sys-color-outline-variant);
83
+ }
84
+ .card__footer.is-empty {
85
+ display: none;
86
+ }
87
+ .card__footer-content {
88
+ flex: 1 1 auto;
89
+ min-width: 0;
90
+ font-size: var(--md-sys-typescale-body-small-size);
91
+ line-height: var(--md-sys-typescale-body-small-line-height);
92
+ color: var(--xm-color-inverse-on-surface-muted);
93
+ }
94
+ .card__footer-content.is-empty {
95
+ display: none;
96
+ }
97
+
98
+ /* ---------- Action (singular trailing region in the footer) ---------- */
99
+ .card__action {
100
+ display: inline-flex;
101
+ align-items: center;
102
+ gap: var(--s-2);
103
+ flex-shrink: 0;
104
+ margin-inline-start: auto;
105
+ }
106
+ .card__action.is-empty {
107
+ display: none;
108
+ }
109
+
110
+ }`);
111
+ sheets = [sheet];
112
+ }
113
+ export default sheets;
@@ -25,6 +25,12 @@ export interface ThreadMessage {
25
25
  atts?: BubbleAttachment[];
26
26
  artifact?: BubbleArtifact | null;
27
27
  }
28
+ /**
29
+ * @fires artifact-close - Fired when the artifact panel is closed.
30
+ * @fires artifact-open - Fired when an artifact is opened.
31
+ * @fires cancel - Fired when the action is cancelled.
32
+ * @fires send - Fired when the user sends the composed content.
33
+ */
28
34
  export declare class XmChatShell extends LitElement {
29
35
  conversations: ConversationGroup[];
30
36
  thread: ThreadMessage[];
@@ -52,17 +52,16 @@ import "../sidebar-item/index.js";
52
52
  import "../bubble/index.js";
53
53
  import "../composer/index.js";
54
54
  import "../artifact/index.js";
55
+ import chatSheets from "./index.styles.js";
56
+ import primitivesSheets from "../primitives/index.styles.js";
57
+ // Light DOM: adopt the build-generated sheets into the document — no runtime
58
+ // URL fetch (ADR 0012). Deduped by sheet identity (the generated modules are
59
+ // singletons); the CSS is wrapped in @layer components (spine AD-2).
55
60
  if (typeof document !== "undefined") {
56
- for (const href of [
57
- new URL("../chat/index.css", import.meta.url).href,
58
- new URL("../primitives/index.css", import.meta.url).href,
59
- ]) {
60
- if (document.querySelector(`link[rel="stylesheet"][href="${href}"]`))
61
- continue;
62
- const link = document.createElement("link");
63
- link.rel = "stylesheet";
64
- link.href = href;
65
- document.head.appendChild(link);
61
+ for (const sheet of [...chatSheets, ...primitivesSheets]) {
62
+ if (!document.adoptedStyleSheets.includes(sheet)) {
63
+ document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];
64
+ }
66
65
  }
67
66
  }
68
67
  /* ---------- Inline icon SVG fragments (used in topbar / sidebar chrome) */
@@ -175,6 +174,12 @@ const htmlToText = (html) => {
175
174
  div.innerHTML = html;
176
175
  return (div.textContent || "").trim();
177
176
  };
177
+ /**
178
+ * @fires artifact-close - Fired when the artifact panel is closed.
179
+ * @fires artifact-open - Fired when an artifact is opened.
180
+ * @fires cancel - Fired when the action is cancelled.
181
+ * @fires send - Fired when the user sends the composed content.
182
+ */
178
183
  let XmChatShell = class XmChatShell extends LitElement {
179
184
  constructor() {
180
185
  super(...arguments);