@nice2dev/icons 1.3.15 → 1.3.17

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 (153) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +1 -1
  3. package/dist/cjs/NiceDesktopIconExporter.js +688 -599
  4. package/dist/cjs/NiceFaviconGenerator.js +603 -417
  5. package/dist/cjs/NiceIconPicker.js +788 -508
  6. package/dist/cjs/NiceIconPreview.js +246 -188
  7. package/dist/cjs/NiceIconSetCreator.js +683 -552
  8. package/dist/cjs/NiceIconStacker.js +547 -171
  9. package/dist/cjs/NiceIconValue.js +27 -35
  10. package/dist/cjs/NtdIconBadge.js +384 -360
  11. package/dist/cjs/NtdIconMorph.js +419 -354
  12. package/dist/cjs/NtdStateMorph.js +150 -147
  13. package/dist/cjs/advancedIconSearch.js +373 -510
  14. package/dist/cjs/animationControls.js +518 -642
  15. package/dist/cjs/animationSpeed.js +69 -0
  16. package/dist/cjs/client.js +12 -15
  17. package/dist/cjs/createIcon.js +374 -252
  18. package/dist/cjs/design-tokens.js +324 -390
  19. package/dist/cjs/figmaExport.js +162 -257
  20. package/dist/cjs/figmaSync.js +234 -316
  21. package/dist/cjs/headless-ui.js +240 -368
  22. package/dist/cjs/iconAnalytics.js +337 -393
  23. package/dist/cjs/iconHtml.js +64 -86
  24. package/dist/cjs/iconMetadata.js +392 -472
  25. package/dist/cjs/iconParts.js +120 -90
  26. package/dist/cjs/iconStack.js +136 -155
  27. package/dist/cjs/iconStyles.js +1670 -509
  28. package/dist/cjs/iconValue.js +359 -430
  29. package/dist/cjs/icons/accessibility.js +1119 -134
  30. package/dist/cjs/icons/actions.js +1290 -330
  31. package/dist/cjs/icons/ai.js +1424 -144
  32. package/dist/cjs/icons/brand.js +613 -184
  33. package/dist/cjs/icons/business.js +938 -192
  34. package/dist/cjs/icons/devtech.js +1656 -227
  35. package/dist/cjs/icons/ecommerce.js +802 -111
  36. package/dist/cjs/icons/education.js +1345 -199
  37. package/dist/cjs/icons/files.js +1597 -328
  38. package/dist/cjs/icons/fintech.js +793 -104
  39. package/dist/cjs/icons/food.js +1028 -156
  40. package/dist/cjs/icons/fun.js +804 -109
  41. package/dist/cjs/icons/gaming.js +916 -170
  42. package/dist/cjs/icons/health.js +623 -112
  43. package/dist/cjs/icons/index.js +32 -42
  44. package/dist/cjs/icons/input.js +282 -83
  45. package/dist/cjs/icons/legal.js +1065 -122
  46. package/dist/cjs/icons/media.js +1061 -267
  47. package/dist/cjs/icons/navigation.js +407 -123
  48. package/dist/cjs/icons/omniverk.js +523 -93
  49. package/dist/cjs/icons/realestate.js +1520 -193
  50. package/dist/cjs/icons/saas.js +867 -98
  51. package/dist/cjs/icons/science.js +1344 -202
  52. package/dist/cjs/icons/shapes.js +1316 -308
  53. package/dist/cjs/icons/smarthome.js +786 -90
  54. package/dist/cjs/icons/social.js +591 -59
  55. package/dist/cjs/icons/sports.js +1133 -133
  56. package/dist/cjs/icons/sustainability.js +1211 -139
  57. package/dist/cjs/icons/travel.js +1470 -148
  58. package/dist/cjs/icons/ui.js +1508 -315
  59. package/dist/cjs/icons/weather.js +1160 -173
  60. package/dist/cjs/index.js +559 -568
  61. package/dist/cjs/lottieIntegration.js +261 -266
  62. package/dist/cjs/nicetodev-icons.css +1 -1
  63. package/dist/cjs/particleEffects.js +270 -251
  64. package/dist/cjs/resolver.js +229 -284
  65. package/dist/cjs/rsc.js +175 -193
  66. package/dist/cjs/sharpen.js +73 -130
  67. package/dist/cjs/smilAnimations.js +380 -165
  68. package/dist/cjs/stacking.js +87 -122
  69. package/dist/cjs/tailwind-plugin.js +280 -320
  70. package/dist/cjs/types.js +46 -72
  71. package/dist/cjs/utilities.js +163 -324
  72. package/dist/cjs/variantProps.js +12 -52
  73. package/dist/esm/NiceDesktopIconExporter.js +671 -598
  74. package/dist/esm/NiceFaviconGenerator.js +583 -416
  75. package/dist/esm/NiceIconPicker.js +789 -507
  76. package/dist/esm/NiceIconPreview.js +247 -187
  77. package/dist/esm/NiceIconSetCreator.js +685 -551
  78. package/dist/esm/NiceIconStacker.js +549 -170
  79. package/dist/esm/NiceIconValue.js +29 -34
  80. package/dist/esm/NtdIconBadge.js +388 -359
  81. package/dist/esm/NtdIconMorph.js +423 -353
  82. package/dist/esm/NtdStateMorph.js +152 -146
  83. package/dist/esm/advancedIconSearch.js +391 -509
  84. package/dist/esm/animationControls.js +527 -641
  85. package/dist/esm/animationSpeed.js +69 -0
  86. package/dist/esm/client.js +48 -10
  87. package/dist/esm/createIcon.js +375 -251
  88. package/dist/esm/design-tokens.js +334 -387
  89. package/dist/esm/figmaExport.js +170 -256
  90. package/dist/esm/figmaSync.js +237 -315
  91. package/dist/esm/headless-ui.js +254 -365
  92. package/dist/esm/iconAnalytics.js +342 -392
  93. package/dist/esm/iconHtml.js +67 -85
  94. package/dist/esm/iconMetadata.js +404 -471
  95. package/dist/esm/iconParts.js +125 -89
  96. package/dist/esm/iconStack.js +145 -154
  97. package/dist/esm/iconStyles.js +1681 -508
  98. package/dist/esm/iconValue.js +361 -429
  99. package/dist/esm/icons/accessibility.js +1133 -133
  100. package/dist/esm/icons/actions.js +1320 -329
  101. package/dist/esm/icons/ai.js +1441 -143
  102. package/dist/esm/icons/brand.js +616 -179
  103. package/dist/esm/icons/business.js +957 -191
  104. package/dist/esm/icons/devtech.js +1687 -226
  105. package/dist/esm/icons/ecommerce.js +816 -110
  106. package/dist/esm/icons/education.js +1364 -198
  107. package/dist/esm/icons/files.js +1628 -327
  108. package/dist/esm/icons/fintech.js +807 -103
  109. package/dist/esm/icons/food.js +1043 -153
  110. package/dist/esm/icons/fun.js +819 -108
  111. package/dist/esm/icons/gaming.js +933 -169
  112. package/dist/esm/icons/health.js +636 -111
  113. package/dist/esm/icons/index.js +589 -32
  114. package/dist/esm/icons/input.js +326 -82
  115. package/dist/esm/icons/legal.js +1079 -121
  116. package/dist/esm/icons/media.js +1086 -266
  117. package/dist/esm/icons/navigation.js +421 -122
  118. package/dist/esm/icons/omniverk.js +534 -91
  119. package/dist/esm/icons/realestate.js +1544 -198
  120. package/dist/esm/icons/saas.js +880 -97
  121. package/dist/esm/icons/science.js +1370 -208
  122. package/dist/esm/icons/shapes.js +1343 -307
  123. package/dist/esm/icons/smarthome.js +799 -89
  124. package/dist/esm/icons/social.js +599 -58
  125. package/dist/esm/icons/sports.js +1148 -132
  126. package/dist/esm/icons/sustainability.js +1226 -138
  127. package/dist/esm/icons/travel.js +1486 -147
  128. package/dist/esm/icons/ui.js +1540 -314
  129. package/dist/esm/icons/weather.js +1181 -172
  130. package/dist/esm/index.js +749 -58
  131. package/dist/esm/lottieIntegration.js +264 -265
  132. package/dist/esm/nicetodev-icons.css +1 -1
  133. package/dist/esm/particleEffects.js +271 -250
  134. package/dist/esm/resolver.js +231 -283
  135. package/dist/esm/rsc.js +182 -192
  136. package/dist/esm/sharpen.js +78 -129
  137. package/dist/esm/smilAnimations.js +385 -164
  138. package/dist/esm/stacking.js +99 -121
  139. package/dist/esm/tailwind-plugin.js +282 -319
  140. package/dist/esm/types.js +50 -71
  141. package/dist/esm/utilities.js +177 -321
  142. package/dist/esm/variantProps.js +23 -52
  143. package/dist/types/animationSpeed.d.ts +19 -0
  144. package/dist/types/createIcon.d.ts +6 -0
  145. package/dist/types/iconStyles.d.ts +6 -1
  146. package/dist/types/icons/brand.d.ts +0 -4
  147. package/dist/types/icons/food.d.ts +0 -3
  148. package/dist/types/icons/index.d.ts +3 -3
  149. package/dist/types/icons/omniverk.d.ts +0 -3
  150. package/dist/types/icons/science.d.ts +1 -1
  151. package/dist/types/smilAnimations.d.ts +4 -2
  152. package/dist/types/types.d.ts +7 -0
  153. package/package.json +15 -22
