@nice2dev/icons 1.3.9 → 1.3.10
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 +53 -0
- package/dist/cjs/NiceIconPicker.js +42 -21
- package/dist/cjs/NiceIconValue.js +44 -0
- package/dist/cjs/client.js +6 -1
- package/dist/cjs/iconHtml.js +0 -18
- package/dist/cjs/iconStack.js +3 -1
- package/dist/cjs/iconValue.js +473 -0
- package/dist/cjs/icons/actions.js +39 -8
- package/dist/cjs/icons/files.js +23 -2
- package/dist/cjs/icons/fintech.js +12 -5
- package/dist/cjs/icons/index.js +1 -0
- package/dist/cjs/icons/media.js +7 -4
- package/dist/cjs/icons/realestate.js +8 -7
- package/dist/cjs/icons/shapes.js +55 -4
- package/dist/cjs/index.js +7 -1
- package/dist/cjs/nicetodev-icons.css +1 -1
- package/dist/esm/NiceIconPicker.js +43 -22
- package/dist/esm/NiceIconValue.js +41 -0
- package/dist/esm/client.js +3 -1
- package/dist/esm/iconHtml.js +1 -18
- package/dist/esm/iconStack.js +3 -1
- package/dist/esm/iconValue.js +470 -0
- package/dist/esm/icons/actions.js +39 -9
- package/dist/esm/icons/files.js +23 -2
- package/dist/esm/icons/fintech.js +12 -5
- package/dist/esm/icons/index.js +1 -1
- package/dist/esm/icons/media.js +8 -5
- package/dist/esm/icons/realestate.js +8 -7
- package/dist/esm/icons/shapes.js +55 -4
- package/dist/esm/index.js +4 -2
- package/dist/esm/nicetodev-icons.css +1 -1
- package/dist/types/NiceIconPicker.d.ts +22 -16
- package/dist/types/NiceIconValue.d.ts +40 -0
- package/dist/types/client.d.ts +6 -2
- package/dist/types/iconHtml.d.ts +1 -23
- package/dist/types/iconValue.d.ts +22 -0
- package/dist/types/icons/actions.d.ts +1 -0
- package/dist/types/icons/index.d.ts +1 -1
- package/dist/types/index.d.ts +6 -2
- package/package.json +2 -2
package/dist/types/iconHtml.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { type NiceIconResolver, type NiceIconStackLayer } from './iconStack';
|
|
3
|
-
import type { NtdIconProps } from './types';
|
|
1
|
+
import type { NiceIconStackLayer } from './iconStack';
|
|
4
2
|
/** What an icon's HTML was drawn from. */
|
|
5
3
|
export interface NiceIconHtmlSource {
|
|
6
4
|
/** The base icon's export name, e.g. `'NtdStar'`. */
|
|
@@ -22,23 +20,3 @@ export declare function iconHtmlAttributes(layers: readonly NiceIconStackLayer[]
|
|
|
22
20
|
* one icon share ids that point at identical definitions.
|
|
23
21
|
*/
|
|
24
22
|
export declare function scopeIconHtmlIds(markup: string): string;
|
|
25
|
-
/** `values` is the bound text here, not the SVG animation attribute of the same name. */
|
|
26
|
-
export interface NiceIconHtmlProps extends Partial<Omit<NtdIconProps, 'children' | 'values'>> {
|
|
27
|
-
/** The icon's HTML as NiceIconPicker wrote it (or an icon's export name). */
|
|
28
|
-
html: string | null | undefined;
|
|
29
|
-
/** Resolves the icon names — a map of exports or a function. */
|
|
30
|
-
icons: NiceIconResolver;
|
|
31
|
-
/** Values for bound text of a stack. */
|
|
32
|
-
values?: Record<string, React.ReactNode>;
|
|
33
|
-
/** Drawn when the HTML holds no icon (default: nothing). */
|
|
34
|
-
fallback?: React.ReactNode;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* NiceIconHtml (1.3.9) — shows an icon kept as HTML in a React page by drawing it again from its
|
|
38
|
-
* data attributes; the markup itself is never injected, so HTML from a database cannot run anything.
|
|
39
|
-
* A plain export name (`'NtdStar'`) works too. The rest of the props go to the base icon.
|
|
40
|
-
*/
|
|
41
|
-
export declare function NiceIconHtml({ html, icons, values, fallback, ...baseProps }: NiceIconHtmlProps): React.ReactElement | null;
|
|
42
|
-
export declare namespace NiceIconHtml {
|
|
43
|
-
var displayName: string;
|
|
44
|
-
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type NiceIconStackLayer } from './iconStack';
|
|
2
|
+
type Shorten = (name: string) => string;
|
|
3
|
+
export interface FormatIconValueOptions {
|
|
4
|
+
/**
|
|
5
|
+
* The name written for an icon in a stack. Default: without `Ntd` (`NtdStar` → `Star`). Pass your
|
|
6
|
+
* own when your icons hold names that differ only by `Ntd`; NiceIconPicker does.
|
|
7
|
+
*/
|
|
8
|
+
shortName?: Shorten;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Writes an icon or a stack as short text (1.3.10): `'name'` — a plain icon's name, a stack's code
|
|
12
|
+
* (`Folder(Star@tr)`) — or `'json'` (`["Folder",["Star",{"a":"tr"}]]`). Empty for no layers.
|
|
13
|
+
* `parseIconValue` reads it back; the ids of the layers are not kept.
|
|
14
|
+
*/
|
|
15
|
+
export declare function formatIconValue(layers: readonly NiceIconStackLayer[], format?: 'name' | 'json', { shortName }?: FormatIconValueOptions): string;
|
|
16
|
+
/**
|
|
17
|
+
* Reads an icon kept as text (1.3.10) — a name, the code (`Folder(Star@tr)`), JSON or the HTML of
|
|
18
|
+
* NiceIconPicker 1.3.9 — into stack layers (ids `'1'`, `'2'`… in document order). `null` for empty
|
|
19
|
+
* or unreadable text. Names stay as written: `renderIconStack` resolves `Star` to `NtdStar`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function parseIconValue(value: string | null | undefined): NiceIconStackLayer[] | null;
|
|
22
|
+
export {};
|
|
@@ -25,5 +25,6 @@ export declare const NtdLogIn: import("react").ForwardRefExoticComponent<import(
|
|
|
25
25
|
export declare const NtdLogOut: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
26
26
|
export declare const NtdLock: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
27
27
|
export declare const NtdUnlock: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
28
|
+
export declare const NtdFrameCorners: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
28
29
|
export declare const NtdGroup: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
29
30
|
export declare const NtdUngroup: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { NtdArrowUp, NtdArrowDown, NtdArrowLeft, NtdArrowRight, NtdChevronUp, NtdChevronDown, NtdChevronLeft, NtdChevronRight, NtdMenu, NtdClose, NtdMoreHorizontal, NtdMoreVertical, NtdExternalLink, NtdRefresh, } from './navigation';
|
|
2
|
-
export { NtdSearch, NtdEdit, NtdEditDetail, NtdTrash, NtdSave, NtdDownload, NtdUpload, NtdShare, NtdCopy, NtdClipboard, NtdPlus, NtdMinus, NtdCheck, NtdFilter, NtdSort, NtdPrint, NtdZoomIn, NtdZoomOut, NtdUndo, NtdRedo, NtdReply, NtdLink, NtdSettings, NtdLogIn, NtdLogOut, NtdLock, NtdUnlock, NtdGroup, NtdUngroup, } from './actions';
|
|
2
|
+
export { NtdSearch, NtdEdit, NtdEditDetail, NtdTrash, NtdSave, NtdDownload, NtdUpload, NtdShare, NtdCopy, NtdClipboard, NtdPlus, NtdMinus, NtdCheck, NtdFilter, NtdSort, NtdPrint, NtdZoomIn, NtdZoomOut, NtdUndo, NtdRedo, NtdReply, NtdLink, NtdSettings, NtdLogIn, NtdLogOut, NtdLock, NtdUnlock, NtdFrameCorners, NtdGroup, NtdUngroup, } from './actions';
|
|
3
3
|
export { NtdHome, NtdUser, NtdAdmin, NtdUsers, NtdHeart, NtdStar, NtdBell, NtdEye, NtdEyeOff, NtdInfo, NtdWarning, NtdError, NtdSuccess, NtdHelp, NtdClock, NtdHourglass, NtdCalendar, NtdTag, NtdBackspace, NtdBookmark, NtdFlag, NtdThumbUp, NtdThumbDown, NtdShield, NtdGlobe, NtdMap, NtdPin, NtdMapPin, NtdSun, NtdMoon, NtdCursor, NtdWireframe, } from './ui';
|
|
4
4
|
export { NtdRecycle, NtdCompost, NtdTrashSort, NtdSolarPanel, NtdWindTurbine, NtdEvCharger, NtdCarbonFootprint, NtdCo2, NtdNetZero, NtdEcoFriendly, NtdOrganic, NtdBiodegradable, NtdPlantTree, NtdWildlife, sustainabilityIcons, } from './sustainability';
|
|
5
5
|
export { NtdAccessibility, NtdWheelchair, NtdBlind, NtdDeaf, NtdSignLanguage, NtdBraille, NtdAudioDescription, NtdClosedCaptions, NtdDyslexia, NtdEasyRead, NtdScreenReader, NtdHearingAid, NtdAssistiveTech, accessibilityIcons, } from './accessibility';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -54,8 +54,12 @@ export { generateSmilAnimation, SmilAnimationWrapper as NiceSmilAnimationWrapper
|
|
|
54
54
|
export type { SmilAnimationType, SmilAnimationConfig, SmilAnimationWrapperProps, } from './smilAnimations';
|
|
55
55
|
export { NiceIconPicker } from './NiceIconPicker';
|
|
56
56
|
export type { NiceIconPickerProps, NiceIconPickerHandle, IconPickerEntry, NiceIconPickerValueFormat, NiceIconPickerDisplayMode, } from './NiceIconPicker';
|
|
57
|
-
export {
|
|
58
|
-
export type {
|
|
57
|
+
export { NiceIconValue, NiceIconHtml } from './NiceIconValue';
|
|
58
|
+
export type { NiceIconValueProps, NiceIconHtmlProps } from './NiceIconValue';
|
|
59
|
+
export { formatIconValue, parseIconValue } from './iconValue';
|
|
60
|
+
export type { FormatIconValueOptions } from './iconValue';
|
|
61
|
+
export { parseIconHtml } from './iconHtml';
|
|
62
|
+
export type { NiceIconHtmlSource } from './iconHtml';
|
|
59
63
|
export { NiceIconStacker } from './NiceIconStacker';
|
|
60
64
|
export { NiceIconStack, niceIconStackCode, renderIconStack, isValidTextBinding, addStackLayer, removeStackLayer, iconDisplayName, } from './iconStack';
|
|
61
65
|
export type { NiceIconStackProps, NiceIconResolver, RenderIconStackOptions } from './iconStack';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice2dev/icons",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.10",
|
|
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.10",
|
|
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",
|