feat(ui): expand reusable component foundation
- add Base UI and shadcn primitives for overlays, forms, navigation, feedback, and data display - add optimized DOM ripple hooks with ref composition and integrate the behavior into interactive controls - add AnchoredSurface SVG geometry and arrow-aware popover, dropdown, and tooltip rendering - extend responsive breakpoint and style utilities, declare component dependencies, and remove the redundant package ESLint config
This commit is contained in:
@@ -4,3 +4,17 @@ import { twMerge } from "tailwind-merge"
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs))
|
||||
}
|
||||
|
||||
export function separate<T, R>({ items, iterator, separator }: {
|
||||
items: ReadonlyArray<T>,
|
||||
iterator: (item: T, index: number) => R,
|
||||
separator: (index: number) => R,
|
||||
}): R[] {
|
||||
return items.reduce<R[]>((acc, item, index) => {
|
||||
if (index > 0) {
|
||||
acc.push(separator(index))
|
||||
}
|
||||
acc.push(iterator(item, index))
|
||||
return acc
|
||||
}, [])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user