@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
@@ -0,0 +1,65 @@
1
+ import React, { forwardRef, useRef } from "react";
2
+ import "../lit/components/data-table/index.js";
3
+ import {
4
+ useEventListener,
5
+ useProperties,
6
+ createForwardedRefHandler,
7
+ } from "./react-utils.js";
8
+
9
+ export const XmDataTable = forwardRef((props, forwardedRef) => {
10
+ const ref = useRef(null);
11
+ const {
12
+ loading,
13
+ server,
14
+ rowClick,
15
+ pageSize,
16
+ emptyHeading,
17
+ emptyText,
18
+ totalItems,
19
+ className,
20
+ exportparts,
21
+ htmlFor,
22
+ part,
23
+ tabIndex,
24
+ sort,
25
+ ...restProps
26
+ } = props;
27
+
28
+ /** Event listeners - run once */
29
+ useEventListener(
30
+ ref,
31
+ "xm-data-table-page-change",
32
+ props.onXmDataTablePageChange,
33
+ );
34
+ useEventListener(
35
+ ref,
36
+ "xm-data-table-sort-change",
37
+ props.onXmDataTableSortChange,
38
+ );
39
+ useEventListener(ref, "xm-data-table-row-click", props.onXmDataTableRowClick);
40
+
41
+ /** Properties - run whenever a property has changed */
42
+ useProperties(ref, "sort", sort);
43
+
44
+ return React.createElement(
45
+ "xm-data-table",
46
+ {
47
+ ref: createForwardedRefHandler(ref, forwardedRef),
48
+ ...restProps,
49
+ "page-size": pageSize ?? props["page-size"],
50
+ "empty-heading": emptyHeading ?? props["empty-heading"],
51
+ "empty-text": emptyText ?? props["empty-text"],
52
+ "total-items": totalItems ?? props["total-items"],
53
+ class: className,
54
+ exportparts: exportparts,
55
+ for: htmlFor ?? props["for"],
56
+ part: part,
57
+ tabindex: tabIndex ?? props["tabindex"],
58
+ loading: loading ? true : undefined,
59
+ server: server ? true : undefined,
60
+ "row-click": rowClick ? true : undefined,
61
+ style: { ...props.style },
62
+ },
63
+ props.children,
64
+ );
65
+ });
@@ -0,0 +1,93 @@
1
+ import React from "react";
2
+ import {
3
+ XmDateRange as XmDateRangeElement,
4
+ CustomEvent,
5
+ } from "../lit/components/date-range/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
+ /** `XmDateRange` component event */
16
+ export type XmDateRangeElementEvent<E = Event> = TypedEvent<
17
+ XmDateRangeElement,
18
+ E
19
+ >;
20
+
21
+ export type { XmDateRangeElement, CustomEvent };
22
+
23
+ export interface XmDateRangeProps 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
+ /** undefined */
39
+ open?: boolean;
40
+
41
+ /** undefined */
42
+ from?: XmDateRangeElement["from"];
43
+
44
+ /** undefined */
45
+ to?: XmDateRangeElement["to"];
46
+
47
+ /** undefined */
48
+ placeholder?: XmDateRangeElement["placeholder"];
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<XmDateRangeElement>;
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 selected date range changes. */
72
+ onXmDateRangeChange?: (event: XmDateRangeElementEvent) => void;
73
+ }
74
+
75
+ /**
76
+ *
77
+ *
78
+ * ## Attributes & Properties
79
+ *
80
+ * Component attributes and properties that can be applied to the element or by using JavaScript.
81
+ *
82
+ * - `from`: undefined
83
+ * - `to`: undefined
84
+ * - `placeholder`: undefined
85
+ * - `open`: undefined
86
+ *
87
+ * ## Events
88
+ *
89
+ * Events that will be emitted by the component.
90
+ *
91
+ * - `xm-date-range-change`: Fired when the selected date range changes.
92
+ */
93
+ export const XmDateRange: React.ForwardRefExoticComponent<XmDateRangeProps>;
@@ -0,0 +1,41 @@
1
+ import React, { forwardRef, useRef } from "react";
2
+ import "../lit/components/date-range/index.js";
3
+ import { useEventListener, createForwardedRefHandler } from "./react-utils.js";
4
+
5
+ export const XmDateRange = forwardRef((props, forwardedRef) => {
6
+ const ref = useRef(null);
7
+ const {
8
+ open,
9
+ from,
10
+ to,
11
+ placeholder,
12
+ className,
13
+ exportparts,
14
+ htmlFor,
15
+ part,
16
+ tabIndex,
17
+ ...restProps
18
+ } = props;
19
+
20
+ /** Event listeners - run once */
21
+ useEventListener(ref, "xm-date-range-change", props.onXmDateRangeChange);
22
+
23
+ return React.createElement(
24
+ "xm-date-range",
25
+ {
26
+ ref: createForwardedRefHandler(ref, forwardedRef),
27
+ ...restProps,
28
+ from: from,
29
+ to: to,
30
+ placeholder: placeholder,
31
+ class: className,
32
+ exportparts: exportparts,
33
+ for: htmlFor ?? props["for"],
34
+ part: part,
35
+ tabindex: tabIndex ?? props["tabindex"],
36
+ open: open ? true : undefined,
37
+ style: { ...props.style },
38
+ },
39
+ props.children,
40
+ );
41
+ });
@@ -0,0 +1,87 @@
1
+ import React from "react";
2
+ import { XmDialog as XmDialogElement } from "../lit/components/dialog/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
+ /** `XmDialog` component event */
13
+ export type XmDialogElementEvent<E = Event> = TypedEvent<XmDialogElement, E>;
14
+
15
+ export type { XmDialogElement };
16
+
17
+ export interface XmDialogProps extends Pick<
18
+ React.AllHTMLAttributes<HTMLElement>,
19
+ | "children"
20
+ | "dir"
21
+ | "hidden"
22
+ | "id"
23
+ | "lang"
24
+ | "slot"
25
+ | "style"
26
+ | "title"
27
+ | "translate"
28
+ | "onClick"
29
+ | "onFocus"
30
+ | "onBlur"
31
+ > {
32
+ /** undefined */
33
+ open?: boolean;
34
+
35
+ /** undefined */
36
+ noScrimClose?: boolean;
37
+
38
+ /** undefined */
39
+ static?: boolean;
40
+
41
+ /** undefined */
42
+ label?: XmDialogElement["label"];
43
+
44
+ /** 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()`. */
45
+ className?: string;
46
+
47
+ /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
48
+ exportparts?: string;
49
+
50
+ /** Used for labels to link them with their inputs (using input id). */
51
+ htmlFor?: string;
52
+
53
+ /** Used to help React identify which items have changed, are added, or are removed within a list. */
54
+ key?: number | string;
55
+
56
+ /** 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. */
57
+ part?: string;
58
+
59
+ /** 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. */
60
+ ref?: React.Ref<XmDialogElement>;
61
+
62
+ /** 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. */
63
+ tabIndex?: number;
64
+
65
+ /** Fired when the element requests to close. */
66
+ onClose?: (event: XmDialogElementEvent) => void;
67
+ }
68
+
69
+ /**
70
+ *
71
+ *
72
+ * ## Attributes & Properties
73
+ *
74
+ * Component attributes and properties that can be applied to the element or by using JavaScript.
75
+ *
76
+ * - `open`: undefined
77
+ * - `no-scrim-close`/`noScrimClose`: undefined
78
+ * - `static`: undefined
79
+ * - `label`: undefined
80
+ *
81
+ * ## Events
82
+ *
83
+ * Events that will be emitted by the component.
84
+ *
85
+ * - `close`: Fired when the element requests to close.
86
+ */
87
+ export const XmDialog: React.ForwardRefExoticComponent<XmDialogProps>;
@@ -0,0 +1,40 @@
1
+ import React, { forwardRef, useRef } from "react";
2
+ import "../lit/components/dialog/index.js";
3
+ import { useEventListener, createForwardedRefHandler } from "./react-utils.js";
4
+
5
+ export const XmDialog = forwardRef((props, forwardedRef) => {
6
+ const ref = useRef(null);
7
+ const {
8
+ open,
9
+ noScrimClose,
10
+ label,
11
+ className,
12
+ exportparts,
13
+ htmlFor,
14
+ part,
15
+ tabIndex,
16
+ ...restProps
17
+ } = props;
18
+
19
+ /** Event listeners - run once */
20
+ useEventListener(ref, "close", props.onClose);
21
+
22
+ return React.createElement(
23
+ "xm-dialog",
24
+ {
25
+ ref: createForwardedRefHandler(ref, forwardedRef),
26
+ ...restProps,
27
+ label: label,
28
+ class: className,
29
+ exportparts: exportparts,
30
+ for: htmlFor ?? props["for"],
31
+ part: part,
32
+ tabindex: tabIndex ?? props["tabindex"],
33
+ open: open ? true : undefined,
34
+ "no-scrim-close": noScrimClose ? true : undefined,
35
+ static: props.static ? true : undefined,
36
+ style: { ...props.style },
37
+ },
38
+ props.children,
39
+ );
40
+ });
@@ -0,0 +1,55 @@
1
+ import React from "react";
2
+ import { XmDivider as XmDividerElement } from "../lit/components/divider/index.js";
3
+
4
+ export type { XmDividerElement };
5
+
6
+ export interface XmDividerProps 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
+ orientation?: XmDividerElement["orientation"];
23
+
24
+ /** 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()`. */
25
+ className?: string;
26
+
27
+ /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
28
+ exportparts?: string;
29
+
30
+ /** Used for labels to link them with their inputs (using input id). */
31
+ htmlFor?: string;
32
+
33
+ /** Used to help React identify which items have changed, are added, or are removed within a list. */
34
+ key?: number | string;
35
+
36
+ /** 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. */
37
+ part?: string;
38
+
39
+ /** 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. */
40
+ ref?: React.Ref<XmDividerElement>;
41
+
42
+ /** 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. */
43
+ tabIndex?: number;
44
+ }
45
+
46
+ /**
47
+ *
48
+ *
49
+ * ## Attributes & Properties
50
+ *
51
+ * Component attributes and properties that can be applied to the element or by using JavaScript.
52
+ *
53
+ * - `orientation`: undefined
54
+ */
55
+ export const XmDivider: React.ForwardRefExoticComponent<XmDividerProps>;
@@ -0,0 +1,32 @@
1
+ import React, { forwardRef, useRef } from "react";
2
+ import "../lit/components/divider/index.js";
3
+ import { createForwardedRefHandler } from "./react-utils.js";
4
+
5
+ export const XmDivider = forwardRef((props, forwardedRef) => {
6
+ const ref = useRef(null);
7
+ const {
8
+ orientation,
9
+ className,
10
+ exportparts,
11
+ htmlFor,
12
+ part,
13
+ tabIndex,
14
+ ...restProps
15
+ } = props;
16
+
17
+ return React.createElement(
18
+ "xm-divider",
19
+ {
20
+ ref: createForwardedRefHandler(ref, forwardedRef),
21
+ ...restProps,
22
+ orientation: orientation,
23
+ class: className,
24
+ exportparts: exportparts,
25
+ for: htmlFor ?? props["for"],
26
+ part: part,
27
+ tabindex: tabIndex ?? props["tabindex"],
28
+ style: { ...props.style },
29
+ },
30
+ props.children,
31
+ );
32
+ });
@@ -0,0 +1,61 @@
1
+ import React from "react";
2
+ import { XmEmptyState as XmEmptyStateElement } from "../lit/components/empty-state/index.js";
3
+
4
+ export type { XmEmptyStateElement };
5
+
6
+ export interface XmEmptyStateProps 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
+ heading?: XmEmptyStateElement["heading"];
23
+
24
+ /** A primitives icon element name (e.g. "xm-search-icon"). Used only when no
25
+ slot="icon" content is supplied. */
26
+ icon?: XmEmptyStateElement["icon"];
27
+
28
+ /** 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()`. */
29
+ className?: string;
30
+
31
+ /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
32
+ exportparts?: string;
33
+
34
+ /** Used for labels to link them with their inputs (using input id). */
35
+ htmlFor?: string;
36
+
37
+ /** Used to help React identify which items have changed, are added, or are removed within a list. */
38
+ key?: number | string;
39
+
40
+ /** 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. */
41
+ part?: string;
42
+
43
+ /** 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. */
44
+ ref?: React.Ref<XmEmptyStateElement>;
45
+
46
+ /** 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. */
47
+ tabIndex?: number;
48
+ }
49
+
50
+ /**
51
+ *
52
+ *
53
+ * ## Attributes & Properties
54
+ *
55
+ * Component attributes and properties that can be applied to the element or by using JavaScript.
56
+ *
57
+ * - `heading`: undefined
58
+ * - `icon`: A primitives icon element name (e.g. "xm-search-icon"). Used only when no
59
+ * slot="icon" content is supplied.
60
+ */
61
+ export const XmEmptyState: React.ForwardRefExoticComponent<XmEmptyStateProps>;
@@ -0,0 +1,34 @@
1
+ import React, { forwardRef, useRef } from "react";
2
+ import "../lit/components/empty-state/index.js";
3
+ import { createForwardedRefHandler } from "./react-utils.js";
4
+
5
+ export const XmEmptyState = forwardRef((props, forwardedRef) => {
6
+ const ref = useRef(null);
7
+ const {
8
+ heading,
9
+ icon,
10
+ className,
11
+ exportparts,
12
+ htmlFor,
13
+ part,
14
+ tabIndex,
15
+ ...restProps
16
+ } = props;
17
+
18
+ return React.createElement(
19
+ "xm-empty-state",
20
+ {
21
+ ref: createForwardedRefHandler(ref, forwardedRef),
22
+ ...restProps,
23
+ heading: heading,
24
+ icon: icon,
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,101 @@
1
+ import React from "react";
2
+ import {
3
+ XmExpansionPanel as XmExpansionPanelElement,
4
+ CustomEvent,
5
+ } from "../lit/components/expansion-panel/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
+ /** `XmExpansionPanel` component event */
16
+ export type XmExpansionPanelElementEvent<E = Event> = TypedEvent<
17
+ XmExpansionPanelElement,
18
+ E
19
+ >;
20
+
21
+ export type { XmExpansionPanelElement, CustomEvent };
22
+
23
+ export interface XmExpansionPanelProps 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
+ /** undefined */
39
+ open?: boolean;
40
+
41
+ /** undefined */
42
+ disabled?: boolean;
43
+
44
+ /** undefined */
45
+ heading?: XmExpansionPanelElement["heading"];
46
+
47
+ /** undefined */
48
+ value?: XmExpansionPanelElement["value"];
49
+
50
+ /** undefined */
51
+ name?: XmExpansionPanelElement["name"];
52
+
53
+ /** 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()`. */
54
+ className?: string;
55
+
56
+ /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
57
+ exportparts?: string;
58
+
59
+ /** Used for labels to link them with their inputs (using input id). */
60
+ htmlFor?: string;
61
+
62
+ /** Used to help React identify which items have changed, are added, or are removed within a list. */
63
+ key?: number | string;
64
+
65
+ /** 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. */
66
+ part?: string;
67
+
68
+ /** 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. */
69
+ ref?: React.Ref<XmExpansionPanelElement>;
70
+
71
+ /** 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. */
72
+ tabIndex?: number;
73
+
74
+ /** Fired on commit with the new value in `detail`. */
75
+ onChange?: (event: XmExpansionPanelElementEvent) => void;
76
+
77
+ /** Coordination event (on document) so sibling panels close in single-open mode. */
78
+ onXmExpansionPanelOpen?: (event: XmExpansionPanelElementEvent) => void;
79
+ }
80
+
81
+ /**
82
+ *
83
+ *
84
+ * ## Attributes & Properties
85
+ *
86
+ * Component attributes and properties that can be applied to the element or by using JavaScript.
87
+ *
88
+ * - `open`: undefined
89
+ * - `heading`: undefined
90
+ * - `disabled`: undefined
91
+ * - `value`: undefined
92
+ * - `name`: undefined
93
+ *
94
+ * ## Events
95
+ *
96
+ * Events that will be emitted by the component.
97
+ *
98
+ * - `change`: Fired on commit with the new value in `detail`.
99
+ * - `xm-expansion-panel-open`: Coordination event (on document) so sibling panels close in single-open mode.
100
+ */
101
+ export const XmExpansionPanel: React.ForwardRefExoticComponent<XmExpansionPanelProps>;
@@ -0,0 +1,48 @@
1
+ import React, { forwardRef, useRef } from "react";
2
+ import "../lit/components/expansion-panel/index.js";
3
+ import { useEventListener, createForwardedRefHandler } from "./react-utils.js";
4
+
5
+ export const XmExpansionPanel = forwardRef((props, forwardedRef) => {
6
+ const ref = useRef(null);
7
+ const {
8
+ open,
9
+ disabled,
10
+ heading,
11
+ value,
12
+ name,
13
+ className,
14
+ exportparts,
15
+ htmlFor,
16
+ part,
17
+ tabIndex,
18
+ ...restProps
19
+ } = props;
20
+
21
+ /** Event listeners - run once */
22
+ useEventListener(ref, "change", props.onChange);
23
+ useEventListener(
24
+ ref,
25
+ "xm-expansion-panel-open",
26
+ props.onXmExpansionPanelOpen,
27
+ );
28
+
29
+ return React.createElement(
30
+ "xm-expansion-panel",
31
+ {
32
+ ref: createForwardedRefHandler(ref, forwardedRef),
33
+ ...restProps,
34
+ heading: heading,
35
+ value: value,
36
+ name: name,
37
+ class: className,
38
+ exportparts: exportparts,
39
+ for: htmlFor ?? props["for"],
40
+ part: part,
41
+ tabindex: tabIndex ?? props["tabindex"],
42
+ open: open ? true : undefined,
43
+ disabled: disabled ? true : undefined,
44
+ style: { ...props.style },
45
+ },
46
+ props.children,
47
+ );
48
+ });