ShadcnUI.Component (shadcn_ui v1.0.0)

Copy Markdown View Source

Shared authoring conventions for ShadcnUI defining component modules.

Public values select complete, statically discoverable class lists. Unknown values return nil; they are never converted into atoms or interpolated into utility names. Component modules use Phoenix attribute values metadata when an unsupported literal should produce a compile-time diagnostic.

Summary

Functions

Flattens package and caller classes into deterministic render order.

Returns the fixed classes for a shared group and value, or nil.

Removes protected native or accessibility keys from caller globals.

Functions

class_names(classes)

@spec class_names(term()) :: [String.t()]

Flattens package and caller classes into deterministic render order.

classes_for(group, value)

@spec classes_for(atom(), atom()) :: [String.t()] | nil

Returns the fixed classes for a shared group and value, or nil.

protect_globals(globals, protected)

@spec protect_globals(map(), [atom() | String.t()]) :: map()

Removes protected native or accessibility keys from caller globals.