import type { ReactNode } from 'react'; import { type Of } from './asset'; /** * A token, wearing its own face. * * Every list on this surface named tokens in bare text — the picker, the market * table, the pool rows, the token page. A person scanning forty rows for the one * they hold is reading forty strings, and reading is slower than recognising. * That is the whole argument for a mark: not decoration, a shorter path to the * row you came for. * * One component draws every asset on the surface. Four screens and the picker * each had their own spelling of "mark, then symbol, then name" and they had * drifted: the picker put the name above the symbol and the tables put it * below, the trigger sized its mark at 28 where the reference draws 24, and the * chooser's rows sized theirs at 34 where the reference draws 36. * * An asset a build serves a mark for wears it. `asset.ts` next door answers * where from, and nothing is drawn here — a mark is a brand, and a brand * redrawn from memory is a different brand. * * Most tokens have no mark. The indexer returns id, symbol, name and decimals * and no image, measured against its own schema, so the fallback is not an edge * case: it is what a list of this chain's tokens mostly looks like. That * fallback is the asset's own letters — derived from what is there, always * resolves, never fetches — rather than a placeholder picture, which says the * same nothing for every row and helps a reader scan none of them. * * The letters are achromatic. `@luxfi/ui/tokens.css` states the rule plainly — * one achromatic ladder plus exactly two hues, reserved for error and success, * and nothing else carries colour. A wall of tinted discs breaks that twice: it * spends colour on identity, and it gives the reader a second thing that looks * like state and is not. * * So it varies in lightness rather than in hue, taken from the asset's own * address. Same asset, same shade, on every screen and across reloads — the * only property that makes it recognisable — and the page stays monochrome. */ /** * A shade for one address, stable across screens and across reloads. * * Returned as a step 0..11 rather than a percentage, so the two lightnesses a * mark needs — its ground and its letters — are derived from one number and * cannot drift apart. * * FNV-1a rather than a sum of character codes. The input is hex, so its * alphabet is sixteen characters wide, and a plain sum lands every address in * the same narrow band: measured across six real tokens, the first version put * all six between 180 and 344 with two of them seventeen apart. Mixing on every * character spreads them. */ export declare const shade: (address: string | undefined) => number; /** * How large a mark is drawn, in the four places this surface draws one, each * measured on the reference. * * `pill` sits beside a figure on a trade card, where the control holds one line * and the amount beside it is the largest thing on the card. Twenty-four, with * the chain badge on it at twelve. * * `row` is a mark in a table, as tall as the two lines beside it, which is what * makes a list of tokens scan as a column of objects rather than a column of * strings. Thirty-two, against a symbol line and a name line that together * stand thirty-three. * * `card` is a row on one of the door's product cards, which lists tokens as * the card's own artwork rather than as a table. The same thirty-two, and the * only place where the name is read before the symbol: nobody is scanning a * column here, so the name leads and the ticker qualifies it. Both at * twenty-four, on one line. * * `list` is a row in the chooser, which is a taller row than a table's because * it is a target rather than a cell. Thirty-six. * * `panel` is the row under a sum that says what the sum is an amount of. The * chooser's thirty-six, because it is the same object at the same distance — * what differs is that it names one asset rather than offering a column of * them, so the symbol is read rather than scanned. * * `page` is the mark for whatever the whole screen is about. Fifty-six, * measured on the reference's token screen, where it opens the header at 160 * with the two words starting at 228 — the mark, twelve, and the name over the * ticker beside it. * * `unit` is the smallest, and it stands beside a name that says what unit the * figure next to it is in rather than offering a choice of asset. Sixteen, * measured on the reference's limit card, where the mark beside LUSD is 16 to * the 24 on the pills under it and its badge is seven. * * Exported, because a row can carry a square that is not an asset's — a holder * mints nothing, so its row wears the chain's mark drawn as a plain image — and * it has to be the rung its neighbours are drawn at. Stated here rather than * restated there: a column whose marks change size between rows is a column of * different objects, which is what a second copy of this number goes on to * produce the day one of them moves. */ export declare const SIZE: { readonly unit: 16; readonly pill: 24; readonly row: 32; readonly card: 32; readonly list: 36; readonly panel: 36; readonly page: 56; }; export type Size = keyof typeof SIZE; /** * The caret that says a control opens a chooser. * * Twenty-four, which is what the reference draws beside its own pill. It is not * a target of its own — the whole control is — so it carries no name and no * press. * * The number lives here and the caret is drawn by the control that opens: an * asset is the same object whether or not pressing it leads anywhere, and where * the caret goes and which way it points are facts about the control's box * rather than about the asset in it. A full-width row puts it at the far end * and points it on; a pill sized to its pair puts it after the symbol. */ export declare const CARET = 24; /** * The two currencies a pool holds, drawn as one object. * * A position, a pool and a market are each named by both their sides, and a * reader recognises the row by the marks before reading either ticker — the * same argument that put a disc beside every single asset on the surface. The * positions table was the one list still naming both sides in bare text. * * Side by side rather than overlapping. The reference's own pair mark is on no * screen this build can capture — its indexer answers 404 and its position list * needs a wallet — so the discs take the gap every other pair of objects on this * surface takes, and an overlap invented for them would be geometry nobody * measured. */ export declare function Coins({ of, say, size, }: { of: readonly Of[]; /** How the pool names itself — "USDC / LUX". Absent, this is the marks * alone, which is what a cell already carrying the name wants. */ say?: string; size?: Size; }): import("react").JSX.Element; export interface CoinProps { symbol?: string; /** The asset's name, drawn under the symbol where a row has both. */ name?: string; address?: string; /** The chain this asset is on, where the screen states one. Draws the badge. */ chain?: string; size?: Size; /** What is held, or offered, drawn at the end of the row. */ amount?: ReactNode; } /** * An asset as a reader meets it: its mark, its symbol, its name where there is * room, and whatever the row states about it. * * With no symbol, no name and nothing after it, this is the disc alone — which * is what a market row whose token the indexer has not named yet, and a wallet * page about one address, each want. */ export declare function Coin({ symbol, name, address, chain, size, amount }: CoinProps): import("react").JSX.Element; //# sourceMappingURL=coin.d.ts.map