@xmesh/system-design 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/custom-elements.json +18382 -0
- package/dist/lit/components/alert/index.d.ts +5 -0
- package/dist/lit/components/alert/index.js +8 -2
- package/dist/lit/components/alert/index.styles.js +215 -0
- package/dist/lit/components/app-bar/index.d.ts +1 -0
- package/dist/lit/components/app-bar/index.js +4 -2
- package/dist/lit/components/app-bar/index.styles.js +94 -0
- package/dist/lit/components/artifact/index.d.ts +5 -0
- package/dist/lit/components/artifact/index.js +14 -10
- package/dist/lit/components/artifact/index.styles.js +180 -0
- package/dist/lit/components/autocomplete/index.d.ts +5 -0
- package/dist/lit/components/autocomplete/index.js +11 -2
- package/dist/lit/components/autocomplete/index.styles.js +185 -0
- package/dist/lit/components/avatar/index.d.ts +1 -0
- package/dist/lit/components/avatar/index.js +4 -2
- package/dist/lit/components/avatar/index.styles.js +76 -0
- package/dist/lit/components/avatar-group/index.d.ts +1 -0
- package/dist/lit/components/avatar-group/index.js +4 -2
- package/dist/lit/components/avatar-group/index.styles.js +74 -0
- package/dist/lit/components/badge/index.d.ts +1 -0
- package/dist/lit/components/badge/index.js +4 -2
- package/dist/lit/components/badge/index.styles.js +86 -0
- package/dist/lit/components/brand-mark/index.js +8 -9
- package/dist/lit/components/brand-mark/index.styles.js +123 -0
- package/dist/lit/components/breadcrumbs/index.d.ts +1 -0
- package/dist/lit/components/breadcrumbs/index.js +5 -4
- package/dist/lit/components/breadcrumbs/index.styles.js +105 -0
- package/dist/lit/components/bubble/index.d.ts +4 -0
- package/dist/lit/components/bubble/index.js +14 -11
- package/dist/lit/components/bubble/index.styles.js +196 -0
- package/dist/lit/components/button/index.d.ts +1 -0
- package/dist/lit/components/button/index.js +6 -13
- package/dist/lit/components/button/index.styles.js +356 -0
- package/dist/lit/components/card/index.d.ts +1 -0
- package/dist/lit/components/card/index.js +4 -2
- package/dist/lit/components/card/index.styles.js +113 -0
- package/dist/lit/components/chat/index.d.ts +6 -0
- package/dist/lit/components/chat/index.js +15 -10
- package/dist/lit/components/chat/index.styles.js +306 -0
- package/dist/lit/components/checkbox/index.d.ts +1 -0
- package/dist/lit/components/checkbox/index.js +7 -4
- package/dist/lit/components/checkbox/index.styles.js +140 -0
- package/dist/lit/components/chip/index.d.ts +5 -0
- package/dist/lit/components/chip/index.js +8 -2
- package/dist/lit/components/chip/index.styles.js +159 -0
- package/dist/lit/components/chip-group/index.d.ts +4 -0
- package/dist/lit/components/chip-group/index.js +7 -2
- package/dist/lit/components/chip-group/index.styles.js +33 -0
- package/dist/lit/components/code/index.d.ts +1 -0
- package/dist/lit/components/code/index.js +4 -3
- package/dist/lit/components/code/index.styles.js +56 -0
- package/dist/lit/components/composer/index.d.ts +6 -0
- package/dist/lit/components/composer/index.js +15 -10
- package/dist/lit/components/composer/index.styles.js +562 -0
- package/dist/lit/components/data-table/index.css +18 -0
- package/dist/lit/components/data-table/index.d.ts +30 -0
- package/dist/lit/components/data-table/index.js +120 -34
- package/dist/lit/components/data-table/index.styles.js +198 -0
- package/dist/lit/components/date-range/index.d.ts +4 -0
- package/dist/lit/components/date-range/index.js +7 -2
- package/dist/lit/components/date-range/index.styles.js +338 -0
- package/dist/lit/components/dialog/index.d.ts +4 -0
- package/dist/lit/components/dialog/index.js +7 -2
- package/dist/lit/components/dialog/index.styles.js +138 -0
- package/dist/lit/components/divider/index.d.ts +1 -0
- package/dist/lit/components/divider/index.js +4 -2
- package/dist/lit/components/divider/index.styles.js +41 -0
- package/dist/lit/components/empty-state/index.d.ts +1 -0
- package/dist/lit/components/empty-state/index.js +4 -2
- package/dist/lit/components/empty-state/index.styles.js +83 -0
- package/dist/lit/components/expansion-panel/index.d.ts +5 -0
- package/dist/lit/components/expansion-panel/index.js +8 -2
- package/dist/lit/components/expansion-panel/index.styles.js +134 -0
- package/dist/lit/components/field/index.d.ts +4 -0
- package/dist/lit/components/field/index.js +9 -4
- package/dist/lit/components/field/index.styles.js +237 -0
- package/dist/lit/components/file-input/index.d.ts +4 -0
- package/dist/lit/components/file-input/index.js +10 -4
- package/dist/lit/components/file-input/index.styles.js +271 -0
- package/dist/lit/components/form/index.d.ts +4 -0
- package/dist/lit/components/form/index.js +7 -2
- package/dist/lit/components/form/index.styles.js +43 -0
- package/dist/lit/components/grid/index.d.ts +1 -0
- package/dist/lit/components/grid/index.js +4 -2
- package/dist/lit/components/grid/index.styles.js +67 -0
- package/dist/lit/components/kbd/index.d.ts +1 -0
- package/dist/lit/components/kbd/index.js +4 -2
- package/dist/lit/components/kbd/index.styles.js +49 -0
- package/dist/lit/components/list/index.d.ts +4 -0
- package/dist/lit/components/list/index.js +7 -2
- package/dist/lit/components/list/index.styles.js +29 -0
- package/dist/lit/components/list-item/index.d.ts +1 -0
- package/dist/lit/components/list-item/index.js +4 -2
- package/dist/lit/components/list-item/index.styles.js +133 -0
- package/dist/lit/components/menu/index.d.ts +8 -0
- package/dist/lit/components/menu/index.js +11 -3
- package/dist/lit/components/menu/index.styles.js +108 -0
- package/dist/lit/components/multi-select/index.css +156 -0
- package/dist/lit/components/multi-select/index.d.ts +70 -0
- package/dist/lit/components/multi-select/index.js +497 -0
- package/dist/lit/components/multi-select/index.styles.js +170 -0
- package/dist/lit/components/navigation-drawer/index.d.ts +4 -0
- package/dist/lit/components/navigation-drawer/index.js +7 -2
- package/dist/lit/components/navigation-drawer/index.styles.js +128 -0
- package/dist/lit/components/overlay/index.d.ts +5 -0
- package/dist/lit/components/overlay/index.js +8 -2
- package/dist/lit/components/overlay/index.styles.js +185 -0
- package/dist/lit/components/pagination/index.d.ts +17 -0
- package/dist/lit/components/pagination/index.js +53 -8
- package/dist/lit/components/pagination/index.styles.js +116 -0
- package/dist/lit/components/popover/index.d.ts +5 -0
- package/dist/lit/components/popover/index.js +8 -2
- package/dist/lit/components/popover/index.styles.js +48 -0
- package/dist/lit/components/primitives/index.js +8 -9
- package/dist/lit/components/primitives/index.styles.js +518 -0
- package/dist/lit/components/progress/index.d.ts +1 -0
- package/dist/lit/components/progress/index.js +4 -2
- package/dist/lit/components/progress/index.styles.js +157 -0
- package/dist/lit/components/radio-group/index.d.ts +5 -0
- package/dist/lit/components/radio-group/index.js +10 -6
- package/dist/lit/components/radio-group/index.styles.js +192 -0
- package/dist/lit/components/select/index.d.ts +4 -0
- package/dist/lit/components/select/index.js +10 -2
- package/dist/lit/components/select/index.styles.js +165 -0
- package/dist/lit/components/sidebar-item/index.js +8 -9
- package/dist/lit/components/sidebar-item/index.styles.js +147 -0
- package/dist/lit/components/skeleton/index.d.ts +1 -0
- package/dist/lit/components/skeleton/index.js +4 -2
- package/dist/lit/components/skeleton/index.styles.js +95 -0
- package/dist/lit/components/slider/index.d.ts +5 -0
- package/dist/lit/components/slider/index.js +11 -4
- package/dist/lit/components/slider/index.styles.js +185 -0
- package/dist/lit/components/snackbar/index.d.ts +4 -0
- package/dist/lit/components/snackbar/index.js +14 -10
- package/dist/lit/components/snackbar/index.styles.js +293 -0
- package/dist/lit/components/stack/index.d.ts +1 -0
- package/dist/lit/components/stack/index.js +4 -2
- package/dist/lit/components/stack/index.styles.js +55 -0
- package/dist/lit/components/switch/index.d.ts +1 -0
- package/dist/lit/components/switch/index.js +7 -4
- package/dist/lit/components/switch/index.styles.js +140 -0
- package/dist/lit/components/table/index.d.ts +1 -0
- package/dist/lit/components/table/index.js +4 -2
- package/dist/lit/components/table/index.styles.js +99 -0
- package/dist/lit/components/tabs/index.d.ts +4 -0
- package/dist/lit/components/tabs/index.js +8 -4
- package/dist/lit/components/tabs/index.styles.js +130 -0
- package/dist/lit/components/text-field/index.d.ts +1 -0
- package/dist/lit/components/text-field/index.js +7 -2
- package/dist/lit/components/text-field/index.styles.js +104 -0
- package/dist/lit/components/textarea/index.d.ts +1 -0
- package/dist/lit/components/textarea/index.js +7 -2
- package/dist/lit/components/textarea/index.styles.js +69 -0
- package/dist/lit/components/tooltip/index.d.ts +1 -0
- package/dist/lit/components/tooltip/index.js +4 -2
- package/dist/lit/components/tooltip/index.styles.js +51 -0
- package/dist/lit/components/validation/index.d.ts +6 -0
- package/dist/lit/components/validation/index.js +15 -10
- package/dist/lit/components/validation/index.styles.js +400 -0
- package/dist/lit/index.d.ts +1 -0
- package/dist/lit/index.js +1 -0
- package/dist/react/XmAlert.d.ts +99 -0
- package/dist/react/XmAlert.js +45 -0
- package/dist/react/XmAppBar.d.ts +59 -0
- package/dist/react/XmAppBar.js +34 -0
- package/dist/react/XmArtifact.d.ts +113 -0
- package/dist/react/XmArtifact.js +45 -0
- package/dist/react/XmArtifactChip.d.ts +56 -0
- package/dist/react/XmArtifactChip.js +32 -0
- package/dist/react/XmAutocomplete.d.ts +153 -0
- package/dist/react/XmAutocomplete.js +68 -0
- package/dist/react/XmAvatar.d.ts +71 -0
- package/dist/react/XmAvatar.js +40 -0
- package/dist/react/XmAvatarGroup.d.ts +59 -0
- package/dist/react/XmAvatarGroup.js +34 -0
- package/dist/react/XmBadge.d.ts +67 -0
- package/dist/react/XmBadge.js +38 -0
- package/dist/react/XmBrandGlyph.d.ts +46 -0
- package/dist/react/XmBrandGlyph.js +24 -0
- package/dist/react/XmBrandMark.d.ts +71 -0
- package/dist/react/XmBrandMark.js +40 -0
- package/dist/react/XmBreadcrumbs.d.ts +56 -0
- package/dist/react/XmBreadcrumbs.js +32 -0
- package/dist/react/XmBubble.d.ts +69 -0
- package/dist/react/XmBubble.js +38 -0
- package/dist/react/XmBubbleActions.d.ts +59 -0
- package/dist/react/XmBubbleActions.js +34 -0
- package/dist/react/XmBubbleGroup.d.ts +82 -0
- package/dist/react/XmBubbleGroup.js +36 -0
- package/dist/react/XmButton.d.ts +89 -0
- package/dist/react/XmButton.js +48 -0
- package/dist/react/XmCard.d.ts +59 -0
- package/dist/react/XmCard.js +34 -0
- package/dist/react/XmChatShell.d.ts +110 -0
- package/dist/react/XmChatShell.js +44 -0
- package/dist/react/XmCheckbox.d.ts +145 -0
- package/dist/react/XmCheckbox.js +58 -0
- package/dist/react/XmChip.d.ts +99 -0
- package/dist/react/XmChip.js +46 -0
- package/dist/react/XmChipGroup.d.ts +79 -0
- package/dist/react/XmChipGroup.js +35 -0
- package/dist/react/XmCode.d.ts +55 -0
- package/dist/react/XmCode.js +32 -0
- package/dist/react/XmComposer.d.ts +123 -0
- package/dist/react/XmComposer.js +52 -0
- package/dist/react/XmDataTable.d.ts +125 -0
- package/dist/react/XmDataTable.js +65 -0
- package/dist/react/XmDateRange.d.ts +93 -0
- package/dist/react/XmDateRange.js +41 -0
- package/dist/react/XmDialog.d.ts +87 -0
- package/dist/react/XmDialog.js +40 -0
- package/dist/react/XmDivider.d.ts +55 -0
- package/dist/react/XmDivider.js +32 -0
- package/dist/react/XmEmptyState.d.ts +61 -0
- package/dist/react/XmEmptyState.js +34 -0
- package/dist/react/XmExpansionPanel.d.ts +101 -0
- package/dist/react/XmExpansionPanel.js +48 -0
- package/dist/react/XmFileInput.d.ts +151 -0
- package/dist/react/XmFileInput.js +68 -0
- package/dist/react/XmFileValidationBlock.d.ts +111 -0
- package/dist/react/XmFileValidationBlock.js +45 -0
- package/dist/react/XmForm.d.ts +91 -0
- package/dist/react/XmForm.js +37 -0
- package/dist/react/XmGrid.d.ts +59 -0
- package/dist/react/XmGrid.js +34 -0
- package/dist/react/XmKbd.d.ts +46 -0
- package/dist/react/XmKbd.js +24 -0
- package/dist/react/XmList.d.ts +83 -0
- package/dist/react/XmList.js +37 -0
- package/dist/react/XmListItem.d.ts +67 -0
- package/dist/react/XmListItem.js +38 -0
- package/dist/react/XmMenu.d.ts +98 -0
- package/dist/react/XmMenu.js +42 -0
- package/dist/react/XmMenuItem.d.ts +63 -0
- package/dist/react/XmMenuItem.js +36 -0
- package/dist/react/XmMultiSelect.d.ts +161 -0
- package/dist/react/XmMultiSelect.js +72 -0
- package/dist/react/XmNavigationDrawer.d.ts +93 -0
- package/dist/react/XmNavigationDrawer.js +41 -0
- package/dist/react/XmOverlay.d.ts +120 -0
- package/dist/react/XmOverlay.js +54 -0
- package/dist/react/XmPagination.d.ts +117 -0
- package/dist/react/XmPagination.js +57 -0
- package/dist/react/XmPopover.d.ts +90 -0
- package/dist/react/XmPopover.js +40 -0
- package/dist/react/XmProgress.d.ts +75 -0
- package/dist/react/XmProgress.js +42 -0
- package/dist/react/XmRadio.d.ts +88 -0
- package/dist/react/XmRadio.js +41 -0
- package/dist/react/XmRadioGroup.d.ts +139 -0
- package/dist/react/XmRadioGroup.js +56 -0
- package/dist/react/XmSelect.d.ts +152 -0
- package/dist/react/XmSelect.js +68 -0
- package/dist/react/XmSidebarItem.d.ts +75 -0
- package/dist/react/XmSidebarItem.js +42 -0
- package/dist/react/XmSkeleton.d.ts +71 -0
- package/dist/react/XmSkeleton.js +40 -0
- package/dist/react/XmSlider.d.ts +160 -0
- package/dist/react/XmSlider.js +74 -0
- package/dist/react/XmSnackbar.d.ts +110 -0
- package/dist/react/XmSnackbar.js +49 -0
- package/dist/react/XmStack.d.ts +71 -0
- package/dist/react/XmStack.js +40 -0
- package/dist/react/XmSwitch.d.ts +136 -0
- package/dist/react/XmSwitch.js +56 -0
- package/dist/react/XmTab.d.ts +79 -0
- package/dist/react/XmTab.js +37 -0
- package/dist/react/XmTabPanel.d.ts +55 -0
- package/dist/react/XmTabPanel.js +32 -0
- package/dist/react/XmTable.d.ts +57 -0
- package/dist/react/XmTable.js +32 -0
- package/dist/react/XmTabs.d.ts +82 -0
- package/dist/react/XmTabs.js +37 -0
- package/dist/react/XmTextField.d.ts +147 -0
- package/dist/react/XmTextField.js +60 -0
- package/dist/react/XmTextarea.d.ts +155 -0
- package/dist/react/XmTextarea.js +64 -0
- package/dist/react/XmTooltip.d.ts +67 -0
- package/dist/react/XmTooltip.js +38 -0
- package/dist/react/index.d.ts +59 -0
- package/dist/react/index.js +59 -0
- package/dist/react/react-utils.js +67 -0
- package/package.json +37 -9
- package/styles/_base-typography.css +86 -0
- package/styles/_primitives.css +54 -0
- package/styles/_reset.css +58 -0
- package/styles/base.css +23 -0
- package/vscode.css-custom-data.json +6 -0
- package/vscode.html-custom-data.json +979 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { XmArtifact as XmArtifactElement } from "../lit/components/artifact/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
|
+
/** `XmArtifact` component event */
|
|
13
|
+
export type XmArtifactElementEvent<E = Event> = TypedEvent<
|
|
14
|
+
XmArtifactElement,
|
|
15
|
+
E
|
|
16
|
+
>;
|
|
17
|
+
|
|
18
|
+
export type { XmArtifactElement };
|
|
19
|
+
|
|
20
|
+
export interface XmArtifactProps 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
|
+
showRefresh?: boolean;
|
|
37
|
+
|
|
38
|
+
/** undefined */
|
|
39
|
+
showClose?: boolean;
|
|
40
|
+
|
|
41
|
+
/** undefined */
|
|
42
|
+
title?: XmArtifactElement["title"];
|
|
43
|
+
|
|
44
|
+
/** undefined */
|
|
45
|
+
subCsv?: XmArtifactElement["subCsv"];
|
|
46
|
+
|
|
47
|
+
/** undefined */
|
|
48
|
+
view?: XmArtifactElement["view"];
|
|
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<XmArtifactElement>;
|
|
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 element requests to close. */
|
|
72
|
+
onClose?: (event: XmArtifactElementEvent) => void;
|
|
73
|
+
|
|
74
|
+
/** Fired when a refresh is requested. */
|
|
75
|
+
onRefresh?: (event: XmArtifactElementEvent) => void;
|
|
76
|
+
|
|
77
|
+
/** Fired when the active view changes. */
|
|
78
|
+
onViewChange?: (event: XmArtifactElementEvent) => 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
|
+
* - `title`: undefined
|
|
89
|
+
* - `sub-csv`/`subCsv`: undefined
|
|
90
|
+
* - `view`: undefined
|
|
91
|
+
* - `show-refresh`/`showRefresh`: undefined
|
|
92
|
+
* - `show-close`/`showClose`: undefined
|
|
93
|
+
* - `sub`: undefined (property only)
|
|
94
|
+
*
|
|
95
|
+
* ## Events
|
|
96
|
+
*
|
|
97
|
+
* Events that will be emitted by the component.
|
|
98
|
+
*
|
|
99
|
+
* - `close`: Fired when the element requests to close.
|
|
100
|
+
* - `refresh`: Fired when a refresh is requested.
|
|
101
|
+
* - `view-change`: Fired when the active view changes.
|
|
102
|
+
*
|
|
103
|
+
* ## Methods
|
|
104
|
+
*
|
|
105
|
+
* Methods that can be called to access component functionality.
|
|
106
|
+
*
|
|
107
|
+
* - `setBodies(preview: ChildNode[], code: ChildNode[]) => void`: Imperatively set the preview/code body nodes from a host. Replaces any
|
|
108
|
+
* authored or previously-set bodies. Used by <xm-chat-shell> to hand the
|
|
109
|
+
* panel its slot content; the chat shell can't author them as direct
|
|
110
|
+
* children of the lit-rendered <xm-artifact> tag without the snapshot
|
|
111
|
+
* timing race that this method sidesteps.
|
|
112
|
+
*/
|
|
113
|
+
export const XmArtifact: React.ForwardRefExoticComponent<XmArtifactProps>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { forwardRef, useRef } from "react";
|
|
2
|
+
import "../lit/components/artifact/index.js";
|
|
3
|
+
import { useEventListener, createForwardedRefHandler } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const XmArtifact = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const {
|
|
8
|
+
showRefresh,
|
|
9
|
+
showClose,
|
|
10
|
+
title,
|
|
11
|
+
subCsv,
|
|
12
|
+
view,
|
|
13
|
+
className,
|
|
14
|
+
exportparts,
|
|
15
|
+
htmlFor,
|
|
16
|
+
part,
|
|
17
|
+
tabIndex,
|
|
18
|
+
...restProps
|
|
19
|
+
} = props;
|
|
20
|
+
|
|
21
|
+
/** Event listeners - run once */
|
|
22
|
+
useEventListener(ref, "close", props.onClose);
|
|
23
|
+
useEventListener(ref, "refresh", props.onRefresh);
|
|
24
|
+
useEventListener(ref, "view-change", props.onViewChange);
|
|
25
|
+
|
|
26
|
+
return React.createElement(
|
|
27
|
+
"xm-artifact",
|
|
28
|
+
{
|
|
29
|
+
ref: createForwardedRefHandler(ref, forwardedRef),
|
|
30
|
+
...restProps,
|
|
31
|
+
title: title,
|
|
32
|
+
"sub-csv": subCsv ?? props["sub-csv"],
|
|
33
|
+
view: view,
|
|
34
|
+
class: className,
|
|
35
|
+
exportparts: exportparts,
|
|
36
|
+
for: htmlFor ?? props["for"],
|
|
37
|
+
part: part,
|
|
38
|
+
tabindex: tabIndex ?? props["tabindex"],
|
|
39
|
+
"show-refresh": showRefresh ? true : undefined,
|
|
40
|
+
"show-close": showClose ? true : undefined,
|
|
41
|
+
style: { ...props.style },
|
|
42
|
+
},
|
|
43
|
+
props.children,
|
|
44
|
+
);
|
|
45
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { XmArtifactChip as XmArtifactChipElement } from "../lit/components/bubble/index.js";
|
|
3
|
+
|
|
4
|
+
export type { XmArtifactChipElement };
|
|
5
|
+
|
|
6
|
+
export interface XmArtifactChipProps 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
|
+
download?: boolean;
|
|
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<XmArtifactChipElement>;
|
|
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
|
+
* - `download`: undefined
|
|
54
|
+
* - `artifact`: undefined (property only)
|
|
55
|
+
*/
|
|
56
|
+
export const XmArtifactChip: React.ForwardRefExoticComponent<XmArtifactChipProps>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React, { forwardRef, useRef } from "react";
|
|
2
|
+
import "../lit/components/bubble/index.js";
|
|
3
|
+
import { createForwardedRefHandler } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const XmArtifactChip = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const {
|
|
8
|
+
download,
|
|
9
|
+
className,
|
|
10
|
+
exportparts,
|
|
11
|
+
htmlFor,
|
|
12
|
+
part,
|
|
13
|
+
tabIndex,
|
|
14
|
+
...restProps
|
|
15
|
+
} = props;
|
|
16
|
+
|
|
17
|
+
return React.createElement(
|
|
18
|
+
"xm-artifact-chip",
|
|
19
|
+
{
|
|
20
|
+
ref: createForwardedRefHandler(ref, forwardedRef),
|
|
21
|
+
...restProps,
|
|
22
|
+
class: className,
|
|
23
|
+
exportparts: exportparts,
|
|
24
|
+
for: htmlFor ?? props["for"],
|
|
25
|
+
part: part,
|
|
26
|
+
tabindex: tabIndex ?? props["tabindex"],
|
|
27
|
+
download: download ? true : undefined,
|
|
28
|
+
style: { ...props.style },
|
|
29
|
+
},
|
|
30
|
+
props.children,
|
|
31
|
+
);
|
|
32
|
+
});
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
XmAutocomplete as XmAutocompleteElement,
|
|
4
|
+
CustomEvent,
|
|
5
|
+
} from "../lit/components/autocomplete/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
|
+
/** `XmAutocomplete` component event */
|
|
16
|
+
export type XmAutocompleteElementEvent<E = Event> = TypedEvent<
|
|
17
|
+
XmAutocompleteElement,
|
|
18
|
+
E
|
|
19
|
+
>;
|
|
20
|
+
|
|
21
|
+
export type { XmAutocompleteElement, CustomEvent };
|
|
22
|
+
|
|
23
|
+
export interface XmAutocompleteProps 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
|
+
required?: boolean;
|
|
40
|
+
|
|
41
|
+
/** undefined */
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
|
|
44
|
+
/** undefined */
|
|
45
|
+
readOnly?: boolean;
|
|
46
|
+
|
|
47
|
+
/** undefined */
|
|
48
|
+
loading?: boolean;
|
|
49
|
+
|
|
50
|
+
/** INITIAL checked for toggle subclasses; mapped from attribute `checked`. */
|
|
51
|
+
initialChecked?: boolean;
|
|
52
|
+
|
|
53
|
+
/** Native placeholder shown when the query is empty. */
|
|
54
|
+
placeholder?: XmAutocompleteElement["placeholder"];
|
|
55
|
+
|
|
56
|
+
/** undefined */
|
|
57
|
+
label?: XmAutocompleteElement["label"];
|
|
58
|
+
|
|
59
|
+
/** undefined */
|
|
60
|
+
helper?: XmAutocompleteElement["helper"];
|
|
61
|
+
|
|
62
|
+
/** Severity copy. Non-empty ⇒ the field is in error (icon + copy, never color). */
|
|
63
|
+
error?: XmAutocompleteElement["error"];
|
|
64
|
+
|
|
65
|
+
/** undefined */
|
|
66
|
+
size?: XmAutocompleteElement["size"];
|
|
67
|
+
|
|
68
|
+
/** Form-control name — mirrors native <input name>. */
|
|
69
|
+
name?: XmAutocompleteElement["name"];
|
|
70
|
+
|
|
71
|
+
/** INITIAL value (uncontrolled-first, AD-6): the `value` attribute seeds the
|
|
72
|
+
live state once, then never overrides user input. Mapped from attribute
|
|
73
|
+
`value` so authors write `<xm-text-field value="…">`. */
|
|
74
|
+
initialValue?: XmAutocompleteElement["initialValue"];
|
|
75
|
+
|
|
76
|
+
/** 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()`. */
|
|
77
|
+
className?: string;
|
|
78
|
+
|
|
79
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
80
|
+
exportparts?: string;
|
|
81
|
+
|
|
82
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
83
|
+
htmlFor?: string;
|
|
84
|
+
|
|
85
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
86
|
+
key?: number | string;
|
|
87
|
+
|
|
88
|
+
/** 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. */
|
|
89
|
+
part?: string;
|
|
90
|
+
|
|
91
|
+
/** 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. */
|
|
92
|
+
ref?: React.Ref<XmAutocompleteElement>;
|
|
93
|
+
|
|
94
|
+
/** 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. */
|
|
95
|
+
tabIndex?: number;
|
|
96
|
+
|
|
97
|
+
/** Shared option model — `{ label, value, disabled? }` (AD-8a). */
|
|
98
|
+
options?: XmAutocompleteElement["options"];
|
|
99
|
+
|
|
100
|
+
/** Typed primitive read for consumers; the inherited string `value` stays in
|
|
101
|
+
sync for xm-form / ElementInternals. */
|
|
102
|
+
selectedValue?: XmAutocompleteElement["selectedValue"];
|
|
103
|
+
|
|
104
|
+
/** Fired on commit with the new value in `detail`. */
|
|
105
|
+
onChange?: (event: XmAutocompleteElementEvent) => void;
|
|
106
|
+
|
|
107
|
+
/** Fired on each edit with the current value in `detail`. */
|
|
108
|
+
onInput?: (event: XmAutocompleteElementEvent) => void;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
*
|
|
113
|
+
*
|
|
114
|
+
* ## Attributes & Properties
|
|
115
|
+
*
|
|
116
|
+
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
117
|
+
*
|
|
118
|
+
* - `placeholder`: Native placeholder shown when the query is empty.
|
|
119
|
+
* - `label`: undefined
|
|
120
|
+
* - `helper`: undefined
|
|
121
|
+
* - `error`: Severity copy. Non-empty ⇒ the field is in error (icon + copy, never color).
|
|
122
|
+
* - `size`: undefined
|
|
123
|
+
* - `required`: undefined
|
|
124
|
+
* - `disabled`: undefined
|
|
125
|
+
* - `readonly`/`readOnly`: undefined
|
|
126
|
+
* - `loading`: undefined
|
|
127
|
+
* - `name`: Form-control name — mirrors native <input name>.
|
|
128
|
+
* - `value`/`initialValue`: INITIAL value (uncontrolled-first, AD-6): the `value` attribute seeds the
|
|
129
|
+
* live state once, then never overrides user input. Mapped from attribute
|
|
130
|
+
* `value` so authors write `<xm-text-field value="…">`.
|
|
131
|
+
* - `checked`/`initialChecked`: INITIAL checked for toggle subclasses; mapped from attribute `checked`.
|
|
132
|
+
* - `options`: Shared option model — `{ label, value, disabled? }` (AD-8a). (property only)
|
|
133
|
+
* - `selectedValue`: Typed primitive read for consumers; the inherited string `value` stays in
|
|
134
|
+
* sync for xm-form / ElementInternals. (property only) (readonly)
|
|
135
|
+
* - `readonly`: undefined (property only)
|
|
136
|
+
* - `value`: Programmatic reset support — setting `value` after first paint updates live state. (property only)
|
|
137
|
+
* - `checked`: Public read contract for toggle subclasses (AD-6a). (property only)
|
|
138
|
+
*
|
|
139
|
+
* ## Events
|
|
140
|
+
*
|
|
141
|
+
* Events that will be emitted by the component.
|
|
142
|
+
*
|
|
143
|
+
* - `change`: Fired on commit with the new value in `detail`.
|
|
144
|
+
* - `input`: Fired on each edit with the current value in `detail`.
|
|
145
|
+
*
|
|
146
|
+
* ## Methods
|
|
147
|
+
*
|
|
148
|
+
* Methods that can be called to access component functionality.
|
|
149
|
+
*
|
|
150
|
+
* - `setFormDisabled(disabled: boolean) => void`: Down-propagation hook: xm-form (Story 2.10) sets this; it OR's with the
|
|
151
|
+
* field's own disabled and can never re-enable a self-disabled field.
|
|
152
|
+
*/
|
|
153
|
+
export const XmAutocomplete: React.ForwardRefExoticComponent<XmAutocompleteProps>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React, { forwardRef, useRef } from "react";
|
|
2
|
+
import "../lit/components/autocomplete/index.js";
|
|
3
|
+
import {
|
|
4
|
+
useEventListener,
|
|
5
|
+
useProperties,
|
|
6
|
+
createForwardedRefHandler,
|
|
7
|
+
} from "./react-utils.js";
|
|
8
|
+
|
|
9
|
+
export const XmAutocomplete = forwardRef((props, forwardedRef) => {
|
|
10
|
+
const ref = useRef(null);
|
|
11
|
+
const {
|
|
12
|
+
required,
|
|
13
|
+
disabled,
|
|
14
|
+
readOnly,
|
|
15
|
+
loading,
|
|
16
|
+
initialChecked,
|
|
17
|
+
placeholder,
|
|
18
|
+
label,
|
|
19
|
+
helper,
|
|
20
|
+
error,
|
|
21
|
+
size,
|
|
22
|
+
name,
|
|
23
|
+
initialValue,
|
|
24
|
+
className,
|
|
25
|
+
exportparts,
|
|
26
|
+
htmlFor,
|
|
27
|
+
part,
|
|
28
|
+
tabIndex,
|
|
29
|
+
options,
|
|
30
|
+
selectedValue,
|
|
31
|
+
...restProps
|
|
32
|
+
} = props;
|
|
33
|
+
|
|
34
|
+
/** Event listeners - run once */
|
|
35
|
+
useEventListener(ref, "change", props.onChange);
|
|
36
|
+
useEventListener(ref, "input", props.onInput);
|
|
37
|
+
|
|
38
|
+
/** Properties - run whenever a property has changed */
|
|
39
|
+
useProperties(ref, "options", options);
|
|
40
|
+
useProperties(ref, "selectedValue", selectedValue);
|
|
41
|
+
|
|
42
|
+
return React.createElement(
|
|
43
|
+
"xm-autocomplete",
|
|
44
|
+
{
|
|
45
|
+
ref: createForwardedRefHandler(ref, forwardedRef),
|
|
46
|
+
...restProps,
|
|
47
|
+
placeholder: placeholder,
|
|
48
|
+
label: label,
|
|
49
|
+
helper: helper,
|
|
50
|
+
error: error,
|
|
51
|
+
size: size,
|
|
52
|
+
name: name,
|
|
53
|
+
value: initialValue ?? props["value"],
|
|
54
|
+
class: className,
|
|
55
|
+
exportparts: exportparts,
|
|
56
|
+
for: htmlFor ?? props["for"],
|
|
57
|
+
part: part,
|
|
58
|
+
tabindex: tabIndex ?? props["tabindex"],
|
|
59
|
+
required: required ? true : undefined,
|
|
60
|
+
disabled: disabled ? true : undefined,
|
|
61
|
+
readonly: readOnly ? true : undefined,
|
|
62
|
+
loading: loading ? true : undefined,
|
|
63
|
+
checked: initialChecked ? true : undefined,
|
|
64
|
+
style: { ...props.style },
|
|
65
|
+
},
|
|
66
|
+
props.children,
|
|
67
|
+
);
|
|
68
|
+
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { XmAvatar as XmAvatarElement } from "../lit/components/avatar/index.js";
|
|
3
|
+
|
|
4
|
+
export type { XmAvatarElement };
|
|
5
|
+
|
|
6
|
+
export interface XmAvatarProps 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
|
+
title?: XmAvatarElement["title"];
|
|
23
|
+
|
|
24
|
+
/** undefined */
|
|
25
|
+
name?: XmAvatarElement["name"];
|
|
26
|
+
|
|
27
|
+
/** undefined */
|
|
28
|
+
initials?: XmAvatarElement["initials"];
|
|
29
|
+
|
|
30
|
+
/** undefined */
|
|
31
|
+
src?: XmAvatarElement["src"];
|
|
32
|
+
|
|
33
|
+
/** undefined */
|
|
34
|
+
size?: XmAvatarElement["size"];
|
|
35
|
+
|
|
36
|
+
/** 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()`. */
|
|
37
|
+
className?: string;
|
|
38
|
+
|
|
39
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
40
|
+
exportparts?: string;
|
|
41
|
+
|
|
42
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
43
|
+
htmlFor?: string;
|
|
44
|
+
|
|
45
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
46
|
+
key?: number | string;
|
|
47
|
+
|
|
48
|
+
/** 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. */
|
|
49
|
+
part?: string;
|
|
50
|
+
|
|
51
|
+
/** 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. */
|
|
52
|
+
ref?: React.Ref<XmAvatarElement>;
|
|
53
|
+
|
|
54
|
+
/** 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. */
|
|
55
|
+
tabIndex?: number;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
*
|
|
61
|
+
* ## Attributes & Properties
|
|
62
|
+
*
|
|
63
|
+
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
64
|
+
*
|
|
65
|
+
* - `title`: undefined
|
|
66
|
+
* - `name`: undefined
|
|
67
|
+
* - `initials`: undefined
|
|
68
|
+
* - `src`: undefined
|
|
69
|
+
* - `size`: undefined
|
|
70
|
+
*/
|
|
71
|
+
export const XmAvatar: React.ForwardRefExoticComponent<XmAvatarProps>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, { forwardRef, useRef } from "react";
|
|
2
|
+
import "../lit/components/avatar/index.js";
|
|
3
|
+
import { createForwardedRefHandler } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const XmAvatar = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const {
|
|
8
|
+
title,
|
|
9
|
+
name,
|
|
10
|
+
initials,
|
|
11
|
+
src,
|
|
12
|
+
size,
|
|
13
|
+
className,
|
|
14
|
+
exportparts,
|
|
15
|
+
htmlFor,
|
|
16
|
+
part,
|
|
17
|
+
tabIndex,
|
|
18
|
+
...restProps
|
|
19
|
+
} = props;
|
|
20
|
+
|
|
21
|
+
return React.createElement(
|
|
22
|
+
"xm-avatar",
|
|
23
|
+
{
|
|
24
|
+
ref: createForwardedRefHandler(ref, forwardedRef),
|
|
25
|
+
...restProps,
|
|
26
|
+
title: title,
|
|
27
|
+
name: name,
|
|
28
|
+
initials: initials,
|
|
29
|
+
src: src,
|
|
30
|
+
size: size,
|
|
31
|
+
class: className,
|
|
32
|
+
exportparts: exportparts,
|
|
33
|
+
for: htmlFor ?? props["for"],
|
|
34
|
+
part: part,
|
|
35
|
+
tabindex: tabIndex ?? props["tabindex"],
|
|
36
|
+
style: { ...props.style },
|
|
37
|
+
},
|
|
38
|
+
props.children,
|
|
39
|
+
);
|
|
40
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { XmAvatarGroup as XmAvatarGroupElement } from "../lit/components/avatar-group/index.js";
|
|
3
|
+
|
|
4
|
+
export type { XmAvatarGroupElement };
|
|
5
|
+
|
|
6
|
+
export interface XmAvatarGroupProps 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
|
+
max?: XmAvatarGroupElement["max"];
|
|
23
|
+
|
|
24
|
+
/** undefined */
|
|
25
|
+
size?: XmAvatarGroupElement["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<XmAvatarGroupElement>;
|
|
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
|
+
* - `max`: undefined
|
|
57
|
+
* - `size`: undefined
|
|
58
|
+
*/
|
|
59
|
+
export const XmAvatarGroup: React.ForwardRefExoticComponent<XmAvatarGroupProps>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React, { forwardRef, useRef } from "react";
|
|
2
|
+
import "../lit/components/avatar-group/index.js";
|
|
3
|
+
import { createForwardedRefHandler } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const XmAvatarGroup = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const {
|
|
8
|
+
max,
|
|
9
|
+
size,
|
|
10
|
+
className,
|
|
11
|
+
exportparts,
|
|
12
|
+
htmlFor,
|
|
13
|
+
part,
|
|
14
|
+
tabIndex,
|
|
15
|
+
...restProps
|
|
16
|
+
} = props;
|
|
17
|
+
|
|
18
|
+
return React.createElement(
|
|
19
|
+
"xm-avatar-group",
|
|
20
|
+
{
|
|
21
|
+
ref: createForwardedRefHandler(ref, forwardedRef),
|
|
22
|
+
...restProps,
|
|
23
|
+
max: max,
|
|
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
|
+
});
|