@nice2dev/icons 1.0.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.
Files changed (132) hide show
  1. package/CHANGELOG.md +124 -0
  2. package/LICENSE +21 -0
  3. package/README.md +581 -0
  4. package/dist/cjs/NiceIconPicker.js +387 -0
  5. package/dist/cjs/NiceIconPicker.js.map +1 -0
  6. package/dist/cjs/NiceVectorEditor.js +675 -0
  7. package/dist/cjs/NiceVectorEditor.js.map +1 -0
  8. package/dist/cjs/animationControls.js +690 -0
  9. package/dist/cjs/animationControls.js.map +1 -0
  10. package/dist/cjs/createIcon.js +142 -0
  11. package/dist/cjs/createIcon.js.map +1 -0
  12. package/dist/cjs/figmaExport.js +288 -0
  13. package/dist/cjs/figmaExport.js.map +1 -0
  14. package/dist/cjs/icons/actions.js +257 -0
  15. package/dist/cjs/icons/actions.js.map +1 -0
  16. package/dist/cjs/icons/brand.js +128 -0
  17. package/dist/cjs/icons/brand.js.map +1 -0
  18. package/dist/cjs/icons/business.js +228 -0
  19. package/dist/cjs/icons/business.js.map +1 -0
  20. package/dist/cjs/icons/devtech.js +374 -0
  21. package/dist/cjs/icons/devtech.js.map +1 -0
  22. package/dist/cjs/icons/ecommerce.js +171 -0
  23. package/dist/cjs/icons/ecommerce.js.map +1 -0
  24. package/dist/cjs/icons/files.js +286 -0
  25. package/dist/cjs/icons/files.js.map +1 -0
  26. package/dist/cjs/icons/fintech.js +151 -0
  27. package/dist/cjs/icons/fintech.js.map +1 -0
  28. package/dist/cjs/icons/fun.js +124 -0
  29. package/dist/cjs/icons/fun.js.map +1 -0
  30. package/dist/cjs/icons/health.js +132 -0
  31. package/dist/cjs/icons/health.js.map +1 -0
  32. package/dist/cjs/icons/media.js +219 -0
  33. package/dist/cjs/icons/media.js.map +1 -0
  34. package/dist/cjs/icons/navigation.js +147 -0
  35. package/dist/cjs/icons/navigation.js.map +1 -0
  36. package/dist/cjs/icons/saas.js +141 -0
  37. package/dist/cjs/icons/saas.js.map +1 -0
  38. package/dist/cjs/icons/shapes.js +205 -0
  39. package/dist/cjs/icons/shapes.js.map +1 -0
  40. package/dist/cjs/icons/smarthome.js +141 -0
  41. package/dist/cjs/icons/smarthome.js.map +1 -0
  42. package/dist/cjs/icons/social.js +159 -0
  43. package/dist/cjs/icons/social.js.map +1 -0
  44. package/dist/cjs/icons/ui.js +262 -0
  45. package/dist/cjs/icons/ui.js.map +1 -0
  46. package/dist/cjs/icons/weather.js +187 -0
  47. package/dist/cjs/icons/weather.js.map +1 -0
  48. package/dist/cjs/index.js +362 -0
  49. package/dist/cjs/index.js.map +1 -0
  50. package/dist/cjs/nicetodev-icons.css +1 -0
  51. package/dist/cjs/smilAnimations.js +182 -0
  52. package/dist/cjs/smilAnimations.js.map +1 -0
  53. package/dist/cjs/types.js +47 -0
  54. package/dist/cjs/types.js.map +1 -0
  55. package/dist/esm/NiceIconPicker.js +385 -0
  56. package/dist/esm/NiceIconPicker.js.map +1 -0
  57. package/dist/esm/NiceVectorEditor.js +673 -0
  58. package/dist/esm/NiceVectorEditor.js.map +1 -0
  59. package/dist/esm/animationControls.js +680 -0
  60. package/dist/esm/animationControls.js.map +1 -0
  61. package/dist/esm/createIcon.js +140 -0
  62. package/dist/esm/createIcon.js.map +1 -0
  63. package/dist/esm/figmaExport.js +279 -0
  64. package/dist/esm/figmaExport.js.map +1 -0
  65. package/dist/esm/icons/actions.js +231 -0
  66. package/dist/esm/icons/actions.js.map +1 -0
  67. package/dist/esm/icons/brand.js +124 -0
  68. package/dist/esm/icons/brand.js.map +1 -0
  69. package/dist/esm/icons/business.js +209 -0
  70. package/dist/esm/icons/business.js.map +1 -0
  71. package/dist/esm/icons/devtech.js +342 -0
  72. package/dist/esm/icons/devtech.js.map +1 -0
  73. package/dist/esm/icons/ecommerce.js +154 -0
  74. package/dist/esm/icons/ecommerce.js.map +1 -0
  75. package/dist/esm/icons/files.js +254 -0
  76. package/dist/esm/icons/files.js.map +1 -0
  77. package/dist/esm/icons/fintech.js +136 -0
  78. package/dist/esm/icons/fintech.js.map +1 -0
  79. package/dist/esm/icons/fun.js +110 -0
  80. package/dist/esm/icons/fun.js.map +1 -0
  81. package/dist/esm/icons/health.js +118 -0
  82. package/dist/esm/icons/health.js.map +1 -0
  83. package/dist/esm/icons/media.js +195 -0
  84. package/dist/esm/icons/media.js.map +1 -0
  85. package/dist/esm/icons/navigation.js +132 -0
  86. package/dist/esm/icons/navigation.js.map +1 -0
  87. package/dist/esm/icons/saas.js +127 -0
  88. package/dist/esm/icons/saas.js.map +1 -0
  89. package/dist/esm/icons/shapes.js +182 -0
  90. package/dist/esm/icons/shapes.js.map +1 -0
  91. package/dist/esm/icons/smarthome.js +127 -0
  92. package/dist/esm/icons/smarthome.js.map +1 -0
  93. package/dist/esm/icons/social.js +150 -0
  94. package/dist/esm/icons/social.js.map +1 -0
  95. package/dist/esm/icons/ui.js +233 -0
  96. package/dist/esm/icons/ui.js.map +1 -0
  97. package/dist/esm/icons/weather.js +166 -0
  98. package/dist/esm/icons/weather.js.map +1 -0
  99. package/dist/esm/index.js +25 -0
  100. package/dist/esm/index.js.map +1 -0
  101. package/dist/esm/nicetodev-icons.css +1 -0
  102. package/dist/esm/smilAnimations.js +176 -0
  103. package/dist/esm/smilAnimations.js.map +1 -0
  104. package/dist/esm/types.js +44 -0
  105. package/dist/esm/types.js.map +1 -0
  106. package/dist/types/NiceIconPicker.d.ts +149 -0
  107. package/dist/types/NiceVectorEditor.d.ts +75 -0
  108. package/dist/types/animationControls.d.ts +307 -0
  109. package/dist/types/createIcon.d.ts +76 -0
  110. package/dist/types/figmaExport.d.ts +243 -0
  111. package/dist/types/icons/actions.d.ts +25 -0
  112. package/dist/types/icons/brand.d.ts +3 -0
  113. package/dist/types/icons/business.d.ts +25 -0
  114. package/dist/types/icons/devtech.d.ts +39 -0
  115. package/dist/types/icons/ecommerce.d.ts +16 -0
  116. package/dist/types/icons/files.d.ts +31 -0
  117. package/dist/types/icons/fintech.d.ts +14 -0
  118. package/dist/types/icons/fun.d.ts +13 -0
  119. package/dist/types/icons/health.d.ts +14 -0
  120. package/dist/types/icons/index.d.ts +17 -0
  121. package/dist/types/icons/media.d.ts +23 -0
  122. package/dist/types/icons/navigation.d.ts +14 -0
  123. package/dist/types/icons/saas.d.ts +13 -0
  124. package/dist/types/icons/shapes.d.ts +22 -0
  125. package/dist/types/icons/smarthome.d.ts +13 -0
  126. package/dist/types/icons/social.d.ts +18 -0
  127. package/dist/types/icons/ui.d.ts +28 -0
  128. package/dist/types/icons/weather.d.ts +20 -0
  129. package/dist/types/index.d.ts +69 -0
  130. package/dist/types/smilAnimations.d.ts +102 -0
  131. package/dist/types/types.d.ts +179 -0
  132. package/package.json +86 -0
