BYOK Lab UI

← Back to module

JSDoc

Functions

px

function

Convert a DTCG pixel dimension (`"16px"`) to a number for React Native styles. Throws on anything that is not `<number>px` — a wrong unit in a token is a contract violation, not a runtime condition to paper over.

px(dimension: string): number

shadowToBoxShadow

function

Render a multi-layer DTCG shadow token as a CSS `box-shadow` string. React Native >= 0.76 (new architecture) and react-native-web both accept this via the `boxShadow` style prop — one code path on every platform.

shadowToBoxShadow(shadow: { $value: ReadonlyArray<{ color: string; offsetX: string; offsetY: string; blur: string; spread: string; }>; }): string

Types

BrandColorKey

type

Token group key unions — derive from the schema, never re-declare.

type BrandColorKey = string | number | symbol

NeutralColorKey

type
type NeutralColorKey = string | number | symbol

SemanticColorKey

type
type SemanticColorKey = string | number | symbol

PriorityKey

type
type PriorityKey = string | number | symbol

CategoricalColorKey

type
type CategoricalColorKey = string | number | symbol

GitRailKey

type

Git graph lane index (`"1"`..`"6"`), excluding the `$description` marker.

type GitRailKey = Exclude<string | number | symbol, "$description">

SyntaxTokenKey

type

Dev-tool syntax token kind, shared by the light and dark syntax palettes.

type SyntaxTokenKey = Exclude<string | number | symbol, "$description">

StatusKey

type

Status hue base key (running/waiting/done/error/idle).

type StatusKey = Exclude<string | number | symbol, "$description">

SpaceKey

type
type SpaceKey = string | number | symbol

RadiusKey

type
type RadiusKey = string | number | symbol

FontSizeKey

type
type FontSizeKey = string | number | symbol

FontWeightKey

type
type FontWeightKey = string | number | symbol

ShadowKey

type
type ShadowKey = string | number | symbol

Constants

tokens

const
const tokens: z.infer<any>