@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.
- 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 +47 -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 +48 -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 +70 -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 +38 -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 +48 -0
- package/dist/react/XmCheckbox.d.ts +145 -0
- package/dist/react/XmCheckbox.js +60 -0
- package/dist/react/XmChip.d.ts +99 -0
- package/dist/react/XmChip.js +48 -0
- package/dist/react/XmChipGroup.d.ts +79 -0
- package/dist/react/XmChipGroup.js +36 -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 +56 -0
- package/dist/react/XmDataTable.d.ts +125 -0
- package/dist/react/XmDataTable.js +66 -0
- package/dist/react/XmDateRange.d.ts +93 -0
- package/dist/react/XmDateRange.js +42 -0
- package/dist/react/XmDialog.d.ts +87 -0
- package/dist/react/XmDialog.js +41 -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 +49 -0
- package/dist/react/XmFileInput.d.ts +151 -0
- package/dist/react/XmFileInput.js +70 -0
- package/dist/react/XmFileValidationBlock.d.ts +111 -0
- package/dist/react/XmFileValidationBlock.js +50 -0
- package/dist/react/XmForm.d.ts +91 -0
- package/dist/react/XmForm.js +38 -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 +38 -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 +46 -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 +74 -0
- package/dist/react/XmNavigationDrawer.d.ts +93 -0
- package/dist/react/XmNavigationDrawer.js +42 -0
- package/dist/react/XmOverlay.d.ts +120 -0
- package/dist/react/XmOverlay.js +56 -0
- package/dist/react/XmPagination.d.ts +117 -0
- package/dist/react/XmPagination.js +58 -0
- package/dist/react/XmPopover.d.ts +90 -0
- package/dist/react/XmPopover.js +42 -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 +42 -0
- package/dist/react/XmRadioGroup.d.ts +139 -0
- package/dist/react/XmRadioGroup.js +58 -0
- package/dist/react/XmSelect.d.ts +152 -0
- package/dist/react/XmSelect.js +70 -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 +76 -0
- package/dist/react/XmSnackbar.d.ts +110 -0
- package/dist/react/XmSnackbar.js +51 -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 +58 -0
- package/dist/react/XmTab.d.ts +79 -0
- package/dist/react/XmTab.js +38 -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 +38 -0
- package/dist/react/XmTextField.d.ts +147 -0
- package/dist/react/XmTextField.js +62 -0
- package/dist/react/XmTextarea.d.ts +155 -0
- package/dist/react/XmTextarea.js +66 -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,75 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { XmSidebarItem as XmSidebarItemElement } from "../lit/components/sidebar-item/index.js";
|
|
3
|
+
|
|
4
|
+
export type { XmSidebarItemElement };
|
|
5
|
+
|
|
6
|
+
export interface XmSidebarItemProps 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
|
+
active?: boolean;
|
|
23
|
+
|
|
24
|
+
/** undefined */
|
|
25
|
+
hover?: boolean;
|
|
26
|
+
|
|
27
|
+
/** undefined */
|
|
28
|
+
showDot?: boolean;
|
|
29
|
+
|
|
30
|
+
/** undefined */
|
|
31
|
+
collapsed?: boolean;
|
|
32
|
+
|
|
33
|
+
/** undefined */
|
|
34
|
+
title?: XmSidebarItemElement["title"];
|
|
35
|
+
|
|
36
|
+
/** undefined */
|
|
37
|
+
layout?: XmSidebarItemElement["layout"];
|
|
38
|
+
|
|
39
|
+
/** 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()`. */
|
|
40
|
+
className?: string;
|
|
41
|
+
|
|
42
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
43
|
+
exportparts?: string;
|
|
44
|
+
|
|
45
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
46
|
+
htmlFor?: string;
|
|
47
|
+
|
|
48
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
49
|
+
key?: number | string;
|
|
50
|
+
|
|
51
|
+
/** 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. */
|
|
52
|
+
part?: string;
|
|
53
|
+
|
|
54
|
+
/** 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. */
|
|
55
|
+
ref?: React.Ref<XmSidebarItemElement>;
|
|
56
|
+
|
|
57
|
+
/** 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. */
|
|
58
|
+
tabIndex?: number;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
*
|
|
64
|
+
* ## Attributes & Properties
|
|
65
|
+
*
|
|
66
|
+
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
67
|
+
*
|
|
68
|
+
* - `title`: undefined
|
|
69
|
+
* - `layout`: undefined
|
|
70
|
+
* - `active`: undefined
|
|
71
|
+
* - `hover`: undefined
|
|
72
|
+
* - `show-dot`/`showDot`: undefined
|
|
73
|
+
* - `collapsed`: undefined
|
|
74
|
+
*/
|
|
75
|
+
export const XmSidebarItem: React.ForwardRefExoticComponent<XmSidebarItemProps>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { forwardRef, useRef } from "react";
|
|
2
|
+
import "../lit/components/sidebar-item/index.js";
|
|
3
|
+
import { createForwardedRefHandler } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const XmSidebarItem = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const {
|
|
8
|
+
active,
|
|
9
|
+
hover,
|
|
10
|
+
showDot,
|
|
11
|
+
collapsed,
|
|
12
|
+
title,
|
|
13
|
+
layout,
|
|
14
|
+
className,
|
|
15
|
+
exportparts,
|
|
16
|
+
htmlFor,
|
|
17
|
+
part,
|
|
18
|
+
tabIndex,
|
|
19
|
+
...restProps
|
|
20
|
+
} = props;
|
|
21
|
+
|
|
22
|
+
return React.createElement(
|
|
23
|
+
"xm-sidebar-item",
|
|
24
|
+
{
|
|
25
|
+
ref: createForwardedRefHandler(ref, forwardedRef),
|
|
26
|
+
...restProps,
|
|
27
|
+
title: title,
|
|
28
|
+
layout: layout,
|
|
29
|
+
class: className,
|
|
30
|
+
exportparts: exportparts,
|
|
31
|
+
for: htmlFor ?? props["for"],
|
|
32
|
+
part: part,
|
|
33
|
+
tabindex: tabIndex ?? props["tabindex"],
|
|
34
|
+
active: active ? true : undefined,
|
|
35
|
+
hover: hover ? true : undefined,
|
|
36
|
+
"show-dot": showDot ? true : undefined,
|
|
37
|
+
collapsed: collapsed ? true : undefined,
|
|
38
|
+
style: { ...props.style },
|
|
39
|
+
},
|
|
40
|
+
props.children,
|
|
41
|
+
);
|
|
42
|
+
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { XmSkeleton as XmSkeletonElement } from "../lit/components/skeleton/index.js";
|
|
3
|
+
|
|
4
|
+
export type { XmSkeletonElement };
|
|
5
|
+
|
|
6
|
+
export interface XmSkeletonProps 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
|
+
variant?: XmSkeletonElement["variant"];
|
|
23
|
+
|
|
24
|
+
/** undefined */
|
|
25
|
+
width?: XmSkeletonElement["width"];
|
|
26
|
+
|
|
27
|
+
/** undefined */
|
|
28
|
+
height?: XmSkeletonElement["height"];
|
|
29
|
+
|
|
30
|
+
/** undefined */
|
|
31
|
+
lines?: XmSkeletonElement["lines"];
|
|
32
|
+
|
|
33
|
+
/** undefined */
|
|
34
|
+
radius?: XmSkeletonElement["radius"];
|
|
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<XmSkeletonElement>;
|
|
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
|
+
* - `variant`: undefined
|
|
66
|
+
* - `width`: undefined
|
|
67
|
+
* - `height`: undefined
|
|
68
|
+
* - `lines`: undefined
|
|
69
|
+
* - `radius`: undefined
|
|
70
|
+
*/
|
|
71
|
+
export const XmSkeleton: React.ForwardRefExoticComponent<XmSkeletonProps>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, { forwardRef, useRef } from "react";
|
|
2
|
+
import "../lit/components/skeleton/index.js";
|
|
3
|
+
import { createForwardedRefHandler } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const XmSkeleton = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const {
|
|
8
|
+
variant,
|
|
9
|
+
width,
|
|
10
|
+
height,
|
|
11
|
+
lines,
|
|
12
|
+
radius,
|
|
13
|
+
className,
|
|
14
|
+
exportparts,
|
|
15
|
+
htmlFor,
|
|
16
|
+
part,
|
|
17
|
+
tabIndex,
|
|
18
|
+
...restProps
|
|
19
|
+
} = props;
|
|
20
|
+
|
|
21
|
+
return React.createElement(
|
|
22
|
+
"xm-skeleton",
|
|
23
|
+
{
|
|
24
|
+
ref: createForwardedRefHandler(ref, forwardedRef),
|
|
25
|
+
...restProps,
|
|
26
|
+
variant: variant,
|
|
27
|
+
width: width,
|
|
28
|
+
height: height,
|
|
29
|
+
lines: lines,
|
|
30
|
+
radius: radius,
|
|
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,160 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
XmSlider as XmSliderElement,
|
|
4
|
+
CustomEvent,
|
|
5
|
+
} from "../lit/components/slider/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
|
+
/** `XmSlider` component event */
|
|
16
|
+
export type XmSliderElementEvent<E = Event> = TypedEvent<XmSliderElement, E>;
|
|
17
|
+
|
|
18
|
+
export type { XmSliderElement, CustomEvent };
|
|
19
|
+
|
|
20
|
+
export interface XmSliderProps 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
|
+
/** Show the current numeric value as a label beside the track. */
|
|
36
|
+
showValue?: boolean;
|
|
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
|
+
/** undefined */
|
|
54
|
+
min?: XmSliderElement["min"];
|
|
55
|
+
|
|
56
|
+
/** undefined */
|
|
57
|
+
max?: XmSliderElement["max"];
|
|
58
|
+
|
|
59
|
+
/** undefined */
|
|
60
|
+
step?: XmSliderElement["step"];
|
|
61
|
+
|
|
62
|
+
/** Optional unit appended to the displayed value (e.g. "%", "px"). */
|
|
63
|
+
unit?: XmSliderElement["unit"];
|
|
64
|
+
|
|
65
|
+
/** undefined */
|
|
66
|
+
label?: XmSliderElement["label"];
|
|
67
|
+
|
|
68
|
+
/** undefined */
|
|
69
|
+
helper?: XmSliderElement["helper"];
|
|
70
|
+
|
|
71
|
+
/** Severity copy. Non-empty ⇒ the field is in error (icon + copy, never color). */
|
|
72
|
+
error?: XmSliderElement["error"];
|
|
73
|
+
|
|
74
|
+
/** undefined */
|
|
75
|
+
size?: XmSliderElement["size"];
|
|
76
|
+
|
|
77
|
+
/** Form-control name — mirrors native <input name>. */
|
|
78
|
+
name?: XmSliderElement["name"];
|
|
79
|
+
|
|
80
|
+
/** INITIAL value (uncontrolled-first, AD-6): the `value` attribute seeds the
|
|
81
|
+
live state once, then never overrides user input. Mapped from attribute
|
|
82
|
+
`value` so authors write `<xm-text-field value="…">`. */
|
|
83
|
+
initialValue?: XmSliderElement["initialValue"];
|
|
84
|
+
|
|
85
|
+
/** 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()`. */
|
|
86
|
+
className?: string;
|
|
87
|
+
|
|
88
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
89
|
+
exportparts?: string;
|
|
90
|
+
|
|
91
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
92
|
+
htmlFor?: string;
|
|
93
|
+
|
|
94
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
95
|
+
key?: number | string;
|
|
96
|
+
|
|
97
|
+
/** 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. */
|
|
98
|
+
part?: string;
|
|
99
|
+
|
|
100
|
+
/** 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. */
|
|
101
|
+
ref?: React.Ref<XmSliderElement>;
|
|
102
|
+
|
|
103
|
+
/** 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. */
|
|
104
|
+
tabIndex?: number;
|
|
105
|
+
|
|
106
|
+
/** Typed live read; the inherited string `value` stays in sync. */
|
|
107
|
+
valueAsNumber?: XmSliderElement["valueAsNumber"];
|
|
108
|
+
|
|
109
|
+
/** Fired on each edit with the current value in `detail`. */
|
|
110
|
+
onInput?: (event: XmSliderElementEvent) => void;
|
|
111
|
+
|
|
112
|
+
/** Fired on commit with the new value in `detail`. */
|
|
113
|
+
onChange?: (event: XmSliderElementEvent) => void;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
*
|
|
118
|
+
*
|
|
119
|
+
* ## Attributes & Properties
|
|
120
|
+
*
|
|
121
|
+
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
122
|
+
*
|
|
123
|
+
* - `min`: undefined
|
|
124
|
+
* - `max`: undefined
|
|
125
|
+
* - `step`: undefined
|
|
126
|
+
* - `show-value`/`showValue`: Show the current numeric value as a label beside the track.
|
|
127
|
+
* - `unit`: Optional unit appended to the displayed value (e.g. "%", "px").
|
|
128
|
+
* - `label`: undefined
|
|
129
|
+
* - `helper`: undefined
|
|
130
|
+
* - `error`: Severity copy. Non-empty ⇒ the field is in error (icon + copy, never color).
|
|
131
|
+
* - `size`: undefined
|
|
132
|
+
* - `required`: undefined
|
|
133
|
+
* - `disabled`: undefined
|
|
134
|
+
* - `readonly`/`readOnly`: undefined
|
|
135
|
+
* - `loading`: undefined
|
|
136
|
+
* - `name`: Form-control name — mirrors native <input name>.
|
|
137
|
+
* - `value`/`initialValue`: INITIAL value (uncontrolled-first, AD-6): the `value` attribute seeds the
|
|
138
|
+
* live state once, then never overrides user input. Mapped from attribute
|
|
139
|
+
* `value` so authors write `<xm-text-field value="…">`.
|
|
140
|
+
* - `checked`/`initialChecked`: INITIAL checked for toggle subclasses; mapped from attribute `checked`.
|
|
141
|
+
* - `valueAsNumber`: Typed live read; the inherited string `value` stays in sync. (property only) (readonly)
|
|
142
|
+
* - `readonly`: undefined (property only)
|
|
143
|
+
* - `value`: Programmatic reset support — setting `value` after first paint updates live state. (property only)
|
|
144
|
+
* - `checked`: Public read contract for toggle subclasses (AD-6a). (property only)
|
|
145
|
+
*
|
|
146
|
+
* ## Events
|
|
147
|
+
*
|
|
148
|
+
* Events that will be emitted by the component.
|
|
149
|
+
*
|
|
150
|
+
* - `input`: Fired on each edit with the current value in `detail`.
|
|
151
|
+
* - `change`: Fired on commit with the new value in `detail`.
|
|
152
|
+
*
|
|
153
|
+
* ## Methods
|
|
154
|
+
*
|
|
155
|
+
* Methods that can be called to access component functionality.
|
|
156
|
+
*
|
|
157
|
+
* - `setFormDisabled(disabled: boolean) => void`: Down-propagation hook: xm-form (Story 2.10) sets this; it OR's with the
|
|
158
|
+
* field's own disabled and can never re-enable a self-disabled field.
|
|
159
|
+
*/
|
|
160
|
+
export const XmSlider: React.ForwardRefExoticComponent<XmSliderProps>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React, { forwardRef, useRef } from "react";
|
|
2
|
+
import "../lit/components/slider/index.js";
|
|
3
|
+
import {
|
|
4
|
+
useEventListener,
|
|
5
|
+
useProperties,
|
|
6
|
+
createForwardedRefHandler,
|
|
7
|
+
} from "./react-utils.js";
|
|
8
|
+
|
|
9
|
+
export const XmSlider = forwardRef((props, forwardedRef) => {
|
|
10
|
+
const ref = useRef(null);
|
|
11
|
+
const {
|
|
12
|
+
showValue,
|
|
13
|
+
required,
|
|
14
|
+
disabled,
|
|
15
|
+
readOnly,
|
|
16
|
+
loading,
|
|
17
|
+
initialChecked,
|
|
18
|
+
min,
|
|
19
|
+
max,
|
|
20
|
+
step,
|
|
21
|
+
unit,
|
|
22
|
+
label,
|
|
23
|
+
helper,
|
|
24
|
+
error,
|
|
25
|
+
size,
|
|
26
|
+
name,
|
|
27
|
+
initialValue,
|
|
28
|
+
className,
|
|
29
|
+
exportparts,
|
|
30
|
+
htmlFor,
|
|
31
|
+
part,
|
|
32
|
+
tabIndex,
|
|
33
|
+
valueAsNumber,
|
|
34
|
+
onInput,
|
|
35
|
+
onChange,
|
|
36
|
+
...restProps
|
|
37
|
+
} = props;
|
|
38
|
+
|
|
39
|
+
/** Event listeners - run once */
|
|
40
|
+
useEventListener(ref, "input", props.onInput);
|
|
41
|
+
useEventListener(ref, "change", props.onChange);
|
|
42
|
+
|
|
43
|
+
/** Properties - run whenever a property has changed */
|
|
44
|
+
useProperties(ref, "valueAsNumber", valueAsNumber);
|
|
45
|
+
|
|
46
|
+
return React.createElement(
|
|
47
|
+
"xm-slider",
|
|
48
|
+
{
|
|
49
|
+
ref: createForwardedRefHandler(ref, forwardedRef),
|
|
50
|
+
...restProps,
|
|
51
|
+
min: min,
|
|
52
|
+
max: max,
|
|
53
|
+
step: step,
|
|
54
|
+
unit: unit,
|
|
55
|
+
label: label,
|
|
56
|
+
helper: helper,
|
|
57
|
+
error: error,
|
|
58
|
+
size: size,
|
|
59
|
+
name: name,
|
|
60
|
+
value: initialValue ?? props["value"],
|
|
61
|
+
class: className,
|
|
62
|
+
exportparts: exportparts,
|
|
63
|
+
for: htmlFor ?? props["for"],
|
|
64
|
+
part: part,
|
|
65
|
+
tabindex: tabIndex ?? props["tabindex"],
|
|
66
|
+
"show-value": showValue ? true : undefined,
|
|
67
|
+
required: required ? true : undefined,
|
|
68
|
+
disabled: disabled ? true : undefined,
|
|
69
|
+
readonly: readOnly ? true : undefined,
|
|
70
|
+
loading: loading ? true : undefined,
|
|
71
|
+
checked: initialChecked ? true : undefined,
|
|
72
|
+
style: { ...props.style },
|
|
73
|
+
},
|
|
74
|
+
props.children,
|
|
75
|
+
);
|
|
76
|
+
});
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { XmSnackbar as XmSnackbarElement } from "../lit/components/snackbar/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
|
+
/** `XmSnackbar` component event */
|
|
13
|
+
export type XmSnackbarElementEvent<E = Event> = TypedEvent<
|
|
14
|
+
XmSnackbarElement,
|
|
15
|
+
E
|
|
16
|
+
>;
|
|
17
|
+
|
|
18
|
+
export type { XmSnackbarElement };
|
|
19
|
+
|
|
20
|
+
export interface XmSnackbarProps 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
|
+
showDismiss?: boolean;
|
|
37
|
+
|
|
38
|
+
/** undefined */
|
|
39
|
+
static?: boolean;
|
|
40
|
+
|
|
41
|
+
/** undefined */
|
|
42
|
+
kind?: XmSnackbarElement["kind"];
|
|
43
|
+
|
|
44
|
+
/** undefined */
|
|
45
|
+
code?: XmSnackbarElement["code"];
|
|
46
|
+
|
|
47
|
+
/** undefined */
|
|
48
|
+
title?: XmSnackbarElement["title"];
|
|
49
|
+
|
|
50
|
+
/** undefined */
|
|
51
|
+
message?: XmSnackbarElement["message"];
|
|
52
|
+
|
|
53
|
+
/** undefined */
|
|
54
|
+
primaryLabel?: XmSnackbarElement["primaryLabel"];
|
|
55
|
+
|
|
56
|
+
/** undefined */
|
|
57
|
+
secondaryLabel?: XmSnackbarElement["secondaryLabel"];
|
|
58
|
+
|
|
59
|
+
/** 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()`. */
|
|
60
|
+
className?: string;
|
|
61
|
+
|
|
62
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
63
|
+
exportparts?: string;
|
|
64
|
+
|
|
65
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
66
|
+
htmlFor?: string;
|
|
67
|
+
|
|
68
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
69
|
+
key?: number | string;
|
|
70
|
+
|
|
71
|
+
/** 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. */
|
|
72
|
+
part?: string;
|
|
73
|
+
|
|
74
|
+
/** 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. */
|
|
75
|
+
ref?: React.Ref<XmSnackbarElement>;
|
|
76
|
+
|
|
77
|
+
/** 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. */
|
|
78
|
+
tabIndex?: number;
|
|
79
|
+
|
|
80
|
+
/** Fired when the snackbar is dismissed. */
|
|
81
|
+
onSnackbarDismiss?: (event: XmSnackbarElementEvent) => void;
|
|
82
|
+
|
|
83
|
+
/** Fired when the snackbar's primary action is activated. */
|
|
84
|
+
onSnackbarPrimary?: (event: XmSnackbarElementEvent) => void;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
*
|
|
89
|
+
*
|
|
90
|
+
* ## Attributes & Properties
|
|
91
|
+
*
|
|
92
|
+
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
93
|
+
*
|
|
94
|
+
* - `kind`: undefined
|
|
95
|
+
* - `code`: undefined
|
|
96
|
+
* - `title`: undefined
|
|
97
|
+
* - `message`: undefined
|
|
98
|
+
* - `primary-label`/`primaryLabel`: undefined
|
|
99
|
+
* - `secondary-label`/`secondaryLabel`: undefined
|
|
100
|
+
* - `show-dismiss`/`showDismiss`: undefined
|
|
101
|
+
* - `static`: undefined
|
|
102
|
+
*
|
|
103
|
+
* ## Events
|
|
104
|
+
*
|
|
105
|
+
* Events that will be emitted by the component.
|
|
106
|
+
*
|
|
107
|
+
* - `snackbar-dismiss`: Fired when the snackbar is dismissed.
|
|
108
|
+
* - `snackbar-primary`: Fired when the snackbar's primary action is activated.
|
|
109
|
+
*/
|
|
110
|
+
export const XmSnackbar: React.ForwardRefExoticComponent<XmSnackbarProps>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React, { forwardRef, useRef } from "react";
|
|
2
|
+
import "../lit/components/snackbar/index.js";
|
|
3
|
+
import { useEventListener, createForwardedRefHandler } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const XmSnackbar = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const {
|
|
8
|
+
showDismiss,
|
|
9
|
+
kind,
|
|
10
|
+
code,
|
|
11
|
+
title,
|
|
12
|
+
message,
|
|
13
|
+
primaryLabel,
|
|
14
|
+
secondaryLabel,
|
|
15
|
+
className,
|
|
16
|
+
exportparts,
|
|
17
|
+
htmlFor,
|
|
18
|
+
part,
|
|
19
|
+
tabIndex,
|
|
20
|
+
onSnackbarDismiss,
|
|
21
|
+
onSnackbarPrimary,
|
|
22
|
+
...restProps
|
|
23
|
+
} = props;
|
|
24
|
+
|
|
25
|
+
/** Event listeners - run once */
|
|
26
|
+
useEventListener(ref, "snackbar-dismiss", props.onSnackbarDismiss);
|
|
27
|
+
useEventListener(ref, "snackbar-primary", props.onSnackbarPrimary);
|
|
28
|
+
|
|
29
|
+
return React.createElement(
|
|
30
|
+
"xm-snackbar",
|
|
31
|
+
{
|
|
32
|
+
ref: createForwardedRefHandler(ref, forwardedRef),
|
|
33
|
+
...restProps,
|
|
34
|
+
kind: kind,
|
|
35
|
+
code: code,
|
|
36
|
+
title: title,
|
|
37
|
+
message: message,
|
|
38
|
+
"primary-label": primaryLabel ?? props["primary-label"],
|
|
39
|
+
"secondary-label": secondaryLabel ?? props["secondary-label"],
|
|
40
|
+
class: className,
|
|
41
|
+
exportparts: exportparts,
|
|
42
|
+
for: htmlFor ?? props["for"],
|
|
43
|
+
part: part,
|
|
44
|
+
tabindex: tabIndex ?? props["tabindex"],
|
|
45
|
+
"show-dismiss": showDismiss ? true : undefined,
|
|
46
|
+
static: props.static ? true : undefined,
|
|
47
|
+
style: { ...props.style },
|
|
48
|
+
},
|
|
49
|
+
props.children,
|
|
50
|
+
);
|
|
51
|
+
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { XmStack as XmStackElement } from "../lit/components/stack/index.js";
|
|
3
|
+
|
|
4
|
+
export type { XmStackElement };
|
|
5
|
+
|
|
6
|
+
export interface XmStackProps 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
|
+
wrap?: boolean;
|
|
23
|
+
|
|
24
|
+
/** undefined */
|
|
25
|
+
direction?: XmStackElement["direction"];
|
|
26
|
+
|
|
27
|
+
/** undefined */
|
|
28
|
+
gap?: XmStackElement["gap"];
|
|
29
|
+
|
|
30
|
+
/** undefined */
|
|
31
|
+
align?: XmStackElement["align"];
|
|
32
|
+
|
|
33
|
+
/** undefined */
|
|
34
|
+
justify?: XmStackElement["justify"];
|
|
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<XmStackElement>;
|
|
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
|
+
* - `direction`: undefined
|
|
66
|
+
* - `gap`: undefined
|
|
67
|
+
* - `align`: undefined
|
|
68
|
+
* - `justify`: undefined
|
|
69
|
+
* - `wrap`: undefined
|
|
70
|
+
*/
|
|
71
|
+
export const XmStack: React.ForwardRefExoticComponent<XmStackProps>;
|