@muraldevkit/ui-toolkit 2.32.0 → 2.33.0

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.
@@ -15,6 +15,7 @@ export * from './pagination';
15
15
  export * from './popover';
16
16
  export * from './svg';
17
17
  export * from './table';
18
+ export * from './tabs';
18
19
  export * from './text';
19
20
  export * from './tooltip';
20
21
  export * from './portal';
@@ -5,14 +5,6 @@
5
5
  * @returns The closest menu parent or null if none is found
6
6
  */
7
7
  export declare const findClosestMenuParent: (el: HTMLElement | null) => HTMLElement | null | undefined;
8
- /**
9
- * Find the interactive element immediately before or after a reference element
10
- *
11
- * @param ref - The reference element
12
- * @param direction - The direction to search in
13
- * @returns The interactive element or null if none is found
14
- */
15
- export declare const findInteractiveElement: (ref: React.RefObject<HTMLElement> | undefined, direction?: 'next' | 'previous') => HTMLElement | null;
16
8
  /**
17
9
  * Calculate the horizontal positioning of the submenu
18
10
  *
@@ -35,9 +27,3 @@ export declare const calculateLeftPosition: (overlapsRight: boolean, overlapsLef
35
27
  * @returns The top position of the menu
36
28
  */
37
29
  export declare const calculateTopPosition: (overlapsRight: boolean, overlapsLeft: boolean, triggerRef: React.RefObject<HTMLElement>, menuRect: DOMRect, parentMenu: HTMLElement, triggerRect: DOMRect) => string;
38
- /**
39
- * Prevent default on event
40
- *
41
- * @param e - The event
42
- */
43
- export declare const preventDefault: (e: React.MouseEvent | React.KeyboardEvent | MouseEvent | KeyboardEvent) => void;
@@ -115,7 +115,7 @@ export declare const colorPictoStoryData: {
115
115
  export declare const animateStoryData: {
116
116
  args: {
117
117
  delay: number;
118
- state: "stop" | "play";
118
+ state: "play" | "stop";
119
119
  };
120
120
  argTypes: {
121
121
  delay: {
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ export interface MrlTabProps extends React.ComponentProps<'button'> {
3
+ /** Class to be applied to the button element of the MrlTab */
4
+ className?: string;
5
+ icon?: React.ReactElement;
6
+ /**
7
+ * The id that will be passed to the MrlTabContext to set the active state.
8
+ * NOTE: This must match the `tabId` set on `MrlTabContent`!
9
+ */
10
+ id: string;
11
+ /** An addition function to call when clicking on a tab */
12
+ hookClick?: () => void;
13
+ text: string;
14
+ }
15
+ /**
16
+ * Renders a tab component
17
+ *
18
+ * @param {MrlTabProps} props the props for your MrlTab
19
+ * @returns {React.ReactElement} an a element containing the text you pass
20
+ */
21
+ export declare const MrlTab: ({ className, icon, id, hookClick, text }: MrlTabProps) => React.ReactElement;
@@ -0,0 +1 @@
1
+ export * from './MrlTab';
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ export interface MrlTabContentPropTypes {
3
+ children: React.ReactNode;
4
+ /** Class to be applied to the container element of the MrlTabContent */
5
+ className?: string;
6
+ /** The id of the tab button associated to this content */
7
+ tabId: string;
8
+ }
9
+ export declare const MrlTabContent: React.FC<MrlTabContentPropTypes>;
@@ -0,0 +1 @@
1
+ export * from './MrlTabContent';
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ export interface MrlTabGroupPropTypes {
3
+ children: React.ReactNode;
4
+ /** Class to be applied to the container element of the MrlTabGroup */
5
+ className?: string;
6
+ disablePageControls?: boolean;
7
+ /** A hidden label for the tab group for accessiblity purposes */
8
+ label?: string;
9
+ }
10
+ export declare const MrlTabGroup: React.FC<MrlTabGroupPropTypes>;
@@ -0,0 +1 @@
1
+ export * from './MrlTabGroup';
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { MrlTabContextProps } from '../../../';
3
+ export type MrlTabSize = 'small' | 'large';
4
+ export interface MrlTabsPropTypes {
5
+ /** Sets the tabs to be styled with capital case */
6
+ capitalizeTabTitles?: boolean;
7
+ children: React.ReactNode;
8
+ /** Class to be applied to the container element of the MrlTabs */
9
+ className?: string;
10
+ size?: MrlTabSize;
11
+ spaceTabsEvenly?: boolean;
12
+ }
13
+ export declare const MrlTabs: React.FC<MrlTabsPropTypes>;
14
+ /**
15
+ * Tab context to prevent us from having to do any prop drilling.
16
+ *
17
+ * @returns {MrlTabContextProps} the context of the tabs
18
+ */
19
+ export declare function useMrlTabContext(): MrlTabContextProps;
@@ -0,0 +1 @@
1
+ export * from './MrlTabs';
@@ -0,0 +1 @@
1
+ export type TabActionType = 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight' | 'Home' | 'End' | null;
@@ -0,0 +1,4 @@
1
+ export * from './MrlTab';
2
+ export * from './MrlTabContent';
3
+ export * from './MrlTabGroup';
4
+ export * from './MrlTabs';
@@ -0,0 +1,6 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ export type MrlTabContextProps = {
3
+ activeTab: string;
4
+ setActiveTab: Dispatch<SetStateAction<string>>;
5
+ };
6
+ export declare const MrlTabContext: import("react").Context<MrlTabContextProps>;
@@ -0,0 +1 @@
1
+ export * from './MrlTabContext';
@@ -1 +1,2 @@
1
1
  export * from './MrlDeviceProvider';
2
+ export * from './MrlTabContext';