ئەم وەرگێڕانە بە یارمەتیی AI نووسراوە و پێویستی بە پێداچوونەوەی کەسێکی زمانزان هەیە.
@0xdolan/deq-icons
ئەم ناوەڕۆکە هێشتا بە زمانەکەت بەردەست نییە.
Deq shapes as icon data, SVG strings, raw SVG files and a sprite.
import { rojHalfSun, toSvg } from "@0xdolan/deq-icons";const svg = toSvg(rojHalfSun, { size: 32 });Source: packages/icons. Install with npm install @0xdolan/deq-icons.
Per-shape exports
93 generated exports, one per shape, such as archDot, archDotColumn, arrowDown. The icon list shows every shape.
Functions
iconComponentName
function iconComponentName(id: string): stringThe component name of an icon: roj-half-sun → RojHalfSun.
iconExportName
function iconExportName(id: string): stringThe JavaScript export name of an icon: roj-half-sun → rojHalfSun.
nodeMarkup
function nodeMarkup(node: IconNode): stringThe child elements of node as SVG markup.
rootAttributes
function rootAttributes(icon: DeqIcon, options?: IconOptions): Attribute[]The root <svg> attributes for icon with options, unescaped. With default options
the result matches render(icon.name) from @0xdolan/deq-core. Framework packages
use this so every package writes the same markup.
toSvg
function toSvg(icon: DeqIcon, options?: IconOptions): stringA standalone SVG document for icon. With default options it is byte for byte
render(icon.name) from @0xdolan/deq-core.
import { rojHalfSun, toSvg } from "@0xdolan/deq-icons";toSvg(rojHalfSun, { size: 32, color: "#ED2024" });@throws {DeqError} INVALID_OPTIONS for a bad size, stroke width, colour or title.
Constants
icons
const icons: Readonly<Record<string, DeqIcon>>Every icon by catalog id. Importing this keeps all icons in a bundle.
packageName
const packageName: '@0xdolan/deq-icons'The npm package name.
Interfaces
DeqIcon
interface DeqIconOne Deq shape as icon data, rendered with core’s default options.
name: string: Catalog id, for exampleroj-half-sun.title: string: English name, used as the default accessible title.node: IconNode
IconOptions
interface IconOptionsThe options icons support. They only change root attributes, so every icon keeps its
precomputed geometry. For dot scale, rotation, fills or parameters, use
@0xdolan/deq-core instead.
size?: string | number: Width and height in px, or any CSS length. Default 24.color?: string: Stroke and dot colour (CSS colour). DefaultcurrentColor.strokeWidth?: string | number: Stroke width in grid units. Default 2.absoluteStrokeWidth?: boolean: Keep the strokestrokeWidthpx wide at any numericsize. Default false.title?: string: Accessible title. Default: the English name.""marks the icon decorative.
Types
Attribute
type Attribute = readonly [name: string, value: string]Root attribute name and value, in the order core writes them.
IconElement
type IconElement = readonly [ tag: "circle" | "ellipse" | "line" | "path" | "polygon" | "polyline", attrs: Readonly<Record<string, string>>, ]An SVG child element: tag name and attributes, in the order core writes them.
IconNode
type IconNode = readonly IconElement[]The elements of an icon, drawn in order inside a 24×24 view box.
وەشانێکی نوێی ئەم ماڵپەڕە بەردەستە.