@loadsmart/miranda-react 3.0.0-beta.4 → 3.0.0-beta.41
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 +9 -12
- package/dist/components/Drawer/DrawerActionPrimary.d.ts +1 -1
- package/dist/components/Drawer/DrawerActionSecondary.d.ts +1 -1
- package/dist/components/Drawer/DrawerActionTertiary.d.ts +1 -1
- 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/Link/Link.d.ts +1 -2
- package/dist/components/Link/index.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +3 -2
- package/dist/components/Select/Select.d.ts +6 -5
- package/dist/components/Select/SelectOption.d.ts +1 -1
- package/dist/components/Select/index.d.ts +1 -1
- 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 +33 -8
- package/dist/components/Tooltip/Tooltip.d.ts +11 -4
- package/dist/index.d.ts +5 -2
- package/dist/index.js +153 -99
- 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;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import type { ComponentProps } from 'react';
|
|
2
2
|
import type { EventName, WebComponentProps } from '@lit/react';
|
|
3
3
|
import { Drawer as WCDrawer } from '@loadsmart/miranda-wc';
|
|
4
|
-
import { DrawerActionPrimary } from './DrawerActionPrimary';
|
|
5
|
-
import { DrawerActionSecondary } from './DrawerActionSecondary';
|
|
6
|
-
import { DrawerActionTertiary } from './DrawerActionTertiary';
|
|
7
4
|
declare global {
|
|
8
5
|
namespace JSX {
|
|
9
6
|
interface IntrinsicElements {
|
|
@@ -12,19 +9,19 @@ declare global {
|
|
|
12
9
|
}
|
|
13
10
|
}
|
|
14
11
|
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
|
|
12
|
+
onClose: EventName<CustomEvent>;
|
|
13
|
+
onOpening: EventName<CustomEvent>;
|
|
14
|
+
onOpened: EventName<CustomEvent>;
|
|
15
|
+
onClosing: EventName<CustomEvent>;
|
|
16
|
+
onClosed: EventName<CustomEvent>;
|
|
20
17
|
}> & {
|
|
21
|
-
ActionPrimary:
|
|
22
|
-
ActionSecondary:
|
|
23
|
-
ActionTertiary:
|
|
18
|
+
ActionPrimary: import("react").ForwardRefExoticComponent<Omit<import("./DrawerActionPrimary").DrawerActionPrimaryProps, "ref"> & import("react").RefAttributes<import("@loadsmart/miranda-wc").DrawerActionPrimary>>;
|
|
19
|
+
ActionSecondary: import("react").ForwardRefExoticComponent<Omit<import("./DrawerActionSecondary").DrawerActionSecondaryProps, "ref"> & import("react").RefAttributes<import("@loadsmart/miranda-wc").DrawerActionSecondary>>;
|
|
20
|
+
ActionTertiary: import("react").ForwardRefExoticComponent<Omit<import("./DrawerActionTertiary").DrawerActionTertiaryProps, "ref"> & import("react").RefAttributes<import("@loadsmart/miranda-wc").DrawerActionTertiary>>;
|
|
24
21
|
Actions: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").DrawerActions, {}>;
|
|
25
22
|
Body: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").DrawerBody, {}>;
|
|
26
23
|
Close: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").DrawerClose, {
|
|
27
|
-
onClose: EventName<CustomEvent
|
|
24
|
+
onClose: EventName<CustomEvent>;
|
|
28
25
|
}>;
|
|
29
26
|
Header: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").DrawerHeader, {}>;
|
|
30
27
|
};
|
|
@@ -13,5 +13,5 @@ export interface DrawerActionPrimaryProps extends ComponentProps<typeof WiredDra
|
|
|
13
13
|
leading?: ReactNode;
|
|
14
14
|
trailing?: ReactNode;
|
|
15
15
|
}
|
|
16
|
-
export declare
|
|
16
|
+
export declare const DrawerActionPrimary: import("react").ForwardRefExoticComponent<Omit<DrawerActionPrimaryProps, "ref"> & import("react").RefAttributes<WCDrawerActionPrimary>>;
|
|
17
17
|
export {};
|
|
@@ -13,5 +13,5 @@ export interface DrawerActionSecondaryProps extends ComponentProps<typeof WiredD
|
|
|
13
13
|
leading?: ReactNode;
|
|
14
14
|
trailing?: ReactNode;
|
|
15
15
|
}
|
|
16
|
-
export declare
|
|
16
|
+
export declare const DrawerActionSecondary: import("react").ForwardRefExoticComponent<Omit<DrawerActionSecondaryProps, "ref"> & import("react").RefAttributes<WCDrawerActionSecondary>>;
|
|
17
17
|
export {};
|
|
@@ -13,5 +13,5 @@ export interface DrawerActionTertiaryProps extends ComponentProps<typeof WiredDr
|
|
|
13
13
|
leading?: ReactNode;
|
|
14
14
|
trailing?: ReactNode;
|
|
15
15
|
}
|
|
16
|
-
export declare
|
|
16
|
+
export declare const DrawerActionTertiary: import("react").ForwardRefExoticComponent<Omit<DrawerActionTertiaryProps, "ref"> & import("react").RefAttributes<WCDrawerActionTertiary>>;
|
|
17
17
|
export {};
|
|
@@ -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,7 +1,7 @@
|
|
|
1
1
|
import type { ComponentProps } from 'react';
|
|
2
2
|
import type { WebComponentProps } from '@lit/react';
|
|
3
3
|
import { Link as WCLink } from '@loadsmart/miranda-wc';
|
|
4
|
-
|
|
4
|
+
export type { LinkReferrerPolicy, LinkSize, LinkTarget, } from '@loadsmart/miranda-wc';
|
|
5
5
|
declare global {
|
|
6
6
|
namespace JSX {
|
|
7
7
|
interface IntrinsicElements {
|
|
@@ -11,4 +11,3 @@ declare global {
|
|
|
11
11
|
}
|
|
12
12
|
export declare const Link: import("@lit/react").ReactWebComponent<WCLink, {}>;
|
|
13
13
|
export type LinkProps = ComponentProps<typeof Link>;
|
|
14
|
-
export type { LinkReferrerPolicy, LinkSize, LinkTarget };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Link } from './Link';
|
|
2
|
-
export type { LinkReferrerPolicy, LinkSize, LinkTarget } from './Link';
|
|
2
|
+
export type { LinkReferrerPolicy, LinkSize, LinkTarget, LinkProps, } from './Link';
|
|
@@ -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
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { ReactNode, ComponentProps } from 'react';
|
|
2
|
-
import type { EventName, WebComponentProps } from '@lit/react';
|
|
3
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';
|
|
4
5
|
declare global {
|
|
5
6
|
namespace JSX {
|
|
6
7
|
interface IntrinsicElements {
|
|
@@ -9,9 +10,9 @@ declare global {
|
|
|
9
10
|
}
|
|
10
11
|
}
|
|
11
12
|
declare const WiredSelect: import("@lit/react").ReactWebComponent<WCSelect, {
|
|
12
|
-
onExpand: EventName<CustomEvent
|
|
13
|
-
onCollapse: EventName<CustomEvent
|
|
14
|
-
onChange:
|
|
13
|
+
onExpand: EventName<CustomEvent>;
|
|
14
|
+
onCollapse: EventName<CustomEvent>;
|
|
15
|
+
onChange: EventName<MirandaChangeEvent<WCSelect>>;
|
|
15
16
|
}>;
|
|
16
17
|
export type SelectOption = {
|
|
17
18
|
value: string;
|
|
@@ -9,7 +9,7 @@ declare global {
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
export declare const WiredSelectOption: import("@lit/react").ReactWebComponent<WCSelectOption, {}>;
|
|
12
|
-
export interface SelectOptionProps extends ComponentProps<typeof WiredSelectOption> {
|
|
12
|
+
export interface SelectOptionProps extends Omit<ComponentProps<typeof WiredSelectOption>, 'leading' | 'trailing'> {
|
|
13
13
|
leading?: ReactNode;
|
|
14
14
|
trailing?: ReactNode;
|
|
15
15
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Select } from './Select';
|
|
2
|
-
export type { SelectProps } from './Select';
|
|
2
|
+
export type { SelectProps, SelectOption } from './Select';
|
|
@@ -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,8 @@
|
|
|
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 { SelectionType, SelectionValue } from '@loadsmart/miranda-wc';
|
|
3
|
+
import type { EventName, WebComponentProps } from '@lit/react';
|
|
4
|
+
import type { ReactNode, ComponentProps } from 'react';
|
|
5
|
+
import type { MirandaChangeEvent } from '../../utils/types';
|
|
4
6
|
declare global {
|
|
5
7
|
namespace JSX {
|
|
6
8
|
interface IntrinsicElements {
|
|
@@ -9,18 +11,41 @@ declare global {
|
|
|
9
11
|
}
|
|
10
12
|
}
|
|
11
13
|
declare const WiredToggleGroup: import("@lit/react").ReactWebComponent<WCToggleGroup, {
|
|
12
|
-
onChange:
|
|
14
|
+
onChange: EventName<MirandaChangeEvent<WCToggleGroup>>;
|
|
13
15
|
}>;
|
|
14
|
-
export type ToggleGroupOption = {
|
|
15
|
-
value:
|
|
16
|
+
export type ToggleGroupOption<TValue extends string> = {
|
|
17
|
+
value: TValue;
|
|
16
18
|
label?: string;
|
|
17
19
|
leading?: ReactNode;
|
|
18
20
|
disabled?: boolean;
|
|
19
21
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
type SingleProps<OptionValue extends string, TValue = OptionValue | null> = {
|
|
23
|
+
type?: 'single';
|
|
24
|
+
value?: TValue;
|
|
25
|
+
onChange?: OnChangeEvent<TValue>;
|
|
26
|
+
};
|
|
27
|
+
type SingleStrictProps<OptionValue extends string, TValue = OptionValue> = {
|
|
28
|
+
type?: 'single-strict';
|
|
29
|
+
value?: TValue;
|
|
30
|
+
onChange?: OnChangeEvent<TValue>;
|
|
31
|
+
};
|
|
32
|
+
type MultipleProps<OptionValue extends string, TValue = Array<OptionValue> | ReadonlyArray<OptionValue> | null> = {
|
|
33
|
+
type?: 'multiple';
|
|
34
|
+
value?: TValue;
|
|
35
|
+
onChange?: OnChangeEvent<TValue>;
|
|
22
36
|
};
|
|
23
|
-
|
|
37
|
+
export type OnChangeEvent<T> = (event: MirandaChangeEvent<Omit<WCToggleGroup, 'value'> & {
|
|
38
|
+
value: T;
|
|
39
|
+
}>) => void;
|
|
40
|
+
export type ToggleGroupProps<TSelectionType extends SelectionType = SelectionType, OptionValue extends string = string, TOptions extends ReadonlyArray<ToggleGroupOption<string>> = ReadonlyArray<ToggleGroupOption<OptionValue>>> = Omit<ComponentProps<typeof WiredToggleGroup>, 'type' | 'value' | 'onChange'> & {
|
|
41
|
+
type?: TSelectionType;
|
|
42
|
+
options?: TOptions;
|
|
43
|
+
} & (TSelectionType extends 'single' ? SingleProps<OptionValue> : TSelectionType extends 'single-strict' ? SingleStrictProps<OptionValue> : TSelectionType extends 'multiple' ? MultipleProps<OptionValue> : {
|
|
44
|
+
type?: TSelectionType;
|
|
45
|
+
value?: SelectionValue<OptionValue>;
|
|
46
|
+
onChange?: OnChangeEvent<OptionValue>;
|
|
47
|
+
});
|
|
48
|
+
declare function ToggleGroup<TSelectionType extends SelectionType = SelectionType, OptionValue extends string = string>({ options, children, onChange, ...rest }: ToggleGroupProps<TSelectionType, OptionValue>): import("react/jsx-runtime").JSX.Element;
|
|
24
49
|
declare namespace ToggleGroup {
|
|
25
50
|
var Toggle: import("react").ForwardRefExoticComponent<Omit<import("./Toggle").ToggleProps, "ref"> & import("react").RefAttributes<import("@loadsmart/miranda-wc").Toggle>>;
|
|
26
51
|
}
|
|
@@ -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
|
@@ -35,6 +35,8 @@ export * from './components/Timeline';
|
|
|
35
35
|
export * from './components/ToggleGroup';
|
|
36
36
|
export * from './components/Tooltip';
|
|
37
37
|
export * from './components/LogoLoader';
|
|
38
|
+
export * from './components/DotsLoader';
|
|
39
|
+
export type { MirandaChangeEvent } from './utils/types';
|
|
38
40
|
export type { TypographyVariant } from '@loadsmart/miranda-wc';
|
|
39
41
|
export { Accordion as WCAccordion, AccordionTitle as WCAccordionTitle, AccordionContent as WCAccordionContent, } from '@loadsmart/miranda-wc';
|
|
40
42
|
export type { AccordionProps as WCAccordionProps, AccordionToggleEventDetails, } from '@loadsmart/miranda-wc';
|
|
@@ -69,6 +71,7 @@ export { Link as WCLink } from '@loadsmart/miranda-wc';
|
|
|
69
71
|
export { PageContent as WCPageContent } from '@loadsmart/miranda-wc';
|
|
70
72
|
export { Pagination as WCPagination } from '@loadsmart/miranda-wc';
|
|
71
73
|
export type { PaginationProps as WCPaginationProps, PaginationChangeEventDetails, } from '@loadsmart/miranda-wc';
|
|
74
|
+
export type { PopoverPlacement, PopoverPosition, PopoverRepositionEventDetail, } from '@loadsmart/miranda-wc';
|
|
72
75
|
export { ProgressBar as WCProgressBar } from '@loadsmart/miranda-wc';
|
|
73
76
|
export type { ProgressBarProps as WCProgressBarProps } from '@loadsmart/miranda-wc';
|
|
74
77
|
export { ProgressBarCountdown as WCProgressBarCountdown } from '@loadsmart/miranda-wc';
|
|
@@ -80,7 +83,7 @@ export type { SectionProps as WCSectionProps } from '@loadsmart/miranda-wc';
|
|
|
80
83
|
export { SpinnerWheel as WCSpinnerWheel } from '@loadsmart/miranda-wc';
|
|
81
84
|
export type { SpinnerWheelProps as WCSpinnerWheelProps } from '@loadsmart/miranda-wc';
|
|
82
85
|
export { Step as WCStep, Steps as WCSteps } from '@loadsmart/miranda-wc';
|
|
83
|
-
export type { StepProps as WCStepProps,
|
|
86
|
+
export type { StepProps as WCStepProps, StepChangeEventDetail, StepNavigateEventDetail, } from '@loadsmart/miranda-wc';
|
|
84
87
|
export { Switch as WCSwitch } from '@loadsmart/miranda-wc';
|
|
85
88
|
export type { SwitchProps as WCSwitchProps, SwitchSize, } from '@loadsmart/miranda-wc';
|
|
86
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';
|
|
@@ -88,7 +91,7 @@ export type { TableProps as WCTableProps, TableCellProps as WCTableCellProps, Ta
|
|
|
88
91
|
export { Tabs as WCTabs, Tab as WCTab, TabPanel as WCTabPanel, } from '@loadsmart/miranda-wc';
|
|
89
92
|
export type { TabsProps as WCTabsProps, TabProps as WCTabProps, TabPanelProps as WCTabPanelProps, TabChangeEventDetail, } from '@loadsmart/miranda-wc';
|
|
90
93
|
export { Tag as WCTag, ActionableTag as WCActionableTag, } from '@loadsmart/miranda-wc';
|
|
91
|
-
export type { TagProps as WCTagProps, ActionableTagProps as WCActionableTagProps, TagVariant, TagSize,
|
|
94
|
+
export type { TagProps as WCTagProps, ActionableTagProps as WCActionableTagProps, TagVariant, TagSize, ActionableTagVariant, } from '@loadsmart/miranda-wc';
|
|
92
95
|
export { Text as WCText } from '@loadsmart/miranda-wc';
|
|
93
96
|
export type { TextProps as WCTextProps } from '@loadsmart/miranda-wc';
|
|
94
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, 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 } 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: {
|
|
@@ -419,30 +413,30 @@ const WiredDrawerActionPrimary = createComponent({
|
|
|
419
413
|
elementClass: DrawerActionPrimary$1,
|
|
420
414
|
displayName: 'DrawerActionPrimary',
|
|
421
415
|
});
|
|
422
|
-
function DrawerActionPrimary(props) {
|
|
416
|
+
const DrawerActionPrimary = forwardRef(function DrawerActionPrimary(props, ref) {
|
|
423
417
|
const { leading, trailing, children, ...rest } = props;
|
|
424
|
-
return (jsxs(WiredDrawerActionPrimary, { ...rest, children: [leading != null && jsx("span", { slot: "leading", children: leading }), children, trailing != null && jsx("span", { slot: "trailing", children: trailing })] }));
|
|
425
|
-
}
|
|
418
|
+
return (jsxs(WiredDrawerActionPrimary, { ...rest, ref: ref, children: [leading != null && jsx("span", { slot: "leading", children: leading }), children, trailing != null && jsx("span", { slot: "trailing", children: trailing })] }));
|
|
419
|
+
});
|
|
426
420
|
|
|
427
421
|
const WiredDrawerActionSecondary = createComponent({
|
|
428
422
|
tagName: 'm-drawer-action-secondary',
|
|
429
423
|
elementClass: DrawerActionSecondary$1,
|
|
430
424
|
displayName: 'DrawerActionSecondary',
|
|
431
425
|
});
|
|
432
|
-
function DrawerActionSecondary(props) {
|
|
426
|
+
const DrawerActionSecondary = forwardRef(function DrawerActionSecondary(props, ref) {
|
|
433
427
|
const { leading, trailing, children, ...rest } = props;
|
|
434
|
-
return (jsxs(WiredDrawerActionSecondary, { ...rest, children: [leading != null && jsx("span", { slot: "leading", children: leading }), children, trailing != null && jsx("span", { slot: "trailing", children: trailing })] }));
|
|
435
|
-
}
|
|
428
|
+
return (jsxs(WiredDrawerActionSecondary, { ...rest, ref: ref, children: [leading != null && jsx("span", { slot: "leading", children: leading }), children, trailing != null && jsx("span", { slot: "trailing", children: trailing })] }));
|
|
429
|
+
});
|
|
436
430
|
|
|
437
431
|
const WiredDrawerActionTertiary = createComponent({
|
|
438
432
|
tagName: 'm-drawer-action-tertiary',
|
|
439
433
|
elementClass: DrawerActionTertiary$1,
|
|
440
434
|
displayName: 'DrawerActionTertiary',
|
|
441
435
|
});
|
|
442
|
-
function DrawerActionTertiary(props) {
|
|
436
|
+
const DrawerActionTertiary = forwardRef(function DrawerActionTertiary(props, ref) {
|
|
443
437
|
const { leading, trailing, children, ...rest } = props;
|
|
444
|
-
return (jsxs(WiredDrawerActionTertiary, { ...rest, children: [leading != null && jsx("span", { slot: "leading", children: leading }), children, trailing != null && jsx("span", { slot: "trailing", children: trailing })] }));
|
|
445
|
-
}
|
|
438
|
+
return (jsxs(WiredDrawerActionTertiary, { ...rest, ref: ref, children: [leading != null && jsx("span", { slot: "leading", children: leading }), children, trailing != null && jsx("span", { slot: "trailing", children: trailing })] }));
|
|
439
|
+
});
|
|
446
440
|
|
|
447
441
|
const DrawerActions = createComponent({
|
|
448
442
|
tagName: 'm-drawer-actions',
|
|
@@ -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
|
|
|
@@ -840,10 +834,10 @@ const WiredSelectOption = createComponent({
|
|
|
840
834
|
elementClass: SelectOption$1,
|
|
841
835
|
displayName: 'SelectOption',
|
|
842
836
|
});
|
|
843
|
-
const SLOTTED_STYLE$
|
|
837
|
+
const SLOTTED_STYLE$2 = { display: 'contents' };
|
|
844
838
|
const SelectOption = forwardRef((props, ref) => {
|
|
845
839
|
const { leading, trailing, children, ...rest } = props;
|
|
846
|
-
return (jsxs(WiredSelectOption, { ...rest, ref: ref, children: [leading != null && (jsx("span", { style: SLOTTED_STYLE$
|
|
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 }))] }));
|
|
847
841
|
});
|
|
848
842
|
SelectOption.displayName = 'SelectOption';
|
|
849
843
|
|
|
@@ -851,19 +845,19 @@ const WiredSelect = createComponent({
|
|
|
851
845
|
tagName: 'm-select',
|
|
852
846
|
elementClass: Select$1,
|
|
853
847
|
events: {
|
|
854
|
-
onExpand: '
|
|
855
|
-
onCollapse: '
|
|
848
|
+
onExpand: 'expand',
|
|
849
|
+
onCollapse: 'collapse',
|
|
856
850
|
onChange: 'change',
|
|
857
851
|
},
|
|
858
852
|
displayName: 'Select',
|
|
859
853
|
});
|
|
860
|
-
const SLOTTED_STYLE = { display: 'contents' };
|
|
854
|
+
const SLOTTED_STYLE$1 = { display: 'contents' };
|
|
861
855
|
function Select(props) {
|
|
862
856
|
const { options, children, ...rest } = props;
|
|
863
857
|
return (jsx(WiredSelect, { ...rest, children: children ||
|
|
864
858
|
(options || []).map(function renderOption(option) {
|
|
865
859
|
const { label, leading, trailing, value: optionValue, ...others } = option;
|
|
866
|
-
return (jsxs(SelectOption, { ...others, value: optionValue, children: [leading != null && (jsx("span", { style: SLOTTED_STYLE, slot: "leading", children: leading })), label, trailing != null && (jsx("span", { style: SLOTTED_STYLE, slot: "trailing", children: trailing }))] }, optionValue));
|
|
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));
|
|
867
861
|
}) }));
|
|
868
862
|
}
|
|
869
863
|
Select.Option = SelectOption;
|
|
@@ -885,11 +879,11 @@ const Steps = createComponent({
|
|
|
885
879
|
elementClass: Steps$1,
|
|
886
880
|
displayName: 'Steps',
|
|
887
881
|
events: {
|
|
888
|
-
onChange: '
|
|
889
|
-
onComplete: '
|
|
890
|
-
onNavigate: '
|
|
891
|
-
onNext: '
|
|
892
|
-
onPrevious: '
|
|
882
|
+
onChange: 'stepchange',
|
|
883
|
+
onComplete: 'stepcomplete',
|
|
884
|
+
onNavigate: 'navigate',
|
|
885
|
+
onNext: 'navigatenext',
|
|
886
|
+
onPrevious: 'navigateprevious',
|
|
893
887
|
},
|
|
894
888
|
subComponents: {
|
|
895
889
|
Step,
|
|
@@ -924,10 +918,10 @@ function useSteps() {
|
|
|
924
918
|
return;
|
|
925
919
|
}
|
|
926
920
|
const navigateToNextStep = () => {
|
|
927
|
-
return createCustomEvent('
|
|
921
|
+
return createCustomEvent('navigatenext');
|
|
928
922
|
};
|
|
929
923
|
const navigateToPreviousStep = () => {
|
|
930
|
-
return createCustomEvent('
|
|
924
|
+
return createCustomEvent('navigateprevious');
|
|
931
925
|
};
|
|
932
926
|
let event;
|
|
933
927
|
switch (step) {
|
|
@@ -938,7 +932,9 @@ function useSteps() {
|
|
|
938
932
|
event = navigateToPreviousStep();
|
|
939
933
|
break;
|
|
940
934
|
default:
|
|
941
|
-
event = createCustomEvent('
|
|
935
|
+
event = createCustomEvent('navigate', {
|
|
936
|
+
step,
|
|
937
|
+
});
|
|
942
938
|
}
|
|
943
939
|
stepsElement.dispatchEvent(event);
|
|
944
940
|
}, [stepsElement]);
|
|
@@ -946,7 +942,7 @@ function useSteps() {
|
|
|
946
942
|
if (stepsElement == null) {
|
|
947
943
|
return;
|
|
948
944
|
}
|
|
949
|
-
const event = createCustomEvent('
|
|
945
|
+
const event = createCustomEvent('stepcomplete');
|
|
950
946
|
stepsElement.dispatchEvent(event);
|
|
951
947
|
}, [stepsElement]);
|
|
952
948
|
return {
|
|
@@ -1007,7 +1003,7 @@ const TableHeadCell = createComponent({
|
|
|
1007
1003
|
elementClass: TableHeadCell$1,
|
|
1008
1004
|
displayName: 'TableHeadCell',
|
|
1009
1005
|
events: {
|
|
1010
|
-
onSort: '
|
|
1006
|
+
onSort: 'columnsort',
|
|
1011
1007
|
},
|
|
1012
1008
|
});
|
|
1013
1009
|
|
|
@@ -1059,7 +1055,7 @@ const Tabs = createComponent({
|
|
|
1059
1055
|
tagName: 'm-tabs',
|
|
1060
1056
|
elementClass: Tabs$1,
|
|
1061
1057
|
events: {
|
|
1062
|
-
onTabChange: '
|
|
1058
|
+
onTabChange: 'tabchange',
|
|
1063
1059
|
},
|
|
1064
1060
|
displayName: 'Tabs',
|
|
1065
1061
|
subComponents: {
|
|
@@ -1083,13 +1079,14 @@ const WiredActionableTag = createComponent({
|
|
|
1083
1079
|
elementClass: ActionableTag$1,
|
|
1084
1080
|
displayName: 'ActionableTag',
|
|
1085
1081
|
events: {
|
|
1086
|
-
onChange: '
|
|
1087
|
-
onRemove: '
|
|
1082
|
+
onChange: 'change',
|
|
1083
|
+
onRemove: 'remove',
|
|
1088
1084
|
},
|
|
1089
1085
|
});
|
|
1086
|
+
const SLOTTED_STYLE = { display: 'contents' };
|
|
1090
1087
|
const ActionableTag = forwardRef((props, ref) => {
|
|
1091
1088
|
const { leading, children, selectable, removable, ...rest } = props;
|
|
1092
|
-
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] }));
|
|
1093
1090
|
});
|
|
1094
1091
|
|
|
1095
1092
|
const Text = createComponent({
|
|
@@ -1117,12 +1114,13 @@ const WiredTextField = createComponent({
|
|
|
1117
1114
|
events: {
|
|
1118
1115
|
onInput: 'input',
|
|
1119
1116
|
onChange: 'change',
|
|
1120
|
-
onClear: '
|
|
1117
|
+
onClear: 'clear',
|
|
1121
1118
|
},
|
|
1122
1119
|
displayName: 'TextField',
|
|
1123
1120
|
});
|
|
1124
|
-
const TextField = forwardRef(({ leading, trailing, ...rest }, ref) => {
|
|
1125
|
-
|
|
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 })] }));
|
|
1126
1124
|
});
|
|
1127
1125
|
|
|
1128
1126
|
const TimelineItem = createComponent({
|
|
@@ -1207,12 +1205,16 @@ const WiredToggleGroup = createComponent({
|
|
|
1207
1205
|
},
|
|
1208
1206
|
displayName: 'ToggleGroup',
|
|
1209
1207
|
});
|
|
1210
|
-
function ToggleGroup(
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1208
|
+
function ToggleGroup({ options, children, onChange, ...rest }) {
|
|
1209
|
+
return (jsx(WiredToggleGroup
|
|
1210
|
+
// @ts-expect-error -- we can't type this properly because of the way the WC is implemented
|
|
1211
|
+
, {
|
|
1212
|
+
// @ts-expect-error -- we can't type this properly because of the way the WC is implemented
|
|
1213
|
+
onChange: onChange, ...rest, children: children ??
|
|
1214
|
+
(options || []).map(function renderOption(option) {
|
|
1215
|
+
const { label, value: optionValue, ...others } = option;
|
|
1216
|
+
return (jsx(Toggle, { ...others, value: optionValue, children: label }, optionValue));
|
|
1217
|
+
}) }));
|
|
1216
1218
|
}
|
|
1217
1219
|
ToggleGroup.Toggle = Toggle;
|
|
1218
1220
|
|
|
@@ -1221,9 +1223,55 @@ const WiredTooltip = createComponent({
|
|
|
1221
1223
|
elementClass: Tooltip$1,
|
|
1222
1224
|
displayName: 'Tooltip',
|
|
1223
1225
|
});
|
|
1226
|
+
let counter = 0;
|
|
1227
|
+
/**
|
|
1228
|
+
* Generates a unique id for our elements, prepending the given `prefix`.
|
|
1229
|
+
* @param prefix Id prefix. Defaults to 'tt-anchor'
|
|
1230
|
+
*/
|
|
1231
|
+
function generateId(prefix = 'tt-anchor') {
|
|
1232
|
+
counter += 1;
|
|
1233
|
+
/**
|
|
1234
|
+
* prefixing with 'm' to ensure we always start with a letter.
|
|
1235
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
|
|
1236
|
+
*/
|
|
1237
|
+
const id = `m-${prefix}-${counter}`;
|
|
1238
|
+
/**
|
|
1239
|
+
* Embracing the unlikelyhood of having 9007199254740991 elements we id-d with this approach
|
|
1240
|
+
* at the same time in the document (in which case we would have a collision).
|
|
1241
|
+
*/
|
|
1242
|
+
if (counter === Number.MAX_SAFE_INTEGER) {
|
|
1243
|
+
counter = 0;
|
|
1244
|
+
}
|
|
1245
|
+
return id;
|
|
1246
|
+
}
|
|
1247
|
+
/**
|
|
1248
|
+
* Render the tooltip component.
|
|
1249
|
+
*
|
|
1250
|
+
* **Warning**: This component will throw if the provided `children` is not a single child,
|
|
1251
|
+
* and will not render if the children is not valid or is a fragment.
|
|
1252
|
+
*/
|
|
1224
1253
|
function Tooltip(props) {
|
|
1225
1254
|
const { children, message, ...rest } = props;
|
|
1226
|
-
|
|
1255
|
+
const child = Children.only(children);
|
|
1256
|
+
if (isFragment(child) || !isValidElement(child)) {
|
|
1257
|
+
console.error('Tooltip must wrap a single and valid child element (Fragment is not accepted).');
|
|
1258
|
+
return null; // do not render the tooltip if the children are not valid or a fragment
|
|
1259
|
+
}
|
|
1260
|
+
const [anchorId, childWithId] = (() => {
|
|
1261
|
+
const elementWithID = child;
|
|
1262
|
+
const { id } = elementWithID.props;
|
|
1263
|
+
if (id) {
|
|
1264
|
+
return [id, elementWithID];
|
|
1265
|
+
}
|
|
1266
|
+
const generatedAnchorId = generateId();
|
|
1267
|
+
return [
|
|
1268
|
+
generatedAnchorId,
|
|
1269
|
+
cloneElement(elementWithID, {
|
|
1270
|
+
id: generatedAnchorId,
|
|
1271
|
+
}),
|
|
1272
|
+
];
|
|
1273
|
+
})();
|
|
1274
|
+
return (jsxs(Fragment, { children: [jsx(WiredTooltip, { anchor: anchorId, ...rest, children: message }), childWithId] }));
|
|
1227
1275
|
}
|
|
1228
1276
|
|
|
1229
1277
|
const LogoLoader = createComponent({
|
|
@@ -1232,4 +1280,10 @@ const LogoLoader = createComponent({
|
|
|
1232
1280
|
displayName: 'LogoLoader',
|
|
1233
1281
|
});
|
|
1234
1282
|
|
|
1235
|
-
|
|
1283
|
+
const DotsLoader = createComponent({
|
|
1284
|
+
tagName: 'm-dots-loader',
|
|
1285
|
+
elementClass: DotsLoader$1,
|
|
1286
|
+
displayName: 'DotsLoader',
|
|
1287
|
+
});
|
|
1288
|
+
|
|
1289
|
+
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.41",
|
|
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.41",
|
|
45
|
+
"@loadsmart/miranda-wc": "3.0.0-beta.41",
|
|
46
|
+
"@lit/react": "^1.0.5",
|
|
47
|
+
"react-is": "^18.3.1"
|
|
46
48
|
},
|
|
47
49
|
"directories": {
|
|
48
50
|
"test": "tests"
|