- @intecion/ipal-kit/blocks: libraryBlocks() opt-in, one builder per block, field
builders, option merging, blockLibraryManifest, faqItemsFromLayout
- @intecion/ipal-kit/blocks/rsc: createBlockRegistry, the block components and UI
primitives (token utilities only; next/image and next/link passed in)
- @intecion/ipal-kit/templates: 10 page templates as createSeeder data
- createSeeder: { $form: title } references
- ipal-blocks eject <block>
- tests: options, rendering and a11y per block, Payload + seeding, GraphQL, admin
wording, schema snapshot (versioning), eject imports
- shorter admin labels: link "New tab", table of contents "Show contents"
Co-Authored-By: Claude Opus 5.5 <[email protected]>
12 lines
544 B
TypeScript
12 lines
544 B
TypeScript
/** Joins class names, skipping empty ones. */
|
|
export function cx(...classes: (false | null | string | undefined)[]): string {
|
|
return classes.filter(Boolean).join(' ')
|
|
}
|
|
|
|
/** A block's classes by part; the project's `classNames` replace a part's defaults. */
|
|
export type PartClasses<P extends string = string> = Partial<Record<P, string>>
|
|
|
|
export function parts<P extends string>(defaults: Record<P, string>, overrides?: PartClasses): Record<P, string> {
|
|
return overrides ? ({ ...defaults, ...overrides } as Record<P, string>) : defaults
|
|
}
|