Files
xrpl-dev-portal/shared/components/Divider/Divider.tsx
akcodez a08b24ed5d Enhance CardImage showcase with image scaling demo and responsive layout adjustments
- Added a new image scaling demonstration to the CardImage showcase, illustrating a zoom effect on hover.
- Updated layout of CardImage components to improve responsiveness, adjusting column spans for various screen sizes.
- Introduced a new image from Figma for the scaling demo and included detailed descriptions of the scaling behavior.
- Refined SCSS styles to support the new layout and ensure consistent spacing across different screen sizes.
2025-12-10 10:35:14 -08:00

63 lines
1.7 KiB
TypeScript

import React from 'react';
import clsx from 'clsx';
export interface DividerProps {
/** Divider orientation - horizontal separates vertical content, vertical separates horizontal content */
orientation?: 'horizontal' | 'vertical';
/** Stroke weight - controls visual thickness */
weight?: 'thin' | 'regular' | 'strong';
/** Color variant - gray (default), base for high contrast (adapts to theme), green for brand emphasis */
color?: 'gray' | 'base' | 'green';
/** Additional CSS classes */
className?: string;
/** Whether the divider is purely decorative (hides from screen readers) */
decorative?: boolean;
}
/**
* BDS Divider Component
*
* A visual separator component following the XRPL Brand Design System.
* Provides clear visual separation between sections, elements, or content groups.
*
* @example
* // Horizontal divider (default)
* <Divider />
*
* // Vertical divider between columns
* <Divider orientation="vertical" />
*
* // Strong green divider for emphasis
* <Divider weight="strong" color="green" />
*
* // Thin base divider (high contrast - adapts to theme)
* <Divider weight="thin" color="base" />
*/
export const Divider: React.FC<DividerProps> = ({
orientation = 'horizontal',
weight = 'regular',
color = 'gray',
className = '',
decorative = true,
}) => {
// Build class names using BEM with bds namespace
const classNames = clsx(
'bds-divider',
`bds-divider--${orientation}`,
`bds-divider--${weight}`,
`bds-divider--${color}`,
className
);
return (
<hr
className={classNames}
aria-hidden={decorative}
role={decorative ? 'presentation' : 'separator'}
aria-orientation={!decorative ? orientation : undefined}
/>
);
};
export default Divider;