@@ -0,0 +1,179 @@
1
+ import { SVGProps } from 'react';
2
+ import type { SmilAnimationType } from './smilAnimations';
3
+ /**
4
+ * Named icon size preset or a custom pixel value.
5
+ *
6
+ * | Preset | Pixels |
7
+ * |--------|--------|
8
+ * | `'xs'` | 12 |
9
+ * | `'sm'` | 16 |
10
+ * | `'md'` | 24 |
11
+ * | `'lg'` | 32 |
12
+ * | `'xl'` | 48 |
13
+ * | `'2xl'`| 64 |
14
+ * | `'xxl'`| 96 |
15
+ * | `'xxxl'`| 128 |
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * <NtdHome size="lg" /> // 32px
20
+ * <NtdHome size={40} /> // 40px
21
+ * ```
22
+ */
23
+ export type IconSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'xxl' | 'xxxl' | number;
24
+ /**
25
+ * Icon rendering variant.
26
+ *
27
+ * - `'solid'` — Filled icon shapes.
28
+ * - `'outline'` — Stroked paths only, no fill.
29
+ * - `'duotone'` — Two-tone rendering with a filled background layer at reduced opacity.
30
+ * - `'flat'` — Badge-style: colored rounded-rect background with solid content on top.
31
+ * - `'sharp'` — Solid variant with sharp corners (no rounded edges).
32
+ * - `'rounded'` — Solid variant with extra-rounded corners.
33
+ * - `'mini'` — Compact variant optimized for small sizes (12-16px).
34
+ * - `'3d'` — Pseudo-3D with highlights and shadows for depth effect.
35
+ *
36
+ * @example
37
+ * ```tsx
38
+ * <NtdHeart variant="duotone" primaryColor="#e74c3c" secondaryColor="#fca5a5" />
39
+ * <NtdHome variant="sharp" /> // Sharp corners
40
+ * <NtdStar variant="rounded" /> // Extra rounded
41
+ * <NtdBox variant="3d" /> // 3D effect with shadows
42
+ * ```
43
+ */
44
+ export type IconVariant = 'solid' | 'outline' | 'duotone' | 'flat' | 'sharp' | 'rounded' | 'mini' | '3d';
45
+ /**
46
+ * All supported CSS animation names.
47
+ *
48
+ * Each value maps to a `.ntd-anim-{name}` CSS class defined in `animations.css`.
49
+ *
50
+ * **Categories:**
51
+ * - **Core transforms:** spin, pulse, bounce, shake, float, flip, glow, wiggle, etc.
52
+ * - **Entrances (one-shot):** fade-in, slide-up, drop, rise, roll-in, vortex, meteor, etc.
53
+ * - **Exits (one-shot):** scale-out, fold, dissolve.
54
+ * - **Organic / natural:** breathe, drift, orbit, sway, tilt, pendulum, levitate, etc.
55
+ * - **Energetic / impact:** jello, pop, squeeze, crush, stomp, snap, dash, surge.
56
+ * - **Effects / digital:** flash, blink, glitch, neon, earthquake, vibrate.
57
+ * - **Complex transforms:** wobble, spiral, warp, morph, zoom-pulse, ripple, radar.
58
+ * - **Dramatic:** ping, implode, explode, scatter, rotate-x, draw-loop.
59
+ *
60
+ * @example
61
+ * ```tsx
62
+ * <NtdSearch animation="bounce" />
63
+ * <NtdBell animation="shake" animationDuration="0.5s" />
64
+ * ```
65
+ */
66
+ export type IconAnimation = 'spin' | 'spin-reverse' | 'pulse' | 'bounce' | 'shake' | 'float' | 'flip' | 'glow' | 'wiggle' | 'rubber' | 'swing' | 'tada' | 'heartbeat' | 'fade-in' | 'slide-up' | 'slide-down' | 'slide-left' | 'slide-right' | 'drop' | 'rise' | 'roll-in' | 'materialize' | 'vortex' | 'meteor' | 'scale-in' | 'signature' | 'draw-sequence' | 'stroke-order' | 'glow-trace' | 'seal-stamp' | 'reveal' | 'typewriter' | 'unfold' | 'assemble' | 'draw' | 'draw-from-dot' | 'scale-out' | 'fold' | 'dissolve' | 'breathe' | 'drift' | 'orbit' | 'sway' | 'tilt' | 'rock' | 'pendulum' | 'levitate' | 'flap' | 'skate' | 'jello' | 'pop' | 'squeeze' | 'crush' | 'stretch' | 'stomp' | 'snap' | 'twist' | 'dash' | 'surge' | 'flash' | 'blink' | 'flicker' | 'vibrate' | 'tremble' | 'glitch' | 'neon' | 'earthquake' | 'wobble' | 'spiral' | 'warp' | 'morph' | 'zoom-pulse' | 'ripple' | 'radar' | 'ping' | 'implode' | 'explode' | 'scatter' | 'rotate-x' | 'draw-loop';
67
+ /**
68
+ * Named gradient presets.
69
+ *
70
+ * Each maps to a set of color stops defined in `GRADIENT_PRESETS`.
71
+ */
72
+ export type GradientPreset = 'sunset' | 'ocean' | 'forest' | 'fire' | 'ice' | 'neon' | 'gold' | 'purple-haze' | 'aurora' | 'midnight' | 'candy' | 'steel';
73
+ /** Gradient shape (linear direction or radial). */
74
+ export type GradientType = 'linear' | 'radial';
75
+ /** Gradient animation style. */
76
+ export type GradientAnimation = 'shift' | 'spin' | 'pulse';
77
+ /** Gradient preset color stops. */
78
+ export declare const GRADIENT_PRESETS: Record<GradientPreset, readonly string[]>;
79
+ /**
80
+ * Common props accepted by every NiceToDev icon component.
81
+ *
82
+ * Extends standard SVG element attributes, adding icon-specific controls
83
+ * for size, variant, multi-color support, animation, and accessibility.
84
+ *
85
+ * @example
86
+ * ```tsx
87
+ * <NtdHome
88
+ * size="lg"
89
+ * variant="duotone"
90
+ * primaryColor="#3b82f6"
91
+ * secondaryColor="#93c5fd"
92
+ * animation="bounce"
93
+ * title="Home"
94
+ * />
95
+ * ```
96
+ */
97
+ export interface NtdIconProps extends Omit<SVGProps<SVGSVGElement>, 'ref'> {
98
+ /** Icon size — named preset or pixel number */
99
+ size?: IconSize;
100
+ /** Rendering variant */
101
+ variant?: IconVariant;
102
+ /** Primary (main) color */
103
+ primaryColor?: string;
104
+ /** Secondary color — used in duotone variant */
105
+ secondaryColor?: string;
106
+ /** Accent color — for small detail elements */
107
+ accentColor?: string;
108
+ /** Opacity for primary elements (0-1) */
109
+ primaryOpacity?: number;
110
+ /** Opacity for secondary elements in duotone variant (0-1) */
111
+ secondaryOpacity?: number;
112
+ /** Opacity for accent/detail elements (0-1) */
113
+ accentOpacity?: number;
114
+ /** Base stroke width for outline / duotone icons (default 2) */
115
+ strokeWidth?: number;
116
+ /** Stroke line cap style (default 'round') */
117
+ strokeLinecap?: 'round' | 'square' | 'butt';
118
+ /** Stroke line join style (default 'round') */
119
+ strokeLinejoin?: 'round' | 'miter' | 'bevel';
120
+ /** CSS animation to apply */
121
+ animation?: IconAnimation;
122
+ /** Animation duration override (CSS value) */
123
+ animationDuration?: string;
124
+ /** SMIL animation to apply (SVG-native, no CSS required) */
125
+ smilAnimation?: SmilAnimationType;
126
+ /** SMIL animation duration in seconds (default: 1) */
127
+ smilDuration?: number;
128
+ /** SMIL animation repeat count ('indefinite' for infinite) */
129
+ smilRepeatCount?: number | 'indefinite';
130
+ /** SMIL animation easing */
131
+ smilEasing?: 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out';
132
+ /** SMIL animation start delay in seconds */
133
+ smilDelay?: number;
134
+ /** Apply a gradient fill preset to the primary color. */
135
+ gradient?: GradientPreset;
136
+ /** Gradient shape — linear or radial (default `'linear'`). */
137
+ gradientType?: GradientType;
138
+ /** Gradient angle in degrees for linear gradients (default `135`). */
139
+ gradientAngle?: number;
140
+ /** Animate the gradient. */
141
+ gradientAnimation?: GradientAnimation;
142
+ /** Accessible title for screen readers */
143
+ title?: string;
144
+ }
145
+ /**
146
+ * Props received by icon path renderer functions inside {@link CreateIconOptions.paths}.
147
+ *
148
+ * Each property is pre-resolved from the user-facing {@link NtdIconProps}
149
+ * so renderers can focus purely on SVG path construction.
150
+ */
151
+ export interface IconRenderProps {
152
+ variant: IconVariant;
153
+ primaryColor: string;
154
+ secondaryColor: string;
155
+ accentColor: string;
156
+ primaryOpacity: number;
157
+ secondaryOpacity: number;
158
+ accentOpacity: number;
159
+ strokeWidth: number;
160
+ strokeLinecap: 'round' | 'square' | 'butt';
161
+ strokeLinejoin: 'round' | 'miter' | 'bevel';
162
+ }
163
+ /**
164
+ * Map of named size presets to their pixel values.
165
+ *
166
+ * Used internally by {@link createIcon} to resolve `IconSize` strings to numbers.
167
+ *
168
+ * | Key | Value |
169
+ * |--------|-------|
170
+ * | `xs` | 12 |
171
+ * | `sm` | 16 |
172
+ * | `md` | 24 |
173
+ * | `lg` | 32 |
174
+ * | `xl` | 48 |
175
+ * | `2xl` | 64 |
176
+ * | `xxl` | 96 |
177
+ * | `xxxl` | 128 |
178
+ */
179
+ export declare const SIZE_MAP: Record<string, number>;
package/package.json ADDED
@@ -0,0 +1,86 @@
1
+ {
2
+ "name": "@nice2dev/icons",
3
+ "version": "1.0.0",
4
+ "description": "Beautiful, lightweight, multi-color SVG icon library for React with animations",
5
+ "author": "NiceToDev <contact@nicetodev.com>",
6
+ "license": "MIT",
7
+ "homepage": "https://github.com/NiceToDev/NiceToDev.UI#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/NiceToDev/NiceToDev.UI.git",
11
+ "directory": "nice2dev-icons"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/NiceToDev/NiceToDev.UI/issues"
15
+ },
16
+ "main": "dist/cjs/index.js",
17
+ "module": "dist/esm/index.js",
18
+ "types": "dist/types/index.d.ts",
19
+ "sideEffects": [
20
+ "*.css"
21
+ ],
22
+ "files": [
23
+ "dist",
24
+ "LICENSE",
25
+ "CHANGELOG.md",
26
+ "README.md"
27
+ ],
28
+ "scripts": {
29
+ "build": "npm run build:types && rollup -c",
30
+ "build:types": "tsc -p tsconfig.types.json",
31
+ "dev": "rollup -c -w",
32
+ "demo": "vite demo",
33
+ "demo:build": "vite build demo",
34
+ "lint": "eslint src/",
35
+ "test": "vitest run --config vitest.config.ts",
36
+ "test:watch": "vitest --config vitest.config.ts",
37
+ "test:coverage": "vitest run --config vitest.config.ts --coverage",
38
+ "prepublishOnly": "npm run build",
39
+ "storybook": "storybook dev -p 6006",
40
+ "build-storybook": "storybook build"
41
+ },
42
+ "keywords": [
43
+ "icons",
44
+ "react",
45
+ "svg",
46
+ "typescript",
47
+ "multi-color",
48
+ "animated",
49
+ "duotone",
50
+ "nicetodev"
51
+ ],
52
+ "author": "NiceToDev",
53
+ "license": "MIT",
54
+ "peerDependencies": {
55
+ "react": ">=17.0.0",
56
+ "react-dom": ">=17.0.0"
57
+ },
58
+ "devDependencies": {
59
+ "@chromatic-com/storybook": "^5.0.1",
60
+ "@rollup/plugin-commonjs": "^28.0.0",
61
+ "@rollup/plugin-node-resolve": "^16.0.0",
62
+ "@rollup/plugin-typescript": "^12.0.0",
63
+ "@storybook/addon-a11y": "^10.2.19",
64
+ "@storybook/addon-docs": "^10.2.19",
65
+ "@storybook/addon-vitest": "^10.2.19",
66
+ "@storybook/react-vite": "^10.2.19",
67
+ "@testing-library/jest-dom": "^6.9.1",
68
+ "@testing-library/react": "^16.3.2",
69
+ "@types/react": "^18.3.0",
70
+ "@types/react-dom": "^18.3.0",
71
+ "@vitejs/plugin-react": "^4.3.0",
72
+ "@vitest/browser-playwright": "^4.1.0",
73
+ "@vitest/coverage-v8": "^4.1.0",
74
+ "jsdom": "^29.0.0",
75
+ "playwright": "^1.58.2",
76
+ "react": "^18.3.0",
77
+ "react-dom": "^18.3.0",
78
+ "rollup": "^4.24.0",
79
+ "rollup-plugin-postcss": "^4.0.2",
80
+ "storybook": "^10.2.19",
81
+ "tslib": "^2.7.0",
82
+ "typescript": "^5.6.0",
83
+ "vite": "^6.0.0",
84
+ "vitest": "^4.1.0"
85
+ }
86
+ }