@nice2dev/icons 1.3.5 → 1.3.6
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/CHANGELOG.md +34 -0
- package/README.md +20 -3
- package/dist/cjs/NiceIconStacker.js +122 -58
- package/dist/cjs/client.js +5 -1
- package/dist/cjs/createIcon.js +1 -1
- package/dist/cjs/iconStack.js +111 -0
- package/dist/cjs/index.js +5 -1
- package/dist/cjs/nicetodev-icons.css +1 -1
- package/dist/cjs/stacking.js +27 -10
- package/dist/esm/NiceIconStacker.js +122 -58
- package/dist/esm/client.js +2 -1
- package/dist/esm/createIcon.js +2 -2
- package/dist/esm/iconParts.js +1 -1
- package/dist/esm/iconStack.js +104 -0
- package/dist/esm/icons/business.js +1 -1
- package/dist/esm/icons/files.js +2 -2
- package/dist/esm/icons/media.js +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/nicetodev-icons.css +1 -1
- package/dist/esm/smilAnimations.js +1 -1
- package/dist/esm/stacking.js +27 -11
- package/dist/types/NiceIconStacker.d.ts +18 -28
- package/dist/types/client.d.ts +4 -2
- package/dist/types/iconStack.d.ts +77 -0
- package/dist/types/index.d.ts +4 -2
- package/dist/types/stacking.d.ts +11 -3
- package/dist/types/types.d.ts +13 -4
- package/package.json +2 -2
package/dist/types/stacking.d.ts
CHANGED
|
@@ -12,9 +12,17 @@ export declare function isNtdIconElement(node: ReactNode): node is ReactElement<
|
|
|
12
12
|
export declare function isFilledVariant(variant: IconVariant): boolean;
|
|
13
13
|
/** Default share of the parent: centred children larger, edge and corner badges smaller. */
|
|
14
14
|
export declare function defaultStackSize(align: IconStackAlign): number;
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Top-left corner of a stacked icon `size` units big inside the 24-unit box. A `half-…` position is
|
|
17
|
+
* halfway between the centre and the edge or corner it names (1.3.6).
|
|
18
|
+
*/
|
|
16
19
|
export declare function stackPlacement(align: IconStackAlign, size: number): [number, number];
|
|
17
|
-
/**
|
|
20
|
+
/** A corner badge — a full corner; `half-` corners sit inside the parent like its centre. */
|
|
21
|
+
export declare function isCornerBadge(align: IconStackAlign): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Font size of text children by length: one character 9, two 7.5, three 6, more 5 (1.3.6 — three
|
|
24
|
+
* quarters of the first sizes, so a number sits inside a star or a circle with room round it).
|
|
25
|
+
*/
|
|
18
26
|
export declare function defaultTextSize(length: number): number;
|
|
19
27
|
export interface StackContext {
|
|
20
28
|
variant: IconVariant;
|
|
@@ -31,7 +39,7 @@ export interface StackContext {
|
|
|
31
39
|
}
|
|
32
40
|
/**
|
|
33
41
|
* The children of an icon, drawn into it. Colours given on a child win; otherwise:
|
|
34
|
-
* - content inside — centred
|
|
42
|
+
* - content inside — centred, at an edge or halfway out — is cut out of a filled parent: an icon child takes
|
|
35
43
|
* the parent's accent as its primary (and the parent's primary as its accent, so its own text
|
|
36
44
|
* and details read), text the accent; on `outline` / `wireframe` it stays in the parent's
|
|
37
45
|
* colours; in a cutout it takes the tile's colour, drawn solid in the cut;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -271,7 +271,8 @@ export interface NtdIconProps extends Omit<SVGProps<SVGSVGElement>, 'ref'> {
|
|
|
271
271
|
transformOrigin?: string;
|
|
272
272
|
/**
|
|
273
273
|
* Where this icon sits when it is a child of another icon (1.3.5):
|
|
274
|
-
* `<NtdSquare><NtdStar stackAlign="top-right" /></NtdSquare>`. Default `'center'
|
|
274
|
+
* `<NtdSquare><NtdStar stackAlign="top-right" /></NtdSquare>`. Default `'center'`; `half-…`
|
|
275
|
+
* positions sit halfway from the centre to that edge or corner (1.3.6). Text children
|
|
275
276
|
* (`<NtdStar>1</NtdStar>`) are centred on the icon.
|
|
276
277
|
*/
|
|
277
278
|
stackAlign?: IconStackAlign;
|
|
@@ -285,16 +286,24 @@ export interface NtdIconProps extends Omit<SVGProps<SVGSVGElement>, 'ref'> {
|
|
|
285
286
|
* as a cut), primary on `outline` / `wireframe`.
|
|
286
287
|
*/
|
|
287
288
|
textColor?: string;
|
|
288
|
-
/**
|
|
289
|
+
/**
|
|
290
|
+
* Font size of text children in the 24-unit box (1.3.5). Default by length: 9, 7.5, 6, 5 (1.3.6;
|
|
291
|
+
* it was 12, 10, 8, 6.5).
|
|
292
|
+
*/
|
|
289
293
|
textSize?: number;
|
|
294
|
+
/**
|
|
295
|
+
* Turns this icon, when stacked in another, about its own centre — degrees, clockwise (1.3.6).
|
|
296
|
+
* Its own contents and text turn with it.
|
|
297
|
+
*/
|
|
298
|
+
stackRotation?: number;
|
|
290
299
|
/** Accessible title for screen readers */
|
|
291
300
|
title?: string;
|
|
292
301
|
}
|
|
293
302
|
/**
|
|
294
303
|
* Where a stacked icon sits inside the icon it is a child of — the centre, an edge or a corner
|
|
295
|
-
* (1.3.5).
|
|
304
|
+
* (1.3.5), or halfway from the centre to one (`half-…`, 1.3.6).
|
|
296
305
|
*/
|
|
297
|
-
export type IconStackAlign = 'center' | 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
306
|
+
export type IconStackAlign = 'center' | 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'half-top' | 'half-bottom' | 'half-left' | 'half-right' | 'half-top-left' | 'half-top-right' | 'half-bottom-left' | 'half-bottom-right';
|
|
298
307
|
/**
|
|
299
308
|
* Props received by icon path renderer functions inside {@link CreateIconOptions.paths}.
|
|
300
309
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice2dev/icons",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.6",
|
|
4
4
|
"description": "Beautiful, lightweight, multi-color SVG icon library for React with animations",
|
|
5
5
|
"author": "NiceToDev <contact@nicetodev.com>",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": {
|
|
111
111
|
"@chromatic-com/storybook": "^5.3.1",
|
|
112
|
-
"@nice2dev/ui-core": "^1.3.
|
|
112
|
+
"@nice2dev/ui-core": "^1.3.6",
|
|
113
113
|
"@rollup/plugin-commonjs": "^29.0.3",
|
|
114
114
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
115
115
|
"@rollup/plugin-typescript": "^12.3.0",
|