@@ -1,146 +1,111 @@
1
- 'use strict';
2
-
3
- var jsxRuntime = require('react/jsx-runtime');
4
- var React = require('react');
5
-
6
- /**
7
- * Icons stacked by nesting (1.3.5): `<NtdSquare><NtdStar stackAlign="center">1</NtdStar></NtdSquare>`.
8
- * An icon draws its children inside its own `<svg>` — an icon child as a nested `<svg>` placed by
9
- * its `stackAlign` / `stackSize`, text centred on the icon, anything else as it is. So the stack
10
- * is one SVG: it exports and copies like any icon.
11
- */
12
- /** Set on every component createIcon makes, so a parent icon tells its icon children apart. */
13
- const NTD_ICON_MARK = 'ntdIcon';
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const React = require("react");
5
+ const NTD_ICON_MARK = "ntdIcon";
14
6
  function isNtdIconElement(node) {
15
- return (React.isValidElement(node) &&
16
- typeof node.type !== 'string' &&
17
- Boolean(node.type[NTD_ICON_MARK]));
7
+ return React.isValidElement(node) && typeof node.type !== "string" && Boolean(node.type[NTD_ICON_MARK]);
18
8
  }
19
- /** Set on every component createIcon makes, next to {@link NTD_ICON_MARK}: its {@link PerfectStack}. */
20
- const PERFECT_STACK = 'perfectStack';
21
- /** The spot icon component `icon` keeps for stacked icons; `undefined` when it is not an icon. */
9
+ const PERFECT_STACK = "perfectStack";
22
10
  function perfectStackOf(icon) {
23
- return icon && (typeof icon === 'object' || typeof icon === 'function')
24
- ? icon[PERFECT_STACK]
25
- : undefined;
11
+ return icon && (typeof icon === "object" || typeof icon === "function") ? icon[PERFECT_STACK] : void 0;
26
12
  }
