@loadsmart/miranda-react 3.0.0-beta.3 → 3.0.0-beta.30
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/dist/components/Banner/Banner.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +4 -3
- package/dist/components/Dialog/Dialog.d.ts +6 -6
- package/dist/components/Dialog/DialogClose.d.ts +1 -1
- package/dist/components/DotsLoader/DotsLoader.d.ts +13 -0
- package/dist/components/DotsLoader/index.d.ts +2 -0
- package/dist/components/Drawer/Drawer.d.ts +6 -6
- package/dist/components/Drawer/DrawerClose.d.ts +1 -1
- package/dist/components/Dropdown/Dropdown.d.ts +2 -2
- package/dist/components/EmptyState/EmptyState.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +3 -2
- package/dist/components/Select/Select.d.ts +31 -0
- package/dist/components/Select/SelectOption.d.ts +16 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Steps/Steps.d.ts +6 -5
- package/dist/components/Steps/useSteps.d.ts +2 -2
- package/dist/components/Switch/Switch.d.ts +4 -3
- package/dist/components/Tag/ActionableTag.d.ts +5 -5
- package/dist/components/TextArea/TextArea.d.ts +5 -4
- package/dist/components/TextField/TextField.d.ts +9 -8
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +4 -3
- package/dist/components/Tooltip/Tooltip.d.ts +11 -4
- package/dist/index.d.ts +6 -2
- package/dist/index.js +161 -78
- package/dist/utils/createComponent.d.ts +1 -1
- package/dist/utils/types.d.ts +6 -0
- package/package.json +6 -4
|
@@ -9,7 +9,7 @@ declare global {
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
export declare const Banner: import("@lit/react").ReactWebComponent<WCBanner, {
|
|
12
|
-
onDismiss: EventName<CustomEvent
|
|
12
|
+
onDismiss: EventName<CustomEvent>;
|
|
13
13
|
}> & {
|
|
14
14
|
ActionPrimary: import("react").ForwardRefExoticComponent<Omit<import("./BannerActionPrimary").BannerActionPrimaryProps, "ref"> & import("react").RefAttributes<import("@loadsmart/miranda-wc").BannerActionPrimary>>;
|
|
15
15
|
Actions: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").BannerActions, {}>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { ReactNode, ComponentProps } from 'react';
|
|
2
1
|
import { Checkbox as WCCheckbox } from '@loadsmart/miranda-wc';
|
|
3
|
-
import type { WebComponentProps } from '@lit/react';
|
|
2
|
+
import type { EventName, WebComponentProps } from '@lit/react';
|
|
3
|
+
import type { ReactNode, ComponentProps } from 'react';
|
|
4
|
+
import type { MirandaChangeEvent } from '../../utils/types';
|
|
4
5
|
declare global {
|
|
5
6
|
namespace JSX {
|
|
6
7
|
interface IntrinsicElements {
|
|
@@ -9,7 +10,7 @@ declare global {
|
|
|
9
10
|
}
|
|
10
11
|
}
|
|
11
12
|
declare const WiredCheckbox: import("@lit/react").ReactWebComponent<WCCheckbox, {
|
|
12
|
-
onChange:
|
|
13
|
+
onChange: EventName<MirandaChangeEvent<WCCheckbox>>;
|
|
13
14
|
}>;
|
|
14
15
|
export type CheckboxProps = ComponentProps<typeof WiredCheckbox> & {
|
|
15
16
|
leading?: ReactNode;
|
|
@@ -9,11 +9,11 @@ declare global {
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
export declare const Dialog: import("@lit/react").ReactWebComponent<WCDialog, {
|
|
12
|
-
onClose: EventName<CustomEvent
|
|
13
|
-
onOpening: EventName<CustomEvent
|
|
14
|
-
onOpened: EventName<CustomEvent
|
|
15
|
-
onClosing: EventName<CustomEvent
|
|
16
|
-
onClosed: EventName<CustomEvent
|
|
12
|
+
onClose: EventName<CustomEvent>;
|
|
13
|
+
onOpening: EventName<CustomEvent>;
|
|
14
|
+
onOpened: EventName<CustomEvent>;
|
|
15
|
+
onClosing: EventName<CustomEvent>;
|
|
16
|
+
onClosed: EventName<CustomEvent>;
|
|
17
17
|
}> & {
|
|
18
18
|
ActionPrimary: import("react").ForwardRefExoticComponent<Omit<import("./DialogActionPrimary").DialogActionPrimaryProps, "ref"> & import("react").RefAttributes<import("@loadsmart/miranda-wc").DialogActionPrimary>>;
|
|
19
19
|
ActionSecondary: import("react").ForwardRefExoticComponent<Omit<import("./DialogActionSecondary").DialogActionSecondaryProps, "ref"> & import("react").RefAttributes<import("@loadsmart/miranda-wc").DialogActionSecondary>>;
|
|
@@ -21,7 +21,7 @@ export declare const Dialog: import("@lit/react").ReactWebComponent<WCDialog, {
|
|
|
21
21
|
Actions: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").DialogActions, {}>;
|
|
22
22
|
Body: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").DialogBody, {}>;
|
|
23
23
|
Close: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").DialogClose, {
|
|
24
|
-
onClose: EventName<CustomEvent
|
|
24
|
+
onClose: EventName<CustomEvent>;
|
|
25
25
|
}>;
|
|
26
26
|
Footer: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").DialogFooter, {}>;
|
|
27
27
|
Header: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").DialogHeader, {}>;
|
|
@@ -9,6 +9,6 @@ declare global {
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
export declare const DialogClose: import("@lit/react").ReactWebComponent<WCDialogClose, {
|
|
12
|
-
onClose: EventName<CustomEvent
|
|
12
|
+
onClose: EventName<CustomEvent>;
|
|
13
13
|
}>;
|
|
14
14
|
export type DialogCloseProps = ComponentProps<typeof DialogClose>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
import { DotsLoader as WCDotsLoader } from '@loadsmart/miranda-wc';
|
|
3
|
+
import type { WebComponentProps } from '@lit/react';
|
|
4
|
+
declare global {
|
|
5
|
+
namespace JSX {
|
|
6
|
+
interface IntrinsicElements {
|
|
7
|
+
'm-dots-loader': WebComponentProps<WCDotsLoader>;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
declare const DotsLoader: import("@lit/react").ReactWebComponent<WCDotsLoader, {}>;
|
|
12
|
+
export type DotsLoaderProps = ComponentProps<typeof DotsLoader>;
|
|
13
|
+
export default DotsLoader;
|
|
@@ -12,11 +12,11 @@ declare global {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
export declare const Drawer: import("@lit/react").ReactWebComponent<WCDrawer, {
|
|
15
|
-
onClose: EventName<CustomEvent
|
|
16
|
-
onOpening: EventName<CustomEvent
|
|
17
|
-
onOpened: EventName<CustomEvent
|
|
18
|
-
onClosing: EventName<CustomEvent
|
|
19
|
-
onClosed: EventName<CustomEvent
|
|
15
|
+
onClose: EventName<CustomEvent>;
|
|
16
|
+
onOpening: EventName<CustomEvent>;
|
|
17
|
+
onOpened: EventName<CustomEvent>;
|
|
18
|
+
onClosing: EventName<CustomEvent>;
|
|
19
|
+
onClosed: EventName<CustomEvent>;
|
|
20
20
|
}> & {
|
|
21
21
|
ActionPrimary: typeof DrawerActionPrimary;
|
|
22
22
|
ActionSecondary: typeof DrawerActionSecondary;
|
|
@@ -24,7 +24,7 @@ export declare const Drawer: import("@lit/react").ReactWebComponent<WCDrawer, {
|
|
|
24
24
|
Actions: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").DrawerActions, {}>;
|
|
25
25
|
Body: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").DrawerBody, {}>;
|
|
26
26
|
Close: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").DrawerClose, {
|
|
27
|
-
onClose: EventName<CustomEvent
|
|
27
|
+
onClose: EventName<CustomEvent>;
|
|
28
28
|
}>;
|
|
29
29
|
Header: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").DrawerHeader, {}>;
|
|
30
30
|
};
|
|
@@ -9,6 +9,6 @@ declare global {
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
export declare const DrawerClose: import("@lit/react").ReactWebComponent<WCDrawerClose, {
|
|
12
|
-
onClose: EventName<CustomEvent
|
|
12
|
+
onClose: EventName<CustomEvent>;
|
|
13
13
|
}>;
|
|
14
14
|
export type DrawerCloseProps = ComponentProps<typeof DrawerClose>;
|
|
@@ -9,8 +9,8 @@ declare global {
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
export declare const Dropdown: import("@lit/react").ReactWebComponent<WCDropdown, {
|
|
12
|
-
onExpand: EventName<CustomEvent
|
|
13
|
-
onCollapse: EventName<CustomEvent
|
|
12
|
+
onExpand: EventName<CustomEvent>;
|
|
13
|
+
onCollapse: EventName<CustomEvent>;
|
|
14
14
|
}> & {
|
|
15
15
|
Item: import("react").ForwardRefExoticComponent<Omit<import("./DropdownItem").DropdownItemProps, "ref"> & import("react").RefAttributes<import("@loadsmart/miranda-wc").DropdownItem>>;
|
|
16
16
|
Menu: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").DropdownMenu, {}>;
|
|
@@ -9,7 +9,7 @@ declare global {
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
export declare const EmptyState: import("@lit/react").ReactWebComponent<WCEmptyState, {
|
|
12
|
-
onAction: EventName<CustomEvent
|
|
12
|
+
onAction: EventName<CustomEvent>;
|
|
13
13
|
}> & {
|
|
14
14
|
Illustration: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").EmptyStateIllustration, {}>;
|
|
15
15
|
Header: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").EmptyStateHeader, {}>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { WebComponentProps } from '@lit/react';
|
|
2
1
|
import { RadioGroup as WCRadioGroup } from '@loadsmart/miranda-wc';
|
|
3
2
|
import type { ComponentProps } from 'react';
|
|
3
|
+
import type { EventName, WebComponentProps } from '@lit/react';
|
|
4
|
+
import type { MirandaChangeEvent } from '../../utils/types';
|
|
4
5
|
declare global {
|
|
5
6
|
namespace JSX {
|
|
6
7
|
interface IntrinsicElements {
|
|
@@ -9,7 +10,7 @@ declare global {
|
|
|
9
10
|
}
|
|
10
11
|
}
|
|
11
12
|
declare const RadioGroup: import("@lit/react").ReactWebComponent<WCRadioGroup, {
|
|
12
|
-
onChange:
|
|
13
|
+
onChange: EventName<MirandaChangeEvent<WCRadioGroup>>;
|
|
13
14
|
}> & {
|
|
14
15
|
Radio: import("react").ForwardRefExoticComponent<Omit<import("./Radio").RadioProps, "ref"> & import("react").RefAttributes<import("@loadsmart/miranda-wc").Radio>>;
|
|
15
16
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Select as WCSelect } from '@loadsmart/miranda-wc';
|
|
2
|
+
import type { EventName, WebComponentProps } from '@lit/react';
|
|
3
|
+
import type { ReactNode, ComponentProps } from 'react';
|
|
4
|
+
import type { MirandaChangeEvent } from '../../utils/types';
|
|
5
|
+
declare global {
|
|
6
|
+
namespace JSX {
|
|
7
|
+
interface IntrinsicElements {
|
|
8
|
+
'm-select': WebComponentProps<WCSelect>;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
declare const WiredSelect: import("@lit/react").ReactWebComponent<WCSelect, {
|
|
13
|
+
onExpand: EventName<CustomEvent>;
|
|
14
|
+
onCollapse: EventName<CustomEvent>;
|
|
15
|
+
onChange: EventName<MirandaChangeEvent<WCSelect>>;
|
|
16
|
+
}>;
|
|
17
|
+
export type SelectOption = {
|
|
18
|
+
value: string;
|
|
19
|
+
label?: string;
|
|
20
|
+
leading?: ReactNode;
|
|
21
|
+
trailing?: ReactNode;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
};
|
|
24
|
+
export type SelectProps = ComponentProps<typeof WiredSelect> & {
|
|
25
|
+
options?: SelectOption[];
|
|
26
|
+
};
|
|
27
|
+
export declare function Select(props: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare namespace Select {
|
|
29
|
+
var Option: import("react").ForwardRefExoticComponent<Omit<import("./SelectOption").SelectOptionProps, "ref"> & import("react").RefAttributes<import("@loadsmart/miranda-wc").SelectOption>>;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import type { WebComponentProps } from '@lit/react';
|
|
3
|
+
import { SelectOption as WCSelectOption } from '@loadsmart/miranda-wc';
|
|
4
|
+
declare global {
|
|
5
|
+
namespace JSX {
|
|
6
|
+
interface IntrinsicElements {
|
|
7
|
+
'm-option': WebComponentProps<WCSelectOption>;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export declare const WiredSelectOption: import("@lit/react").ReactWebComponent<WCSelectOption, {}>;
|
|
12
|
+
export interface SelectOptionProps extends Omit<ComponentProps<typeof WiredSelectOption>, 'leading' | 'trailing'> {
|
|
13
|
+
leading?: ReactNode;
|
|
14
|
+
trailing?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export declare const SelectOption: import("react").ForwardRefExoticComponent<Omit<SelectOptionProps, "ref"> & import("react").RefAttributes<WCSelectOption>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ComponentProps } from 'react';
|
|
2
2
|
import type { EventName, WebComponentProps } from '@lit/react';
|
|
3
|
+
import type { StepChangeEventDetail, StepNavigateEventDetail } from '@loadsmart/miranda-wc';
|
|
3
4
|
import { Steps as WCSteps } from '@loadsmart/miranda-wc';
|
|
4
5
|
declare global {
|
|
5
6
|
namespace JSX {
|
|
@@ -9,11 +10,11 @@ declare global {
|
|
|
9
10
|
}
|
|
10
11
|
}
|
|
11
12
|
export declare const Steps: import("@lit/react").ReactWebComponent<WCSteps, {
|
|
12
|
-
onChange: EventName<CustomEvent<
|
|
13
|
-
onComplete: EventName<CustomEvent
|
|
14
|
-
onNavigate: EventName<CustomEvent<
|
|
15
|
-
onNext: EventName<CustomEvent
|
|
16
|
-
onPrevious: EventName<CustomEvent
|
|
13
|
+
onChange: EventName<CustomEvent<StepChangeEventDetail>>;
|
|
14
|
+
onComplete: EventName<CustomEvent>;
|
|
15
|
+
onNavigate: EventName<CustomEvent<StepNavigateEventDetail>>;
|
|
16
|
+
onNext: EventName<CustomEvent>;
|
|
17
|
+
onPrevious: EventName<CustomEvent>;
|
|
17
18
|
}> & {
|
|
18
19
|
Step: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").Step, {}>;
|
|
19
20
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { LiteralUnion } from '../../utils/types';
|
|
2
|
-
export declare function createCustomEvent(eventName: string, detail?:
|
|
2
|
+
export declare function createCustomEvent<T>(eventName: string, detail?: T): CustomEvent<T>;
|
|
3
3
|
export declare function useSteps(): {
|
|
4
4
|
elementRef: HTMLElement | null;
|
|
5
5
|
registerSteps: () => {
|
|
6
6
|
ref(element: HTMLElement | null): void;
|
|
7
7
|
};
|
|
8
|
-
navigateToStep: (step: LiteralUnion<
|
|
8
|
+
navigateToStep: (step: LiteralUnion<"previous" | "next", string>) => void;
|
|
9
9
|
completeStep: () => void;
|
|
10
10
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { ComponentProps } from 'react';
|
|
2
|
-
import type { WebComponentProps } from '@lit/react';
|
|
3
1
|
import { Switch as WCSwitch } from '@loadsmart/miranda-wc';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
import type { EventName, WebComponentProps } from '@lit/react';
|
|
4
|
+
import type { MirandaChangeEvent } from '../../utils/types';
|
|
4
5
|
declare global {
|
|
5
6
|
namespace JSX {
|
|
6
7
|
interface IntrinsicElements {
|
|
@@ -9,6 +10,6 @@ declare global {
|
|
|
9
10
|
}
|
|
10
11
|
}
|
|
11
12
|
export declare const Switch: import("@lit/react").ReactWebComponent<WCSwitch, {
|
|
12
|
-
onChange:
|
|
13
|
+
onChange: EventName<MirandaChangeEvent<WCSwitch>>;
|
|
13
14
|
}>;
|
|
14
15
|
export type SwitchProps = ComponentProps<typeof Switch>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ReactNode, ComponentProps } from 'react';
|
|
2
|
-
import type { EventName, WebComponentProps } from '@lit/react';
|
|
3
1
|
import { ActionableTag as WCActionableTag } from '@loadsmart/miranda-wc';
|
|
4
|
-
import type {
|
|
2
|
+
import type { EventName, WebComponentProps } from '@lit/react';
|
|
3
|
+
import type { ReactNode, ComponentProps } from 'react';
|
|
4
|
+
import type { MirandaChangeEvent } from '../../utils/types';
|
|
5
5
|
declare global {
|
|
6
6
|
namespace JSX {
|
|
7
7
|
interface IntrinsicElements {
|
|
@@ -10,8 +10,8 @@ declare global {
|
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
declare const WiredActionableTag: import("@lit/react").ReactWebComponent<WCActionableTag, {
|
|
13
|
-
onChange: EventName<
|
|
14
|
-
onRemove: EventName<CustomEvent
|
|
13
|
+
onChange: EventName<MirandaChangeEvent<WCActionableTag>>;
|
|
14
|
+
onRemove: EventName<CustomEvent>;
|
|
15
15
|
}>;
|
|
16
16
|
export type ActionableTagProps = ComponentProps<typeof WiredActionableTag> & {
|
|
17
17
|
leading?: ReactNode;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { TextArea as WCTextArea } from '@loadsmart/miranda-wc';
|
|
1
2
|
import type { ComponentProps } from 'react';
|
|
2
|
-
import type { WebComponentProps } from '@lit/react';
|
|
3
|
+
import type { EventName, WebComponentProps } from '@lit/react';
|
|
3
4
|
import type { TextAreaProps as WCTextAreaProps } from '@loadsmart/miranda-wc';
|
|
4
|
-
import {
|
|
5
|
+
import type { MirandaChangeEvent } from '../../utils/types';
|
|
5
6
|
declare global {
|
|
6
7
|
namespace JSX {
|
|
7
8
|
interface IntrinsicElements {
|
|
@@ -10,8 +11,8 @@ declare global {
|
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
declare const WiredTextArea: import("@lit/react").ReactWebComponent<WCTextArea, {
|
|
13
|
-
onInput:
|
|
14
|
-
onChange:
|
|
14
|
+
onInput: EventName<MirandaChangeEvent<WCTextArea>>;
|
|
15
|
+
onChange: EventName<MirandaChangeEvent<WCTextArea>>;
|
|
15
16
|
}>;
|
|
16
17
|
export type TextAreaProps = ComponentProps<typeof WiredTextArea>;
|
|
17
18
|
declare function TextArea(props: TextAreaProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import type { ReactNode, ComponentProps } from 'react';
|
|
2
|
-
import type { EventName, WebComponentProps } from '@lit/react';
|
|
3
|
-
import type { TextFieldProps as WCTextFieldProps } from '@loadsmart/miranda-wc';
|
|
4
1
|
import { TextField as WCTextField } from '@loadsmart/miranda-wc';
|
|
2
|
+
import type { EventName, WebComponentProps } from '@lit/react';
|
|
3
|
+
import type { ReactNode, ComponentProps, InputHTMLAttributes } from 'react';
|
|
4
|
+
import type { MirandaChangeEvent } from '../../utils/types';
|
|
5
5
|
declare global {
|
|
6
6
|
namespace JSX {
|
|
7
7
|
interface IntrinsicElements {
|
|
8
|
-
'm-text-field': WebComponentProps<WCTextField
|
|
8
|
+
'm-text-field': WebComponentProps<WCTextField>;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
declare const WiredTextField: import("@lit/react").ReactWebComponent<WCTextField, {
|
|
13
|
-
onInput:
|
|
14
|
-
onChange:
|
|
15
|
-
onClear: EventName<CustomEvent
|
|
13
|
+
onInput: EventName<MirandaChangeEvent<WCTextField>>;
|
|
14
|
+
onChange: EventName<MirandaChangeEvent<WCTextField>>;
|
|
15
|
+
onClear: EventName<CustomEvent>;
|
|
16
16
|
}>;
|
|
17
|
-
export type TextFieldProps = ComponentProps<typeof WiredTextField> & {
|
|
17
|
+
export type TextFieldProps = Omit<ComponentProps<typeof WiredTextField>, 'value'> & {
|
|
18
|
+
value?: InputHTMLAttributes<HTMLInputElement>['value'];
|
|
18
19
|
leading?: ReactNode;
|
|
19
20
|
trailing?: ReactNode;
|
|
20
21
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { ReactNode, ComponentProps } from 'react';
|
|
2
|
-
import type { WebComponentProps } from '@lit/react';
|
|
3
1
|
import { ToggleGroup as WCToggleGroup } from '@loadsmart/miranda-wc';
|
|
2
|
+
import type { EventName, WebComponentProps } from '@lit/react';
|
|
3
|
+
import type { ReactNode, ComponentProps } from 'react';
|
|
4
|
+
import type { MirandaChangeEvent } from '../../utils/types';
|
|
4
5
|
declare global {
|
|
5
6
|
namespace JSX {
|
|
6
7
|
interface IntrinsicElements {
|
|
@@ -9,7 +10,7 @@ declare global {
|
|
|
9
10
|
}
|
|
10
11
|
}
|
|
11
12
|
declare const WiredToggleGroup: import("@lit/react").ReactWebComponent<WCToggleGroup, {
|
|
12
|
-
onChange:
|
|
13
|
+
onChange: EventName<MirandaChangeEvent<WCToggleGroup>>;
|
|
13
14
|
}>;
|
|
14
15
|
export type ToggleGroupOption = {
|
|
15
16
|
value: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ReactNode, ComponentProps } from 'react';
|
|
2
|
-
import type { WebComponentProps } from '@lit/react';
|
|
3
1
|
import { Tooltip as WCTooltip } from '@loadsmart/miranda-wc';
|
|
2
|
+
import type { ReactElement, ReactNode, ComponentProps } from 'react';
|
|
3
|
+
import type { WebComponentProps } from '@lit/react';
|
|
4
4
|
import type { TooltipPlacement, TooltipTrigger } from '@loadsmart/miranda-wc';
|
|
5
5
|
declare global {
|
|
6
6
|
namespace JSX {
|
|
@@ -11,7 +11,14 @@ declare global {
|
|
|
11
11
|
}
|
|
12
12
|
declare const WiredTooltip: import("@lit/react").ReactWebComponent<WCTooltip, {}>;
|
|
13
13
|
export type TooltipProps = ComponentProps<typeof WiredTooltip> & {
|
|
14
|
-
message
|
|
14
|
+
message: ReactNode;
|
|
15
|
+
children: ReactElement;
|
|
15
16
|
};
|
|
16
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Render the tooltip component.
|
|
19
|
+
*
|
|
20
|
+
* **Warning**: This component will throw if the provided `children` is not a single child,
|
|
21
|
+
* and will not render if the children is not valid or is a fragment.
|
|
22
|
+
*/
|
|
23
|
+
export declare function Tooltip(props: TooltipProps): import("react/jsx-runtime").JSX.Element | null;
|
|
17
24
|
export type { TooltipPlacement, TooltipTrigger };
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export * from './components/ProgressBar';
|
|
|
21
21
|
export * from './components/ProgressBarCountdown';
|
|
22
22
|
export * from './components/RadioGroup';
|
|
23
23
|
export * from './components/Section';
|
|
24
|
+
export * from './components/Select';
|
|
24
25
|
export * from './components/SpinnerWheel';
|
|
25
26
|
export * from './components/Steps';
|
|
26
27
|
export * from './components/Switch';
|
|
@@ -34,6 +35,8 @@ export * from './components/Timeline';
|
|
|
34
35
|
export * from './components/ToggleGroup';
|
|
35
36
|
export * from './components/Tooltip';
|
|
36
37
|
export * from './components/LogoLoader';
|
|
38
|
+
export * from './components/DotsLoader';
|
|
39
|
+
export type { MirandaChangeEvent } from './utils/types';
|
|
37
40
|
export type { TypographyVariant } from '@loadsmart/miranda-wc';
|
|
38
41
|
export { Accordion as WCAccordion, AccordionTitle as WCAccordionTitle, AccordionContent as WCAccordionContent, } from '@loadsmart/miranda-wc';
|
|
39
42
|
export type { AccordionProps as WCAccordionProps, AccordionToggleEventDetails, } from '@loadsmart/miranda-wc';
|
|
@@ -68,6 +71,7 @@ export { Link as WCLink } from '@loadsmart/miranda-wc';
|
|
|
68
71
|
export { PageContent as WCPageContent } from '@loadsmart/miranda-wc';
|
|
69
72
|
export { Pagination as WCPagination } from '@loadsmart/miranda-wc';
|
|
70
73
|
export type { PaginationProps as WCPaginationProps, PaginationChangeEventDetails, } from '@loadsmart/miranda-wc';
|
|
74
|
+
export type { PopoverPlacement, PopoverPosition, PopoverRepositionEventDetail, } from '@loadsmart/miranda-wc';
|
|
71
75
|
export { ProgressBar as WCProgressBar } from '@loadsmart/miranda-wc';
|
|
72
76
|
export type { ProgressBarProps as WCProgressBarProps } from '@loadsmart/miranda-wc';
|
|
73
77
|
export { ProgressBarCountdown as WCProgressBarCountdown } from '@loadsmart/miranda-wc';
|
|
@@ -79,7 +83,7 @@ export type { SectionProps as WCSectionProps } from '@loadsmart/miranda-wc';
|
|
|
79
83
|
export { SpinnerWheel as WCSpinnerWheel } from '@loadsmart/miranda-wc';
|
|
80
84
|
export type { SpinnerWheelProps as WCSpinnerWheelProps } from '@loadsmart/miranda-wc';
|
|
81
85
|
export { Step as WCStep, Steps as WCSteps } from '@loadsmart/miranda-wc';
|
|
82
|
-
export type { StepProps as WCStepProps,
|
|
86
|
+
export type { StepProps as WCStepProps, StepChangeEventDetail, StepNavigateEventDetail, } from '@loadsmart/miranda-wc';
|
|
83
87
|
export { Switch as WCSwitch } from '@loadsmart/miranda-wc';
|
|
84
88
|
export type { SwitchProps as WCSwitchProps, SwitchSize, } from '@loadsmart/miranda-wc';
|
|
85
89
|
export { Table as WCTable, TableHead as WCTableHead, TableHeadCell as WCTableHeadCell, TableBody as WCTableBody, TableFoot as WCTableFoot, TableRow as WCTableRow, TableCell as WCTableCell, TableToolbar as WCTableToolbar, TableFeedback as WCTableFeedback, TableActions as WCTableActions, } from '@loadsmart/miranda-wc';
|
|
@@ -87,7 +91,7 @@ export type { TableProps as WCTableProps, TableCellProps as WCTableCellProps, Ta
|
|
|
87
91
|
export { Tabs as WCTabs, Tab as WCTab, TabPanel as WCTabPanel, } from '@loadsmart/miranda-wc';
|
|
88
92
|
export type { TabsProps as WCTabsProps, TabProps as WCTabProps, TabPanelProps as WCTabPanelProps, TabChangeEventDetail, } from '@loadsmart/miranda-wc';
|
|
89
93
|
export { Tag as WCTag, ActionableTag as WCActionableTag, } from '@loadsmart/miranda-wc';
|
|
90
|
-
export type { TagProps as WCTagProps, ActionableTagProps as WCActionableTagProps, TagVariant, TagSize,
|
|
94
|
+
export type { TagProps as WCTagProps, ActionableTagProps as WCActionableTagProps, TagVariant, TagSize, } from '@loadsmart/miranda-wc';
|
|
91
95
|
export { Text as WCText } from '@loadsmart/miranda-wc';
|
|
92
96
|
export type { TextProps as WCTextProps } from '@loadsmart/miranda-wc';
|
|
93
97
|
export { TextArea as WCTextArea } from '@loadsmart/miranda-wc';
|
package/dist/index.js
CHANGED
|
@@ -1,54 +1,48 @@
|
|
|
1
|
-
import { AccordionTitle as AccordionTitle$1, AccordionContent as AccordionContent$1, Accordion as Accordion$1, Badge as Badge$1, BannerActionPrimary as BannerActionPrimary$1, BannerActions as BannerActions$1, BannerActionSecondary as BannerActionSecondary$1, BannerDescription as BannerDescription$1, BannerIcon as BannerIcon$1, BannerTitle as BannerTitle$1, Banner as Banner$1, Button as Button$1, CardTitle as CardTitle$1, CardSubtitle as CardSubtitle$1, CardBody as CardBody$1, CardDivider as CardDivider$1, CardActionPrimary as CardActionPrimary$1, CardActionSecondary as CardActionSecondary$1, CardActionTertiary as CardActionTertiary$1, CardFooter as CardFooter$1, Card as Card$1, Checkbox as Checkbox$1, DialogActionPrimary as DialogActionPrimary$1, DialogActionSecondary as DialogActionSecondary$1, DialogActionTertiary as DialogActionTertiary$1, DialogActions as DialogActions$1, DialogBody as DialogBody$1, DialogClose as DialogClose$1, DialogFooter as DialogFooter$1, DialogHeader as DialogHeader$1, Dialog as Dialog$1, Divider as Divider$1, DrawerActionPrimary as DrawerActionPrimary$1, DrawerActionSecondary as DrawerActionSecondary$1, DrawerActionTertiary as DrawerActionTertiary$1, DrawerActions as DrawerActions$1, DrawerBody as DrawerBody$1, DrawerClose as DrawerClose$1, DrawerHeader as DrawerHeader$1, Drawer as Drawer$1, DropdownItem as DropdownItem$1, DropdownMenu as DropdownMenu$1, DropdownTrigger as DropdownTrigger$1, Dropdown as Dropdown$1, EmptyStateIllustration as EmptyStateIllustration$1, EmptyStateHeader as EmptyStateHeader$1, EmptyStateMessage as EmptyStateMessage$1, EmptyStateAction as EmptyStateAction$1, EmptyState as EmptyState$1, FieldLabel as FieldLabel$1, FieldHint as FieldHint$1, Field as Field$1, HeaderActions as HeaderActions$1, HeaderContent as HeaderContent$1, HeaderTitle as HeaderTitle$1, SubHeader as SubHeader$1, BackButton, Header as Header$1, Icon as Icon$1, LabeledValueLabel as LabeledValueLabel$1, LabeledValueValue as LabeledValueValue$1, LabeledValue as LabeledValue$1, Box as Box$1, Group as Group$1, Stack as Stack$1, Grid as Grid$1, Sidebar as Sidebar$1, Switcher as Switcher$1, Container as Container$1, Row as Row$1, Column as Column$1, Link as Link$1, Body as Body$1, PageContent as PageContent$1, Pagination as Pagination$1, ProgressBar as ProgressBar$1, ProgressBarCountdown as ProgressBarCountdown$1, Radio as Radio$1, RadioGroup as RadioGroup$1, SectionTitle as SectionTitle$1, Section as Section$1, SpinnerWheel as SpinnerWheel$1, Step as Step$1, Steps as Steps$1, Switch as Switch$1, TableHead as TableHead$1, TableBody as TableBody$1, TableFoot as TableFoot$1, TableRow as TableRow$1, TableCell as TableCell$1, TableToolbar as TableToolbar$1, TableHeadCell as TableHeadCell$1, TableFeedback as TableFeedback$1, TableActions as TableActions$1, Table as Table$1, Tab as Tab$1, TabPanel as TabPanel$1, Tabs as Tabs$1, Tag as Tag$1, ActionableTag as ActionableTag$1, Text as Text$1, TextArea as TextArea$1, TextField as TextField$1, TimelineItem as TimelineItem$1, TimelineExpandableItem as TimelineExpandableItem$1, TimelineItemBody as TimelineItemBody$1, TimelineItemFooter as TimelineItemFooter$1, TimelineItemHeader as TimelineItemHeader$1, TimelineItemHeaderSubtitle as TimelineItemHeaderSubtitle$1, TimelineItemHeaderTitle as TimelineItemHeaderTitle$1, TimelineItemIcon as TimelineItemIcon$1, Timeline as Timeline$1, Toggle as Toggle$1, ToggleGroup as ToggleGroup$1, Tooltip as Tooltip$1, LogoLoader as LogoLoader$1 } from '@loadsmart/miranda-wc';
|
|
1
|
+
import { AccordionTitle as AccordionTitle$1, AccordionContent as AccordionContent$1, Accordion as Accordion$1, Badge as Badge$1, BannerActionPrimary as BannerActionPrimary$1, BannerActions as BannerActions$1, BannerActionSecondary as BannerActionSecondary$1, BannerDescription as BannerDescription$1, BannerIcon as BannerIcon$1, BannerTitle as BannerTitle$1, Banner as Banner$1, Button as Button$1, CardTitle as CardTitle$1, CardSubtitle as CardSubtitle$1, CardBody as CardBody$1, CardDivider as CardDivider$1, CardActionPrimary as CardActionPrimary$1, CardActionSecondary as CardActionSecondary$1, CardActionTertiary as CardActionTertiary$1, CardFooter as CardFooter$1, Card as Card$1, Checkbox as Checkbox$1, DialogActionPrimary as DialogActionPrimary$1, DialogActionSecondary as DialogActionSecondary$1, DialogActionTertiary as DialogActionTertiary$1, DialogActions as DialogActions$1, DialogBody as DialogBody$1, DialogClose as DialogClose$1, DialogFooter as DialogFooter$1, DialogHeader as DialogHeader$1, Dialog as Dialog$1, Divider as Divider$1, DrawerActionPrimary as DrawerActionPrimary$1, DrawerActionSecondary as DrawerActionSecondary$1, DrawerActionTertiary as DrawerActionTertiary$1, DrawerActions as DrawerActions$1, DrawerBody as DrawerBody$1, DrawerClose as DrawerClose$1, DrawerHeader as DrawerHeader$1, Drawer as Drawer$1, DropdownItem as DropdownItem$1, DropdownMenu as DropdownMenu$1, DropdownTrigger as DropdownTrigger$1, Dropdown as Dropdown$1, EmptyStateIllustration as EmptyStateIllustration$1, EmptyStateHeader as EmptyStateHeader$1, EmptyStateMessage as EmptyStateMessage$1, EmptyStateAction as EmptyStateAction$1, EmptyState as EmptyState$1, FieldLabel as FieldLabel$1, FieldHint as FieldHint$1, Field as Field$1, HeaderActions as HeaderActions$1, HeaderContent as HeaderContent$1, HeaderTitle as HeaderTitle$1, SubHeader as SubHeader$1, BackButton, Header as Header$1, Icon as Icon$1, LabeledValueLabel as LabeledValueLabel$1, LabeledValueValue as LabeledValueValue$1, LabeledValue as LabeledValue$1, Box as Box$1, Group as Group$1, Stack as Stack$1, Grid as Grid$1, Sidebar as Sidebar$1, Switcher as Switcher$1, Container as Container$1, Row as Row$1, Column as Column$1, Link as Link$1, Body as Body$1, PageContent as PageContent$1, Pagination as Pagination$1, ProgressBar as ProgressBar$1, ProgressBarCountdown as ProgressBarCountdown$1, Radio as Radio$1, RadioGroup as RadioGroup$1, SectionTitle as SectionTitle$1, Section as Section$1, SelectOption as SelectOption$1, Select as Select$1, SpinnerWheel as SpinnerWheel$1, Step as Step$1, Steps as Steps$1, Switch as Switch$1, TableHead as TableHead$1, TableBody as TableBody$1, TableFoot as TableFoot$1, TableRow as TableRow$1, TableCell as TableCell$1, TableToolbar as TableToolbar$1, TableHeadCell as TableHeadCell$1, TableFeedback as TableFeedback$1, TableActions as TableActions$1, Table as Table$1, Tab as Tab$1, TabPanel as TabPanel$1, Tabs as Tabs$1, Tag as Tag$1, ActionableTag as ActionableTag$1, Text as Text$1, TextArea as TextArea$1, TextField as TextField$1, TimelineItem as TimelineItem$1, TimelineExpandableItem as TimelineExpandableItem$1, TimelineItemBody as TimelineItemBody$1, TimelineItemFooter as TimelineItemFooter$1, TimelineItemHeader as TimelineItemHeader$1, TimelineItemHeaderSubtitle as TimelineItemHeaderSubtitle$1, TimelineItemHeaderTitle as TimelineItemHeaderTitle$1, TimelineItemIcon as TimelineItemIcon$1, Timeline as Timeline$1, Toggle as Toggle$1, ToggleGroup as ToggleGroup$1, Tooltip as Tooltip$1, LogoLoader as LogoLoader$1, DotsLoader as DotsLoader$1 } from '@loadsmart/miranda-wc';
|
|
2
2
|
export { DIALOG_SIZES, DIALOG_VARIANTS, DRAWER_SIZES, EMPTY_STATE_VARIANTS, Accordion as WCAccordion, AccordionContent as WCAccordionContent, AccordionTitle as WCAccordionTitle, ActionableTag as WCActionableTag, Badge as WCBadge, Banner as WCBanner, BannerActionPrimary as WCBannerActionPrimary, BannerActionSecondary as WCBannerActionSecondary, BannerActions as WCBannerActions, BannerDescription as WCBannerDescription, BannerIcon as WCBannerIcon, BannerTitle as WCBannerTitle, Box as WCBox, Button as WCButton, Card as WCCard, CardActionPrimary as WCCardActionPrimary, CardActionSecondary as WCCardActionSecondary, CardActionTertiary as WCCardActionTertiary, CardBody as WCCardBody, CardDivider as WCCardDivider, CardFooter as WCCardFooter, CardSubtitle as WCCardSubtitle, CardTitle as WCCardTitle, Checkbox as WCCheckbox, Column as WCColumn, Container as WCContainer, Dialog as WCDialog, DialogActionPrimary as WCDialogActionPrimary, DialogActionSecondary as WCDialogActionSecondary, DialogActionTertiary as WCDialogActionTertiary, DialogActions as WCDialogActions, DialogBody as WCDialogBody, DialogClose as WCDialogClose, DialogFooter as WCDialogFooter, DialogHeader as WCDialogHeader, Divider as WCDivider, Drawer as WCDrawer, DrawerActionPrimary as WCDrawerActionPrimary, DrawerActionSecondary as WCDrawerActionSecondary, DrawerActionTertiary as WCDrawerActionTertiary, DrawerActions as WCDrawerActions, DrawerBody as WCDrawerBody, DrawerClose as WCDrawerClose, DrawerHeader as WCDrawerHeader, Dropdown as WCDropdown, DropdownItem as WCDropdownItem, DropdownMenu as WCDropdownMenu, DropdownTrigger as WCDropdownTrigger, EmptyState as WCEmptyState, EmptyStateAction as WCEmptyStateAction, EmptyStateHeader as WCEmptyStateHeader, EmptyStateIllustration as WCEmptyStateIllustration, EmptyStateMessage as WCEmptyStateMessage, Field as WCField, FieldHint as WCFieldHint, FieldLabel as WCFieldLabel, Grid as WCGrid, Group as WCGroup, Header as WCHeader, HeaderActions as WCHeaderActions, HeaderContent as WCHeaderContent, HeaderTitle as WCHeaderTitle, Icon as WCIcon, LabeledValue as WCLabeledValue, LabeledValueLabel as WCLabeledValueLabel, LabeledValueValue as WCLabeledValueValue, Link as WCLink, LogoLoader as WCLogoLoader, PageContent as WCPageContent, Pagination as WCPagination, ProgressBar as WCProgressBar, ProgressBarCountdown as WCProgressBarCountdown, Radio as WCRadio, RadioGroup as WCRadioGroup, Row as WCRow, Section as WCSection, SectionTitle as WCSectionTitle, Sidebar as WCSidebar, SpinnerWheel as WCSpinnerWheel, Stack as WCStack, Step as WCStep, Steps as WCSteps, SubHeader as WCSubHeader, Switch as WCSwitch, Switcher as WCSwitcher, Tab as WCTab, TabPanel as WCTabPanel, Table as WCTable, TableActions as WCTableActions, TableBody as WCTableBody, TableCell as WCTableCell, TableFeedback as WCTableFeedback, TableFoot as WCTableFoot, TableHead as WCTableHead, TableHeadCell as WCTableHeadCell, TableRow as WCTableRow, TableToolbar as WCTableToolbar, Tabs as WCTabs, Tag as WCTag, Text as WCText, TextArea as WCTextArea, TextField as WCTextField, Timeline as WCTimeline, TimelineExpandableItem as WCTimelineExpandableItem, TimelineItem as WCTimelineItem, TimelineItemBody as WCTimelineItemBody, TimelineItemFooter as WCTimelineItemFooter, TimelineItemHeader as WCTimelineItemHeader, TimelineItemHeaderSubtitle as WCTimelineItemHeaderSubtitle, TimelineItemHeaderTitle as WCTimelineItemHeaderTitle, TimelineItemIcon as WCTimelineItemIcon, Toggle as WCToggle, ToggleGroup as WCToggleGroup, Tooltip as WCTooltip } from '@loadsmart/miranda-wc';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import { forwardRef, useState, useCallback } from 'react';
|
|
5
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
13
|
-
target[key] = source[key];
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return target;
|
|
18
|
-
};
|
|
19
|
-
return _extends.apply(this, arguments);
|
|
20
|
-
}
|
|
21
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
22
|
-
if (!o) return;
|
|
23
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
24
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
25
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
26
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
27
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
4
|
+
import { forwardRef, useState, useCallback, Children, isValidElement, cloneElement } from 'react';
|
|
5
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
6
|
+
import { isFragment } from 'react-is';
|
|
7
|
+
|
|
8
|
+
function _arrayLikeToArray(r, a) {
|
|
9
|
+
(null == a || a > r.length) && (a = r.length);
|
|
10
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
11
|
+
return n;
|
|
28
12
|
}
|
|
29
|
-
function
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
36
|
-
if (it) return (it = it.call(o)).next.bind(it);
|
|
37
|
-
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
38
|
-
if (it) o = it;
|
|
39
|
-
var i = 0;
|
|
13
|
+
function _createForOfIteratorHelperLoose(r, e) {
|
|
14
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
15
|
+
if (t) return (t = t.call(r)).next.bind(t);
|
|
16
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) {
|
|
17
|
+
t && (r = t);
|
|
18
|
+
var o = 0;
|
|
40
19
|
return function () {
|
|
41
|
-
|
|
42
|
-
done:
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
value: o[i++]
|
|
20
|
+
return o >= r.length ? {
|
|
21
|
+
done: !0
|
|
22
|
+
} : {
|
|
23
|
+
done: !1,
|
|
24
|
+
value: r[o++]
|
|
47
25
|
};
|
|
48
26
|
};
|
|
49
27
|
}
|
|
50
28
|
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
51
29
|
}
|
|
30
|
+
function _extends() {
|
|
31
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
32
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
33
|
+
var t = arguments[e];
|
|
34
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
35
|
+
}
|
|
36
|
+
return n;
|
|
37
|
+
}, _extends.apply(null, arguments);
|
|
38
|
+
}
|
|
39
|
+
function _unsupportedIterableToArray(r, a) {
|
|
40
|
+
if (r) {
|
|
41
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
42
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
43
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
52
46
|
|
|
53
47
|
/**
|
|
54
48
|
* @license
|
|
@@ -142,7 +136,7 @@ const Accordion = createComponent({
|
|
|
142
136
|
elementClass: Accordion$1,
|
|
143
137
|
displayName: 'Accordion',
|
|
144
138
|
events: {
|
|
145
|
-
onToggle: '
|
|
139
|
+
onToggle: 'toggle',
|
|
146
140
|
},
|
|
147
141
|
subComponents: {
|
|
148
142
|
Title: AccordionTitle,
|
|
@@ -204,7 +198,7 @@ const Banner = createComponent({
|
|
|
204
198
|
tagName: 'm-banner',
|
|
205
199
|
elementClass: Banner$1,
|
|
206
200
|
events: {
|
|
207
|
-
onDismiss: '
|
|
201
|
+
onDismiss: 'dismiss',
|
|
208
202
|
},
|
|
209
203
|
displayName: 'Banner',
|
|
210
204
|
subComponents: {
|
|
@@ -295,7 +289,7 @@ const Card = createComponent({
|
|
|
295
289
|
elementClass: Card$1,
|
|
296
290
|
displayName: 'Card',
|
|
297
291
|
events: {
|
|
298
|
-
onToggle: '
|
|
292
|
+
onToggle: 'toggle',
|
|
299
293
|
},
|
|
300
294
|
subComponents: {
|
|
301
295
|
Title: CardTitle,
|
|
@@ -389,11 +383,11 @@ const Dialog = createComponent({
|
|
|
389
383
|
tagName: 'm-dialog',
|
|
390
384
|
elementClass: Dialog$1,
|
|
391
385
|
events: {
|
|
392
|
-
onClose: '
|
|
393
|
-
onOpening: '
|
|
394
|
-
onOpened: '
|
|
395
|
-
onClosing: '
|
|
396
|
-
onClosed: '
|
|
386
|
+
onClose: 'close',
|
|
387
|
+
onOpening: 'opening',
|
|
388
|
+
onOpened: 'opened',
|
|
389
|
+
onClosing: 'closing',
|
|
390
|
+
onClosed: 'closed',
|
|
397
391
|
},
|
|
398
392
|
displayName: 'Dialog',
|
|
399
393
|
subComponents: {
|
|
@@ -475,11 +469,11 @@ const Drawer = createComponent({
|
|
|
475
469
|
tagName: 'm-drawer',
|
|
476
470
|
elementClass: Drawer$1,
|
|
477
471
|
events: {
|
|
478
|
-
onClose: '
|
|
479
|
-
onOpening: '
|
|
480
|
-
onOpened: '
|
|
481
|
-
onClosing: '
|
|
482
|
-
onClosed: '
|
|
472
|
+
onClose: 'close',
|
|
473
|
+
onOpening: 'opening',
|
|
474
|
+
onOpened: 'opened',
|
|
475
|
+
onClosing: 'closing',
|
|
476
|
+
onClosed: 'closed',
|
|
483
477
|
},
|
|
484
478
|
displayName: 'Drawer',
|
|
485
479
|
subComponents: {
|
|
@@ -529,8 +523,8 @@ const Dropdown = createComponent({
|
|
|
529
523
|
Trigger: DropdownTrigger,
|
|
530
524
|
},
|
|
531
525
|
events: {
|
|
532
|
-
onExpand: '
|
|
533
|
-
onCollapse: '
|
|
526
|
+
onExpand: 'expand',
|
|
527
|
+
onCollapse: 'collapse',
|
|
534
528
|
},
|
|
535
529
|
});
|
|
536
530
|
|
|
@@ -566,7 +560,7 @@ const EmptyState = createComponent({
|
|
|
566
560
|
tagName: 'm-empty-state',
|
|
567
561
|
elementClass: EmptyState$1,
|
|
568
562
|
events: {
|
|
569
|
-
onAction: '
|
|
563
|
+
onAction: 'action',
|
|
570
564
|
},
|
|
571
565
|
displayName: 'EmptyState',
|
|
572
566
|
subComponents: {
|
|
@@ -779,7 +773,7 @@ const Pagination = createComponent({
|
|
|
779
773
|
elementClass: Pagination$1,
|
|
780
774
|
displayName: 'Pagination',
|
|
781
775
|
events: {
|
|
782
|
-
onChange: '
|
|
776
|
+
onChange: 'paginationchange',
|
|
783
777
|
},
|
|
784
778
|
});
|
|
785
779
|
|
|
@@ -835,6 +829,39 @@ const Section = createComponent({
|
|
|
835
829
|
},
|
|
836
830
|
});
|
|
837
831
|
|
|
832
|
+
const WiredSelectOption = createComponent({
|
|
833
|
+
tagName: 'm-option',
|
|
834
|
+
elementClass: SelectOption$1,
|
|
835
|
+
displayName: 'SelectOption',
|
|
836
|
+
});
|
|
837
|
+
const SLOTTED_STYLE$2 = { display: 'contents' };
|
|
838
|
+
const SelectOption = forwardRef((props, ref) => {
|
|
839
|
+
const { leading, trailing, children, ...rest } = props;
|
|
840
|
+
return (jsxs(WiredSelectOption, { ...rest, ref: ref, children: [leading != null && (jsx("span", { style: SLOTTED_STYLE$2, slot: "leading", children: leading })), children, trailing != null && (jsx("span", { style: SLOTTED_STYLE$2, slot: "trailing", children: trailing }))] }));
|
|
841
|
+
});
|
|
842
|
+
SelectOption.displayName = 'SelectOption';
|
|
843
|
+
|
|
844
|
+
const WiredSelect = createComponent({
|
|
845
|
+
tagName: 'm-select',
|
|
846
|
+
elementClass: Select$1,
|
|
847
|
+
events: {
|
|
848
|
+
onExpand: 'expand',
|
|
849
|
+
onCollapse: 'collapse',
|
|
850
|
+
onChange: 'change',
|
|
851
|
+
},
|
|
852
|
+
displayName: 'Select',
|
|
853
|
+
});
|
|
854
|
+
const SLOTTED_STYLE$1 = { display: 'contents' };
|
|
855
|
+
function Select(props) {
|
|
856
|
+
const { options, children, ...rest } = props;
|
|
857
|
+
return (jsx(WiredSelect, { ...rest, children: children ||
|
|
858
|
+
(options || []).map(function renderOption(option) {
|
|
859
|
+
const { label, leading, trailing, value: optionValue, ...others } = option;
|
|
860
|
+
return (jsxs(SelectOption, { ...others, value: optionValue, children: [leading != null && (jsx("span", { style: SLOTTED_STYLE$1, slot: "leading", children: leading })), label, trailing != null && (jsx("span", { style: SLOTTED_STYLE$1, slot: "trailing", children: trailing }))] }, optionValue));
|
|
861
|
+
}) }));
|
|
862
|
+
}
|
|
863
|
+
Select.Option = SelectOption;
|
|
864
|
+
|
|
838
865
|
const SpinnerWheel = createComponent({
|
|
839
866
|
tagName: 'm-spinner-wheel',
|
|
840
867
|
elementClass: SpinnerWheel$1,
|
|
@@ -852,11 +879,11 @@ const Steps = createComponent({
|
|
|
852
879
|
elementClass: Steps$1,
|
|
853
880
|
displayName: 'Steps',
|
|
854
881
|
events: {
|
|
855
|
-
onChange: '
|
|
856
|
-
onComplete: '
|
|
857
|
-
onNavigate: '
|
|
858
|
-
onNext: '
|
|
859
|
-
onPrevious: '
|
|
882
|
+
onChange: 'stepchange',
|
|
883
|
+
onComplete: 'stepcomplete',
|
|
884
|
+
onNavigate: 'navigate',
|
|
885
|
+
onNext: 'navigatenext',
|
|
886
|
+
onPrevious: 'navigateprevious',
|
|
860
887
|
},
|
|
861
888
|
subComponents: {
|
|
862
889
|
Step,
|
|
@@ -891,10 +918,10 @@ function useSteps() {
|
|
|
891
918
|
return;
|
|
892
919
|
}
|
|
893
920
|
const navigateToNextStep = () => {
|
|
894
|
-
return createCustomEvent('
|
|
921
|
+
return createCustomEvent('navigatenext');
|
|
895
922
|
};
|
|
896
923
|
const navigateToPreviousStep = () => {
|
|
897
|
-
return createCustomEvent('
|
|
924
|
+
return createCustomEvent('navigateprevious');
|
|
898
925
|
};
|
|
899
926
|
let event;
|
|
900
927
|
switch (step) {
|
|
@@ -905,7 +932,9 @@ function useSteps() {
|
|
|
905
932
|
event = navigateToPreviousStep();
|
|
906
933
|
break;
|
|
907
934
|
default:
|
|
908
|
-
event = createCustomEvent('
|
|
935
|
+
event = createCustomEvent('navigate', {
|
|
936
|
+
step,
|
|
937
|
+
});
|
|
909
938
|
}
|
|
910
939
|
stepsElement.dispatchEvent(event);
|
|
911
940
|
}, [stepsElement]);
|
|
@@ -913,7 +942,7 @@ function useSteps() {
|
|
|
913
942
|
if (stepsElement == null) {
|
|
914
943
|
return;
|
|
915
944
|
}
|
|
916
|
-
const event = createCustomEvent('
|
|
945
|
+
const event = createCustomEvent('stepcomplete');
|
|
917
946
|
stepsElement.dispatchEvent(event);
|
|
918
947
|
}, [stepsElement]);
|
|
919
948
|
return {
|
|
@@ -974,7 +1003,7 @@ const TableHeadCell = createComponent({
|
|
|
974
1003
|
elementClass: TableHeadCell$1,
|
|
975
1004
|
displayName: 'TableHeadCell',
|
|
976
1005
|
events: {
|
|
977
|
-
onSort: '
|
|
1006
|
+
onSort: 'columnsort',
|
|
978
1007
|
},
|
|
979
1008
|
});
|
|
980
1009
|
|
|
@@ -1026,7 +1055,7 @@ const Tabs = createComponent({
|
|
|
1026
1055
|
tagName: 'm-tabs',
|
|
1027
1056
|
elementClass: Tabs$1,
|
|
1028
1057
|
events: {
|
|
1029
|
-
onTabChange: '
|
|
1058
|
+
onTabChange: 'tabchange',
|
|
1030
1059
|
},
|
|
1031
1060
|
displayName: 'Tabs',
|
|
1032
1061
|
subComponents: {
|
|
@@ -1050,13 +1079,14 @@ const WiredActionableTag = createComponent({
|
|
|
1050
1079
|
elementClass: ActionableTag$1,
|
|
1051
1080
|
displayName: 'ActionableTag',
|
|
1052
1081
|
events: {
|
|
1053
|
-
onChange: '
|
|
1054
|
-
onRemove: '
|
|
1082
|
+
onChange: 'change',
|
|
1083
|
+
onRemove: 'remove',
|
|
1055
1084
|
},
|
|
1056
1085
|
});
|
|
1086
|
+
const SLOTTED_STYLE = { display: 'contents' };
|
|
1057
1087
|
const ActionableTag = forwardRef((props, ref) => {
|
|
1058
1088
|
const { leading, children, selectable, removable, ...rest } = props;
|
|
1059
|
-
return (jsxs(WiredActionableTag, { ...rest, selectable: selectable || Boolean(rest.onChange), removable: removable || Boolean(rest.onRemove), ref: ref, children: [leading != null && jsx("span", { slot: "leading", children: leading }), children] }));
|
|
1089
|
+
return (jsxs(WiredActionableTag, { ...rest, selectable: selectable || Boolean(rest.onChange), removable: removable || Boolean(rest.onRemove), ref: ref, children: [leading != null && (jsx("span", { slot: "leading", style: SLOTTED_STYLE, children: leading })), children] }));
|
|
1060
1090
|
});
|
|
1061
1091
|
|
|
1062
1092
|
const Text = createComponent({
|
|
@@ -1084,12 +1114,13 @@ const WiredTextField = createComponent({
|
|
|
1084
1114
|
events: {
|
|
1085
1115
|
onInput: 'input',
|
|
1086
1116
|
onChange: 'change',
|
|
1087
|
-
onClear: '
|
|
1117
|
+
onClear: 'clear',
|
|
1088
1118
|
},
|
|
1089
1119
|
displayName: 'TextField',
|
|
1090
1120
|
});
|
|
1091
|
-
const TextField = forwardRef(({ leading, trailing, ...rest }, ref) => {
|
|
1092
|
-
|
|
1121
|
+
const TextField = forwardRef(({ leading, trailing, value, ...rest }, ref) => {
|
|
1122
|
+
const normalizedValue = value !== undefined ? String(value) : '';
|
|
1123
|
+
return (jsxs(WiredTextField, { ...rest, value: normalizedValue, ref: ref, children: [leading != null && jsx("div", { slot: "leading", children: leading }), trailing != null && jsx("div", { slot: "trailing", children: trailing })] }));
|
|
1093
1124
|
});
|
|
1094
1125
|
|
|
1095
1126
|
const TimelineItem = createComponent({
|
|
@@ -1188,9 +1219,55 @@ const WiredTooltip = createComponent({
|
|
|
1188
1219
|
elementClass: Tooltip$1,
|
|
1189
1220
|
displayName: 'Tooltip',
|
|
1190
1221
|
});
|
|
1222
|
+
let counter = 0;
|
|
1223
|
+
/**
|
|
1224
|
+
* Generates a unique id for our elements, prepending the given `prefix`.
|
|
1225
|
+
* @param prefix - Id prefix. Defaults to 'tt-anchor'
|
|
1226
|
+
*/
|
|
1227
|
+
function generateId(prefix = 'tt-anchor') {
|
|
1228
|
+
counter += 1;
|
|
1229
|
+
/**
|
|
1230
|
+
* prefixing with 'm' to ensure we always start with a letter.
|
|
1231
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
|
|
1232
|
+
*/
|
|
1233
|
+
const id = `m-${prefix}-${counter}`;
|
|
1234
|
+
/**
|
|
1235
|
+
* Embracing the unlikelyhood of having 9007199254740991 elements we id-d with this approach
|
|
1236
|
+
* at the same time in the document (in which case we would have a collision).
|
|
1237
|
+
*/
|
|
1238
|
+
if (counter === Number.MAX_SAFE_INTEGER) {
|
|
1239
|
+
counter = 0;
|
|
1240
|
+
}
|
|
1241
|
+
return id;
|
|
1242
|
+
}
|
|
1243
|
+
/**
|
|
1244
|
+
* Render the tooltip component.
|
|
1245
|
+
*
|
|
1246
|
+
* **Warning**: This component will throw if the provided `children` is not a single child,
|
|
1247
|
+
* and will not render if the children is not valid or is a fragment.
|
|
1248
|
+
*/
|
|
1191
1249
|
function Tooltip(props) {
|
|
1192
1250
|
const { children, message, ...rest } = props;
|
|
1193
|
-
|
|
1251
|
+
const child = Children.only(children);
|
|
1252
|
+
if (isFragment(child) || !isValidElement(child)) {
|
|
1253
|
+
console.error('Tooltip must wrap a single and valid child element (Fragment is not accepted).');
|
|
1254
|
+
return null; // do not render the tooltip if the children are not valid or a fragment
|
|
1255
|
+
}
|
|
1256
|
+
const [anchorId, childWithId] = (() => {
|
|
1257
|
+
const elementWithID = child;
|
|
1258
|
+
const { id } = elementWithID.props;
|
|
1259
|
+
if (id) {
|
|
1260
|
+
return [id, elementWithID];
|
|
1261
|
+
}
|
|
1262
|
+
const generatedAnchorId = generateId();
|
|
1263
|
+
return [
|
|
1264
|
+
generatedAnchorId,
|
|
1265
|
+
cloneElement(elementWithID, {
|
|
1266
|
+
id: generatedAnchorId,
|
|
1267
|
+
}),
|
|
1268
|
+
];
|
|
1269
|
+
})();
|
|
1270
|
+
return (jsxs(Fragment, { children: [jsx(WiredTooltip, { anchor: anchorId, ...rest, children: message }), childWithId] }));
|
|
1194
1271
|
}
|
|
1195
1272
|
|
|
1196
1273
|
const LogoLoader = createComponent({
|
|
@@ -1199,4 +1276,10 @@ const LogoLoader = createComponent({
|
|
|
1199
1276
|
displayName: 'LogoLoader',
|
|
1200
1277
|
});
|
|
1201
1278
|
|
|
1202
|
-
|
|
1279
|
+
const DotsLoader = createComponent({
|
|
1280
|
+
tagName: 'm-dots-loader',
|
|
1281
|
+
elementClass: DotsLoader$1,
|
|
1282
|
+
displayName: 'DotsLoader',
|
|
1283
|
+
});
|
|
1284
|
+
|
|
1285
|
+
export { Accordion, ActionableTag, Badge, Banner, Box, Button, Card, Checkbox, Column, Container, Dialog, Divider, DotsLoader, Drawer, Dropdown, DropdownItem, DropdownMenu, DropdownTrigger, EmptyState, Field, Grid, Group, Header, HeaderActions, HeaderTitle, Icon, LabeledValue, LabeledValueLabel, LabeledValueValue, Layout, Link, LogoLoader, PageContent, Pagination, ProgressBar, ProgressBarCountdown, Radio, RadioGroup, Row, Section, Select, Sidebar, SpinnerWheel, Stack, Step, Steps, SubHeader, Switch, Switcher, Tab, TabPanel, Table, TableActions, TableBody, TableCell, TableFeedback, TableFoot, TableHead, TableHeadCell, TableRow, TableToolbar, Tabs, Tag, Text, TextArea, TextField, Timeline, TimelineExpandableItem, TimelineItem, TimelineItemBody, TimelineItemFooter, TimelineItemHeader, TimelineItemHeaderSubtitle, TimelineItemHeaderTitle, TimelineItemIcon, Toggle, ToggleGroup, Tooltip, useSteps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EventName, Options } from '@lit/react';
|
|
2
2
|
type EventNames = Record<string, EventName | string>;
|
|
3
3
|
export declare const createComponent: <I extends HTMLElement, E extends EventNames = {}, SubComponents extends Record<string, unknown> = {}>({ subComponents, ...options }: Omit<Options<I, E>, "react"> & {
|
|
4
|
-
subComponents?: SubComponents
|
|
4
|
+
subComponents?: SubComponents;
|
|
5
5
|
}) => import("@lit/react").ReactWebComponent<I, E> & SubComponents;
|
|
6
6
|
export {};
|
package/dist/utils/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ChangeEvent } from 'react';
|
|
1
2
|
export type Mutable<T> = {
|
|
2
3
|
-readonly [P in keyof T]: T[P] extends ReadonlyArray<infer U> ? U[] : T[P];
|
|
3
4
|
};
|
|
@@ -7,3 +8,8 @@ export type Primitive = null | undefined | string | number | boolean | symbol |
|
|
|
7
8
|
* in IDEs for the literal type part of the union.
|
|
8
9
|
*/
|
|
9
10
|
export type LiteralUnion<LiteralType, BaseType extends Primitive> = LiteralType | (BaseType & Record<never, never>);
|
|
11
|
+
/**
|
|
12
|
+
* This is a patch type to make our components compatible to React's
|
|
13
|
+
* synthetic event types.
|
|
14
|
+
*/
|
|
15
|
+
export type MirandaChangeEvent<T = Element> = ChangeEvent<T> & Event;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loadsmart/miranda-react",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.30",
|
|
4
4
|
"description": "React component library based on Miranda Web Components",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"@testing-library/cypress": "^10.0.1",
|
|
27
27
|
"@types/react": "^17.0.79",
|
|
28
28
|
"@types/react-dom": "^17.0.25",
|
|
29
|
+
"@types/react-is": "^18.3.0",
|
|
29
30
|
"cypress": "^13.2.0",
|
|
30
31
|
"cypress-plugin-tab": "^1.0.5",
|
|
31
32
|
"react": "^17.0.2",
|
|
@@ -40,9 +41,10 @@
|
|
|
40
41
|
"access": "public"
|
|
41
42
|
},
|
|
42
43
|
"dependencies": {
|
|
43
|
-
"@loadsmart/miranda-tokens": "4.0.0-beta.
|
|
44
|
-
"@loadsmart/miranda-wc": "3.0.0-beta.
|
|
45
|
-
"@lit/react": "^1.0.5"
|
|
44
|
+
"@loadsmart/miranda-tokens": "4.0.0-beta.30",
|
|
45
|
+
"@loadsmart/miranda-wc": "3.0.0-beta.30",
|
|
46
|
+
"@lit/react": "^1.0.5",
|
|
47
|
+
"react-is": "^18.3.1"
|
|
46
48
|
},
|
|
47
49
|
"directories": {
|
|
48
50
|
"test": "tests"
|