@loadsmart/miranda-react 3.0.0-beta.5 → 3.0.0-beta.50
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/Header/Header.d.ts +3 -0
- package/dist/components/Header/HeaderTabs.d.ts +15 -0
- package/dist/components/Header/index.d.ts +2 -0
- 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/Table/Table.d.ts +7 -3
- package/dist/components/Table/TableSelectionCell.d.ts +12 -0
- package/dist/components/Table/index.d.ts +2 -0
- 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 +175 -100
- 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, {}>;
|
|
@@ -14,5 +14,8 @@ export declare const Header: import("@lit/react").ReactWebComponent<WCHeader, {}
|
|
|
14
14
|
Title: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").HeaderTitle, {}>;
|
|
15
15
|
SubHeader: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").SubHeader, {}>;
|
|
16
16
|
BackButton: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").BackButton, {}>;
|
|
17
|
+
Tabs: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").HeaderTabs, {
|
|
18
|
+
onTabChange: import("@lit/react").EventName<CustomEvent<import("@loadsmart/miranda-wc").TabChangeEventDetail>>;
|
|
19
|
+
}>;
|
|
17
20
|
};
|
|
18
21
|
export type HeaderProps = ComponentProps<typeof Header>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
import type { EventName, WebComponentProps } from '@lit/react';
|
|
3
|
+
import type { TabChangeEventDetail } from '@loadsmart/miranda-wc';
|
|
4
|
+
import { HeaderTabs as WCHeaderTabs } from '@loadsmart/miranda-wc';
|
|
5
|
+
declare global {
|
|
6
|
+
namespace JSX {
|
|
7
|
+
interface IntrinsicElements {
|
|
8
|
+
'm-header-tabs': WebComponentProps<WCHeaderTabs>;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export declare const HeaderTabs: import("@lit/react").ReactWebComponent<WCHeaderTabs, {
|
|
13
|
+
onTabChange: EventName<CustomEvent<TabChangeEventDetail>>;
|
|
14
|
+
}>;
|
|
15
|
+
export type HeaderTabsProps = ComponentProps<typeof HeaderTabs>;
|
|
@@ -6,3 +6,5 @@ export { SubHeader } from './SubHeader';
|
|
|
6
6
|
export type { SubHeaderProps } from './SubHeader';
|
|
7
7
|
export { HeaderTitle } from './HeaderTitle';
|
|
8
8
|
export type { HeaderTitleProps } from './HeaderTitle';
|
|
9
|
+
export { HeaderTabs } from './HeaderTabs';
|
|
10
|
+
export type { HeaderTabsProps } from './HeaderTabs';
|
|
@@ -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,6 +1,7 @@
|
|
|
1
1
|
import { Table as WCTable } from '@loadsmart/miranda-wc';
|
|
2
|
-
import type { WebComponentProps } from '@lit/react';
|
|
2
|
+
import type { EventName, WebComponentProps } from '@lit/react';
|
|
3
3
|
import type { ComponentProps } from 'react';
|
|
4
|
+
import type { TableSelectEventDetail } from '@loadsmart/miranda-wc/dist/components/table/table.types';
|
|
4
5
|
declare global {
|
|
5
6
|
namespace JSX {
|
|
6
7
|
interface IntrinsicElements {
|
|
@@ -17,15 +18,18 @@ declare module 'react' {
|
|
|
17
18
|
'--m-table-border-bottom-right-radius'?: string;
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
|
-
export declare const Table: import("@lit/react").ReactWebComponent<WCTable, {
|
|
21
|
+
export declare const Table: import("@lit/react").ReactWebComponent<WCTable, {
|
|
22
|
+
onSelect: EventName<CustomEvent<TableSelectEventDetail>>;
|
|
23
|
+
}> & {
|
|
21
24
|
Head: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").TableHead, {}>;
|
|
22
25
|
Body: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").TableBody, {}>;
|
|
23
26
|
Foot: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").TableFoot, {}>;
|
|
24
27
|
Row: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").TableRow, {}>;
|
|
25
28
|
HeadCell: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").TableHeadCell, {
|
|
26
|
-
onSort:
|
|
29
|
+
onSort: EventName<CustomEvent<import("@loadsmart/miranda-wc").TableHeadCellSortEventDetails>>;
|
|
27
30
|
}>;
|
|
28
31
|
Cell: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").TableCell, {}>;
|
|
32
|
+
SelectionCell: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").TableSelectionCell, {}>;
|
|
29
33
|
Toolbar: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").TableToolbar, {}>;
|
|
30
34
|
Feedback: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").TableFeedback, {}>;
|
|
31
35
|
Actions: import("@lit/react").ReactWebComponent<import("@loadsmart/miranda-wc").TableActions, {}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
import type { WebComponentProps } from '@lit/react';
|
|
3
|
+
import { TableSelectionCell as WCTableSelectionCell } from '@loadsmart/miranda-wc';
|
|
4
|
+
declare global {
|
|
5
|
+
namespace JSX {
|
|
6
|
+
interface IntrinsicElements {
|
|
7
|
+
'm-table-selection-cell': WebComponentProps<WCTableSelectionCell>;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export declare const TableSelectionCell: import("@lit/react").ReactWebComponent<WCTableSelectionCell, {}>;
|
|
12
|
+
export type TableSelectionCellProps = ComponentProps<typeof TableSelectionCell>;
|
|
@@ -5,6 +5,7 @@ export { TableFoot } from './TableFoot';
|
|
|
5
5
|
export { TableRow } from './TableRow';
|
|
6
6
|
export { TableHeadCell } from './TableHeadCell';
|
|
7
7
|
export { TableCell } from './TableCell';
|
|
8
|
+
export { TableSelectionCell } from './TableSelectionCell';
|
|
8
9
|
export { TableToolbar } from './TableToolbar';
|
|
9
10
|
export { TableFeedback } from './TableFeedback';
|
|
10
11
|
export { TableActions } from './TableActions';
|
|
@@ -19,3 +20,4 @@ export type { TableToolbarProps } from './TableToolbar';
|
|
|
19
20
|
export type { TableFeedbackProps } from './TableFeedback';
|
|
20
21
|
export type { TableActionsProps } from './TableActions';
|
|
21
22
|
export type { TableSize, TableCellAlignment, TableSortDirection, TableHeadCellSortEventDetails, } from '@loadsmart/miranda-wc';
|
|
23
|
+
export type { TableSelectionCellProps } from './TableSelectionCell';
|
|
@@ -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<Extract<TValue, ReadonlyArray<OptionValue>>>;
|
|
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, HeaderTabs as HeaderTabs$1, 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, TableSelectionCell as TableSelectionCell$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);
|
|
28
|
-
}
|
|
29
|
-
function _arrayLikeToArray(arr, len) {
|
|
30
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
31
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
32
|
-
return arr2;
|
|
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;
|
|
33
12
|
}
|
|
34
|
-
function _createForOfIteratorHelperLoose(
|
|
35
|
-
var
|
|
36
|
-
if (
|
|
37
|
-
if (Array.isArray(
|
|
38
|
-
|
|
39
|
-
var
|
|
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: {
|
|
@@ -632,6 +626,15 @@ const HeaderBackButton = createComponent({
|
|
|
632
626
|
displayName: 'HeaderBackButton',
|
|
633
627
|
});
|
|
634
628
|
|
|
629
|
+
const HeaderTabs = createComponent({
|
|
630
|
+
tagName: 'm-header-tabs',
|
|
631
|
+
elementClass: HeaderTabs$1,
|
|
632
|
+
displayName: 'HeaderTabs',
|
|
633
|
+
events: {
|
|
634
|
+
onTabChange: 'tabchange',
|
|
635
|
+
},
|
|
636
|
+
});
|
|
637
|
+
|
|
635
638
|
const Header = createComponent({
|
|
636
639
|
tagName: 'm-header',
|
|
637
640
|
elementClass: Header$1,
|
|
@@ -642,6 +645,7 @@ const Header = createComponent({
|
|
|
642
645
|
Title: HeaderTitle,
|
|
643
646
|
SubHeader,
|
|
644
647
|
BackButton: HeaderBackButton,
|
|
648
|
+
Tabs: HeaderTabs,
|
|
645
649
|
},
|
|
646
650
|
});
|
|
647
651
|
|
|
@@ -779,7 +783,7 @@ const Pagination = createComponent({
|
|
|
779
783
|
elementClass: Pagination$1,
|
|
780
784
|
displayName: 'Pagination',
|
|
781
785
|
events: {
|
|
782
|
-
onChange: '
|
|
786
|
+
onChange: 'paginationchange',
|
|
783
787
|
},
|
|
784
788
|
});
|
|
785
789
|
|
|
@@ -840,10 +844,10 @@ const WiredSelectOption = createComponent({
|
|
|
840
844
|
elementClass: SelectOption$1,
|
|
841
845
|
displayName: 'SelectOption',
|
|
842
846
|
});
|
|
843
|
-
const SLOTTED_STYLE$
|
|
847
|
+
const SLOTTED_STYLE$3 = { display: 'contents' };
|
|
844
848
|
const SelectOption = forwardRef((props, ref) => {
|
|
845
849
|
const { leading, trailing, children, ...rest } = props;
|
|
846
|
-
return (jsxs(WiredSelectOption, { ...rest, ref: ref, children: [leading != null && (jsx("span", { style: SLOTTED_STYLE$
|
|
850
|
+
return (jsxs(WiredSelectOption, { ...rest, ref: ref, children: [leading != null && (jsx("span", { style: SLOTTED_STYLE$3, slot: "leading", children: leading })), children, trailing != null && (jsx("span", { style: SLOTTED_STYLE$3, slot: "trailing", children: trailing }))] }));
|
|
847
851
|
});
|
|
848
852
|
SelectOption.displayName = 'SelectOption';
|
|
849
853
|
|
|
@@ -851,19 +855,19 @@ const WiredSelect = createComponent({
|
|
|
851
855
|
tagName: 'm-select',
|
|
852
856
|
elementClass: Select$1,
|
|
853
857
|
events: {
|
|
854
|
-
onExpand: '
|
|
855
|
-
onCollapse: '
|
|
858
|
+
onExpand: 'expand',
|
|
859
|
+
onCollapse: 'collapse',
|
|
856
860
|
onChange: 'change',
|
|
857
861
|
},
|
|
858
862
|
displayName: 'Select',
|
|
859
863
|
});
|
|
860
|
-
const SLOTTED_STYLE = { display: 'contents' };
|
|
864
|
+
const SLOTTED_STYLE$2 = { display: 'contents' };
|
|
861
865
|
function Select(props) {
|
|
862
866
|
const { options, children, ...rest } = props;
|
|
863
867
|
return (jsx(WiredSelect, { ...rest, children: children ||
|
|
864
868
|
(options || []).map(function renderOption(option) {
|
|
865
869
|
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));
|
|
870
|
+
return (jsxs(SelectOption, { ...others, value: optionValue, children: [leading != null && (jsx("span", { style: SLOTTED_STYLE$2, slot: "leading", children: leading })), label, trailing != null && (jsx("span", { style: SLOTTED_STYLE$2, slot: "trailing", children: trailing }))] }, optionValue));
|
|
867
871
|
}) }));
|
|
868
872
|
}
|
|
869
873
|
Select.Option = SelectOption;
|
|
@@ -885,11 +889,11 @@ const Steps = createComponent({
|
|
|
885
889
|
elementClass: Steps$1,
|
|
886
890
|
displayName: 'Steps',
|
|
887
891
|
events: {
|
|
888
|
-
onChange: '
|
|
889
|
-
onComplete: '
|
|
890
|
-
onNavigate: '
|
|
891
|
-
onNext: '
|
|
892
|
-
onPrevious: '
|
|
892
|
+
onChange: 'stepchange',
|
|
893
|
+
onComplete: 'stepcomplete',
|
|
894
|
+
onNavigate: 'navigate',
|
|
895
|
+
onNext: 'navigatenext',
|
|
896
|
+
onPrevious: 'navigateprevious',
|
|
893
897
|
},
|
|
894
898
|
subComponents: {
|
|
895
899
|
Step,
|
|
@@ -924,10 +928,10 @@ function useSteps() {
|
|
|
924
928
|
return;
|
|
925
929
|
}
|
|
926
930
|
const navigateToNextStep = () => {
|
|
927
|
-
return createCustomEvent('
|
|
931
|
+
return createCustomEvent('navigatenext');
|
|
928
932
|
};
|
|
929
933
|
const navigateToPreviousStep = () => {
|
|
930
|
-
return createCustomEvent('
|
|
934
|
+
return createCustomEvent('navigateprevious');
|
|
931
935
|
};
|
|
932
936
|
let event;
|
|
933
937
|
switch (step) {
|
|
@@ -938,7 +942,9 @@ function useSteps() {
|
|
|
938
942
|
event = navigateToPreviousStep();
|
|
939
943
|
break;
|
|
940
944
|
default:
|
|
941
|
-
event = createCustomEvent('
|
|
945
|
+
event = createCustomEvent('navigate', {
|
|
946
|
+
step,
|
|
947
|
+
});
|
|
942
948
|
}
|
|
943
949
|
stepsElement.dispatchEvent(event);
|
|
944
950
|
}, [stepsElement]);
|
|
@@ -946,7 +952,7 @@ function useSteps() {
|
|
|
946
952
|
if (stepsElement == null) {
|
|
947
953
|
return;
|
|
948
954
|
}
|
|
949
|
-
const event = createCustomEvent('
|
|
955
|
+
const event = createCustomEvent('stepcomplete');
|
|
950
956
|
stepsElement.dispatchEvent(event);
|
|
951
957
|
}, [stepsElement]);
|
|
952
958
|
return {
|
|
@@ -1007,7 +1013,7 @@ const TableHeadCell = createComponent({
|
|
|
1007
1013
|
elementClass: TableHeadCell$1,
|
|
1008
1014
|
displayName: 'TableHeadCell',
|
|
1009
1015
|
events: {
|
|
1010
|
-
onSort: '
|
|
1016
|
+
onSort: 'columnsort',
|
|
1011
1017
|
},
|
|
1012
1018
|
});
|
|
1013
1019
|
|
|
@@ -1023,10 +1029,19 @@ const TableActions = createComponent({
|
|
|
1023
1029
|
displayName: 'TableActions',
|
|
1024
1030
|
});
|
|
1025
1031
|
|
|
1032
|
+
const TableSelectionCell = createComponent({
|
|
1033
|
+
tagName: 'm-table-selection-cell',
|
|
1034
|
+
elementClass: TableSelectionCell$1,
|
|
1035
|
+
displayName: 'TableSelectionCell',
|
|
1036
|
+
});
|
|
1037
|
+
|
|
1026
1038
|
const Table = createComponent({
|
|
1027
1039
|
tagName: 'm-table',
|
|
1028
1040
|
elementClass: Table$1,
|
|
1029
1041
|
displayName: 'Table',
|
|
1042
|
+
events: {
|
|
1043
|
+
onSelect: 'select',
|
|
1044
|
+
},
|
|
1030
1045
|
subComponents: {
|
|
1031
1046
|
Head: TableHead,
|
|
1032
1047
|
Body: TableBody,
|
|
@@ -1034,6 +1049,7 @@ const Table = createComponent({
|
|
|
1034
1049
|
Row: TableRow,
|
|
1035
1050
|
HeadCell: TableHeadCell,
|
|
1036
1051
|
Cell: TableCell,
|
|
1052
|
+
SelectionCell: TableSelectionCell,
|
|
1037
1053
|
Toolbar: TableToolbar,
|
|
1038
1054
|
Feedback: TableFeedback,
|
|
1039
1055
|
Actions: TableActions,
|
|
@@ -1059,7 +1075,7 @@ const Tabs = createComponent({
|
|
|
1059
1075
|
tagName: 'm-tabs',
|
|
1060
1076
|
elementClass: Tabs$1,
|
|
1061
1077
|
events: {
|
|
1062
|
-
onTabChange: '
|
|
1078
|
+
onTabChange: 'tabchange',
|
|
1063
1079
|
},
|
|
1064
1080
|
displayName: 'Tabs',
|
|
1065
1081
|
subComponents: {
|
|
@@ -1073,9 +1089,10 @@ const WiredTag = createComponent({
|
|
|
1073
1089
|
elementClass: Tag$1,
|
|
1074
1090
|
displayName: 'Tag',
|
|
1075
1091
|
});
|
|
1092
|
+
const SLOTTED_STYLE$1 = { display: 'contents' };
|
|
1076
1093
|
const Tag = forwardRef((props, ref) => {
|
|
1077
1094
|
const { leading, children, ...rest } = props;
|
|
1078
|
-
return (jsxs(WiredTag, { ...rest, ref: ref, children: [leading != null && jsx("span", { slot: "leading", children: leading }), children] }));
|
|
1095
|
+
return (jsxs(WiredTag, { ...rest, ref: ref, children: [leading != null && (jsx("span", { style: SLOTTED_STYLE$1, slot: "leading", children: leading })), children] }));
|
|
1079
1096
|
});
|
|
1080
1097
|
|
|
1081
1098
|
const WiredActionableTag = createComponent({
|
|
@@ -1083,13 +1100,14 @@ const WiredActionableTag = createComponent({
|
|
|
1083
1100
|
elementClass: ActionableTag$1,
|
|
1084
1101
|
displayName: 'ActionableTag',
|
|
1085
1102
|
events: {
|
|
1086
|
-
onChange: '
|
|
1087
|
-
onRemove: '
|
|
1103
|
+
onChange: 'change',
|
|
1104
|
+
onRemove: 'remove',
|
|
1088
1105
|
},
|
|
1089
1106
|
});
|
|
1107
|
+
const SLOTTED_STYLE = { display: 'contents' };
|
|
1090
1108
|
const ActionableTag = forwardRef((props, ref) => {
|
|
1091
1109
|
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] }));
|
|
1110
|
+
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
1111
|
});
|
|
1094
1112
|
|
|
1095
1113
|
const Text = createComponent({
|
|
@@ -1117,12 +1135,13 @@ const WiredTextField = createComponent({
|
|
|
1117
1135
|
events: {
|
|
1118
1136
|
onInput: 'input',
|
|
1119
1137
|
onChange: 'change',
|
|
1120
|
-
onClear: '
|
|
1138
|
+
onClear: 'clear',
|
|
1121
1139
|
},
|
|
1122
1140
|
displayName: 'TextField',
|
|
1123
1141
|
});
|
|
1124
|
-
const TextField = forwardRef(({ leading, trailing, ...rest }, ref) => {
|
|
1125
|
-
|
|
1142
|
+
const TextField = forwardRef(({ leading, trailing, value, ...rest }, ref) => {
|
|
1143
|
+
const normalizedValue = value !== undefined ? String(value) : '';
|
|
1144
|
+
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
1145
|
});
|
|
1127
1146
|
|
|
1128
1147
|
const TimelineItem = createComponent({
|
|
@@ -1207,12 +1226,16 @@ const WiredToggleGroup = createComponent({
|
|
|
1207
1226
|
},
|
|
1208
1227
|
displayName: 'ToggleGroup',
|
|
1209
1228
|
});
|
|
1210
|
-
function ToggleGroup(
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1229
|
+
function ToggleGroup({ options, children, onChange, ...rest }) {
|
|
1230
|
+
return (jsx(WiredToggleGroup
|
|
1231
|
+
// @ts-expect-error -- we can't type this properly because of the way the WC is implemented
|
|
1232
|
+
, {
|
|
1233
|
+
// @ts-expect-error -- we can't type this properly because of the way the WC is implemented
|
|
1234
|
+
onChange: onChange, ...rest, children: children ??
|
|
1235
|
+
(options || []).map(function renderOption(option) {
|
|
1236
|
+
const { label, value: optionValue, ...others } = option;
|
|
1237
|
+
return (jsx(Toggle, { ...others, value: optionValue, children: label }, optionValue));
|
|
1238
|
+
}) }));
|
|
1216
1239
|
}
|
|
1217
1240
|
ToggleGroup.Toggle = Toggle;
|
|
1218
1241
|
|
|
@@ -1221,9 +1244,55 @@ const WiredTooltip = createComponent({
|
|
|
1221
1244
|
elementClass: Tooltip$1,
|
|
1222
1245
|
displayName: 'Tooltip',
|
|
1223
1246
|
});
|
|
1247
|
+
let counter = 0;
|
|
1248
|
+
/**
|
|
1249
|
+
* Generates a unique id for our elements, prepending the given `prefix`.
|
|
1250
|
+
* @param prefix Id prefix. Defaults to 'tt-anchor'
|
|
1251
|
+
*/
|
|
1252
|
+
function generateId(prefix = 'tt-anchor') {
|
|
1253
|
+
counter += 1;
|
|
1254
|
+
/**
|
|
1255
|
+
* prefixing with 'm' to ensure we always start with a letter.
|
|
1256
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
|
|
1257
|
+
*/
|
|
1258
|
+
const id = `m-${prefix}-${counter}`;
|
|
1259
|
+
/**
|
|
1260
|
+
* Embracing the unlikelyhood of having 9007199254740991 elements we id-d with this approach
|
|
1261
|
+
* at the same time in the document (in which case we would have a collision).
|
|
1262
|
+
*/
|
|
1263
|
+
if (counter === Number.MAX_SAFE_INTEGER) {
|
|
1264
|
+
counter = 0;
|
|
1265
|
+
}
|
|
1266
|
+
return id;
|
|
1267
|
+
}
|
|
1268
|
+
/**
|
|
1269
|
+
* Render the tooltip component.
|
|
1270
|
+
*
|
|
1271
|
+
* **Warning**: This component will throw if the provided `children` is not a single child,
|
|
1272
|
+
* and will not render if the children is not valid or is a fragment.
|
|
1273
|
+
*/
|
|
1224
1274
|
function Tooltip(props) {
|
|
1225
1275
|
const { children, message, ...rest } = props;
|
|
1226
|
-
|
|
1276
|
+
const child = Children.only(children);
|
|
1277
|
+
if (isFragment(child) || !isValidElement(child)) {
|
|
1278
|
+
console.error('Tooltip must wrap a single and valid child element (Fragment is not accepted).');
|
|
1279
|
+
return null; // do not render the tooltip if the children are not valid or a fragment
|
|
1280
|
+
}
|
|
1281
|
+
const [anchorId, childWithId] = (() => {
|
|
1282
|
+
const elementWithID = child;
|
|
1283
|
+
const { id } = elementWithID.props;
|
|
1284
|
+
if (id) {
|
|
1285
|
+
return [id, elementWithID];
|
|
1286
|
+
}
|
|
1287
|
+
const generatedAnchorId = generateId();
|
|
1288
|
+
return [
|
|
1289
|
+
generatedAnchorId,
|
|
1290
|
+
cloneElement(elementWithID, {
|
|
1291
|
+
id: generatedAnchorId,
|
|
1292
|
+
}),
|
|
1293
|
+
];
|
|
1294
|
+
})();
|
|
1295
|
+
return (jsxs(Fragment, { children: [jsx(WiredTooltip, { anchor: anchorId, ...rest, children: message }), childWithId] }));
|
|
1227
1296
|
}
|
|
1228
1297
|
|
|
1229
1298
|
const LogoLoader = createComponent({
|
|
@@ -1232,4 +1301,10 @@ const LogoLoader = createComponent({
|
|
|
1232
1301
|
displayName: 'LogoLoader',
|
|
1233
1302
|
});
|
|
1234
1303
|
|
|
1235
|
-
|
|
1304
|
+
const DotsLoader = createComponent({
|
|
1305
|
+
tagName: 'm-dots-loader',
|
|
1306
|
+
elementClass: DotsLoader$1,
|
|
1307
|
+
displayName: 'DotsLoader',
|
|
1308
|
+
});
|
|
1309
|
+
|
|
1310
|
+
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, HeaderTabs, 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, TableSelectionCell, 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.50",
|
|
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.50",
|
|
45
|
+
"@loadsmart/miranda-wc": "3.0.0-beta.50",
|
|
46
|
+
"@lit/react": "^1.0.5",
|
|
47
|
+
"react-is": "^18.3.1"
|
|
46
48
|
},
|
|
47
49
|
"directories": {
|
|
48
50
|
"test": "tests"
|