27
- /** A child of the spot's default size and no turn, at the box centre — `'center'`. */
28
13
  const BOX_PERFECT_STACK = { rotation: 0, size: 0.6 };
29
- /** Variants drawn with lines; every other variant is a filled shape. */
30
- const LINE_VARIANTS = new Set(['outline', 'wireframe']);
14
+ const LINE_VARIANTS = /* @__PURE__ */ new Set(["outline", "wireframe"]);
31
15
  function isFilledVariant(variant) {
32
- return !LINE_VARIANTS.has(variant);
16
+ return !LINE_VARIANTS.has(variant);
33
17
  }
34
- /** Default share of the parent: centred children larger, edge and corner badges smaller. */
35
18
  function defaultStackSize(align) {
36
- return align === 'center' ? 0.6 : 0.5;
19
+ return align === "center" ? 0.6 : 0.5;
37
20
  }
38
- /**
39
- * Top-left corner of a stacked icon `size` units big inside the 24-unit box. A `half-…` position is
40
- * halfway between the centre and the edge or corner it names (1.3.6).
41
- */
42
21
  function stackPlacement(align, size) {
43
- const far = 24 - size;
44
- const mid = far / 2;
45
- const half = align.startsWith('half-');
46
- const edge = half ? align.slice(5) : align;
47
- const x = edge.endsWith('left') ? 0 : edge.endsWith('right') ? far : mid;
48
- const y = edge.startsWith('top') ? 0 : edge.startsWith('bottom') ? far : mid;
49
- return half ? [(x + mid) / 2, (y + mid) / 2] : [x, y];
22
+ const far = 24 - size;
23
+ const mid = far / 2;
24
+ const half = align.startsWith("half-");
25
+ const edge = half ? align.slice(5) : align;
26
+ const x = edge.endsWith("left") ? 0 : edge.endsWith("right") ? far : mid;
27
+ const y = edge.startsWith("top") ? 0 : edge.startsWith("bottom") ? far : mid;
28
+ return half ? [(x + mid) / 2, (y + mid) / 2] : [x, y];
50
29
  }
