MCPcopy
hub / github.com/intentui/intentui / cx

Function cx

src/lib/primitive.ts:10–19  ·  view source on GitHub ↗
(...args: CxArgs<T>)

Source from the content-addressed store, hash-verified

8type CxArgs<T> = [...ClassNameValue[], Render<T>] | [[...ClassNameValue[], Render<T>]]
9
10export function cx<T = unknown>(...args: CxArgs<T>): string | ((v: T) => string) {
11 const flat = (args.length === 1 && Array.isArray(args[0]) ? args[0] : args) as [
12 ...ClassNameValue[],
13 Render<T>,
14 ]
15
16 const fixed = twMerge(...(flat.slice(0, -1) as ClassNameValue[]))
17
18 return composeRenderProps(flat[flat.length - 1] as Render<T>, (cn) => twMerge(fixed, cn))
19}

Callers 15

ResponsiveNavigationFunction · 0.90
DialogTriggerFunction · 0.90
DialogCloseIconFunction · 0.90
DrawerContentFunction · 0.90
ComboBoxFunction · 0.90
ComboBoxContentFunction · 0.90
SwitchFieldFunction · 0.90
SwitchFunction · 0.90
CarouselButtonFunction · 0.90
DatePickerFunction · 0.90
DatePickerTriggerFunction · 0.90
TextareaFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected