@muraldevkit/ui-toolkit 4.11.0 → 4.12.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.
- package/dist/components/filter/MrlFilter/MrlFilter.d.ts +28 -0
- package/dist/components/filter/MrlFilter/index.d.ts +1 -0
- package/dist/components/filter/MrlFilterContext/MrlFilterContext.d.ts +34 -0
- package/dist/components/filter/MrlFilterContext/index.d.ts +1 -0
- package/dist/components/filter/MrlFilterItem/MrlFilterItem.d.ts +23 -0
- package/dist/components/filter/MrlFilterItem/index.d.ts +1 -0
- package/dist/components/filter/index.d.ts +3 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/pagination/MrlPaginationText/MrlPaginationText.d.ts +3 -1
- package/dist/index.js +1 -1
- package/dist/styles/MrlFilter/module.scss +5 -0
- package/dist/styles/MrlFilterItem/module.scss +54 -0
- package/dist/styles.css +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { RovingPropTypes } from '../../rovingTabindex';
|
|
3
|
+
import { DataQa } from '../../../utils/dataQa';
|
|
4
|
+
export type MrlFilterProps = {
|
|
5
|
+
/**
|
|
6
|
+
* The label for the radio group.
|
|
7
|
+
*/
|
|
8
|
+
radioGroupLabel: string;
|
|
9
|
+
/**
|
|
10
|
+
* The children elements to be rendered within the MrlFilter component.
|
|
11
|
+
*/
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Callback function that is called when the filter value changes.
|
|
15
|
+
*/
|
|
16
|
+
onFilterChange?: (checked: string) => void;
|
|
17
|
+
/**
|
|
18
|
+
* The default checked value for the filter. It will match the value of the MrlFilterItem.
|
|
19
|
+
*/
|
|
20
|
+
defaultCheckedValue?: string;
|
|
21
|
+
} & Omit<React.ComponentPropsWithoutRef<'div'>, 'defaultChecked' | 'defaultValue'> & Required<Pick<RovingPropTypes, 'orientation'>> & DataQa;
|
|
22
|
+
/**
|
|
23
|
+
* MrlFilter component.
|
|
24
|
+
*
|
|
25
|
+
* @param props - The component props.
|
|
26
|
+
* @returns The MrlFilter component.
|
|
27
|
+
*/
|
|
28
|
+
export declare function MrlFilter(props: MrlFilterProps): React.ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MrlFilter';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { MrlFilterProps } from '../MrlFilter/MrlFilter';
|
|
3
|
+
type MrlFilterState = {
|
|
4
|
+
checked: string;
|
|
5
|
+
};
|
|
6
|
+
type MrlFilterContextValue = {
|
|
7
|
+
state: MrlFilterState;
|
|
8
|
+
dispatch: React.Dispatch<MrlFilterAction>;
|
|
9
|
+
};
|
|
10
|
+
type SET_CHECKED = {
|
|
11
|
+
type: 'SET_CHECKED';
|
|
12
|
+
payload: string;
|
|
13
|
+
};
|
|
14
|
+
type MrlFilterAction = SET_CHECKED;
|
|
15
|
+
type MrlFilterContextProviderProps = {
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
} & Pick<MrlFilterProps, 'defaultCheckedValue' | 'onFilterChange'>;
|
|
18
|
+
/**
|
|
19
|
+
* MrlFilterContextProvider component.
|
|
20
|
+
*
|
|
21
|
+
* @param props - The component props.
|
|
22
|
+
* @returns The MrlFilterContextProvider component.
|
|
23
|
+
*/
|
|
24
|
+
export declare function MrlFilterContextProvider(props: MrlFilterContextProviderProps): JSX.Element;
|
|
25
|
+
/**
|
|
26
|
+
* Custom hook to use the MrlFilterContext.
|
|
27
|
+
*
|
|
28
|
+
* This hook provides access to the MrlFilterContext value.
|
|
29
|
+
*
|
|
30
|
+
* @returns The MrlFilterContext value.
|
|
31
|
+
* @throws Will throw an error if used outside of a MrlFilterContextProvider.
|
|
32
|
+
*/
|
|
33
|
+
export declare const useMrlFilterContext: () => MrlFilterContextValue;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MrlFilterContext';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DataQa } from '../../../utils/dataQa';
|
|
3
|
+
export type MrlFilterItemProps = {
|
|
4
|
+
/**
|
|
5
|
+
* The filter item's value.
|
|
6
|
+
*/
|
|
7
|
+
value: string;
|
|
8
|
+
/**
|
|
9
|
+
* The content to be displayed within the filter item.
|
|
10
|
+
*/
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* The count of items for this filter option.
|
|
14
|
+
*/
|
|
15
|
+
count?: number;
|
|
16
|
+
} & React.ComponentPropsWithoutRef<'span'> & DataQa;
|
|
17
|
+
/**
|
|
18
|
+
* MrlFilterItem component.
|
|
19
|
+
*
|
|
20
|
+
* @param props - The component props.
|
|
21
|
+
* @returns The MrlFilterItem component.
|
|
22
|
+
*/
|
|
23
|
+
export declare function MrlFilterItem(props: MrlFilterItemProps): React.ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MrlFilterItem';
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
interface MrlPaginationTextProps {
|
|
3
3
|
/** Additional class to add to the container element */
|
|
4
4
|
className?: string;
|
|
5
|
+
/** Show total as estimate */
|
|
6
|
+
isEstimate?: boolean;
|
|
5
7
|
/** The last visible item */
|
|
6
8
|
rangeEnd: number;
|
|
7
9
|
/** The first visible item */
|
|
@@ -17,5 +19,5 @@ interface MrlPaginationTextProps {
|
|
|
17
19
|
* @param {MrlPaginationTextProps} props - the component props
|
|
18
20
|
* @returns pagination text
|
|
19
21
|
*/
|
|
20
|
-
export declare function MrlPaginationText({ className, rangeStart, rangeEnd, textClass, total }: MrlPaginationTextProps): JSX.Element;
|
|
22
|
+
export declare function MrlPaginationText({ className, isEstimate, rangeStart, rangeEnd, textClass, total }: MrlPaginationTextProps): JSX.Element;
|
|
21
23
|
export {};
|