51
- /**
52
- * `at` moved by `percent` of the parent (`stackOffsetX` / `stackOffsetY`, 1.3.7), in the parent's
53
- * 24 units. Rounded to a thousandth, so the markup reads 7.2, not 7.199999999999999.
54
- */
55
30
  function stackOffset(at, percent) {
56
- return percent ? Math.round(1000 * at + 240 * percent) / 1000 : at;
31
+ return percent ? Math.round(1e3 * at + 240 * percent) / 1e3 : at;
57
32
  }
58
- /** A corner badge — a full corner; `half-` corners sit inside the parent like its centre. */
59
33
  function isCornerBadge(align) {
60
- return /^(top|bottom)-(left|right)$/.test(align);
34
+ return /^(top|bottom)-(left|right)$/.test(align);
61
35
  }
62
- /**
63
- * Font size of text children by length: one character 9, two 7.5, three 6, more 5 (1.3.6 — three
64
- * quarters of the first sizes, so a number sits inside a star or a circle with room round it).
65
- * In a spot smaller or larger than the default 0.6 (`perfectStackSize`, 1.3.8) it scales with it.
66
- */
67
36
  function defaultTextSize(length, spot = BOX_PERFECT_STACK.size) {
68
- const size = length <= 1 ? 9 : length === 2 ? 7.5 : length === 3 ? 6 : 5;
69
- return spot === BOX_PERFECT_STACK.size
70
- ? size
71
- : Math.round((10 * size * spot) / BOX_PERFECT_STACK.size) / 10;
37
+ const size = length <= 1 ? 9 : length === 2 ? 7.5 : length === 3 ? 6 : 5;
38
+ return spot === BOX_PERFECT_STACK.size ? size : Math.round(10 * size * spot / BOX_PERFECT_STACK.size) / 10;
72
39
  }
73
- /** `n` rounded to a thousandth — 7.2 in the markup, not 7.199999999999999. */
74
- const thousandth = (n) => Math.round(1000 * n) / 1000;
75
- /** The cutout variant draws its shape at 80% in the tile; its stack follows the shape. */
76
- const CUTOUT_SHAPE = 'translate(12 12) scale(0.8) translate(-12 -12)';
77
- /** The gap kept round a corner badge, in the parent's units. */
40
+ const thousandth = (n) => Math.round(1e3 * n) / 1e3;
41
+ const CUTOUT_SHAPE = "translate(12 12) scale(0.8) translate(-12 -12)";
78
42
  const BADGE_GAP = 1;
