/** * Hand-drawn SF Symbols–style glyphs on a 24-unit grid. * Stroke 1.8, round caps/joins; `.f` parts fill when the glyph is "active". * No icon fonts: the repo's Material Symbols font is subset. */ const F = 'fill="currentColor" stroke="none"'; /** Rounded seal outline (checkmark.seal) generated from a wavy circle. */ function sealPath(cx = 12, cy = 12, r = 8.6, bumps = 12, amp = 1.05) { const steps = bumps * 8; let d = ''; for (let i = 0; i <= steps; i += 1) { const a = (i / steps) * Math.PI * 2; const rr = r + amp * Math.cos(a * bumps); const x = cx + rr * Math.cos(a); const y = cy + rr * Math.sin(a); d += `${i ? 'L' : 'M'}${x.toFixed(2)} ${y.toFixed(2)}`; } return `${d}Z`; } const SEAL = sealPath(); const P = { now: ``, globe: ``, viewfinder: ``, threads: ``, you: ``, search: ``, chevronLeft: ``, chevronRight: ``, chevronDown: ``, chevronUp: ``, close: ``, info: ``, north: ``, home: ``, layers: ``, sky: ``, sea: ``, orbit: ``, hazards: ``, flame: ``, eyes: ``, ground: ``, weather: ``, infra: ``, star: ``, starFill: ``, ride: ``, video: ``, share: ``, seal: ``, sealFill: ``, play: ``, pause: ``, sparkles: ``, agree: ``, dispute: ``, sliders: ``, refresh: ``, lock: ``, key: ``, location: ``, camera: ``, cube: ``, download: ``, lens: ``, checkmark: ``, xmark: ``, minus: ``, plus: ``, ellipsis: ``, clock: ``, pin: ``, sidebar: ``, waveform: ``, arrowUpRight: ``, scope: ``, hand: ``, }; /** * Inline SVG markup for a glyph. * @param {string} name * @param {{ label?: string, cls?: string }} [opts] */ export function icon(name, { label = '', cls = '' } = {}) { const body = P[name] || P.ellipsis; const a11y = label ? `role="img" aria-label="${label}"` : 'aria-hidden="true" focusable="false"'; return `${body}`; } export const FAMILY_ICON = { sky: 'sky', sea: 'sea', orbit: 'orbit', hazards: 'hazards', eyes: 'eyes', ground: 'ground', weather: 'weather', infra: 'infra', }; export const FAMILIES = [ { id: 'sky', name: 'Sky', color: '#7CC4FF' }, { id: 'sea', name: 'Sea', color: '#38E1C6' }, { id: 'orbit', name: 'Orbit', color: '#C9A7FF' }, { id: 'hazards', name: 'Hazards', color: '#FF6A3D' }, { id: 'eyes', name: 'Eyes', color: '#FFD166' }, { id: 'ground', name: 'Ground', color: '#9BE15D' }, { id: 'weather', name: 'Weather', color: '#8AB4F8' }, { id: 'infra', name: 'Infra', color: '#B8C0CC' }, ]; export const FAMILY_COLOR = Object.fromEntries( FAMILIES.map((f) => [f.id, f.color]), );