@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,38 @@
1
+ import React, { forwardRef, useRef } from "react";
2
+ import "../lit/components/bubble/index.js";
3
+ import { useEventListener, createForwardedRefHandler } from "./react-utils.js";
4
+
5
+ export const XmBubbleGroup = forwardRef((props, forwardedRef) => {
6
+ const ref = useRef(null);
7
+ const {
8
+ variant,
9
+ className,
10
+ exportparts,
11
+ htmlFor,
12
+ part,
13
+ tabIndex,
14
+ onArtifactDownload,
15
+ onArtifactOpen,
16
+ ...restProps
17
+ } = props;
18
+
19
+ /** Event listeners - run once */
20
+ useEventListener(ref, "artifact-download", props.onArtifactDownload);
21
+ useEventListener(ref, "artifact-open", props.onArtifactOpen);
22
+
23
+ return React.createElement(
24
+ "xm-bubble-group",
25
+ {
26
+ ref: createForwardedRefHandler(ref, forwardedRef),
27
+ ...restProps,
28
+ variant: variant,
29
+ class: className,
30
+ exportparts: exportparts,
31
+ for: htmlFor ?? props["for"],
32
+ part: part,
33
+ tabindex: tabIndex ?? props["tabindex"],
34
+ style: { ...props.style },
35
+ },
36
+ props.children,
37
+ );
38
+ });
@@ -0,0 +1,89 @@
1
+ import React from "react";
2
+ import { XmButton as XmButtonElement } from "../lit/components/button/index.js";
3
+
4
+ export type { XmButtonElement };
5
+
6
+ export interface XmButtonProps extends Pick<
7
+ React.AllHTMLAttributes<HTMLElement>,
8
+ | "children"
9
+ | "dir"
10
+ | "hidden"
11
+ | "id"
12
+ | "lang"
13
+ | "slot"
14
+ | "style"
15
+ | "title"
16
+ | "translate"
17
+ | "onClick"
18
+ | "onFocus"
19
+ | "onBlur"
20
+ > {
21
+ /** undefined */
22
+ iconOnly?: boolean;
23
+
24
+ /** undefined */
25
+ fullWidth?: boolean;
26
+
27
+ /** Persistent active/selected state — used by toggle/tab buttons. Reuses
28
+ the same .is-active visual the design canvases trigger via forceState. */
29
+ selected?: boolean;
30
+
31
+ /** undefined */
32
+ disabled?: boolean;
33
+
34
+ /** undefined */
35
+ loading?: boolean;
36
+
37
+ /** undefined */
38
+ variant?: XmButtonElement["variant"];
39
+
40
+ /** undefined */
41
+ size?: XmButtonElement["size"];
42
+
43
+ /** undefined */
44
+ type?: XmButtonElement["type"];
45
+
46
+ /** undefined */
47
+ forceState?: XmButtonElement["forceState"];
48
+
49
+ /** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
50
+ className?: string;
51
+
52
+ /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
53
+ exportparts?: string;
54
+
55
+ /** Used for labels to link them with their inputs (using input id). */
56
+ htmlFor?: string;
57
+
58
+ /** Used to help React identify which items have changed, are added, or are removed within a list. */
59
+ key?: number | string;
60
+
61
+ /** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
62
+ part?: string;
63
+
64
+ /** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
65
+ ref?: React.Ref<XmButtonElement>;
66
+
67
+ /** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
68
+ tabIndex?: number;
69
+ }
70
+
71
+ /**
72
+ *
73
+ *
74
+ * ## Attributes & Properties
75
+ *
76
+ * Component attributes and properties that can be applied to the element or by using JavaScript.
77
+ *
78
+ * - `variant`: undefined
79
+ * - `size`: undefined
80
+ * - `icon-only`/`iconOnly`: undefined
81
+ * - `full-width`/`fullWidth`: undefined
82
+ * - `selected`: Persistent active/selected state — used by toggle/tab buttons. Reuses
83
+ * the same .is-active visual the design canvases trigger via forceState.
84
+ * - `type`: undefined
85
+ * - `disabled`: undefined
86
+ * - `loading`: undefined
87
+ * - `force-state`/`forceState`: undefined
88
+ */
89
+ export const XmButton: React.ForwardRefExoticComponent<XmButtonProps>;
@@ -0,0 +1,48 @@
1
+ import React, { forwardRef, useRef } from "react";
2
+ import "../lit/components/button/index.js";
3
+ import { createForwardedRefHandler } from "./react-utils.js";
4
+
5
+ export const XmButton = forwardRef((props, forwardedRef) => {
6
+ const ref = useRef(null);
7
+ const {
8
+ iconOnly,
9
+ fullWidth,
10
+ selected,
11
+ disabled,
12
+ loading,
13
+ variant,
14
+ size,
15
+ type,
16
+ forceState,
17
+ className,
18
+ exportparts,
19
+ htmlFor,
20
+ part,
21
+ tabIndex,
22
+ ...restProps
23
+ } = props;
24
+
25
+ return React.createElement(
26
+ "xm-button",
27
+ {
28
+ ref: createForwardedRefHandler(ref, forwardedRef),
29
+ ...restProps,
30
+ variant: variant,
31
+ size: size,
32
+ type: type,
33
+ "force-state": forceState ?? props["force-state"],
34
+ class: className,
35
+ exportparts: exportparts,
36
+ for: htmlFor ?? props["for"],
37
+ part: part,
38
+ tabindex: tabIndex ?? props["tabindex"],
39
+ "icon-only": iconOnly ? true : undefined,
40
+ "full-width": fullWidth ? true : undefined,
41
+ selected: selected ? true : undefined,
42
+ disabled: disabled ? true : undefined,
43
+ loading: loading ? true : undefined,
44
+ style: { ...props.style },
45
+ },
46
+ props.children,
47
+ );
48
+ });
@@ -0,0 +1,59 @@
1
+ import React from "react";
2
+ import { XmCard as XmCardElement } from "../lit/components/card/index.js";
3
+
4
+ export type { XmCardElement };
5
+
6
+ export interface XmCardProps extends Pick<
7
+ React.AllHTMLAttributes<HTMLElement>,
8
+ | "children"
9
+ | "dir"
10
+ | "hidden"
11
+ | "id"
12
+ | "lang"
13
+ | "slot"
14
+ | "style"
15
+ | "title"
16
+ | "translate"
17
+ | "onClick"
18
+ | "onFocus"
19
+ | "onBlur"
20
+ > {
21
+ /** undefined */
22
+ elevation?: XmCardElement["elevation"];
23
+
24
+ /** undefined */
25
+ size?: XmCardElement["size"];
26
+
27
+ /** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
28
+ className?: string;
29
+
30
+ /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
31
+ exportparts?: string;
32
+
33
+ /** Used for labels to link them with their inputs (using input id). */
34
+ htmlFor?: string;
35
+
36
+ /** Used to help React identify which items have changed, are added, or are removed within a list. */
37
+ key?: number | string;
38
+
39
+ /** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
40
+ part?: string;
41
+
42
+ /** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
43
+ ref?: React.Ref<XmCardElement>;
44
+
45
+ /** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
46
+ tabIndex?: number;
47
+ }
48
+
49
+ /**
50
+ *
51
+ *
52
+ * ## Attributes & Properties
53
+ *
54
+ * Component attributes and properties that can be applied to the element or by using JavaScript.
55
+ *
56
+ * - `elevation`: undefined
57
+ * - `size`: undefined
58
+ */
59
+ export const XmCard: React.ForwardRefExoticComponent<XmCardProps>;
@@ -0,0 +1,34 @@
1
+ import React, { forwardRef, useRef } from "react";
2
+ import "../lit/components/card/index.js";
3
+ import { createForwardedRefHandler } from "./react-utils.js";
4
+
5
+ export const XmCard = forwardRef((props, forwardedRef) => {
6
+ const ref = useRef(null);
7
+ const {
8
+ elevation,
9
+ size,
10
+ className,
11
+ exportparts,
12
+ htmlFor,
13
+ part,
14
+ tabIndex,
15
+ ...restProps
16
+ } = props;
17
+
18
+ return React.createElement(
19
+ "xm-card",
20
+ {
21
+ ref: createForwardedRefHandler(ref, forwardedRef),
22
+ ...restProps,
23
+ elevation: elevation,
24
+ size: size,
25
+ class: className,
26
+ exportparts: exportparts,
27
+ for: htmlFor ?? props["for"],
28
+ part: part,
29
+ tabindex: tabIndex ?? props["tabindex"],
30
+ style: { ...props.style },
31
+ },
32
+ props.children,
33
+ );
34
+ });
@@ -0,0 +1,110 @@
1
+ import React from "react";
2
+ import { XmChatShell as XmChatShellElement } from "../lit/components/chat/index.js";
3
+
4
+ /**
5
+ * A generic type for strongly typing custom events with their targets
6
+ * @template T - The type of the event target (extends EventTarget)
7
+ * @template D - The type of the detail payload for the custom event
8
+ */
9
+ type TypedEvent<T extends EventTarget, E = Event> = E & {
10
+ target: T;
11
+ };
12
+ /** `XmChatShell` component event */
13
+ export type XmChatShellElementEvent<E = Event> = TypedEvent<
14
+ XmChatShellElement,
15
+ E
16
+ >;
17
+
18
+ export type { XmChatShellElement };
19
+
20
+ export interface XmChatShellProps extends Pick<
21
+ React.AllHTMLAttributes<HTMLElement>,
22
+ | "children"
23
+ | "dir"
24
+ | "hidden"
25
+ | "id"
26
+ | "lang"
27
+ | "slot"
28
+ | "style"
29
+ | "title"
30
+ | "translate"
31
+ | "onClick"
32
+ | "onFocus"
33
+ | "onBlur"
34
+ > {
35
+ /** undefined */
36
+ processing?: boolean;
37
+
38
+ /** Pin the shell to the viewport (height: 100vh). Default is height: 100%
39
+ so the shell sizes to its container — embedded hosts get correct
40
+ sizing for free. Full-bleed previews opt in via the `full-viewport`
41
+ attribute. */
42
+ fullViewport?: boolean;
43
+
44
+ /** undefined */
45
+ thinkingLabel?: XmChatShellElement["thinkingLabel"];
46
+
47
+ /** undefined */
48
+ topTitle?: XmChatShellElement["topTitle"];
49
+
50
+ /** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
51
+ className?: string;
52
+
53
+ /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
54
+ exportparts?: string;
55
+
56
+ /** Used for labels to link them with their inputs (using input id). */
57
+ htmlFor?: string;
58
+
59
+ /** Used to help React identify which items have changed, are added, or are removed within a list. */
60
+ key?: number | string;
61
+
62
+ /** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
63
+ part?: string;
64
+
65
+ /** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
66
+ ref?: React.Ref<XmChatShellElement>;
67
+
68
+ /** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
69
+ tabIndex?: number;
70
+
71
+ /** Fired when the artifact panel is closed. */
72
+ onArtifactClose?: (event: XmChatShellElementEvent) => void;
73
+
74
+ /** Fired when an artifact is opened. */
75
+ onArtifactOpen?: (event: XmChatShellElementEvent) => void;
76
+
77
+ /** Fired when the action is cancelled. */
78
+ onCancel?: (event: XmChatShellElementEvent) => void;
79
+
80
+ /** Fired when the user sends the composed content. */
81
+ onSend?: (event: XmChatShellElementEvent) => void;
82
+ }
83
+
84
+ /**
85
+ *
86
+ *
87
+ * ## Attributes & Properties
88
+ *
89
+ * Component attributes and properties that can be applied to the element or by using JavaScript.
90
+ *
91
+ * - `processing`: undefined
92
+ * - `thinking-label`/`thinkingLabel`: undefined
93
+ * - `top-title`/`topTitle`: undefined
94
+ * - `full-viewport`/`fullViewport`: Pin the shell to the viewport (height: 100vh). Default is height: 100%
95
+ * so the shell sizes to its container — embedded hosts get correct
96
+ * sizing for free. Full-bleed previews opt in via the `full-viewport`
97
+ * attribute.
98
+ * - `conversations`: undefined (property only)
99
+ * - `thread`: undefined (property only)
100
+ *
101
+ * ## Events
102
+ *
103
+ * Events that will be emitted by the component.
104
+ *
105
+ * - `artifact-close`: Fired when the artifact panel is closed.
106
+ * - `artifact-open`: Fired when an artifact is opened.
107
+ * - `cancel`: Fired when the action is cancelled.
108
+ * - `send`: Fired when the user sends the composed content.
109
+ */
110
+ export const XmChatShell: React.ForwardRefExoticComponent<XmChatShellProps>;
@@ -0,0 +1,48 @@
1
+ import React, { forwardRef, useRef } from "react";
2
+ import "../lit/components/chat/index.js";
3
+ import { useEventListener, createForwardedRefHandler } from "./react-utils.js";
4
+
5
+ export const XmChatShell = forwardRef((props, forwardedRef) => {
6
+ const ref = useRef(null);
7
+ const {
8
+ processing,
9
+ fullViewport,
10
+ thinkingLabel,
11
+ topTitle,
12
+ className,
13
+ exportparts,
14
+ htmlFor,
15
+ part,
16
+ tabIndex,
17
+ onArtifactClose,
18
+ onArtifactOpen,
19
+ onCancel,
20
+ onSend,
21
+ ...restProps
22
+ } = props;
23
+
24
+ /** Event listeners - run once */
25
+ useEventListener(ref, "artifact-close", props.onArtifactClose);
26
+ useEventListener(ref, "artifact-open", props.onArtifactOpen);
27
+ useEventListener(ref, "cancel", props.onCancel);
28
+ useEventListener(ref, "send", props.onSend);
29
+
30
+ return React.createElement(
31
+ "xm-chat-shell",
32
+ {
33
+ ref: createForwardedRefHandler(ref, forwardedRef),
34
+ ...restProps,
35
+ "thinking-label": thinkingLabel ?? props["thinking-label"],
36
+ "top-title": topTitle ?? props["top-title"],
37
+ class: className,
38
+ exportparts: exportparts,
39
+ for: htmlFor ?? props["for"],
40
+ part: part,
41
+ tabindex: tabIndex ?? props["tabindex"],
42
+ processing: processing ? true : undefined,
43
+ "full-viewport": fullViewport ? true : undefined,
44
+ style: { ...props.style },
45
+ },
46
+ props.children,
47
+ );
48
+ });
@@ -0,0 +1,145 @@
1
+ import React from "react";
2
+ import {
3
+ XmCheckbox as XmCheckboxElement,
4
+ CustomEvent,
5
+ } from "../lit/components/checkbox/index.js";
6
+
7
+ /**
8
+ * A generic type for strongly typing custom events with their targets
9
+ * @template T - The type of the event target (extends EventTarget)
10
+ * @template D - The type of the detail payload for the custom event
11
+ */
12
+ type TypedEvent<T extends EventTarget, E = Event> = E & {
13
+ target: T;
14
+ };
15
+ /** `XmCheckbox` component event */
16
+ export type XmCheckboxElementEvent<E = Event> = TypedEvent<
17
+ XmCheckboxElement,
18
+ E
19
+ >;
20
+
21
+ export type { XmCheckboxElement, CustomEvent };
22
+
23
+ export interface XmCheckboxProps extends Pick<
24
+ React.AllHTMLAttributes<HTMLElement>,
25
+ | "children"
26
+ | "dir"
27
+ | "hidden"
28
+ | "id"
29
+ | "lang"
30
+ | "slot"
31
+ | "style"
32
+ | "title"
33
+ | "translate"
34
+ | "onClick"
35
+ | "onFocus"
36
+ | "onBlur"
37
+ > {
38
+ /** Indeterminate (mixed) state — shows the dash mark on the coral fill and
39
+ reports aria-checked="mixed". Cleared on the first user toggle. */
40
+ indeterminate?: boolean;
41
+
42
+ /** undefined */
43
+ required?: boolean;
44
+
45
+ /** undefined */
46
+ disabled?: boolean;
47
+
48
+ /** undefined */
49
+ readOnly?: boolean;
50
+
51
+ /** undefined */
52
+ loading?: boolean;
53
+
54
+ /** INITIAL checked for toggle subclasses; mapped from attribute `checked`. */
55
+ initialChecked?: boolean;
56
+
57
+ /** undefined */
58
+ label?: XmCheckboxElement["label"];
59
+
60
+ /** undefined */
61
+ helper?: XmCheckboxElement["helper"];
62
+
63
+ /** Severity copy. Non-empty ⇒ the field is in error (icon + copy, never color). */
64
+ error?: XmCheckboxElement["error"];
65
+
66
+ /** undefined */
67
+ size?: XmCheckboxElement["size"];
68
+
69
+ /** Form-control name — mirrors native <input name>. */
70
+ name?: XmCheckboxElement["name"];
71
+
72
+ /** INITIAL value (uncontrolled-first, AD-6): the `value` attribute seeds the
73
+ live state once, then never overrides user input. Mapped from attribute
74
+ `value` so authors write `<xm-text-field value="…">`. */
75
+ initialValue?: XmCheckboxElement["initialValue"];
76
+
77
+ /** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
78
+ className?: string;
79
+
80
+ /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
81
+ exportparts?: string;
82
+
83
+ /** Used for labels to link them with their inputs (using input id). */
84
+ htmlFor?: string;
85
+
86
+ /** Used to help React identify which items have changed, are added, or are removed within a list. */
87
+ key?: number | string;
88
+
89
+ /** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
90
+ part?: string;
91
+
92
+ /** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
93
+ ref?: React.Ref<XmCheckboxElement>;
94
+
95
+ /** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
96
+ tabIndex?: number;
97
+
98
+ /** Fired on each edit with the current value in `detail` (inherited by every field). */
99
+ onInput?: (event: XmCheckboxElementEvent) => void;
100
+
101
+ /** Fired on commit with the new value in `detail` (inherited by every field). */
102
+ onChange?: (event: XmCheckboxElementEvent) => void;
103
+ }
104
+
105
+ /**
106
+ *
107
+ *
108
+ * ## Attributes & Properties
109
+ *
110
+ * Component attributes and properties that can be applied to the element or by using JavaScript.
111
+ *
112
+ * - `indeterminate`: Indeterminate (mixed) state — shows the dash mark on the coral fill and
113
+ * reports aria-checked="mixed". Cleared on the first user toggle.
114
+ * - `label`: undefined
115
+ * - `helper`: undefined
116
+ * - `error`: Severity copy. Non-empty ⇒ the field is in error (icon + copy, never color).
117
+ * - `size`: undefined
118
+ * - `required`: undefined
119
+ * - `disabled`: undefined
120
+ * - `readonly`/`readOnly`: undefined
121
+ * - `loading`: undefined
122
+ * - `name`: Form-control name — mirrors native <input name>.
123
+ * - `value`/`initialValue`: INITIAL value (uncontrolled-first, AD-6): the `value` attribute seeds the
124
+ * live state once, then never overrides user input. Mapped from attribute
125
+ * `value` so authors write `<xm-text-field value="…">`.
126
+ * - `checked`/`initialChecked`: INITIAL checked for toggle subclasses; mapped from attribute `checked`.
127
+ * - `readonly`: undefined (property only)
128
+ * - `value`: Programmatic reset support — setting `value` after first paint updates live state. (property only)
129
+ * - `checked`: Public read contract for toggle subclasses (AD-6a). (property only)
130
+ *
131
+ * ## Events
132
+ *
133
+ * Events that will be emitted by the component.
134
+ *
135
+ * - `input`: Fired on each edit with the current value in `detail` (inherited by every field).
136
+ * - `change`: Fired on commit with the new value in `detail` (inherited by every field).
137
+ *
138
+ * ## Methods
139
+ *
140
+ * Methods that can be called to access component functionality.
141
+ *
142
+ * - `setFormDisabled(disabled: boolean) => void`: Down-propagation hook: xm-form (Story 2.10) sets this; it OR's with the
143
+ * field's own disabled and can never re-enable a self-disabled field.
144
+ */
145
+ export const XmCheckbox: React.ForwardRefExoticComponent<XmCheckboxProps>;
@@ -0,0 +1,60 @@
1
+ import React, { forwardRef, useRef } from "react";
2
+ import "../lit/components/checkbox/index.js";
3
+ import { useEventListener, createForwardedRefHandler } from "./react-utils.js";
4
+
5
+ export const XmCheckbox = forwardRef((props, forwardedRef) => {
6
+ const ref = useRef(null);
7
+ const {
8
+ indeterminate,
9
+ required,
10
+ disabled,
11
+ readOnly,
12
+ loading,
13
+ initialChecked,
14
+ label,
15
+ helper,
16
+ error,
17
+ size,
18
+ name,
19
+ initialValue,
20
+ className,
21
+ exportparts,
22
+ htmlFor,
23
+ part,
24
+ tabIndex,
25
+ onInput,
26
+ onChange,
27
+ ...restProps
28
+ } = props;
29
+
30
+ /** Event listeners - run once */
31
+ useEventListener(ref, "input", props.onInput);
32
+ useEventListener(ref, "change", props.onChange);
33
+
34
+ return React.createElement(
35
+ "xm-checkbox",
36
+ {
37
+ ref: createForwardedRefHandler(ref, forwardedRef),
38
+ ...restProps,
39
+ label: label,
40
+ helper: helper,
41
+ error: error,
42
+ size: size,
43
+ name: name,
44
+ value: initialValue ?? props["value"],
45
+ class: className,
46
+ exportparts: exportparts,
47
+ for: htmlFor ?? props["for"],
48
+ part: part,
49
+ tabindex: tabIndex ?? props["tabindex"],
50
+ indeterminate: indeterminate ? true : undefined,
51
+ required: required ? true : undefined,
52
+ disabled: disabled ? true : undefined,
53
+ readonly: readOnly ? true : undefined,
54
+ loading: loading ? true : undefined,
55
+ checked: initialChecked ? true : undefined,
56
+ style: { ...props.style },
57
+ },
58
+ props.children,
59
+ );
60
+ });