79
- /**
80
- * The children of an icon, drawn into it. A child without a `stackAlign` goes to the spot the icon
81
- * keeps for it (`ctx.perfect`: its centre, size and turn), and so does text. Colours given on a
82
- * child win; otherwise:
83
- * - content inside — at that spot, centred, at an edge or halfway out — is cut out of a filled parent: an icon child takes
84
- * the parent's accent as its primary (and the parent's primary as its accent, so its own text
85
- * and details read), text the accent; on `outline` / `wireframe` it stays in the parent's
86
- * colours; in a cutout it takes the tile's colour, drawn solid in the cut;
87
- * - a corner badge keeps the parent's colours and sits on a disc of the accent colour a little
88
- * larger than itself — a gap cut into the parent where they overlap, unseen beyond it.
89
- */
90
43
  function renderStackChildren(children, ctx) {
91
- var _a, _b;
92
- const items = React.Children.toArray(children);
93
- if (items.length === 0) {
94
- return null;
44
+ const items = React.Children.toArray(children);
45
+ if (items.length === 0) {
46
+ return null;
47
+ }
48
+ const cutout = ctx.variant === "cutout";
49
+ const filled = isFilledVariant(ctx.variant);
50
+ const insidePrimary = cutout ? ctx.tileColor : filled ? ctx.accentColor : ctx.primaryColor;
51
+ const insideAccent = filled && !cutout ? ctx.primaryColor : ctx.accentColor;
52
+ const text = items.filter((c) => typeof c === "string" || typeof c === "number").join("");
53
+ const { perfect } = ctx;
54
+ const layers = items.map((child, i) => {
55
+ if (isNtdIconElement(child)) {
56
+ const p = child.props;
57
+ const align = p.stackAlign ?? "perfect";
58
+ const atSpot = align === "perfect";
59
+ const size = thousandth(
60
+ 24 * (p.stackSize ?? (atSpot ? perfect.size : defaultStackSize(align)))
61
+ );
62
+ const [alignX, alignY] = atSpot ? [thousandth(perfect.x - size / 2), thousandth(perfect.y - size / 2)] : stackPlacement(align, size);
63
+ const x = stackOffset(alignX, p.stackOffsetX);
64
+ const y = stackOffset(alignY, p.stackOffsetY);
65
+ const badge = isCornerBadge(align);
66
+ const icon = React.cloneElement(child, {
67
+ x,
68
+ y,
69
+ size,
70
+ variant: p.variant ?? (cutout ? "solid" : ctx.variant),
71
+ primaryColor: p.primaryColor ?? (badge ? ctx.primaryColor : insidePrimary),
72
+ accentColor: p.accentColor ?? (badge ? ctx.accentColor : insideAccent),
73
+ strokeWidth: p.strokeWidth ?? ctx.strokeWidth
74
+ });
75
+ const cx = x + size / 2;
76
+ const cy = y + size / 2;
77
+ const rotation = p.stackRotation ?? (atSpot ? perfect.rotation : 0);
78
+ const turn = rotation ? `rotate(${rotation} ${cx} ${cy})` : void 0;
79
+ if (!badge && !turn) {
80
+ return icon;
81
+ }
82
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: turn, children: [
83
+ badge && /* @__PURE__ */ jsxRuntime.jsx("circle", { cx, cy, r: size / 2 + BADGE_GAP, fill: ctx.accentColor }),
84
+ icon
85
+ ] }, child.key ?? i);
95
86
  }
96
- const cutout = ctx.variant === 'cutout';
97
- const filled = isFilledVariant(ctx.variant);
98
- const insidePrimary = cutout ? ctx.tileColor : filled ? ctx.accentColor : ctx.primaryColor;
99
- const insideAccent = filled && !cutout ? ctx.primaryColor : ctx.accentColor;
100
- const text = items
101
- .filter((c) => typeof c === 'string' || typeof c === 'number')
102
- .join('');
103
- const { perfect } = ctx;
104
- const layers = items.map((child, i) => {
105
- var _a, _b, _c, _d, _e, _f, _g, _h;
106
- if (isNtdIconElement(child)) {
107
- const p = child.props;
108
- const align = (_a = p.stackAlign) !== null && _a !== void 0 ? _a : 'perfect';
109
- // the parent's own spot (1.3.8): its centre, size and turn, unless the child sets them
110
- const atSpot = align === 'perfect';
111
- const size = thousandth(24 * ((_b = p.stackSize) !== null && _b !== void 0 ? _b : (atSpot ? perfect.size : defaultStackSize(align))));
112
- const [alignX, alignY] = atSpot
113
- ? [thousandth(perfect.x - size / 2), thousandth(perfect.y - size / 2)]
114
- : stackPlacement(align, size);
115
- // nudged from the aligned spot (1.3.7) — a share of the parent, so it scales with it
116
- const x = stackOffset(alignX, p.stackOffsetX);
117
- const y = stackOffset(alignY, p.stackOffsetY);
118
- const badge = isCornerBadge(align);
119
- const icon = React.cloneElement(child, {
120
- x,
121
- y,
122
- size,
123
- variant: (_c = p.variant) !== null && _c !== void 0 ? _c : (cutout ? 'solid' : ctx.variant),
124
- primaryColor: (_d = p.primaryColor) !== null && _d !== void 0 ? _d : (badge ? ctx.primaryColor : insidePrimary),
125
- accentColor: (_e = p.accentColor) !== null && _e !== void 0 ? _e : (badge ? ctx.accentColor : insideAccent),
126
- strokeWidth: (_f = p.strokeWidth) !== null && _f !== void 0 ? _f : ctx.strokeWidth,
127
- });
128
- const cx = x + size / 2;
129
- const cy = y + size / 2;
130
- // turned about its own centre (1.3.6) — through a group: a nested <svg> takes no transform
131
- const rotation = (_g = p.stackRotation) !== null && _g !== void 0 ? _g : (atSpot ? perfect.rotation : 0);
132
- const turn = rotation ? `rotate(${rotation} ${cx} ${cy})` : undefined;
133
- if (!badge && !turn) {
134
- return icon;
135
- }
136
- return (jsxRuntime.jsxs("g", { transform: turn, children: [badge && jsxRuntime.jsx("circle", { cx: cx, cy: cy, r: size / 2 + BADGE_GAP, fill: ctx.accentColor }), icon] }, (_h = child.key) !== null && _h !== void 0 ? _h : i));
137
- }
138
- return React.isValidElement(child) ? child : null;
139
- });
140
- const content = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [layers, text && (jsxRuntime.jsx("text", { x: perfect.x, y: perfect.y, transform: perfect.rotation ? `rotate(${perfect.rotation} ${perfect.x} ${perfect.y})` : undefined, textAnchor: "middle", dominantBaseline: "central", fontSize: (_a = ctx.textSize) !== null && _a !== void 0 ? _a : defaultTextSize(text.length, perfect.size), fontWeight: 700, fill: (_b = ctx.textColor) !== null && _b !== void 0 ? _b : insidePrimary, stroke: "none", children: text }))] }));
141
- return cutout ? jsxRuntime.jsx("g", { transform: CUTOUT_SHAPE, children: content }) : content;
87
+ return React.isValidElement(child) ? child : null;
88
+ });
89
+ const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
90
+ layers,
91
+ text && /* @__PURE__ */ jsxRuntime.jsx(
92
+ "text",
93
+ {
94
+ x: perfect.x,
95
+ y: perfect.y,
96
+ transform: perfect.rotation ? `rotate(${perfect.rotation} ${perfect.x} ${perfect.y})` : void 0,
97
+ textAnchor: "middle",
98
+ dominantBaseline: "central",
99
+ fontSize: ctx.textSize ?? defaultTextSize(text.length, perfect.size),
100
+ fontWeight: 700,
101
+ fill: ctx.textColor ?? insidePrimary,
102
+ stroke: "none",
103
+ children: text
104
+ }
105
+ )
106
+ ] });
107
+ return cutout ? /* @__PURE__ */ jsxRuntime.jsx("g", { transform: CUTOUT_SHAPE, children: content }) : content;
142
108
  }
143
-
144
109
  exports.BOX_PERFECT_STACK = BOX_PERFECT_STACK;
145
110
  exports.NTD_ICON_MARK = NTD_ICON_MARK;
146
111
  exports.PERFECT_STACK = PERFECT_STACK;