@mszczygiel-projects/ui-core-icons 0.0.0-stage → 1.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/build/build.d.ts +49 -0
- package/dist/build/build.js +127 -0
- package/dist/build/cli.d.ts +2 -0
- package/dist/build/cli.js +13 -0
- package/dist/build/names.d.ts +11 -0
- package/dist/build/names.js +19 -0
- package/dist/build/run-cli.d.ts +12 -0
- package/dist/build/run-cli.js +83 -0
- package/dist/build/svg.d.ts +16 -0
- package/dist/build/svg.js +170 -0
- package/dist/generated/icons.d.ts +72 -0
- package/dist/generated/icons.js +73 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/package.json +99 -3
- package/required-icons.txt +18 -0
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @mszczygiel-projects/ui-core-icons
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The icons of UI Core Library: one constant per icon, holding its `<svg>` element as a string. A bundler keeps only the icons you import. The `ui-core-icons` CLI builds a package with the same exports from your own SVG files.
|
|
4
|
+
|
|
5
|
+
The documentation site shows how to use it: [Getting started](https://mszczygiel-projects.github.io/ui-core-library/?path=/docs/guides-getting-started--docs), [Custom tokens and icons](https://mszczygiel-projects.github.io/ui-core-library/?path=/docs/guides-custom-tokens-and-icons--docs) and [Icons](https://mszczygiel-projects.github.io/ui-core-library/?path=/docs/foundations-icons--docs).
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export interface IconSource {
|
|
2
|
+
/** The file name without `.svg`. */
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly svg: string;
|
|
5
|
+
}
|
|
6
|
+
export interface Icon {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly exportName: string;
|
|
9
|
+
/** The normalized `<svg>` element. */
|
|
10
|
+
readonly svg: string;
|
|
11
|
+
}
|
|
12
|
+
export interface BuildResult {
|
|
13
|
+
/** The icons in the order of their names, or none when an error stopped the build. */
|
|
14
|
+
readonly icons: readonly Icon[];
|
|
15
|
+
readonly errors: readonly string[];
|
|
16
|
+
/** Broken design rules that did not stop a build outside strict mode. */
|
|
17
|
+
readonly warnings: readonly string[];
|
|
18
|
+
}
|
|
19
|
+
export interface BuildOptions {
|
|
20
|
+
/**
|
|
21
|
+
* The library's own build is strict: a broken design rule stops it. A consumer's set may draw
|
|
22
|
+
* on another grid or with strokes, so there a broken rule is only a warning.
|
|
23
|
+
*/
|
|
24
|
+
readonly strict: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Builds the icons of a directory. Every file in it must be an icon named `<name>.svg`, so that an
|
|
28
|
+
* icon cannot go missing without an error; hidden files, such as .DS_Store, belong to the system.
|
|
29
|
+
*/
|
|
30
|
+
export declare function buildDirectory(dir: string, options: BuildOptions): BuildResult;
|
|
31
|
+
/**
|
|
32
|
+
* Checks and normalizes every icon. Any error, and in strict mode any rule violation, stops the
|
|
33
|
+
* build, so a broken icon never reaches a component; nothing is renamed or repaired behind the
|
|
34
|
+
* designer's back.
|
|
35
|
+
*/
|
|
36
|
+
export declare function buildIcons(sources: readonly IconSource[], options: BuildOptions): BuildResult;
|
|
37
|
+
/**
|
|
38
|
+
* The names of the icons that the component packages import, from `required-icons.txt`: one name
|
|
39
|
+
* per line, blank lines and lines starting with `#` ignored.
|
|
40
|
+
*/
|
|
41
|
+
export declare function parseRequired(text: string): string[];
|
|
42
|
+
/** The errors for required icons that a set lacks, since a component would import nothing. */
|
|
43
|
+
export declare function missingRequired(icons: readonly Icon[], required: readonly string[]): string[];
|
|
44
|
+
/** The TypeScript module the package compiles: one exported string per icon. */
|
|
45
|
+
export declare function emitModule(icons: readonly Icon[]): string;
|
|
46
|
+
/** The package name a consumer's set replaces, so that the component packages import it. */
|
|
47
|
+
export declare const PACKAGE_NAME = "@mszczygiel-projects/ui-core-icons";
|
|
48
|
+
/** The files of a consumer's icon package: the same name and exports as the library's own. */
|
|
49
|
+
export declare function emitPackage(icons: readonly Icon[], version: string): Readonly<Record<'package.json' | 'index.js' | 'index.d.ts', string>>;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the module of icons from the SVG files of [Core] Icons: every icon is checked,
|
|
3
|
+
* normalized and exported as one string constant, so a bundler keeps only the icons imported.
|
|
4
|
+
*/
|
|
5
|
+
import { readdirSync, readFileSync } from 'node:fs';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import { exportName, isIconName } from "./names.js";
|
|
8
|
+
import { checkIcon, normalizeIcon } from "./svg.js";
|
|
9
|
+
function compare(a, b) {
|
|
10
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Builds the icons of a directory. Every file in it must be an icon named `<name>.svg`, so that an
|
|
14
|
+
* icon cannot go missing without an error; hidden files, such as .DS_Store, belong to the system.
|
|
15
|
+
*/
|
|
16
|
+
export function buildDirectory(dir, options) {
|
|
17
|
+
const errors = [];
|
|
18
|
+
const sources = [];
|
|
19
|
+
const entries = readdirSync(dir, { withFileTypes: true }).sort((a, b) => compare(a.name, b.name));
|
|
20
|
+
for (const entry of entries) {
|
|
21
|
+
if (entry.name.startsWith('.')) {
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
if (!entry.isFile() || !entry.name.endsWith('.svg')) {
|
|
25
|
+
errors.push(`${entry.name} is not an icon file; icons are SVG files named in kebab case, like chevron-down.svg`);
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
sources.push({
|
|
29
|
+
name: entry.name.slice(0, -'.svg'.length),
|
|
30
|
+
svg: readFileSync(join(dir, entry.name), 'utf8'),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
const built = buildIcons(sources, options);
|
|
34
|
+
return errors.length > 0
|
|
35
|
+
? { icons: [], errors: [...errors, ...built.errors], warnings: built.warnings }
|
|
36
|
+
: built;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Checks and normalizes every icon. Any error, and in strict mode any rule violation, stops the
|
|
40
|
+
* build, so a broken icon never reaches a component; nothing is renamed or repaired behind the
|
|
41
|
+
* designer's back.
|
|
42
|
+
*/
|
|
43
|
+
export function buildIcons(sources, options) {
|
|
44
|
+
const errors = [];
|
|
45
|
+
const warnings = [];
|
|
46
|
+
const icons = [];
|
|
47
|
+
const owners = new Map();
|
|
48
|
+
for (const source of [...sources].sort((a, b) => compare(a.name, b.name))) {
|
|
49
|
+
if (!isIconName(source.name)) {
|
|
50
|
+
errors.push(`${source.name}.svg is not named in kebab case, like chevron-down.svg; rename the component icon/${source.name} in Figma`);
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
const name = exportName(source.name);
|
|
54
|
+
const owner = owners.get(name);
|
|
55
|
+
if (owner !== undefined) {
|
|
56
|
+
errors.push(`${owner}.svg and ${source.name}.svg would both export ${name}; rename one of them in Figma`);
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
owners.set(name, source.name);
|
|
60
|
+
const findings = checkIcon(source.name, source.svg);
|
|
61
|
+
const violations = findings.violations.map((violation) => violation.message);
|
|
62
|
+
if (findings.errors.length > 0 || (options.strict && violations.length > 0)) {
|
|
63
|
+
errors.push(...findings.errors, ...(options.strict ? violations : []));
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
warnings.push(...violations);
|
|
67
|
+
icons.push({ name: source.name, exportName: name, svg: normalizeIcon(source.svg) });
|
|
68
|
+
}
|
|
69
|
+
return errors.length > 0 ? { icons: [], errors, warnings } : { icons, errors, warnings };
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The names of the icons that the component packages import, from `required-icons.txt`: one name
|
|
73
|
+
* per line, blank lines and lines starting with `#` ignored.
|
|
74
|
+
*/
|
|
75
|
+
export function parseRequired(text) {
|
|
76
|
+
return text
|
|
77
|
+
.split('\n')
|
|
78
|
+
.map((line) => line.trim())
|
|
79
|
+
.filter((line) => line !== '' && !line.startsWith('#'));
|
|
80
|
+
}
|
|
81
|
+
/** The errors for required icons that a set lacks, since a component would import nothing. */
|
|
82
|
+
export function missingRequired(icons, required) {
|
|
83
|
+
const names = new Set(icons.map((icon) => icon.name));
|
|
84
|
+
return required
|
|
85
|
+
.filter((name) => !names.has(name))
|
|
86
|
+
.map((name) => `${name}.svg is missing; the components render icon/${name}, so every set needs it`);
|
|
87
|
+
}
|
|
88
|
+
/** The TypeScript module the package compiles: one exported string per icon. */
|
|
89
|
+
export function emitModule(icons) {
|
|
90
|
+
const lines = [
|
|
91
|
+
'// Generated by scripts/generate.ts from the SVG files in figma/. Do not edit.',
|
|
92
|
+
'',
|
|
93
|
+
];
|
|
94
|
+
for (const icon of icons) {
|
|
95
|
+
lines.push(`/** The \`${icon.name}\` icon of [Core] Icons. */`, `export const ${icon.exportName}: string = ${JSON.stringify(icon.svg)};`, '');
|
|
96
|
+
}
|
|
97
|
+
return lines.join('\n');
|
|
98
|
+
}
|
|
99
|
+
/** The package name a consumer's set replaces, so that the component packages import it. */
|
|
100
|
+
export const PACKAGE_NAME = '@mszczygiel-projects/ui-core-icons';
|
|
101
|
+
/** The files of a consumer's icon package: the same name and exports as the library's own. */
|
|
102
|
+
export function emitPackage(icons, version) {
|
|
103
|
+
const notice = '// Generated by ui-core-icons build from your SVG files. Do not edit.';
|
|
104
|
+
const manifest = {
|
|
105
|
+
name: PACKAGE_NAME,
|
|
106
|
+
version,
|
|
107
|
+
description: 'Icons built with ui-core-icons from a custom set of SVG files.',
|
|
108
|
+
type: 'module',
|
|
109
|
+
sideEffects: false,
|
|
110
|
+
exports: {
|
|
111
|
+
'.': { types: './index.d.ts', default: './index.js' },
|
|
112
|
+
'./package.json': './package.json',
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
const js = [notice, ''];
|
|
116
|
+
const dts = [notice, ''];
|
|
117
|
+
for (const icon of icons) {
|
|
118
|
+
const doc = `/** The \`${icon.name}\` icon. */`;
|
|
119
|
+
js.push(doc, `export const ${icon.exportName} = ${JSON.stringify(icon.svg)};`, '');
|
|
120
|
+
dts.push(doc, `export declare const ${icon.exportName}: string;`, '');
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
'package.json': `${JSON.stringify(manifest, null, 2)}\n`,
|
|
124
|
+
'index.js': js.join('\n'),
|
|
125
|
+
'index.d.ts': dts.join('\n'),
|
|
126
|
+
};
|
|
127
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import { runCli } from "./run-cli.js";
|
|
4
|
+
process.exitCode = runCli(process.argv.slice(2), {
|
|
5
|
+
out: (line) => {
|
|
6
|
+
console.log(line);
|
|
7
|
+
},
|
|
8
|
+
err: (line) => {
|
|
9
|
+
console.error(line);
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
// dist/build/cli.js, two levels below the package with its version and required icons.
|
|
13
|
+
{ packageDir: fileURLToPath(new URL('../..', import.meta.url)) });
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One name in three places: the component `icon/<name>` in Figma, the file
|
|
3
|
+
* `figma/<name>.svg` and the export `icon<Name>` in code.
|
|
4
|
+
*/
|
|
5
|
+
/** Whether a name is in kebab case, like `chevron-down`. */
|
|
6
|
+
export declare function isIconName(name: string): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* The export of an icon in code: `chevron-down` becomes `iconChevronDown`. The prefix keeps every
|
|
9
|
+
* name a valid identifier, `delete` included, and tells a reader what the constant holds.
|
|
10
|
+
*/
|
|
11
|
+
export declare function exportName(name: string): string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One name in three places: the component `icon/<name>` in Figma, the file
|
|
3
|
+
* `figma/<name>.svg` and the export `icon<Name>` in code.
|
|
4
|
+
*/
|
|
5
|
+
const ICON_NAME = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
6
|
+
/** Whether a name is in kebab case, like `chevron-down`. */
|
|
7
|
+
export function isIconName(name) {
|
|
8
|
+
return ICON_NAME.test(name);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The export of an icon in code: `chevron-down` becomes `iconChevronDown`. The prefix keeps every
|
|
12
|
+
* name a valid identifier, `delete` included, and tells a reader what the constant holds.
|
|
13
|
+
*/
|
|
14
|
+
export function exportName(name) {
|
|
15
|
+
return `icon${name
|
|
16
|
+
.split('-')
|
|
17
|
+
.map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))
|
|
18
|
+
.join('')}`;
|
|
19
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** The help text. Its commands and flags are public API from 1.0.0. */
|
|
2
|
+
export declare const HELP = "ui-core-icons: build an icon package from your own SVG files\n\nUsage:\n ui-core-icons build --input <dir> --output <dir>\n\nOptions:\n -i, --input <dir> Directory of SVG files named in kebab case, like chevron-down.svg\n -o, --output <dir> Directory to write the package to: package.json, index.js and index.d.ts\n -h, --help Show this help\n\nThe package has the name and exports of @mszczygiel-projects/ui-core-icons, so the components\nrender your icons once your package manager points that name at it (pnpm.overrides, overrides\nor resolutions). Every icon the components render must be in the set. An icon may hold only\nplain shapes; one drawn off the 24 grid, in several colours or with strokes is built with\na warning.\n";
|
|
3
|
+
export interface CliIo {
|
|
4
|
+
readonly out: (line: string) => void;
|
|
5
|
+
readonly err: (line: string) => void;
|
|
6
|
+
}
|
|
7
|
+
/** Where the CLI finds the list of required icons and its own version. */
|
|
8
|
+
export interface CliContext {
|
|
9
|
+
readonly packageDir: string;
|
|
10
|
+
}
|
|
11
|
+
/** Runs the CLI with its arguments and returns the exit code. */
|
|
12
|
+
export declare function runCli(argv: readonly string[], io: CliIo, context: CliContext): number;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { join, resolve } from 'node:path';
|
|
3
|
+
import { parseArgs } from 'node:util';
|
|
4
|
+
import { buildDirectory, emitPackage, missingRequired, parseRequired } from "./build.js";
|
|
5
|
+
/** The help text. Its commands and flags are public API from 1.0.0. */
|
|
6
|
+
export const HELP = `ui-core-icons: build an icon package from your own SVG files
|
|
7
|
+
|
|
8
|
+
Usage:
|
|
9
|
+
ui-core-icons build --input <dir> --output <dir>
|
|
10
|
+
|
|
11
|
+
Options:
|
|
12
|
+
-i, --input <dir> Directory of SVG files named in kebab case, like chevron-down.svg
|
|
13
|
+
-o, --output <dir> Directory to write the package to: package.json, index.js and index.d.ts
|
|
14
|
+
-h, --help Show this help
|
|
15
|
+
|
|
16
|
+
The package has the name and exports of @mszczygiel-projects/ui-core-icons, so the components
|
|
17
|
+
render your icons once your package manager points that name at it (pnpm.overrides, overrides
|
|
18
|
+
or resolutions). Every icon the components render must be in the set. An icon may hold only
|
|
19
|
+
plain shapes; one drawn off the 24 grid, in several colours or with strokes is built with
|
|
20
|
+
a warning.
|
|
21
|
+
`;
|
|
22
|
+
function usageError(io, message) {
|
|
23
|
+
io.err(`✗ ${message}\n`);
|
|
24
|
+
io.err(HELP);
|
|
25
|
+
return 1;
|
|
26
|
+
}
|
|
27
|
+
/** Runs the CLI with its arguments and returns the exit code. */
|
|
28
|
+
export function runCli(argv, io, context) {
|
|
29
|
+
let parsed;
|
|
30
|
+
try {
|
|
31
|
+
parsed = parseArgs({
|
|
32
|
+
args: [...argv],
|
|
33
|
+
allowPositionals: true,
|
|
34
|
+
strict: true,
|
|
35
|
+
options: {
|
|
36
|
+
input: { type: 'string', short: 'i' },
|
|
37
|
+
output: { type: 'string', short: 'o' },
|
|
38
|
+
help: { type: 'boolean', short: 'h' },
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
return usageError(io, error instanceof Error ? error.message : String(error));
|
|
44
|
+
}
|
|
45
|
+
const { values, positionals } = parsed;
|
|
46
|
+
if (values.help === true) {
|
|
47
|
+
io.out(HELP);
|
|
48
|
+
return 0;
|
|
49
|
+
}
|
|
50
|
+
const [command, ...extra] = positionals;
|
|
51
|
+
if (command !== 'build' || extra.length > 0) {
|
|
52
|
+
return usageError(io, command === undefined ? 'Missing command' : `Unknown command: ${positionals.join(' ')}`);
|
|
53
|
+
}
|
|
54
|
+
if (values.input === undefined || values.output === undefined) {
|
|
55
|
+
return usageError(io, 'build needs --input and --output');
|
|
56
|
+
}
|
|
57
|
+
const input = resolve(values.input);
|
|
58
|
+
if (!existsSync(input)) {
|
|
59
|
+
io.err(`✗ ${input} does not exist`);
|
|
60
|
+
return 1;
|
|
61
|
+
}
|
|
62
|
+
const { icons, errors, warnings } = buildDirectory(input, { strict: false });
|
|
63
|
+
const required = parseRequired(readFileSync(join(context.packageDir, 'required-icons.txt'), 'utf8'));
|
|
64
|
+
const problems = [...errors, ...(errors.length > 0 ? [] : missingRequired(icons, required))];
|
|
65
|
+
for (const warning of warnings) {
|
|
66
|
+
io.err(`⚠ ${warning}`);
|
|
67
|
+
}
|
|
68
|
+
if (problems.length > 0) {
|
|
69
|
+
for (const problem of problems) {
|
|
70
|
+
io.err(`✗ ${problem}`);
|
|
71
|
+
}
|
|
72
|
+
io.err(`✗ Nothing was written: ${String(problems.length)} error(s)`);
|
|
73
|
+
return 1;
|
|
74
|
+
}
|
|
75
|
+
const { version } = JSON.parse(readFileSync(join(context.packageDir, 'package.json'), 'utf8'));
|
|
76
|
+
const output = resolve(values.output);
|
|
77
|
+
mkdirSync(output, { recursive: true });
|
|
78
|
+
for (const [name, content] of Object.entries(emitPackage(icons, version))) {
|
|
79
|
+
writeFileSync(join(output, name), content);
|
|
80
|
+
}
|
|
81
|
+
io.out(`✓ Wrote a package of ${String(icons.length)} icons to ${output}`);
|
|
82
|
+
return 0;
|
|
83
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** The rules of an icon's design. The library's build treats every violation as an error. */
|
|
2
|
+
export type Rule = 'view-box' | 'colour' | 'stroke';
|
|
3
|
+
export interface Violation {
|
|
4
|
+
readonly rule: Rule;
|
|
5
|
+
readonly message: string;
|
|
6
|
+
}
|
|
7
|
+
export interface Findings {
|
|
8
|
+
/** What stops every build: an SVG that cannot be read, or anything but plain shapes. */
|
|
9
|
+
readonly errors: readonly string[];
|
|
10
|
+
readonly violations: readonly Violation[];
|
|
11
|
+
}
|
|
12
|
+
export declare const VIEW_BOX = "0 0 24 24";
|
|
13
|
+
/** The errors and rule violations of one icon's SVG; `name` is its file name without `.svg`. */
|
|
14
|
+
export declare function checkIcon(name: string, svg: string): Findings;
|
|
15
|
+
/** The SVG of an icon, ready to be inlined: 1em in size, painted in currentColor, minified. */
|
|
16
|
+
export declare function normalizeIcon(svg: string): string;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the build checks and changes in the SVG of an icon. svgo parses every source; a
|
|
3
|
+
* plugin of our own reads it before anything changes, and the normalization then rewrites it for
|
|
4
|
+
* inline use: sized by the text around it and painted in its colour.
|
|
5
|
+
*/
|
|
6
|
+
import { optimize } from 'svgo';
|
|
7
|
+
export const VIEW_BOX = '0 0 24 24';
|
|
8
|
+
const SHAPES = new Set(['path', 'circle', 'ellipse', 'line', 'polyline', 'polygon', 'rect']);
|
|
9
|
+
/**
|
|
10
|
+
* All an icon may contain: plain shapes, with their geometry and paint. The icon is inserted as
|
|
11
|
+
* markup, so anything else could run code or load content where it is rendered. A list of what is
|
|
12
|
+
* forbidden would always miss something: the HTML parser that inserts the icon reads names in any
|
|
13
|
+
* case and lifts some elements, such as img, out of the SVG. Names are compared exactly, so a name
|
|
14
|
+
* in another case is another name.
|
|
15
|
+
*/
|
|
16
|
+
const ELEMENTS = new Set(['svg', 'g', ...SHAPES]);
|
|
17
|
+
const ATTRIBUTES = new Set([
|
|
18
|
+
...['xmlns', 'viewBox', 'width', 'height', 'transform'],
|
|
19
|
+
...['d', 'x', 'y', 'cx', 'cy', 'r', 'rx', 'ry', 'x1', 'y1', 'x2', 'y2', 'points'],
|
|
20
|
+
...['fill', 'fill-rule', 'clip-rule', 'fill-opacity', 'opacity'],
|
|
21
|
+
...['stroke', 'stroke-width', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit'],
|
|
22
|
+
...['stroke-dasharray', 'stroke-dashoffset', 'stroke-opacity'],
|
|
23
|
+
]);
|
|
24
|
+
/** A colour, or a keyword such as none; a url() or any other function could load content. */
|
|
25
|
+
const PAINT = /^\s*(?:#[\da-f]{3,8}|(?:rgba?|hsla?)\([^()\\'"]*\)|[a-z]+)\s*$/i;
|
|
26
|
+
const PAINT_ATTRIBUTES = new Set(['fill', 'stroke']);
|
|
27
|
+
const NO_PAINT = new Set(['none', 'currentcolor', 'transparent', 'inherit']);
|
|
28
|
+
const OPACITY_ATTRIBUTES = new Set(['opacity', 'fill-opacity', 'stroke-opacity']);
|
|
29
|
+
const NUMBER = String.raw `[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?`;
|
|
30
|
+
const OPACITY = new RegExp(String.raw `^\s*(${NUMBER})(%?)\s*$`, 'i');
|
|
31
|
+
/** An opacity from 0 to 1, such as 0.4 for 0.4 or 40%; undefined when it cannot be read. */
|
|
32
|
+
function opacity(value) {
|
|
33
|
+
const [, number, percent] = OPACITY.exec(value) ?? [];
|
|
34
|
+
return number === undefined ? undefined : Number(number) / (percent === '%' ? 100 : 1);
|
|
35
|
+
}
|
|
36
|
+
/** Collects what the rules need, without changing the tree. */
|
|
37
|
+
function inspectionPlugin(facts) {
|
|
38
|
+
const inherited = [];
|
|
39
|
+
return {
|
|
40
|
+
name: 'inspectIcon',
|
|
41
|
+
fn: () => ({
|
|
42
|
+
element: {
|
|
43
|
+
enter: (node, parentNode) => {
|
|
44
|
+
if (parentNode.type === 'root' && facts.root === null) {
|
|
45
|
+
facts.root = node.name;
|
|
46
|
+
facts.viewBox = node.attributes['viewBox'];
|
|
47
|
+
}
|
|
48
|
+
if (!ELEMENTS.has(node.name)) {
|
|
49
|
+
facts.disallowed.add(`<${node.name}>`);
|
|
50
|
+
}
|
|
51
|
+
for (const [name, value] of Object.entries(node.attributes)) {
|
|
52
|
+
if (!ATTRIBUTES.has(name)) {
|
|
53
|
+
facts.disallowed.add(`the attribute ${name}`);
|
|
54
|
+
}
|
|
55
|
+
else if (PAINT_ATTRIBUTES.has(name)) {
|
|
56
|
+
const paint = value.trim().toLowerCase();
|
|
57
|
+
if (!PAINT.test(value)) {
|
|
58
|
+
facts.disallowed.add(`the ${name} ${value}`);
|
|
59
|
+
}
|
|
60
|
+
else if (!NO_PAINT.has(paint)) {
|
|
61
|
+
facts.colours.add(paint);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else if (OPACITY_ATTRIBUTES.has(name)) {
|
|
65
|
+
const alpha = opacity(value);
|
|
66
|
+
if (alpha === undefined || alpha < 1) {
|
|
67
|
+
facts.transparency.add(`${name} ${value}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const stroke = node.attributes['stroke'] ?? inherited.at(-1);
|
|
72
|
+
inherited.push(stroke);
|
|
73
|
+
if (SHAPES.has(node.name) && stroke !== undefined && stroke !== 'none') {
|
|
74
|
+
facts.stroked = true;
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
exit: () => {
|
|
78
|
+
inherited.pop();
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
}),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function reason(error) {
|
|
85
|
+
return error instanceof Error ? (error.message.split('\n')[0] ?? error.message) : String(error);
|
|
86
|
+
}
|
|
87
|
+
/** The errors and rule violations of one icon's SVG; `name` is its file name without `.svg`. */
|
|
88
|
+
export function checkIcon(name, svg) {
|
|
89
|
+
const facts = {
|
|
90
|
+
root: null,
|
|
91
|
+
viewBox: undefined,
|
|
92
|
+
disallowed: new Set(),
|
|
93
|
+
colours: new Set(),
|
|
94
|
+
transparency: new Set(),
|
|
95
|
+
stroked: false,
|
|
96
|
+
};
|
|
97
|
+
try {
|
|
98
|
+
// convertColors writes every colour one way first, so #174BA0 and rgb(23, 75, 160) are one.
|
|
99
|
+
optimize(svg, {
|
|
100
|
+
plugins: [{ name: 'convertColors', params: { shortname: false } }, inspectionPlugin(facts)],
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
return { errors: [`${name}.svg cannot be read: ${reason(error)}`], violations: [] };
|
|
105
|
+
}
|
|
106
|
+
const errors = [];
|
|
107
|
+
if (facts.root !== 'svg') {
|
|
108
|
+
errors.push(`${name}.svg does not start with an <svg> element`);
|
|
109
|
+
}
|
|
110
|
+
if (facts.disallowed.size > 0) {
|
|
111
|
+
errors.push(`${name}.svg contains ${[...facts.disallowed].join(', ')}; an icon holds only plain shapes painted in colours`);
|
|
112
|
+
}
|
|
113
|
+
if (facts.root !== 'svg') {
|
|
114
|
+
// The design rules say nothing useful about a file that is not an icon at all.
|
|
115
|
+
return { errors, violations: [] };
|
|
116
|
+
}
|
|
117
|
+
const violations = [];
|
|
118
|
+
if (facts.viewBox !== VIEW_BOX) {
|
|
119
|
+
violations.push({
|
|
120
|
+
rule: 'view-box',
|
|
121
|
+
message: `${name}.svg has ${facts.viewBox === undefined ? 'no viewBox' : `the viewBox "${facts.viewBox}"`}; icons are drawn on "${VIEW_BOX}"`,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
if (facts.colours.size > 1) {
|
|
125
|
+
violations.push({
|
|
126
|
+
rule: 'colour',
|
|
127
|
+
message: `${name}.svg paints in ${[...facts.colours].join(', ')}; an icon has one colour, which becomes currentColor`,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
if (facts.transparency.size > 0) {
|
|
131
|
+
violations.push({
|
|
132
|
+
rule: 'colour',
|
|
133
|
+
message: `${name}.svg paints with ${[...facts.transparency].join(', ')}; an icon has one solid colour, which becomes currentColor`,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
if (facts.stroked) {
|
|
137
|
+
violations.push({
|
|
138
|
+
rule: 'stroke',
|
|
139
|
+
message: `${name}.svg draws with strokes; icons are drawn with fills, which is where a component sets their colour`,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
return { errors, violations };
|
|
143
|
+
}
|
|
144
|
+
/** Sizes the icon by the font size around it; a component or an application sets its own size. */
|
|
145
|
+
const sizeToText = {
|
|
146
|
+
name: 'sizeToText',
|
|
147
|
+
fn: () => ({
|
|
148
|
+
element: {
|
|
149
|
+
enter: (node, parentNode) => {
|
|
150
|
+
if (parentNode.type === 'root' && node.name === 'svg') {
|
|
151
|
+
node.attributes['width'] = '1em';
|
|
152
|
+
node.attributes['height'] = '1em';
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
}),
|
|
157
|
+
};
|
|
158
|
+
const NORMALIZATION = {
|
|
159
|
+
plugins: [
|
|
160
|
+
{
|
|
161
|
+
name: 'preset-default',
|
|
162
|
+
params: { overrides: { convertColors: { currentColor: true } } },
|
|
163
|
+
},
|
|
164
|
+
sizeToText,
|
|
165
|
+
],
|
|
166
|
+
};
|
|
167
|
+
/** The SVG of an icon, ready to be inlined: 1em in size, painted in currentColor, minified. */
|
|
168
|
+
export function normalizeIcon(svg) {
|
|
169
|
+
return optimize(svg, NORMALIZATION).data;
|
|
170
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/** The `alert` icon of [Core] Icons. */
|
|
2
|
+
export declare const iconAlert: string;
|
|
3
|
+
/** The `calendar` icon of [Core] Icons. */
|
|
4
|
+
export declare const iconCalendar: string;
|
|
5
|
+
/** The `cart` icon of [Core] Icons. */
|
|
6
|
+
export declare const iconCart: string;
|
|
7
|
+
/** The `check` icon of [Core] Icons. */
|
|
8
|
+
export declare const iconCheck: string;
|
|
9
|
+
/** The `checkmark` icon of [Core] Icons. */
|
|
10
|
+
export declare const iconCheckmark: string;
|
|
11
|
+
/** The `chevron-down` icon of [Core] Icons. */
|
|
12
|
+
export declare const iconChevronDown: string;
|
|
13
|
+
/** The `chevron-left` icon of [Core] Icons. */
|
|
14
|
+
export declare const iconChevronLeft: string;
|
|
15
|
+
/** The `chevron-right` icon of [Core] Icons. */
|
|
16
|
+
export declare const iconChevronRight: string;
|
|
17
|
+
/** The `chevron-up` icon of [Core] Icons. */
|
|
18
|
+
export declare const iconChevronUp: string;
|
|
19
|
+
/** The `clock` icon of [Core] Icons. */
|
|
20
|
+
export declare const iconClock: string;
|
|
21
|
+
/** The `close` icon of [Core] Icons. */
|
|
22
|
+
export declare const iconClose: string;
|
|
23
|
+
/** The `contact` icon of [Core] Icons. */
|
|
24
|
+
export declare const iconContact: string;
|
|
25
|
+
/** The `danger` icon of [Core] Icons. */
|
|
26
|
+
export declare const iconDanger: string;
|
|
27
|
+
/** The `delete` icon of [Core] Icons. */
|
|
28
|
+
export declare const iconDelete: string;
|
|
29
|
+
/** The `eye` icon of [Core] Icons. */
|
|
30
|
+
export declare const iconEye: string;
|
|
31
|
+
/** The `eye-slash` icon of [Core] Icons. */
|
|
32
|
+
export declare const iconEyeSlash: string;
|
|
33
|
+
/** The `file` icon of [Core] Icons. */
|
|
34
|
+
export declare const iconFile: string;
|
|
35
|
+
/** The `filters` icon of [Core] Icons. */
|
|
36
|
+
export declare const iconFilters: string;
|
|
37
|
+
/** The `flag` icon of [Core] Icons. */
|
|
38
|
+
export declare const iconFlag: string;
|
|
39
|
+
/** The `heart` icon of [Core] Icons. */
|
|
40
|
+
export declare const iconHeart: string;
|
|
41
|
+
/** The `home` icon of [Core] Icons. */
|
|
42
|
+
export declare const iconHome: string;
|
|
43
|
+
/** The `info` icon of [Core] Icons. */
|
|
44
|
+
export declare const iconInfo: string;
|
|
45
|
+
/** The `menu` icon of [Core] Icons. */
|
|
46
|
+
export declare const iconMenu: string;
|
|
47
|
+
/** The `minus` icon of [Core] Icons. */
|
|
48
|
+
export declare const iconMinus: string;
|
|
49
|
+
/** The `plus` icon of [Core] Icons. */
|
|
50
|
+
export declare const iconPlus: string;
|
|
51
|
+
/** The `refresh` icon of [Core] Icons. */
|
|
52
|
+
export declare const iconRefresh: string;
|
|
53
|
+
/** The `search` icon of [Core] Icons. */
|
|
54
|
+
export declare const iconSearch: string;
|
|
55
|
+
/** The `settings` icon of [Core] Icons. */
|
|
56
|
+
export declare const iconSettings: string;
|
|
57
|
+
/** The `share` icon of [Core] Icons. */
|
|
58
|
+
export declare const iconShare: string;
|
|
59
|
+
/** The `shopping-bag` icon of [Core] Icons. */
|
|
60
|
+
export declare const iconShoppingBag: string;
|
|
61
|
+
/** The `star` icon of [Core] Icons. */
|
|
62
|
+
export declare const iconStar: string;
|
|
63
|
+
/** The `swap` icon of [Core] Icons. */
|
|
64
|
+
export declare const iconSwap: string;
|
|
65
|
+
/** The `ticket` icon of [Core] Icons. */
|
|
66
|
+
export declare const iconTicket: string;
|
|
67
|
+
/** The `upload` icon of [Core] Icons. */
|
|
68
|
+
export declare const iconUpload: string;
|
|
69
|
+
/** The `user` icon of [Core] Icons. */
|
|
70
|
+
export declare const iconUser: string;
|
|
71
|
+
/** The `users` icon of [Core] Icons. */
|
|
72
|
+
export declare const iconUsers: string;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Generated by scripts/generate.ts from the SVG files in figma/. Do not edit.
|
|
2
|
+
/** The `alert` icon of [Core] Icons. */
|
|
3
|
+
export const iconAlert = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M13.375 20.419a.75.75 0 0 1 1.25.83c-.6.903-1.63 1.5-2.799 1.5a3.36 3.36 0 0 1-2.799-1.5.75.75 0 0 1 1.25-.83c.334.503.903.83 1.55.83.645 0 1.214-.328 1.548-.83M3.25 14.885c0-.76.209-1.473.572-2.082.31-.518.59-.933.822-1.397.22-.443.345-.84.345-1.226V8.087c0-.932.187-1.823.527-2.635a.75.75 0 0 1 1.383.58 5.3 5.3 0 0 0-.41 2.055v2.093c0 .712-.23 1.348-.504 1.896-.264.53-.62 1.068-.875 1.495-.228.384-.36.832-.36 1.314 0 1.246.886 2.29 2.086 2.456 1.57.217 3.498.43 4.99.43s3.42-.213 4.99-.43c1.2-.167 2.086-1.21 2.086-2.456 0-.482-.131-.93-.36-1.314-.255-.427-.61-.966-.875-1.495-.274-.549-.504-1.184-.504-1.896V8.087a5.337 5.337 0 0 0-8.268-4.461.75.75 0 0 1-.826-1.252 6.837 6.837 0 0 1 10.594 5.713v2.093c0 .387.124.783.346 1.226.231.464.512.879.821 1.397.364.61.572 1.322.572 2.082 0 1.96-1.404 3.667-3.38 3.941-1.582.22-3.595.445-5.196.445s-3.613-.225-5.196-.445c-1.976-.274-3.38-1.982-3.38-3.941\"/></svg>";
|
|
4
|
+
/** The `calendar` icon of [Core] Icons. */
|
|
5
|
+
export const iconCalendar = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M7.5 15.75a.75.75 0 0 1 0 1.5h-1a.75.75 0 0 1 0-1.5zm5 0a.75.75 0 0 1 0 1.5h-1a.75.75 0 0 1 0-1.5zm5 0a.75.75 0 0 1 0 1.5h-1a.75.75 0 0 1 0-1.5zm-10-4a.75.75 0 0 1 0 1.5h-1a.75.75 0 0 1 0-1.5zm5 0a.75.75 0 0 1 0 1.5h-1a.75.75 0 0 1 0-1.5zm5 0a.75.75 0 0 1 0 1.5h-1a.75.75 0 0 1 0-1.5zM15.75 5v-.75h-7.5V5a.75.75 0 0 1-1.5 0V2a.75.75 0 0 1 1.5 0v.75h7.5V2a.75.75 0 0 1 1.5 0v.888a5.75 5.75 0 0 1 4.5 5.612v8A5.75 5.75 0 0 1 16 22.25H8a5.75 5.75 0 0 1-5.75-5.75v-8c0-1.491.569-2.852 1.5-3.873a.75.75 0 0 1 1.108 1.01A4.23 4.23 0 0 0 3.75 8.5v8A4.25 4.25 0 0 0 8 20.75h8a4.25 4.25 0 0 0 4.25-4.25V9.25H6a.75.75 0 0 1 0-1.5h14.183a4.26 4.26 0 0 0-2.933-3.313V5a.75.75 0 0 1-1.5 0\"/></svg>";
|
|
6
|
+
/** The `cart` icon of [Core] Icons. */
|
|
7
|
+
export const iconCart = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M6.25 20.75a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0m9 0a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0M1.265 2.852a.75.75 0 0 1 .882-.587l1.05.21a2.75 2.75 0 0 1 2.197 2.422l.15 1.513.99 8.24a1.25 1.25 0 0 0 1.24 1.1h8.994a2.75 2.75 0 0 0 2.668-2.083l1.122-4.491a1.55 1.55 0 0 0-1.503-1.926H8.5a.75.75 0 1 1 0-1.5h10.555a3.05 3.05 0 0 1 2.958 3.79l-1.122 4.491a4.25 4.25 0 0 1-4.123 3.219H7.774a2.75 2.75 0 0 1-2.73-2.422L4.056 6.59l-.002-.016L3.9 5.047a1.25 1.25 0 0 0-.999-1.102l-1.05-.21a.75.75 0 0 1-.587-.883M13 12.75a.75.75 0 0 1 0 1.5H9v-1.5z\"/></svg>";
|
|
8
|
+
/** The `check` icon of [Core] Icons. */
|
|
9
|
+
export const iconCheck = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M21.25 12a9.25 9.25 0 1 0-16.942 5.139.75.75 0 0 1-1.247.834A10.7 10.7 0 0 1 1.25 12C1.25 6.063 6.063 1.25 12 1.25S22.75 6.063 22.75 12 17.937 22.75 12 22.75c-2.143 0-4.142-.628-5.82-1.71a.75.75 0 0 1 .814-1.26A9.25 9.25 0 0 0 21.25 12m-5.364-2.946a.75.75 0 1 1 1.06 1.06L11.53 15.53a.75.75 0 0 1-1.06 0l-2.708-2.708a.75.75 0 1 1 1.06-1.06L11 13.94z\"/></svg>";
|
|
10
|
+
/** The `checkmark` icon of [Core] Icons. */
|
|
11
|
+
export const iconCheckmark = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M19.47 5.97a.75.75 0 1 1 1.06 1.06l-11 11a.75.75 0 0 1-1.06 0l-5-5a.75.75 0 1 1 1.06-1.06L9 16.44z\"/></svg>";
|
|
12
|
+
/** The `chevron-down` icon of [Core] Icons. */
|
|
13
|
+
export const iconChevronDown = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M4.43 8.512a.75.75 0 0 1 1.058-.081l7 6a.75.75 0 0 1-.976 1.138l-7-6a.75.75 0 0 1-.081-1.057m14.082-.081a.75.75 0 0 1 .976 1.138l-4.375 3.75a.75.75 0 0 1-.976-1.138z\"/></svg>";
|
|
14
|
+
/** The `chevron-left` icon of [Core] Icons. */
|
|
15
|
+
export const iconChevronLeft = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M8.43 11.512a.75.75 0 0 0 1.14.976l6-7a.75.75 0 0 0-1.14-.976zm2.332 2.544a.75.75 0 0 0-.081 1.057l3.75 4.375a.75.75 0 0 0 1.138-.976l-3.75-4.375a.75.75 0 0 0-1.057-.081\"/></svg>";
|
|
16
|
+
/** The `chevron-right` icon of [Core] Icons. */
|
|
17
|
+
export const iconChevronRight = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M15.57 11.512a.75.75 0 0 1-1.14.976l-6-7a.75.75 0 0 1 1.14-.976zm-2.332 2.544a.75.75 0 0 1 .081 1.057l-3.75 4.375a.75.75 0 0 1-1.138-.976l3.75-4.375a.75.75 0 0 1 1.057-.081\"/></svg>";
|
|
18
|
+
/** The `chevron-up` icon of [Core] Icons. */
|
|
19
|
+
export const iconChevronUp = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M11.512 8.43a.75.75 0 0 1 .976 1.14l-7 6a.75.75 0 0 1-.976-1.14zm2.544 2.332a.75.75 0 0 1 1.057-.081l4.375 3.75a.75.75 0 0 1-.976 1.138l-4.375-3.75a.75.75 0 0 1-.081-1.057\"/></svg>";
|
|
20
|
+
/** The `clock` icon of [Core] Icons. */
|
|
21
|
+
export const iconClock = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M12 1.25c5.937 0 10.75 4.813 10.75 10.75S17.937 22.75 12 22.75 1.25 17.937 1.25 12 6.063 1.25 12 1.25m0 1.5A9.25 9.25 0 0 0 2.75 12 9.25 9.25 0 0 0 12 21.25 9.25 9.25 0 0 0 21.25 12 9.25 9.25 0 0 0 12 2.75m-.75 3.75a.75.75 0 0 1 1.5 0v5.189l3.03 3.031a.749.749 0 1 1-1.06 1.06l-3.25-3.25a.75.75 0 0 1-.22-.53z\" clip-rule=\"evenodd\"/></svg>";
|
|
22
|
+
/** The `close` icon of [Core] Icons. */
|
|
23
|
+
export const iconClose = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M9.22 13.72a.75.75 0 1 1 1.06 1.06l-3.75 3.75a.75.75 0 1 1-1.06-1.06zM5.47 5.47a.75.75 0 0 1 1.06 0l12 12a.75.75 0 1 1-1.06 1.06l-12-12a.75.75 0 0 1 0-1.06m12 0a.75.75 0 1 1 1.06 1.06l-3.75 3.75a.75.75 0 1 1-1.06-1.06z\"/></svg>";
|
|
24
|
+
/** The `contact` icon of [Core] Icons. */
|
|
25
|
+
export const iconContact = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M1.25 15v-1a.75.75 0 0 1 1.5 0v1A4.25 4.25 0 0 0 7 19.25h10A4.25 4.25 0 0 0 21.25 15V9A4.25 4.25 0 0 0 17 4.75H7A4.25 4.25 0 0 0 2.75 9v1a.75.75 0 0 1-1.5 0V9A5.75 5.75 0 0 1 7 3.25h10A5.75 5.75 0 0 1 22.75 9v6A5.75 5.75 0 0 1 17 20.75H7A5.75 5.75 0 0 1 1.25 15m16.3-6.6a.75.75 0 0 1 .9 1.2l-4.8 3.6a2.75 2.75 0 0 1-3.3 0l-4.8-3.6a.75.75 0 0 1 .9-1.2l4.8 3.6a1.25 1.25 0 0 0 1.5 0z\"/></svg>";
|
|
26
|
+
/** The `danger` icon of [Core] Icons. */
|
|
27
|
+
export const iconDanger = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M1.25 17.85c0-.735.187-1.458.544-2.1l4.238-7.628a.75.75 0 1 1 1.31.729l-4.237 7.627a2.824 2.824 0 0 0 2.47 4.196h12.85a2.824 2.824 0 0 0 2.47-4.195L14.709 5.344a3.1 3.1 0 0 0-5.418 0l-.073.132a.75.75 0 1 1-1.31-.729l.072-.132a4.599 4.599 0 0 1 8.04 0l6.186 11.135a4.325 4.325 0 0 1-3.78 6.424H5.574A4.324 4.324 0 0 1 1.25 17.85m10-1.426v-.5a.75.75 0 0 1 1.5 0v.5a.75.75 0 0 1-1.5 0m0-3.5v-4a.75.75 0 0 1 1.5 0v4a.75.75 0 0 1-1.5 0\"/></svg>";
|
|
28
|
+
/** The `delete` icon of [Core] Icons. */
|
|
29
|
+
export const iconDelete = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M5.544 18v-1a.75.75 0 0 1 1.5 0v1a3.25 3.25 0 0 0 3.25 3.25h4a3.25 3.25 0 0 0 3.25-3.25v-6.418c0-1.19.386-2.346 1.1-3.298a.959.959 0 0 0-.767-1.534H6.712a.959.959 0 0 0-.767 1.534 5.5 5.5 0 0 1 1.099 3.298V13a.75.75 0 0 1-1.5 0v-1.418c0-.865-.28-1.706-.799-2.397C3.53 7.564 4.685 5.25 6.712 5.25h11.165c2.026 0 3.182 2.314 1.967 3.935a4 4 0 0 0-.8 2.397V18a4.75 4.75 0 0 1-4.75 4.75h-4A4.75 4.75 0 0 1 5.544 18m4-1v-6a.75.75 0 0 1 1.5 0v6a.75.75 0 1 1-1.5 0m4 0v-6a.75.75 0 0 1 1.5 0v6a.75.75 0 0 1-1.5 0m.308-14.75c.54 0 1.052.157 1.484.434a.75.75 0 0 1-.81 1.263 1.25 1.25 0 0 0-.674-.197h-3.117c-.245 0-.477.071-.673.197a.75.75 0 0 1-.81-1.263 2.75 2.75 0 0 1 1.483-.434z\"/></svg>";
|
|
30
|
+
/** The `eye` icon of [Core] Icons. */
|
|
31
|
+
export const iconEye = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M12 5.25c4.081 0 7.631 2.267 9.457 5.605.39.714.39 1.576 0 2.29A10.77 10.77 0 0 1 12 18.75a10.77 10.77 0 0 1-9.457-5.605 2.38 2.38 0 0 1 0-2.29A10.77 10.77 0 0 1 12 5.25m0 1.5a9.27 9.27 0 0 0-8.142 4.825.89.89 0 0 0 0 .85A9.27 9.27 0 0 0 12 17.25a9.27 9.27 0 0 0 8.142-4.825.89.89 0 0 0 0-.85A9.27 9.27 0 0 0 12 6.75M8.25 12a.75.75 0 0 1 1.5 0A2.25 2.25 0 1 0 12 9.75a.75.75 0 0 1 0-1.5A3.75 3.75 0 1 1 8.25 12\"/></svg>";
|
|
32
|
+
/** The `eye-slash` icon of [Core] Icons. */
|
|
33
|
+
export const iconEyeSlash = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M18.935 4.47a.75.75 0 0 1 1.06 1.06l-15 15-1.06-1.06 2.032-2.033q-.534-.36-1.019-.777a10.8 10.8 0 0 1-2.405-2.98 2.38 2.38 0 0 1 0-2.288A10.77 10.77 0 0 1 12 5.786a10.8 10.8 0 0 1 4.594 1.024zm-.472 4.388a.75.75 0 0 1 1.06-.013 10.8 10.8 0 0 1 1.934 2.547c.39.713.39 1.574 0 2.288A10.77 10.77 0 0 1 12 19.286c-.927 0-1.827-.117-2.687-.338a.75.75 0 0 1 .374-1.453c.738.19 1.513.291 2.313.291a9.27 9.27 0 0 0 8.142-4.826.89.89 0 0 0 0-.849 9.3 9.3 0 0 0-1.665-2.192.75.75 0 0 1-.014-1.06M12 7.286a9.27 9.27 0 0 0-8.142 4.825.88.88 0 0 0 0 .849 9.3 9.3 0 0 0 2.048 2.545l1.17.823 8.378-8.379A9.2 9.2 0 0 0 12 7.286m-3.75 5.25A3.75 3.75 0 0 1 12 8.786a.75.75 0 0 1 0 1.5 2.25 2.25 0 0 0-2.25 2.25.75.75 0 0 1-1.5 0\"/></svg>";
|
|
34
|
+
/** The `file` icon of [Core] Icons. */
|
|
35
|
+
export const iconFile = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M14.25 6V2.766a1 1 0 0 0-.187-.016H8A3.25 3.25 0 0 0 4.75 6v4a.75.75 0 0 1-1.5 0V6A4.75 4.75 0 0 1 8 1.25h6.063c.816 0 1.59.362 2.113.99l3.936 4.724a2.75 2.75 0 0 1 .638 1.76V18A4.75 4.75 0 0 1 16 22.75H8A4.75 4.75 0 0 1 3.25 18v-3a.75.75 0 0 1 1.5 0v3A3.25 3.25 0 0 0 8 21.25h8A3.25 3.25 0 0 0 19.25 18V8.724a1.25 1.25 0 0 0-.29-.8L15.75 4.07V6A1.244 1.244 0 0 0 17 7.25a.75.75 0 0 1 0 1.5 2.74 2.74 0 0 1-1.941-.803A2.74 2.74 0 0 1 14.25 6\"/></svg>";
|
|
36
|
+
/** The `filters` icon of [Core] Icons. */
|
|
37
|
+
export const iconFilters = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M16.25 17a.75.75 0 0 1 1.5 0A1.25 1.25 0 1 0 19 15.75a.75.75 0 0 1 0-1.5A2.75 2.75 0 1 1 16.25 17M13 16.25v1.5H3a.75.75 0 0 1 0-1.5zM2.25 7A2.75 2.75 0 0 1 5 4.25a.75.75 0 0 1 0 1.5A1.25 1.25 0 1 0 6.25 7a.75.75 0 0 1 1.5 0 2.75 2.75 0 0 1-5.5 0M21 6.25a.75.75 0 0 1 0 1.5H11v-1.5z\"/></svg>";
|
|
38
|
+
/** The `flag` icon of [Core] Icons. */
|
|
39
|
+
export const iconFlag = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M18.036 3.25c1.43 0 2.256 1.623 1.415 2.78l-1.99 2.735a1.25 1.25 0 0 0 0 1.47l1.99 2.736c.841 1.156.015 2.779-1.415 2.779H13A1.75 1.75 0 0 1 11.25 14V3.5a.75.75 0 0 0-.75-.75h-5a.75.75 0 0 0-.75.75v8.75H8a.75.75 0 0 1 0 1.5H4.75V22a.75.75 0 0 1-1.5 0V3.5A2.25 2.25 0 0 1 5.5 1.25h5a2.25 2.25 0 0 1 2.25 2.25V14c0 .138.112.25.25.25h5.036a.25.25 0 0 0 .202-.398l-1.989-2.735a2.75 2.75 0 0 1 0-3.234l1.99-2.736a.25.25 0 0 0-.203-.397H16a.75.75 0 0 1 0-1.5z\"/></svg>";
|
|
40
|
+
/** The `heart` icon of [Core] Icons. */
|
|
41
|
+
export const iconHeart = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M15.636 2.288a6.2 6.2 0 0 1 1.374 0 .75.75 0 0 1-.167 1.491 4.68 4.68 0 0 0-2.734.528c-.45.24-.876.56-1.257.962a1.175 1.175 0 0 1-1.704 0c-1.922-2.025-5.02-2.025-6.941 0-1.942 2.047-1.942 5.381 0 7.428l6.161 6.493a2.25 2.25 0 0 0 3.264 0l6.161-6.493c1.942-2.047 1.942-5.381 0-7.428a.75.75 0 0 1 1.088-1.033c2.491 2.626 2.491 6.868 0 9.494l-6.16 6.493a3.75 3.75 0 0 1-5.442 0L3.12 13.73c-2.491-2.626-2.491-6.868 0-9.494C5.555 1.67 9.473 1.591 12 4.001c.43-.41.902-.75 1.402-1.018a6.2 6.2 0 0 1 2.234-.695\"/></svg>";
|
|
42
|
+
/** The `home` icon of [Core] Icons. */
|
|
43
|
+
export const iconHome = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M2.25 18v-6.562A4.75 4.75 0 0 1 4.057 7.71l1.447-1.143a.75.75 0 0 1 .93 1.178L4.986 8.888a3.25 3.25 0 0 0-1.236 2.55V18A3.25 3.25 0 0 0 7 21.25h1.5a.25.25 0 0 0 .25-.25v-3a2.75 2.75 0 0 1 2.75-2.75h1a.75.75 0 0 1 0 1.5h-1c-.69 0-1.25.56-1.25 1.25v3a1.75 1.75 0 0 1-1.75 1.75H7A4.75 4.75 0 0 1 2.25 18m19 0v-6.562a3.25 3.25 0 0 0-1.236-2.55L14.41 4.464a3.08 3.08 0 0 0-3.82 0l-.594.469a.75.75 0 0 1-.93-1.178l.594-.469a4.58 4.58 0 0 1 5.68 0l5.603 4.424a4.75 4.75 0 0 1 1.807 3.728V18A4.75 4.75 0 0 1 18 22.75h-1.5A1.75 1.75 0 0 1 14.75 21v-2a.75.75 0 0 1 1.5 0v2c0 .138.112.25.25.25H18A3.25 3.25 0 0 0 21.25 18\"/></svg>";
|
|
44
|
+
/** The `info` icon of [Core] Icons. */
|
|
45
|
+
export const iconInfo = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M21.25 12a9.25 9.25 0 1 0-16.942 5.139.75.75 0 0 1-1.247.834A10.7 10.7 0 0 1 1.25 12C1.25 6.063 6.063 1.25 12 1.25S22.75 6.063 22.75 12 17.937 22.75 12 22.75c-2.143 0-4.142-.628-5.82-1.71a.75.75 0 0 1 .814-1.26A9.25 9.25 0 0 0 21.25 12m-9.5 5v-5.25H10.5a.75.75 0 0 1 0-1.5h2a.75.75 0 0 1 .75.75v6a.75.75 0 0 1-1.5 0m0-9V7a.75.75 0 0 1 1.5 0v1a.75.75 0 0 1-1.5 0\"/></svg>";
|
|
46
|
+
/** The `menu` icon of [Core] Icons. */
|
|
47
|
+
export const iconMenu = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M20 17.25a.75.75 0 0 1 0 1.5H4a.75.75 0 0 1 0-1.5zm-14-6a.75.75 0 0 1 0 1.5H4a.75.75 0 0 1 0-1.5zm14 0a.75.75 0 0 1 0 1.5H10a.75.75 0 0 1 0-1.5zm0-6a.75.75 0 0 1 0 1.5H4a.75.75 0 0 1 0-1.5z\"/></svg>";
|
|
48
|
+
/** The `minus` icon of [Core] Icons. */
|
|
49
|
+
export const iconMinus = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M21 11.25a.75.75 0 0 1 0 1.5H3a.75.75 0 0 1 0-1.5z\"/></svg>";
|
|
50
|
+
/** The `plus` icon of [Core] Icons. */
|
|
51
|
+
export const iconPlus = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M11.25 21v-8.25H3a.75.75 0 0 1 0-1.5h8.25V3a.75.75 0 0 1 1.5 0v8.25H21a.75.75 0 0 1 0 1.5h-8.25V21a.75.75 0 0 1-1.5 0\"/></svg>";
|
|
52
|
+
/** The `refresh` icon of [Core] Icons. */
|
|
53
|
+
export const iconRefresh = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M4.155 14.568a.75.75 0 0 1 .99.381 7.25 7.25 0 0 0 11.608 2.316.75.75 0 1 1 1.031 1.09 8.752 8.752 0 0 1-14.01-2.796.75.75 0 0 1 .381-.99m14.284-.723a1.75 1.75 0 0 1 2.1 1.311l.729 3.16a.75.75 0 0 1-1.462.337l-.73-3.159a.25.25 0 0 0-.3-.187l-3.159.73a.75.75 0 0 1-.338-1.463zM2.83 4.785a.75.75 0 0 1 .9.562l.729 3.159a.25.25 0 0 0 .3.187l3.16-.73a.75.75 0 0 1 .337 1.463l-3.16.73A1.75 1.75 0 0 1 3 8.843l-.73-3.16a.75.75 0 0 1 .562-.9m4.762-.474a8.75 8.75 0 0 1 9.132.478 8.75 8.75 0 0 1 3.037 3.652.75.75 0 1 1-1.37.61A7.25 7.25 0 0 0 6.654 6.86a.751.751 0 0 1-1.058-1.063A8.8 8.8 0 0 1 7.593 4.31\"/></svg>";
|
|
54
|
+
/** The `search` icon of [Core] Icons. */
|
|
55
|
+
export const iconSearch = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M8.639 2.575a8.75 8.75 0 0 1 10.655 11.213.75.75 0 0 1-1.422-.478 7.25 7.25 0 1 0-1.953 3.016.75.75 0 0 1 1.06.042l.04.049.011.01 5 5a.75.75 0 1 1-1.06 1.061l-4.59-4.59A8.749 8.749 0 1 1 8.639 2.575\"/></svg>";
|
|
56
|
+
/** The `settings` icon of [Core] Icons. */
|
|
57
|
+
export const iconSettings = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M19.733 12c0-1.166.534-2.209 1.368-2.896a.4.4 0 0 0 .11-.14l.006-.022a9.2 9.2 0 0 0-1.702-2.953l-.018-.006a.35.35 0 0 0-.153.006c-.38.09-.775.12-1.17.088a.75.75 0 1 1 .124-1.495c.236.02.473.001.702-.053.465-.11 1.101-.067 1.56.384l.09.096.314.384a10.7 10.7 0 0 1 1.672 3.063c.265.762-.146 1.448-.581 1.807A2.24 2.24 0 0 0 21.233 12c0 .7.32 1.323.822 1.737.435.359.846 1.045.58 1.807a10.7 10.7 0 0 1-1.985 3.447c-.463.54-1.154.596-1.65.479a2.24 2.24 0 0 0-1.64.242 2.24 2.24 0 0 0-1.068 1.442c-.115.496-.472 1.093-1.163 1.268-.847.214-1.734.328-2.646.328s-1.797-.114-2.644-.328c-.691-.175-1.048-.772-1.163-1.268a2.3 2.3 0 0 0-.18-.5.75.75 0 0 1 1.342-.67q.199.399.3.831a.4.4 0 0 0 .062.141l.013.013a9.3 9.3 0 0 0 4.54 0l.015-.013a.4.4 0 0 0 .062-.14 3.74 3.74 0 0 1 1.78-2.403 3.74 3.74 0 0 1 2.734-.403.4.4 0 0 0 .153.007q.015-.006.019-.008a9.2 9.2 0 0 0 1.7-2.952q0-.005-.005-.02a.4.4 0 0 0-.11-.142A3.75 3.75 0 0 1 19.733 12m-16 0c0-.7-.318-1.323-.82-1.737-.435-.359-.847-1.045-.581-1.807l.178-.474A10.8 10.8 0 0 1 4.317 5.01l.09-.096c.46-.45 1.096-.493 1.56-.384a2.24 2.24 0 0 0 1.641-.24 2.24 2.24 0 0 0 1.068-1.443c.115-.496.472-1.093 1.163-1.268a10.8 10.8 0 0 1 2.644-.328c.912 0 1.799.114 2.646.328.69.175 1.048.772 1.163 1.268q.068.293.209.558a.75.75 0 1 1-1.322.708 3.8 3.8 0 0 1-.349-.927.4.4 0 0 0-.062-.141l-.014-.014a9.3 9.3 0 0 0-2.27-.28 9.3 9.3 0 0 0-2.271.28c.006-.003.002-.003-.013.014a.4.4 0 0 0-.062.14 3.74 3.74 0 0 1-1.78 2.403 3.74 3.74 0 0 1-2.734.402.35.35 0 0 0-.153-.006c-.022.005-.024.01-.019.006A9.2 9.2 0 0 0 3.75 8.942c0-.006-.003-.002.007.022.014.036.05.09.11.14A3.74 3.74 0 0 1 5.233 12a3.74 3.74 0 0 1-1.366 2.896.4.4 0 0 0-.11.14c-.01.025-.006.029-.007.02a9.2 9.2 0 0 0 1.701 2.953c-.003-.002 0 .003.02.008a.4.4 0 0 0 .152-.007c.424-.1.866-.127 1.306-.075a.75.75 0 0 1-.178 1.49 2.3 2.3 0 0 0-.783.045c-.496.117-1.188.062-1.65-.479a10.7 10.7 0 0 1-1.986-3.447c-.266-.762.146-1.448.581-1.807.502-.414.82-1.038.82-1.737m11 0a2.25 2.25 0 1 0-4.5 0 2.25 2.25 0 0 0 4.5 0m1.5 0a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0\"/></svg>";
|
|
58
|
+
/** The `share` icon of [Core] Icons. */
|
|
59
|
+
export const iconShare = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M14.25 19.5c0-.343.053-.674.151-.984L7.26 14.23c-.508.327-1.111.519-1.76.519a.75.75 0 0 1 0-1.5 1.75 1.75 0 1 0-1.75-1.75.75.75 0 0 1-1.5 0 3.25 3.25 0 0 1 5.577-2.266L14.4 5.48a3.3 3.3 0 0 1-.15-.979.75.75 0 0 1 1.5 0 1.75 1.75 0 1 0 1.75-1.75.75.75 0 0 1 0-1.5 3.25 3.25 0 1 1-2.328 5.515L8.599 10.52a3.25 3.25 0 0 1-.28 2.595l6.857 4.115a3.24 3.24 0 0 1 2.324-.981.75.75 0 0 1 0 1.5 1.75 1.75 0 1 0 1.75 1.75.75.75 0 0 1 1.5 0 3.25 3.25 0 0 1-6.5 0\"/></svg>";
|
|
60
|
+
/** The `shopping-bag` icon of [Core] Icons. */
|
|
61
|
+
export const iconShoppingBag = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M15.682 9V6a3.25 3.25 0 1 0-6.5 0v.25h3.25a.75.75 0 0 1 0 1.5h-3.25V9a.75.75 0 1 1-1.5 0v-.997a3.25 3.25 0 0 0-1.97 2.567l-.286 2.155a.75.75 0 0 1-1.488-.2l.288-2.153a4.75 4.75 0 0 1 3.456-3.955V6a4.75 4.75 0 0 1 9.5 0v.417a4.75 4.75 0 0 1 3.456 3.953l.933 7.002a4.75 4.75 0 0 1-4.708 5.378H8.001a4.75 4.75 0 0 1-4.709-5.378l.146-1.097a.75.75 0 0 1 1.488.2l-.147 1.095a3.25 3.25 0 0 0 3.222 3.68h8.862a3.25 3.25 0 0 0 3.222-3.68l-.934-7.002a3.25 3.25 0 0 0-1.97-2.565V9a.75.75 0 0 1-1.5 0\"/></svg>";
|
|
62
|
+
/** The `star` icon of [Core] Icons. */
|
|
63
|
+
export const iconStar = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M15.243 6.622a.75.75 0 0 1 1.03.256l.19.316a.45.45 0 0 0 .284.206l4.402 1.02c1.432.332 1.997 2.069 1.034 3.179l-2.963 3.413a.45.45 0 0 0-.109.333l.391 4.503c.127 1.464-1.35 2.537-2.703 1.963l-4.162-1.762a.45.45 0 0 0-.35 0l-4.382 1.856a1.807 1.807 0 0 1-2.505-1.82l.038-.437a.75.75 0 0 1 1.495.13l-.038.437c-.02.23.213.398.425.308l4.381-1.855a1.95 1.95 0 0 1 1.522 0l4.16 1.763a.45.45 0 0 0 .625-.454l-.39-4.502a1.95 1.95 0 0 1 .469-1.447l2.963-3.413a.45.45 0 0 0-.239-.733l-4.403-1.02a1.95 1.95 0 0 1-1.23-.894l-.19-.317a.75.75 0 0 1 .255-1.029M10.79 3.324c.758-1.26 2.586-1.259 3.343.002l.473.788a.75.75 0 1 1-1.287.772l-.472-.787a.45.45 0 0 0-.772-.001l-2.328 3.87a1.95 1.95 0 0 1-1.231.894L4.11 9.882a.45.45 0 0 0-.238.733l2.963 3.413c.346.399.516.92.47 1.447l-.108 1.243a.75.75 0 0 1-1.494-.13l.108-1.243a.45.45 0 0 0-.109-.333l-2.962-3.413c-.963-1.11-.4-2.847 1.032-3.18L8.177 7.4a.45.45 0 0 0 .283-.206z\"/></svg>";
|
|
64
|
+
/** The `swap` icon of [Core] Icons. */
|
|
65
|
+
export const iconSwap = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M7.056 13.47a.75.75 0 1 1 1.06 1.06l-2.293 2.293a.25.25 0 0 0 0 .354l2.293 2.293a.75.75 0 0 1-1.06 1.06l-2.293-2.293a1.75 1.75 0 0 1 0-2.474zm10.53 2.78a.75.75 0 0 1 0 1.5h-9a.75.75 0 0 1 0-1.5zm-1.53-11.78a.75.75 0 0 1 1.06 0l2.293 2.293a1.75 1.75 0 0 1 0 2.474l-2.293 2.293a.75.75 0 1 1-1.06-1.06l2.293-2.293a.25.25 0 0 0 0-.354L16.056 5.53a.75.75 0 0 1 0-1.06m-.47 2.78a.75.75 0 0 1 0 1.5h-9a.75.75 0 0 1 0-1.5z\"/></svg>";
|
|
66
|
+
/** The `ticket` icon of [Core] Icons. */
|
|
67
|
+
export const iconTicket = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M14.25 13.5v-3a.75.75 0 0 1 1.5 0v3a.75.75 0 0 1-1.5 0m0-6.5V4.75H11a.75.75 0 0 1 0-1.5h7A4.75 4.75 0 0 1 22.75 8v1.223c0 .565-.394.974-.82 1.122a1.752 1.752 0 0 0 0 3.31c.426.148.82.557.82 1.122V16A4.75 4.75 0 0 1 18 20.75H6A4.75 4.75 0 0 1 1.25 16v-1.223c0-.565.394-.974.82-1.122l.127-.05a1.75 1.75 0 0 0-.127-3.26c-.426-.148-.82-.557-.82-1.122V8A4.75 4.75 0 0 1 6 3.25h1.5a.75.75 0 0 1 0 1.5H6A3.25 3.25 0 0 0 2.75 8v1.001a3.249 3.249 0 0 1 0 5.997V16A3.25 3.25 0 0 0 6 19.25h8.25V17a.75.75 0 0 1 1.5 0v2.25H18A3.25 3.25 0 0 0 21.25 16v-1.002a3.248 3.248 0 0 1 0-5.997V8A3.25 3.25 0 0 0 18 4.75h-2.25V7a.75.75 0 0 1-1.5 0\"/></svg>";
|
|
68
|
+
/** The `upload` icon of [Core] Icons. */
|
|
69
|
+
export const iconUpload = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M11.25 19v-5.19l-1.22 1.22a.75.75 0 1 1-1.06-1.06l2.146-2.147.095-.086a1.25 1.25 0 0 1 1.578 0l.095.086 2.146 2.147a.75.75 0 0 1-1.06 1.06l-1.22-1.22V19a.75.75 0 0 1-1.5 0m10-7.223c0-2.212-2.047-3.967-4.224-3.656a.76.76 0 0 1-.787-.412v.001A5.362 5.362 0 0 0 6.105 9.615a.76.76 0 0 1-.756.69c-1.412 0-2.599 1.175-2.599 2.584a2.584 2.584 0 0 0 2.583 2.584H6a.75.75 0 1 1 0 1.5h-.667a4.084 4.084 0 0 1-4.083-4.084c0-2.025 1.516-3.716 3.447-4.03a6.863 6.863 0 0 1 12.636-2.27c2.87-.112 5.417 2.233 5.417 5.188a5.195 5.195 0 0 1-4.676 5.17.75.75 0 1 1-.148-1.493 3.696 3.696 0 0 0 3.324-3.677\"/></svg>";
|
|
70
|
+
/** The `user` icon of [Core] Icons. */
|
|
71
|
+
export const iconUser = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M18.25 16.935c0-.544-.342-1.029-.854-1.211a16.05 16.05 0 0 0-10.792 0 1.29 1.29 0 0 0-.854 1.21v1.316c0 .731.647 1.293 1.371 1.19l.954-.137a27.8 27.8 0 0 1 7.85 0l.954.136a1.2 1.2 0 0 0 1.371-1.189zM7.25 7a.75.75 0 0 1 1.5 0A3.25 3.25 0 1 0 12 3.75a.75.75 0 0 1 0-1.5A4.75 4.75 0 1 1 7.25 7m12.5 11.25a2.7 2.7 0 0 1-3.083 2.674l-.955-.136a26.3 26.3 0 0 0-7.424 0l-.955.136A2.7 2.7 0 0 1 4.25 18.25v-1.315c0-1.178.74-2.227 1.849-2.623a17.55 17.55 0 0 1 11.802 0 2.79 2.79 0 0 1 1.849 2.623z\"/></svg>";
|
|
72
|
+
/** The `users` icon of [Core] Icons. */
|
|
73
|
+
export const iconUsers = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M17.42 16.86a.98.98 0 0 0-.651-.926 13.55 13.55 0 0 0-9.112 0 .98.98 0 0 0-.652.925v1.12c0 .554.491.98 1.04.902l.333-.048a27.1 27.1 0 0 1 7.669 0l.334.048a.91.91 0 0 0 1.039-.901zM1.25 16.75v-.88c0-.892.561-1.688 1.401-1.988a12 12 0 0 1 1.76-.482.75.75 0 0 1 .284 1.474q-.781.15-1.54.42a.61.61 0 0 0-.405.576v.88c0 .337.299.596.633.549l.263-.037a.75.75 0 0 1 .211 1.484l-.261.038a2.055 2.055 0 0 1-2.346-2.034m20 0v-.88a.61.61 0 0 0-.405-.575q-.759-.27-1.54-.421a.75.75 0 0 1 .284-1.474q.893.173 1.76.482c.84.3 1.401 1.096 1.401 1.988v.88a2.055 2.055 0 0 1-2.346 2.034l-.261-.038a.75.75 0 1 1 .212-1.484l.262.037a.555.555 0 0 0 .633-.549M3.256 9.228A3.425 3.425 0 0 1 6.68 5.803a.75.75 0 0 1 0 1.5 1.925 1.925 0 0 0 0 3.85.75.75 0 0 1 0 1.5 3.425 3.425 0 0 1-3.425-3.425m15.988 0a1.925 1.925 0 0 0-1.925-1.925.75.75 0 0 1 0-1.5 3.425 3.425 0 0 1 0 6.85.75.75 0 1 1 0-1.5 1.925 1.925 0 0 0 1.925-1.925M8.06 8.404a.75.75 0 1 1 1.5 0 2.654 2.654 0 1 0 2.654-2.654.75.75 0 0 1 0-1.5 4.154 4.154 0 1 1-4.154 4.154m10.86 9.576a2.41 2.41 0 0 1-2.75 2.385l-.334-.048a25.6 25.6 0 0 0-7.244 0l-.334.048a2.41 2.41 0 0 1-2.752-2.385v-1.12c0-1.05.66-1.986 1.648-2.338a15.04 15.04 0 0 1 10.12 0 2.48 2.48 0 0 1 1.647 2.337z\"/></svg>";
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,102 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mszczygiel-projects/ui-core-icons",
|
|
3
|
-
"version": "0.0.0
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.0-alpha.0",
|
|
4
|
+
"description": "Icons of UI Core Library, one SVG string per icon, and a CLI that builds the same package from your own SVG files.",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json",
|
|
14
|
+
"./required-icons.txt": "./required-icons.txt"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"required-icons.txt"
|
|
19
|
+
],
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/mszczygiel-projects/ui-core-library.git",
|
|
23
|
+
"directory": "packages/icons"
|
|
24
|
+
},
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"registry": "https://registry.npmjs.org/",
|
|
27
|
+
"access": "public",
|
|
28
|
+
"provenance": true
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"svgo": "4.1.0"
|
|
32
|
+
},
|
|
33
|
+
"nx": {
|
|
34
|
+
"name": "icons",
|
|
35
|
+
"tags": [
|
|
36
|
+
"type:icons"
|
|
37
|
+
],
|
|
38
|
+
"targets": {
|
|
39
|
+
"generate": {
|
|
40
|
+
"command": "node scripts/generate.ts",
|
|
41
|
+
"options": {
|
|
42
|
+
"cwd": "{projectRoot}"
|
|
43
|
+
},
|
|
44
|
+
"inputs": [
|
|
45
|
+
"default"
|
|
46
|
+
],
|
|
47
|
+
"outputs": [
|
|
48
|
+
"{projectRoot}/src/generated"
|
|
49
|
+
],
|
|
50
|
+
"cache": true
|
|
51
|
+
},
|
|
52
|
+
"build": {
|
|
53
|
+
"dependsOn": [
|
|
54
|
+
"generate",
|
|
55
|
+
"^build"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
"typecheck": {
|
|
59
|
+
"dependsOn": [
|
|
60
|
+
"generate",
|
|
61
|
+
"^build"
|
|
62
|
+
],
|
|
63
|
+
"inputs": [
|
|
64
|
+
"...",
|
|
65
|
+
{
|
|
66
|
+
"dependentTasksOutputFiles": "**/src/generated/**/*"
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
"lint": {
|
|
71
|
+
"dependsOn": [
|
|
72
|
+
"generate",
|
|
73
|
+
"^build"
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
"check-package": {
|
|
77
|
+
"command": "publint --strict . && attw --pack . --profile esm-only --exclude-entrypoints ./required-icons.txt",
|
|
78
|
+
"options": {
|
|
79
|
+
"cwd": "{projectRoot}"
|
|
80
|
+
},
|
|
81
|
+
"dependsOn": [
|
|
82
|
+
"build"
|
|
83
|
+
],
|
|
84
|
+
"inputs": [
|
|
85
|
+
"production"
|
|
86
|
+
],
|
|
87
|
+
"cache": true
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"bin": {
|
|
92
|
+
"ui-core-icons": "./dist/build/cli.js"
|
|
93
|
+
},
|
|
94
|
+
"peerDependencies": {
|
|
95
|
+
"svgo": "4.1.0"
|
|
96
|
+
},
|
|
97
|
+
"peerDependenciesMeta": {
|
|
98
|
+
"svgo": {
|
|
99
|
+
"optional": true
|
|
100
|
+
}
|
|
101
|
+
}
|
|
6
102
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# The icons that the component packages import, one name per line. Every icon set, the library's
|
|
2
|
+
# own and a consumer's, must hold them. The component packages keep this list in step with their
|
|
3
|
+
# imports.
|
|
4
|
+
calendar
|
|
5
|
+
check
|
|
6
|
+
checkmark
|
|
7
|
+
chevron-down
|
|
8
|
+
chevron-left
|
|
9
|
+
chevron-right
|
|
10
|
+
clock
|
|
11
|
+
close
|
|
12
|
+
danger
|
|
13
|
+
delete
|
|
14
|
+
file
|
|
15
|
+
info
|
|
16
|
+
minus
|
|
17
|
+
plus
|
|
18
|
+
upload
|