@payfit/unity-components
Version:
147 lines (146 loc) • 4.7 kB
TypeScript
import { default as React, PropsWithChildren } from 'react';
import { VariantProps } from '@payfit/unity-themes';
export declare const navigationCardGroup: import('tailwind-variants').TVReturnType<{
orientation: {
horizontal: {
list: string;
};
vertical: {
list: string;
};
};
variant: {
compact: {
list: string;
};
comfortable: {
list: string;
};
};
showLabel: {
true: {
label: string;
};
false: {
label: string;
};
};
}, {
base: string[];
label: string[];
list: string[];
listItem: string[];
}, undefined, {
orientation: {
horizontal: {
list: string;
};
vertical: {
list: string;
};
};
variant: {
compact: {
list: string;
};
comfortable: {
list: string;
};
};
showLabel: {
true: {
label: string;
};
false: {
label: string;
};
};
}, {
base: string[];
label: string[];
list: string[];
listItem: string[];
}, import('tailwind-variants').TVReturnType<{
orientation: {
horizontal: {
list: string;
};
vertical: {
list: string;
};
};
variant: {
compact: {
list: string;
};
comfortable: {
list: string;
};
};
showLabel: {
true: {
label: string;
};
false: {
label: string;
};
};
}, {
base: string[];
label: string[];
list: string[];
listItem: string[];
}, undefined, unknown, unknown, undefined>>;
export interface NavigationCardGroupProps extends PropsWithChildren {
label: string;
isLabelHidden?: boolean;
orientation?: VariantProps<typeof navigationCardGroup>['orientation'];
variant?: VariantProps<typeof navigationCardGroup>['variant'];
}
/**
* Groups multiple NavigationCard components together with a shared label, consistent layout, and proper accessibility.
* Use this component to organize related navigation cards into logical sections, creating clear visual hierarchy and improving discoverability.
* The group automatically handles spacing, borders, and rounded corners for seamless visual integration between cards.
* @param {NavigationCardGroupProps} props - Props including label, isLabelHidden, orientation, variant, and children
* @example
* ```tsx
* import {
* NavigationCardGroup,
* RawNavigationCard,
* NavigationCardLabel
* } from '@payfit/unity-components'
*
* function Example() {
* return (
* <NavigationCardGroup
* label="Quick Actions"
* variant="compact"
* >
* <RawNavigationCard href="/payroll">
* <NavigationCardLabel>Run Payroll</NavigationCardLabel>
* </RawNavigationCard>
* <RawNavigationCard href="/reports">
* <NavigationCardLabel>View Reports</NavigationCardLabel>
* </RawNavigationCard>
* <RawNavigationCard href="/settings">
* <NavigationCardLabel>Settings</NavigationCardLabel>
* </RawNavigationCard>
* </NavigationCardGroup>
* )
* }
* ```
* @remarks
* - Set the `variant` prop to `"compact"` to remove spacing between cards and merge their borders for a unified look
* - Use `variant="comfortable"` (default) for cards with individual spacing and borders
* - Set `orientation` to `"horizontal"` for responsive layout (stacks vertically on mobile, horizontally on larger screens)
* - Use `isLabelHidden` to visually hide the label while keeping it accessible to screen readers
* - The label is required for accessibility and provides context for navigation landmarks
* - Only include NavigationCard components as direct children for proper styling
* @see {@link NavigationCardGroupProps} for all available props
* @see Source code in {@link https://github.com/PayFit/hr-apps/tree/master/libs/shared/unity/components/src/components/navigation-card/parts GitHub}
* @see Design specs {@link https://www.figma.com/design/poaMyU7abAgL9VRhx4ygyy/Unity-DS-%3E-Components-Library?node-id=14505-64292 Figma}
* @see Design docs in {@link https://www.payfit.design/ Payfit.design}
* @see Developer docs in {@link https://unity-components.payfit.io/?path=/docs/navigation-navigationcard-navigationcardgroup--docs unity-components.payfit.io}
*/
declare const NavigationCardGroup: React.ForwardRefExoticComponent<NavigationCardGroupProps & React.RefAttributes<HTMLElement>>;
export { NavigationCardGroup };