/** * @fileoverview The shared design vocabulary of the themed components — * the `@mapples/ui` `Button`/`IconButton` variants and every * `@mapples/components` widget draw their colours, sizes and radii from * here, so one source of truth feeds the runtime, the editor schematics (the * inspector `Select` options) and the AI digest. * * Colours are theme-token strings resolved by `@mapples/style`. The key * structure is the Mapples palette contract every project theme satisfies * (the default palette and the AI design schema enforce it): `background`, * `primary`, `accent`, `text`, `neutral`, `system`. * * @public */ /** Control sizes shared by buttons, fields and selection controls. */ export declare const CONTROL_SIZE_KEYS: readonly ["sm", "md", "lg"]; export type ControlSize = (typeof CONTROL_SIZE_KEYS)[number]; /** * The whole control size scale: the shared {@link CONTROL_SIZE_KEYS} plus * `xl` (76 pt), the round primary media control (play/pause). Only * `IconButton` takes `xl`; buttons and fields stay on `sm`–`lg`. */ export declare const CONTROL_SCALE_KEYS: readonly ["sm", "md", "lg", "xl"]; export type ControlScaleSize = (typeof CONTROL_SCALE_KEYS)[number]; export interface ControlSizeSpec { /** Control height in points — `md` satisfies the 44 pt touch target. */ height: number; /** Glyph size for leading/trailing icons. */ iconSize: number; /** Horizontal padding of a control with a label. */ paddingX: number; /** Typography variant of the control label. */ labelVariant: string; /** Corner radius of the control. */ radius: number; } /** * Geometry per control size. Points, not sizing tokens, so a control keeps * its proportions whatever base a project's sizing scale uses. */ export declare const CONTROL_SIZES: Record; /** Corner radius scale. */ export declare const RADII: { readonly xs: 4; readonly sm: 8; readonly md: 12; readonly lg: 16; readonly xl: 24; readonly pill: 999; }; export type RadiusKey = keyof typeof RADII; /** The outline weight of a project (see {@link resolveShape}). */ export interface ShapeBorder { /** * The project's `borderWidth`, or `undefined` when its sizing names none — * then every component keeps its own outline width. */ width: number | undefined; } /** The corner radii, control geometry, outline weight and shadow of a project. */ export interface Shape { radius: Record; control: Record; border: ShapeBorder; /** * The outline width of a surface or control: the project's `borderWidth` * when set, else `defaultWidth` (the component's own width — `1`, or * `StyleSheet.hairlineWidth` where it draws a hairline). */ borderWidth: (defaultWidth: number) => number; /** * The width of an outline that thickens to show focus or the current item: * `defaultWidth` when the project names no `borderWidth`, else the larger of * `defaultWidth` and `borderWidth + 1`, so the emphasis stays visible over * heavier outlines. */ emphasisWidth: (defaultWidth: number) => number; /** * The offset of the hard shadow in points; `0` keeps the soft * {@link ELEVATION}. Read through `useElevation`. */ shadowOffset: number; } /** * The shape when a project's sizing names no `radius`, `radiusLarge`, * `control`, `borderWidth` or `shadowOffset`. */ export declare const DEFAULT_SHAPE: Shape; /** * The project sizing keys the shape reads — what the design setup writes: * `radius` (controls, chips, small surfaces), `radiusLarge` (cards, sheets, * dialogs), `control` (the height of an `md` control), `borderWidth` (0–4, * the outline weight of surfaces and controls) and `shadowOffset` (0–8, a * hard offset shadow instead of the soft elevation). */ export declare const SHAPE_SIZING_KEYS: { readonly radius: "sizing.radius"; readonly radiusLarge: "sizing.radiusLarge"; readonly control: "sizing.control"; readonly borderWidth: "sizing.borderWidth"; readonly shadowOffset: "sizing.shadowOffset"; }; /** * Derives the shape from a project's sizing. Each value left undefined keeps * the default, so the defaults reproduce {@link DEFAULT_SHAPE} exactly. * * - `radius` sets `md` and scales `xs`/`sm` with it; `radiusLarge` sets `lg` * and scales `xl`. A `radius` of 0 is a sharp direction: pills square off. * - `control` sets the `md` height; `sm`/`lg` keep their 8 pt steps and `xl` * its 32 pt step. Control corners follow `radius` and never exceed half the * height (a pill). * - `borderWidth` (0–4) is the outline weight of every surface and control * border (outlined cards and fields, chips, checkbox and radio rings, * outlined buttons, bar edges, the dark-theme hairline of elevated * surfaces). Missing, each component keeps its own width (1 or a * hairline). Dividers and separators between items are not borders and * keep theirs; outlines that thicken for focus or the current item use * {@link Shape.emphasisWidth} — `max(own width, borderWidth + 1)`. * - `shadowOffset` (0–8): `0` or missing keeps the soft {@link ELEVATION}; * above 0 every elevated surface casts a hard shadow, offset by that many * points on both axes with no blur, in the theme's text colour (the * neo-brutalist look). See {@link resolveElevation}. */ export declare const resolveShape: (radius: number | undefined, radiusLarge: number | undefined, control: number | undefined, borderWidth?: number, shadowOffset?: number) => Shape; /** Opacity of a disabled control. */ export declare const DISABLED_OPACITY = 0.38; /** Alpha of the state layer painted over a control in the label colour. */ export declare const STATE_LAYER_OPACITY: { readonly hover: 0.08; readonly pressed: 0.12; }; /** * The one elevation level, as the CSS `boxShadow` string React Native and * the web accept; on dark themes surfaces add a 1 px outline as well because * shadows vanish. The object form (`ELEVATION_SHADOW`) is what schematics and * the AI write into style slots — the styled pipeline converts it. Components * read the project's elevation through `useElevation`, which swaps in a hard * shadow when the project sets `shadowOffset`. */ export declare const ELEVATION = "0px 2px 8px rgba(0, 0, 0, 0.12)"; export declare const ELEVATION_SHADOW: { readonly x: 0; readonly y: 2; readonly radius: 8; readonly color: "rgba(0, 0, 0, 0.12)"; }; /** {@link ELEVATION} cast upwards — bars and sheets pinned to the bottom edge. */ export declare const ELEVATION_UP: string; /** Which way a surface casts its shadow: `down` (the default) or `up` (bottom-pinned bars and sheets). */ export type ElevationDirection = 'down' | 'up'; /** * The `boxShadow` of an elevated surface. A `shadowOffset` of 0 is the soft * {@link ELEVATION} ({@link ELEVATION_UP} upwards); above 0 it is a hard * shadow — `offset` points on both axes (y negated upwards), no blur, in * `color` (the theme's text colour). */ export declare const resolveElevation: (shadowOffset: number, color: string, direction?: ElevationDirection) => string; /** Typography variants by the part of a component they set. */ export declare const TYPOGRAPHY_PARTS: { readonly label: "Label"; readonly button: "Button"; readonly body: "Body"; readonly title: "Subtitle"; readonly headline: "Headline"; readonly helper: "Caption"; readonly overline: "Overline"; readonly link: "Link"; }; /** Theme-token strings for the palette contract. */ export declare const Tokens: { readonly color: { readonly primary: "theme.primary.main"; readonly primaryLight: "theme.primary.light"; readonly primaryDark: "theme.primary.dark"; readonly onPrimary: "theme.primary.contrast"; readonly primaryContainer: "theme.primary.background"; readonly accent: "theme.accent.main"; readonly accentLight: "theme.accent.light"; readonly accentDark: "theme.accent.dark"; readonly onAccent: "theme.accent.contrast"; readonly accentContainer: "theme.accent.background"; readonly surface: "theme.background.card"; readonly background: "theme.background.primary"; readonly inverse: "theme.background.contrast"; readonly text: "theme.text.primary"; readonly textSecondary: "theme.text.secondary"; readonly textTertiary: "theme.text.tertiary"; readonly white: "theme.neutral.white"; readonly black: "theme.neutral.black"; readonly error: "theme.system.error"; readonly success: "theme.system.success"; readonly warning: "theme.system.warning"; readonly info: "theme.system.info"; }; }; /** Visual variants of `Button`. */ export declare const BUTTON_VARIANTS: readonly ["filled", "tonal", "outlined", "text", "elevated"]; export type ButtonVariant = (typeof BUTTON_VARIANTS)[number]; /** Visual variants of `IconButton` when it renders a glyph by name. */ export declare const ICON_BUTTON_VARIANTS: readonly ["standard", "filled", "tonal", "outlined"]; export type IconButtonVariant = (typeof ICON_BUTTON_VARIANTS)[number]; /** Sizes of `IconButton`: `sm` 36, `md` 44, `lg` 52, `xl` 76 points. */ export declare const ICON_BUTTON_SIZES: readonly ["sm", "md", "lg", "xl"]; export type IconButtonSize = ControlScaleSize; /** * Corner shapes of a themed `IconButton`: `auto` is round unless the project * is sharp (radius 0 squares it off); `circle` is round whatever the project * radius; `rounded` takes the project's control corner radius. */ export declare const ICON_BUTTON_SHAPES: readonly ["auto", "circle", "rounded"]; export type IconButtonShape = (typeof ICON_BUTTON_SHAPES)[number]; /** Colour roles a control can take. */ export declare const TONES: readonly ["primary", "accent", "neutral", "error", "success", "warning", "info"]; export type Tone = (typeof TONES)[number]; //# sourceMappingURL=tokens.d.ts.map