@nice2dev/icons 1.3.4 → 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 +70 -0
- package/README.md +48 -0
- package/dist/cjs/NiceIconStacker.js +184 -0
- package/dist/cjs/client.js +7 -0
- package/dist/cjs/createIcon.js +21 -3
- package/dist/cjs/iconStack.js +111 -0
- package/dist/cjs/icons/actions.js +25 -4
- package/dist/cjs/icons/ai.js +3 -0
- package/dist/cjs/icons/files.js +24 -7
- package/dist/cjs/icons/index.js +2 -2
- package/dist/cjs/icons/shapes.js +2 -10
- package/dist/cjs/icons/sustainability.js +2 -11
- package/dist/cjs/icons/ui.js +6 -0
- package/dist/cjs/icons/weather.js +3 -0
- package/dist/cjs/index.js +9 -2
- package/dist/cjs/nicetodev-icons.css +1 -1
- package/dist/cjs/stacking.js +117 -0
- package/dist/esm/NiceIconStacker.js +181 -0
- package/dist/esm/client.js +2 -0
- package/dist/esm/createIcon.js +23 -5
- package/dist/esm/iconParts.js +1 -1
- package/dist/esm/iconStack.js +104 -0
- package/dist/esm/icons/actions.js +25 -4
- package/dist/esm/icons/ai.js +3 -1
- package/dist/esm/icons/business.js +1 -1
- package/dist/esm/icons/files.js +26 -9
- package/dist/esm/icons/index.js +4 -4
- package/dist/esm/icons/media.js +1 -1
- package/dist/esm/icons/shapes.js +3 -10
- package/dist/esm/icons/sustainability.js +2 -10
- package/dist/esm/icons/ui.js +6 -0
- package/dist/esm/icons/weather.js +3 -1
- package/dist/esm/index.js +6 -4
- package/dist/esm/nicetodev-icons.css +1 -1
- package/dist/esm/smilAnimations.js +1 -1
- package/dist/esm/stacking.js +108 -0
- package/dist/types/NiceIconStacker.d.ts +40 -0
- package/dist/types/client.d.ts +4 -0
- package/dist/types/createIcon.d.ts +5 -0
- package/dist/types/iconStack.d.ts +77 -0
- package/dist/types/icons/ai.d.ts +2 -0
- package/dist/types/icons/index.d.ts +4 -4
- package/dist/types/icons/shapes.d.ts +0 -1
- package/dist/types/icons/sustainability.d.ts +0 -1
- package/dist/types/icons/weather.d.ts +2 -0
- package/dist/types/index.d.ts +5 -1
- package/dist/types/stacking.d.ts +49 -0
- package/dist/types/types.d.ts +32 -0
- package/package.json +2 -2
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useNiceTranslation, useControllableState } from '@nice2dev/ui-core';
|
|
3
|
+
import { forwardRef, useRef, useId, useState, useCallback, useMemo, useImperativeHandle } from 'react';
|
|
4
|
+
import { NtdPlus, NtdTrash, NtdCheck, NtdCopy } from './icons/actions.js';
|
|
5
|
+
import { NtdClose } from './icons/navigation.js';
|
|
6
|
+
import { niceIconStackCode, renderIconStack, stackChildrenOf, isValidTextBinding, stackParentId } from './iconStack.js';
|
|
7
|
+
import { defaultStackSize, defaultTextSize } from './stacking.js';
|
|
8
|
+
|
|
9
|
+
const ALIGNS = [
|
|
10
|
+
'center',
|
|
11
|
+
'top',
|
|
12
|
+
'bottom',
|
|
13
|
+
'left',
|
|
14
|
+
'right',
|
|
15
|
+
'top-left',
|
|
16
|
+
'top-right',
|
|
17
|
+
'bottom-left',
|
|
18
|
+
'bottom-right',
|
|
19
|
+
'half-top',
|
|
20
|
+
'half-bottom',
|
|
21
|
+
'half-left',
|
|
22
|
+
'half-right',
|
|
23
|
+
'half-top-left',
|
|
24
|
+
'half-top-right',
|
|
25
|
+
'half-bottom-left',
|
|
26
|
+
'half-bottom-right',
|
|
27
|
+
];
|
|
28
|
+
const PREVIEW_SIZES = [96, 48, 24];
|
|
29
|
+
const NO_LAYERS = [];
|
|
30
|
+
/** What a colour field shows while the colour is unset (follows the parent). */
|
|
31
|
+
const AUTO_SWATCH = '#808080';
|
|
32
|
+
/** The layers in tree order (each followed by what sits in it), with their depth. */
|
|
33
|
+
function walk(layers) {
|
|
34
|
+
const out = [];
|
|
35
|
+
const visit = (layer, depth) => {
|
|
36
|
+
out.push({ layer, depth });
|
|
37
|
+
for (const child of stackChildrenOf(layers, layer.id)) {
|
|
38
|
+
visit(child, depth + 1);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
if (layers[0]) {
|
|
42
|
+
visit(layers[0], 0);
|
|
43
|
+
}
|
|
44
|
+
return out;
|
|
45
|
+
}
|
|
46
|
+
/** Removes a layer; what sat in it moves up into its parent (a removed base hands over to its first child). */
|
|
47
|
+
function removeLayer(layers, id) {
|
|
48
|
+
const base = layers[0];
|
|
49
|
+
if (!base) {
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
if (id !== base.id) {
|
|
53
|
+
const gone = layers.find((l) => l.id === id);
|
|
54
|
+
const up = gone ? stackParentId(layers, gone) : undefined;
|
|
55
|
+
return layers
|
|
56
|
+
.filter((l) => l.id !== id)
|
|
57
|
+
.map((l) => (l.parent === id ? { ...l, parent: up === base.id ? undefined : up } : l));
|
|
58
|
+
}
|
|
59
|
+
const [heir, ...siblings] = stackChildrenOf(layers, base.id);
|
|
60
|
+
if (!heir) {
|
|
61
|
+
return [];
|
|
62
|
+
}
|
|
63
|
+
const newBase = {
|
|
64
|
+
...heir,
|
|
65
|
+
parent: undefined,
|
|
66
|
+
align: undefined,
|
|
67
|
+
size: undefined,
|
|
68
|
+
rotation: undefined,
|
|
69
|
+
};
|
|
70
|
+
return [
|
|
71
|
+
newBase,
|
|
72
|
+
...layers
|
|
73
|
+
.filter((l) => l.id !== base.id && l.id !== heir.id)
|
|
74
|
+
.map((l) => siblings.includes(l)
|
|
75
|
+
? { ...l, parent: heir.id }
|
|
76
|
+
: l.parent === heir.id
|
|
77
|
+
? { ...l, parent: undefined }
|
|
78
|
+
: l),
|
|
79
|
+
];
|
|
80
|
+
}
|
|
81
|
+
/** A colour of the layer's own, or "auto" — following its parent — until one is picked. */
|
|
82
|
+
function ColorField({ label, value, onChange, autoLabel, resetLabel }) {
|
|
83
|
+
return (jsxs("span", { className: "nice-icon-stacker__color", children: [jsxs("label", { className: "nice-icon-stacker__field", children: [jsx("span", { children: label }), jsx("input", { type: "color", value: value !== null && value !== void 0 ? value : AUTO_SWATCH, onChange: (e) => onChange(e.target.value) })] }), value ? (jsx("button", { type: "button", className: "nice-icon-stacker__reset", onClick: () => onChange(undefined), "aria-label": resetLabel, title: resetLabel, children: jsx(NtdClose, { size: 12 }) })) : (jsx("small", { className: "nice-icon-stacker__auto", children: autoLabel }))] }));
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* NiceIconStacker (1.3.5) — builds an icon stack: the base icon and the icons stacked in it, each
|
|
87
|
+
* with its position, size, turn and colours, nested any number of levels deep (1.3.6) with text
|
|
88
|
+
* innermost — its size, colour and the value it is bound to — shown live at three sizes and as the
|
|
89
|
+
* JSX that draws it. The "add" button puts `current` into the selected layer and selects it, so
|
|
90
|
+
* adding again goes one level deeper; select an outer layer to add side by side. Layers leave one
|
|
91
|
+
* by one or all at once. `NiceIconStack` draws a stack built here from data.
|
|
92
|
+
*/
|
|
93
|
+
const NiceIconStacker = forwardRef(function NiceIconStacker({ icons, layers: layersProp, defaultLayers, onLayersChange, current, previewProps, className }, ref) {
|
|
94
|
+
var _a, _b, _c, _d;
|
|
95
|
+
const { t } = useNiceTranslation();
|
|
96
|
+
const [layers, setLayers] = useControllableState({
|
|
97
|
+
value: layersProp,
|
|
98
|
+
defaultValue: defaultLayers,
|
|
99
|
+
fallbackValue: NO_LAYERS,
|
|
100
|
+
onChange: onLayersChange,
|
|
101
|
+
componentName: 'NiceIconStacker',
|
|
102
|
+
});
|
|
103
|
+
const nextId = useRef(0);
|
|
104
|
+
const targetGroup = useId();
|
|
105
|
+
const [copied, setCopied] = useState(false);
|
|
106
|
+
// The layer the next icon goes into — the newest by default, so adding nests deeper.
|
|
107
|
+
const [selected, setSelected] = useState(undefined);
|
|
108
|
+
const base = layers[0];
|
|
109
|
+
const target = (_b = (_a = layers.find((l) => l.id === selected)) !== null && _a !== void 0 ? _a : layers[layers.length - 1]) !== null && _b !== void 0 ? _b : undefined;
|
|
110
|
+
const resolve = useCallback((name) => (typeof icons === 'function' ? icons(name) : icons[name]), [icons]);
|
|
111
|
+
const tree = useMemo(() => walk(layers), [layers]);
|
|
112
|
+
const code = useMemo(() => niceIconStackCode(layers), [layers]);
|
|
113
|
+
const update = (id, patch) => setLayers((prev) => prev.map((l) => (l.id === id ? { ...l, ...patch } : l)));
|
|
114
|
+
const add = () => {
|
|
115
|
+
if (!current) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
nextId.current += 1;
|
|
119
|
+
const id = `${current.icon}-${Date.now().toString(36)}-${nextId.current}`;
|
|
120
|
+
setLayers((prev) => {
|
|
121
|
+
const into = prev.find((l) => l.id === (target === null || target === void 0 ? void 0 : target.id));
|
|
122
|
+
const layer = {
|
|
123
|
+
id,
|
|
124
|
+
icon: current.icon,
|
|
125
|
+
variant: current.variant,
|
|
126
|
+
...(into && into !== prev[0] ? { parent: into.id } : {}),
|
|
127
|
+
};
|
|
128
|
+
return [...prev, layer];
|
|
129
|
+
});
|
|
130
|
+
setSelected(id);
|
|
131
|
+
};
|
|
132
|
+
const remove = (id) => {
|
|
133
|
+
setLayers((prev) => removeLayer(prev, id));
|
|
134
|
+
if (selected === id) {
|
|
135
|
+
setSelected(undefined);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
const clear = () => {
|
|
139
|
+
setLayers(NO_LAYERS);
|
|
140
|
+
setSelected(undefined);
|
|
141
|
+
};
|
|
142
|
+
useImperativeHandle(ref, () => ({ add, clear }));
|
|
143
|
+
const copy = () => {
|
|
144
|
+
var _a;
|
|
145
|
+
void ((_a = navigator.clipboard) === null || _a === void 0 ? void 0 : _a.writeText(code).then(() => {
|
|
146
|
+
setCopied(true);
|
|
147
|
+
window.setTimeout(() => setCopied(false), 1500);
|
|
148
|
+
}));
|
|
149
|
+
};
|
|
150
|
+
const autoLabel = t('iconStacker.auto', 'auto');
|
|
151
|
+
const resetLabel = t('iconStacker.reset', 'Back to auto');
|
|
152
|
+
const addLabel = base && target
|
|
153
|
+
? t('iconStacker.addInto', 'Add {icon} into {target}')
|
|
154
|
+
.replace('{icon}', (_c = current === null || current === void 0 ? void 0 : current.icon) !== null && _c !== void 0 ? _c : '')
|
|
155
|
+
.replace('{target}', target.icon)
|
|
156
|
+
: t('iconStacker.add', 'Add {icon} to the stack').replace('{icon}', (_d = current === null || current === void 0 ? void 0 : current.icon) !== null && _d !== void 0 ? _d : '');
|
|
157
|
+
return (jsxs("div", { className: ['nice-icon-stacker', className].filter(Boolean).join(' '), children: [jsxs("div", { className: "nice-icon-stacker__toolbar", children: [jsxs("button", { type: "button", onClick: add, disabled: !current, children: [jsx(NtdPlus, { size: 14 }), " ", addLabel] }), jsxs("button", { type: "button", onClick: clear, disabled: layers.length === 0, children: [jsx(NtdTrash, { size: 14 }), " ", t('iconStacker.clear', 'Clear the stack')] })] }), !base ? (jsx("p", { className: "nice-icon-stacker__empty", children: t('iconStacker.empty', 'The stack is empty. Add an icon to start one.') })) : (jsxs("div", { className: "nice-icon-stacker__body", children: [jsx("div", { className: "nice-icon-stacker__preview", "aria-label": t('iconStacker.preview', 'Preview'), role: "group", children: PREVIEW_SIZES.map((s) => (jsxs("span", { className: "nice-icon-stacker__preview-cell", children: [renderIconStack(layers, icons, {
|
|
158
|
+
baseProps: { ...previewProps, size: s, title: base.icon },
|
|
159
|
+
}), jsxs("small", { children: [s, "px"] })] }, s))) }), jsx("ol", { className: "nice-icon-stacker__layers", "aria-label": t('iconStacker.layers', 'Layers'), children: tree.map(({ layer: l, depth }) => {
|
|
160
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
161
|
+
const Icon = resolve(l.icon);
|
|
162
|
+
const isBase = l === base;
|
|
163
|
+
const align = (_a = l.align) !== null && _a !== void 0 ? _a : 'center';
|
|
164
|
+
const share = (_b = l.size) !== null && _b !== void 0 ? _b : defaultStackSize(align);
|
|
165
|
+
const innermost = stackChildrenOf(layers, l.id).length === 0;
|
|
166
|
+
const textSize = (_c = l.textSize) !== null && _c !== void 0 ? _c : defaultTextSize(((_d = l.text) !== null && _d !== void 0 ? _d : '').length || 1);
|
|
167
|
+
const bindingInvalid = !!l.textBinding && !isValidTextBinding(l.textBinding);
|
|
168
|
+
const depthStyle = {
|
|
169
|
+
['--nice-icon-stacker-depth']: String(depth),
|
|
170
|
+
};
|
|
171
|
+
const label = (key, fallback) => t(key, fallback).replace('{icon}', l.icon);
|
|
172
|
+
return (jsxs("li", { className: "nice-icon-stacker__layer", style: depthStyle, children: [jsxs("div", { className: "nice-icon-stacker__layer-row", children: [jsx("input", { type: "radio", name: targetGroup, checked: (target === null || target === void 0 ? void 0 : target.id) === l.id, onChange: () => setSelected(l.id), "aria-label": label('iconStacker.target', 'Add the next icon into {icon}'), title: label('iconStacker.target', 'Add the next icon into {icon}') }), jsx("span", { className: "nice-icon-stacker__layer-icon", children: Icon ? jsx(Icon, { size: 24, variant: l.variant }) : null }), jsxs("span", { className: "nice-icon-stacker__layer-name", children: [l.icon, isBase && (jsx("span", { className: "nice-icon-stacker__badge", children: t('iconStacker.base', 'Base') }))] }), !isBase && (jsxs("label", { className: "nice-icon-stacker__field", children: [jsx("span", { children: t('iconStacker.align', 'Position') }), jsx("select", { value: align, onChange: (e) => update(l.id, { align: e.target.value }), children: ALIGNS.map((a) => (jsx("option", { value: a, children: a }, a))) })] })), !isBase && (jsxs("label", { className: "nice-icon-stacker__field", children: [jsx("span", { children: t('iconStacker.size', 'Size') }), jsx("input", { type: "range", min: 0.2, max: 1, step: 0.05, value: share, onChange: (e) => update(l.id, { size: Number(e.target.value) }) }), jsxs("output", { children: [Math.round(share * 100), "%"] })] })), jsx("button", { type: "button", className: "nice-icon-stacker__remove", onClick: () => remove(l.id), "aria-label": label('iconStacker.remove', 'Remove {icon}'), title: label('iconStacker.remove', 'Remove {icon}'), children: jsx(NtdTrash, { size: 14 }) })] }), jsxs("details", { className: "nice-icon-stacker__more", children: [jsx("summary", { children: t('iconStacker.more', 'More') }), jsxs("div", { className: "nice-icon-stacker__more-body", children: [!isBase && (jsxs("label", { className: "nice-icon-stacker__field", children: [jsx("span", { children: t('iconStacker.rotation', 'Turn') }), jsx("input", { type: "range", min: -180, max: 180, step: 15, value: (_e = l.rotation) !== null && _e !== void 0 ? _e : 0, onChange: (e) => update(l.id, { rotation: Number(e.target.value) || undefined }) }), jsxs("output", { children: [(_f = l.rotation) !== null && _f !== void 0 ? _f : 0, "\u00B0"] })] })), jsx(ColorField, { label: t('iconStacker.primary', 'Primary'), value: l.primaryColor, onChange: (v) => update(l.id, { primaryColor: v }), autoLabel: autoLabel, resetLabel: resetLabel }), jsx(ColorField, { label: t('iconStacker.secondary', 'Secondary'), value: l.secondaryColor, onChange: (v) => update(l.id, { secondaryColor: v }), autoLabel: autoLabel, resetLabel: resetLabel }), jsx(ColorField, { label: t('iconStacker.accent', 'Accent'), value: l.accentColor, onChange: (v) => update(l.id, { accentColor: v }), autoLabel: autoLabel, resetLabel: resetLabel })] })] }), (innermost || l.text || l.textBinding) && (jsxs("div", { className: "nice-icon-stacker__text", children: [jsxs("label", { className: "nice-icon-stacker__field", children: [jsx("span", { children: t('iconStacker.text', 'Text') }), jsx("input", { type: "text", value: (_g = l.text) !== null && _g !== void 0 ? _g : '', maxLength: 4, onChange: (e) => update(l.id, { text: e.target.value || undefined }) })] }), jsxs("label", { className: "nice-icon-stacker__field", children: [jsx("span", { children: t('iconStacker.textSize', 'Text size') }), jsx("input", { type: "range", min: 3, max: 14, step: 0.5, value: textSize, onChange: (e) => update(l.id, { textSize: Number(e.target.value) }) }), jsx("output", { children: textSize }), l.textSize !== undefined && (jsx("button", { type: "button", className: "nice-icon-stacker__reset", onClick: () => update(l.id, { textSize: undefined }), "aria-label": resetLabel, title: resetLabel, children: jsx(NtdClose, { size: 12 }) }))] }), jsx(ColorField, { label: t('iconStacker.textColor', 'Text colour'), value: l.textColor, onChange: (v) => update(l.id, { textColor: v }), autoLabel: autoLabel, resetLabel: resetLabel }), jsxs("label", { className: "nice-icon-stacker__field", children: [jsx("span", { children: t('iconStacker.bind', 'Bind to') }), jsx("input", { type: "text", value: (_h = l.textBinding) !== null && _h !== void 0 ? _h : '', "aria-invalid": bindingInvalid || undefined, title: t('iconStacker.bindHint', 'The name of the value the text shows, e.g. count — the text above is a sample'), onChange: (e) => update(l.id, { textBinding: e.target.value.trim() || undefined }) })] })] }))] }, l.id));
|
|
173
|
+
}) }), jsxs("div", { className: "nice-icon-stacker__code", children: [jsx("pre", { children: code }), jsxs("button", { type: "button", onClick: copy, children: [copied ? jsx(NtdCheck, { size: 14 }) : jsx(NtdCopy, { size: 14 }), ' ', copied
|
|
174
|
+
? t('iconStacker.copied', 'Copied')
|
|
175
|
+
: t('iconStacker.copy', 'Copy the code')] })] })] }))] }));
|
|
176
|
+
});
|
|
177
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
178
|
+
NiceIconStacker.displayName = 'NiceIconStacker';
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export { NiceIconStacker, niceIconStackCode };
|
package/dist/esm/client.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { AnimationController, InteractiveIcon, PRESET_INTERACTIONS, PRESET_SEQUENCES, createAnimationSequence, createClickAnimation, createHoverAnimation, createVisibilityAnimation, useAnimationSequence } from './animationControls.js';
|
|
2
2
|
export { NiceIconPicker } from './NiceIconPicker.js';
|
|
3
|
+
export { NiceIconStacker } from './NiceIconStacker.js';
|
|
4
|
+
export { NiceIconStack, isValidTextBinding, niceIconStackCode, renderIconStack } from './iconStack.js';
|
|
3
5
|
export { NtdIconMorph, NtdMorphPair, NtdPathMorph, useMorphState } from './NtdIconMorph.js';
|
|
4
6
|
export { NtdBadge, NtdIconOverlay, NtdIconStack, NtdStatusDot } from './NtdIconBadge.js';
|
|
5
7
|
export { SMIL_ANIMATION_TYPES, SmilAnimationWrapper, createSmilAnimationDef, generateSmilAnimation, isSmilSupported } from './smilAnimations.js';
|
package/dist/esm/createIcon.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef, useId, useSyncExternalStore } from 'react';
|
|
3
3
|
import { sharpenTree, roundTree, wireTree, MINI_SCALE } from './sharpen.js';
|
|
4
4
|
import { generateSmilAnimation } from './smilAnimations.js';
|
|
5
|
-
import {
|
|
5
|
+
import { renderStackChildren, NTD_ICON_MARK } from './stacking.js';
|
|
6
|
+
import { SEMANTIC_COLOR_VARS, SEMANTIC_COLOR_DEFAULTS, SIZE_MAP, GRADIENT_PRESETS } from './types.js';
|
|
6
7
|
|
|
7
8
|
/* ── Dark mode detection hook ───────────────────────── */
|
|
8
9
|
// No `matchMedia` (jsdom without a polyfill, some embedded webviews): light, and nothing to
|
|
@@ -25,6 +26,7 @@ function subscribeColorScheme(callback) {
|
|
|
25
26
|
function useColorScheme() {
|
|
26
27
|
return useSyncExternalStore(subscribeColorScheme, getColorScheme, () => 'light');
|
|
27
28
|
}
|
|
29
|
+
const BOX_CENTER = [12, 12];
|
|
28
30
|
/**
|
|
29
31
|
* Factory function that creates a React icon component from SVG path renderers.
|
|
30
32
|
*
|
|
@@ -111,10 +113,12 @@ function renderCutoutShape(shape, fill, maskId) {
|
|
|
111
113
|
}
|
|
112
114
|
}
|
|
113
115
|
function createIcon(options) {
|
|
114
|
-
const { displayName, viewBox = '0 0 24 24', paths } = options;
|
|
116
|
+
const { displayName, viewBox = '0 0 24 24', paths, textCenter = BOX_CENTER } = options;
|
|
115
117
|
const Icon = forwardRef(({ size = 'md', variant = 'solid', cutoutShape = 'rounded-square', color, lightColor, darkColor, primaryColor: propPrimaryColor = 'currentColor', secondaryColor, accentColor, primaryOpacity = 1, secondaryOpacity = 0.4, accentOpacity = 1, strokeWidth = 2, strokeLinecap: propLinecap, strokeLinejoin: propLinejoin, animation, animationDuration, smilAnimation, smilDuration = 1, smilRepeatCount = 'indefinite', smilEasing = 'ease-in-out', smilDelay = 0, gradient, gradientType = 'linear', gradientAngle = 135, gradientAnimation,
|
|
116
118
|
// Transform props
|
|
117
|
-
rotate, flipX, flipY, scale, transition, transformOrigin = 'center center',
|
|
119
|
+
rotate, flipX, flipY, scale, transition, transformOrigin = 'center center',
|
|
120
|
+
// stacking (1.3.5): the parent icon reads a child's own align / size from its props
|
|
121
|
+
children, stackAlign: _stackAlign, stackSize: _stackSize, stackRotation: _stackRotation, textColor, textSize, title, className, style, ...rest }, ref) => {
|
|
118
122
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
119
123
|
const resolvedSize = typeof size === 'number' ? size : ((_a = SIZE_MAP[size]) !== null && _a !== void 0 ? _a : 24);
|
|
120
124
|
const gradId = useId();
|
|
@@ -223,7 +227,19 @@ function createIcon(options) {
|
|
|
223
227
|
: variant === 'wireframe'
|
|
224
228
|
? wireTree(renderer(renderProps), effectivePrimary)
|
|
225
229
|
: renderer(renderProps);
|
|
226
|
-
|
|
230
|
+
// Children stacked in the icon (1.3.5) — drawn as they are, not re-drawn as the variant.
|
|
231
|
+
const stacked = renderStackChildren(children, {
|
|
232
|
+
variant,
|
|
233
|
+
primaryColor: effectivePrimary,
|
|
234
|
+
accentColor: resolvedAccent,
|
|
235
|
+
tileColor: gradient ? effectivePrimary : resolvedSecondary,
|
|
236
|
+
strokeWidth,
|
|
237
|
+
textCenter,
|
|
238
|
+
textColor,
|
|
239
|
+
textSize,
|
|
240
|
+
});
|
|
241
|
+
const drawn = stacked ? (jsxs(Fragment, { children: [rendered, stacked] })) : (rendered);
|
|
242
|
+
const iconContent = variant === 'mini' ? (jsx("g", { transform: `translate(${center.x} ${center.y}) scale(${MINI_SCALE}) translate(${-center.x} ${-center.y})`, children: drawn })) : (drawn);
|
|
227
243
|
return (jsxs("svg", { ref: ref, xmlns: "http://www.w3.org/2000/svg", viewBox: viewBox, width: resolvedSize, height: resolvedSize, fill: "none", strokeLinecap: strokeLinecap, strokeLinejoin: strokeLinejoin, className: classes, style: animStyle, role: title ? 'img' : 'presentation', "aria-hidden": title ? undefined : true, "aria-label": title, ...rest, children: [title && jsx("title", { children: title }), gradient && (jsx("defs", { children: renderGradientDef(gradId, gradient, gradientType, gradientAngle, gradientAnimation) })), is3d && jsx("defs", { children: render3dFilterDef(filterId) }), isCutout && (jsx("defs", { children: jsxs("mask", { id: maskId, children: [jsx("rect", { x: "0", y: "0", width: "24", height: "24", fill: "white" }), jsx("g", { transform: "translate(12,12) scale(0.8) translate(-12,-12)", children: paths.solid({
|
|
228
244
|
...renderProps,
|
|
229
245
|
primaryColor: 'black',
|
|
@@ -236,6 +252,8 @@ function createIcon(options) {
|
|
|
236
252
|
}) })] }) })), smilAnimation ? (needsSmilScaleWrapper ? (jsxs("g", { transform: `translate(${center.x}, ${center.y})`, filter: is3d ? `url(#${filterId})` : undefined, children: [jsx("g", { transform: `translate(-${center.x}, -${center.y})`, children: iconContent }), smilAnimationElements] })) : (jsxs("g", { filter: is3d ? `url(#${filterId})` : undefined, children: [iconContent, smilAnimationElements] }))) : is3d ? (jsx("g", { filter: `url(#${filterId})`, children: iconContent })) : (iconContent)] }));
|
|
237
253
|
});
|
|
238
254
|
Icon.displayName = displayName;
|
|
255
|
+
// lets a parent icon tell this one among its children (stacking, 1.3.5)
|
|
256
|
+
Icon[NTD_ICON_MARK] = true;
|
|
239
257
|
return Icon;
|
|
240
258
|
}
|
|
241
259
|
|
package/dist/esm/iconParts.js
CHANGED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { createElement } from 'react';
|
|
3
|
+
|
|
4
|
+
/** A name `textBinding` can take: a JavaScript identifier. */
|
|
5
|
+
function isValidTextBinding(name) {
|
|
6
|
+
return !!name && /^[A-Za-z_$][\w$]*$/.test(name);
|
|
7
|
+
}
|
|
8
|
+
/** The id of the layer `layer` sits in, `undefined` for the base. */
|
|
9
|
+
function stackParentId(layers, layer) {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
return layer === layers[0] ? undefined : ((_a = layer.parent) !== null && _a !== void 0 ? _a : (_b = layers[0]) === null || _b === void 0 ? void 0 : _b.id);
|
|
12
|
+
}
|
|
13
|
+
/** The layers that sit directly in layer `id`, in order. */
|
|
14
|
+
function stackChildrenOf(layers, id) {
|
|
15
|
+
return layers.filter((l) => l !== layers[0] && stackParentId(layers, l) === id);
|
|
16
|
+
}
|
|
17
|
+
const COLOR_PROPS = ['primaryColor', 'secondaryColor', 'accentColor', 'textColor'];
|
|
18
|
+
/** The stack as JSX: every layer wrapping the layers that sit in it, text innermost. */
|
|
19
|
+
function niceIconStackCode(layers) {
|
|
20
|
+
const base = layers[0];
|
|
21
|
+
if (!base) {
|
|
22
|
+
return '';
|
|
23
|
+
}
|
|
24
|
+
const bound = layers.filter((l) => isValidTextBinding(l.textBinding));
|
|
25
|
+
const write = (layer, parent, indent) => {
|
|
26
|
+
var _a;
|
|
27
|
+
const attrs = [
|
|
28
|
+
parent ? `stackAlign="${(_a = layer.align) !== null && _a !== void 0 ? _a : 'center'}"` : '',
|
|
29
|
+
parent && layer.size !== undefined ? `stackSize={${layer.size}}` : '',
|
|
30
|
+
parent && layer.rotation ? `stackRotation={${layer.rotation}}` : '',
|
|
31
|
+
layer.variant && layer.variant !== (parent === null || parent === void 0 ? void 0 : parent.variant) ? `variant="${layer.variant}"` : '',
|
|
32
|
+
...COLOR_PROPS.map((p) => (layer[p] ? `${p}="${layer[p]}"` : '')),
|
|
33
|
+
layer.textSize !== undefined ? `textSize={${layer.textSize}}` : '',
|
|
34
|
+
]
|
|
35
|
+
.filter(Boolean)
|
|
36
|
+
.join(' ');
|
|
37
|
+
const open = `${layer.icon}${attrs ? ` ${attrs}` : ''}`;
|
|
38
|
+
const text = isValidTextBinding(layer.textBinding) ? `{${layer.textBinding}}` : layer.text;
|
|
39
|
+
const inner = stackChildrenOf(layers, layer.id);
|
|
40
|
+
if (inner.length === 0) {
|
|
41
|
+
return text ? `${indent}<${open}>${text}</${layer.icon}>` : `${indent}<${open} />`;
|
|
42
|
+
}
|
|
43
|
+
return [
|
|
44
|
+
`${indent}<${open}>`,
|
|
45
|
+
...(text ? [`${indent} ${text}`] : []),
|
|
46
|
+
...inner.map((child) => write(child, layer, `${indent} `)),
|
|
47
|
+
`${indent}</${layer.icon}>`,
|
|
48
|
+
].join('\n');
|
|
49
|
+
};
|
|
50
|
+
const notes = bound.map((l) => `// {${l.textBinding}}: bound text${l.text ? `, e.g. "${l.text}"` : ''}`);
|
|
51
|
+
return [...notes, write(base, undefined, '')].join('\n');
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The stack drawn as icons — the base wrapping the layers that sit in it, text innermost (1.3.6).
|
|
55
|
+
* One SVG, as nesting the icons by hand would give.
|
|
56
|
+
*/
|
|
57
|
+
function renderIconStack(layers, icons, { baseProps, values } = {}) {
|
|
58
|
+
const resolve = (name) => (typeof icons === 'function' ? icons(name) : icons[name]);
|
|
59
|
+
const draw = (layer, parent) => {
|
|
60
|
+
var _a, _b;
|
|
61
|
+
const Icon = resolve(layer.icon);
|
|
62
|
+
if (!Icon) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
const bound = isValidTextBinding(layer.textBinding) ? values === null || values === void 0 ? void 0 : values[layer.textBinding] : undefined;
|
|
66
|
+
const text = bound !== null && bound !== void 0 ? bound : layer.text;
|
|
67
|
+
const own = {
|
|
68
|
+
primaryColor: layer.primaryColor,
|
|
69
|
+
secondaryColor: layer.secondaryColor,
|
|
70
|
+
accentColor: layer.accentColor,
|
|
71
|
+
textColor: layer.textColor,
|
|
72
|
+
textSize: layer.textSize,
|
|
73
|
+
};
|
|
74
|
+
const inner = stackChildrenOf(layers, layer.id).map((child) => draw(child, layer));
|
|
75
|
+
if (!parent) {
|
|
76
|
+
const props = { ...baseProps };
|
|
77
|
+
for (const [k, v] of Object.entries(own)) {
|
|
78
|
+
if (v !== undefined) {
|
|
79
|
+
props[k] = v;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return (createElement(Icon, { ...props, key: layer.id, variant: (_a = layer.variant) !== null && _a !== void 0 ? _a : baseProps === null || baseProps === void 0 ? void 0 : baseProps.variant },
|
|
83
|
+
inner,
|
|
84
|
+
text));
|
|
85
|
+
}
|
|
86
|
+
return (createElement(Icon, { ...own, key: layer.id, stackAlign: (_b = layer.align) !== null && _b !== void 0 ? _b : 'center', stackSize: layer.size, stackRotation: layer.rotation, variant: layer.variant !== parent.variant ? layer.variant : undefined },
|
|
87
|
+
inner,
|
|
88
|
+
text));
|
|
89
|
+
};
|
|
90
|
+
return layers[0] ? draw(layers[0], undefined) : null;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* NiceIconStack (1.3.6) — draws a stack kept as data (NiceIconStacker's layers) as one icon, its
|
|
94
|
+
* bound text filled from `values`: `<NiceIconStack layers={stack} icons={icons} values={{ count }} />`.
|
|
95
|
+
* The rest of the props go to the base icon.
|
|
96
|
+
*/
|
|
97
|
+
function NiceIconStack({ layers, icons, values, ...baseProps }) {
|
|
98
|
+
return jsx(Fragment, { children: renderIconStack(layers, icons, { baseProps, values }) });
|
|
99
|
+
}
|
|
100
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
101
|
+
NiceIconStack.displayName = 'NiceIconStack';
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export { NiceIconStack, isValidTextBinding, niceIconStackCode, renderIconStack, stackChildrenOf, stackParentId };
|
|
@@ -119,13 +119,34 @@ const NtdShare = /* @__PURE__ */ createIcon({
|
|
|
119
119
|
vivid: ({ primaryColor, secondaryColor, strokeWidth }) => shareFilled(primaryColor, secondaryColor, strokeWidth),
|
|
120
120
|
},
|
|
121
121
|
});
|
|
122
|
+
// NtdCopy: the front sheet at the top right (it was at the bottom right), the back one showing at
|
|
123
|
+
// the bottom left as a line that stops 1 short of the front — closer than before. The gap is
|
|
124
|
+
// worked out from the stroke width, so it stays the same at any weight; `sharp` draws the back
|
|
125
|
+
// sheet with square corners (the derived one kept their arcs). Duotone, fills only: the back sheet
|
|
126
|
+
// secondary under the primary front one; vivid: the back line secondary.
|
|
127
|
+
const COPY_FRONT = { x: 8.5, y: 3, width: 12.5, height: 12.5, rx: 2.5 };
|
|
128
|
+
const COPY_BACK = { x: 3, y: 8.5, width: 12.5, height: 12.5, rx: 2.5 };
|
|
129
|
+
/** What shows of the back sheet: its edges outside the front one, `gap` short of it. */
|
|
130
|
+
function copyBack(gap, square = false) {
|
|
131
|
+
const top = COPY_FRONT.x - gap;
|
|
132
|
+
const right = COPY_FRONT.y + COPY_FRONT.height + gap;
|
|
133
|
+
return square
|
|
134
|
+
? `M${top} 8.5H3V21h12.5V${right}`
|
|
135
|
+
: `M${top} 8.5H5.5a2.5 2.5 0 00-2.5 2.5v7.5a2.5 2.5 0 002.5 2.5h7.5a2.5 2.5 0 002.5-2.5V${right}`;
|
|
136
|
+
}
|
|
137
|
+
/** The front sheet filled and the back one as a line 1 short of it (past its round cap). */
|
|
138
|
+
function copyFilled(front, back, strokeWidth, square = false) {
|
|
139
|
+
return (jsxs(Fragment, { children: [jsx("rect", { ...COPY_FRONT, fill: front }), jsx("path", { d: copyBack(1 + strokeWidth / 2, square), stroke: back, strokeWidth: strokeWidth, fill: "none" })] }));
|
|
140
|
+
}
|
|
122
141
|
const NtdCopy = /* @__PURE__ */ createIcon({
|
|
123
142
|
displayName: 'NtdCopy',
|
|
124
143
|
paths: {
|
|
125
|
-
solid: ({ primaryColor, strokeWidth }) => (
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
144
|
+
solid: ({ primaryColor, strokeWidth }) => copyFilled(primaryColor, primaryColor, strokeWidth),
|
|
145
|
+
sharp: ({ primaryColor, strokeWidth }) => copyFilled(primaryColor, primaryColor, strokeWidth, true),
|
|
146
|
+
// both sheets stroked: the back line stops 1 short of the front sheet's line
|
|
147
|
+
outline: ({ primaryColor, strokeWidth }) => (jsxs(Fragment, { children: [jsx("rect", { ...COPY_FRONT, stroke: primaryColor, strokeWidth: strokeWidth, fill: "none" }), jsx("path", { d: copyBack(1 + strokeWidth), stroke: primaryColor, strokeWidth: strokeWidth, fill: "none" })] })),
|
|
148
|
+
duotone: ({ primaryColor, secondaryColor }) => (jsxs(Fragment, { children: [jsx("rect", { ...COPY_BACK, fill: secondaryColor }), jsx("rect", { ...COPY_FRONT, fill: primaryColor })] })),
|
|
149
|
+
vivid: ({ primaryColor, secondaryColor, strokeWidth }) => copyFilled(primaryColor, secondaryColor, strokeWidth),
|
|
129
150
|
},
|
|
130
151
|
});
|
|
131
152
|
/** NtdClipboard's two lines of text, high on the board (they sat below its middle). */
|
package/dist/esm/icons/ai.js
CHANGED
|
@@ -130,6 +130,8 @@ const NtdSparkle = /* @__PURE__ */ createIcon({
|
|
|
130
130
|
vivid: ({ primaryColor, secondaryColor: _secondaryColor }) => (jsxs(Fragment, { children: [jsx("path", { d: "M12 2l2.4 7.2L22 12l-7.6 2.8L12 22l-2.4-7.2L2 12l7.6-2.8L12 2z", fill: primaryColor }), jsx("path", { d: "M12 2l2.4 7.2L22 12l-7.6 2.8L12 22l-2.4-7.2L2 12l7.6-2.8L12 2z", fill: "white", opacity: "0.1" })] })),
|
|
131
131
|
},
|
|
132
132
|
});
|
|
133
|
+
/** @deprecated The same four-pointed star as {@link NtdSparkle} — use that. */
|
|
134
|
+
const NtdStar4 = NtdSparkle;
|
|
133
135
|
const NtdMagicWand = /* @__PURE__ */ createIcon({
|
|
134
136
|
displayName: 'NtdMagicWand',
|
|
135
137
|
paths: {
|
|
@@ -170,4 +172,4 @@ const aiIcons = {
|
|
|
170
172
|
NtdPrompt,
|
|
171
173
|
};
|
|
172
174
|
|
|
173
|
-
export { NtdBrain, NtdChatbot, NtdDataset, NtdDeepLearning, NtdGradient, NtdInference, NtdMagicWand, NtdModel, NtdNeuralNetwork, NtdPrompt, NtdRobot, NtdSparkle, NtdTensor, NtdTraining, NtdVoiceAssistant, aiIcons };
|
|
175
|
+
export { NtdBrain, NtdChatbot, NtdDataset, NtdDeepLearning, NtdGradient, NtdInference, NtdMagicWand, NtdModel, NtdNeuralNetwork, NtdPrompt, NtdRobot, NtdSparkle, NtdStar4, NtdTensor, NtdTraining, NtdVoiceAssistant, aiIcons };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { createIcon } from '../createIcon.js';
|
|
3
|
-
import {
|
|
3
|
+
import { within, paperIcon } from '../iconParts.js';
|
|
4
4
|
|
|
5
5
|
// The band sits halfway down the case and is a cut through it: kept inside the case it meets the
|
|
6
6
|
// sides flush (its round caps stuck out of both). A clasp hangs from its middle: low and wide, in
|
package/dist/esm/icons/files.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { createIcon } from '../createIcon.js';
|
|
3
|
-
import {
|
|
3
|
+
import { within, paperIcon } from '../iconParts.js';
|
|
4
4
|
|
|
5
5
|
// NtdFile is the page every paper icon is drawn on (`paperIcon` in iconParts.tsx): the fold is
|
|
6
6
|
// 8 now (7 before — the duotone's stroked fold looked the largest), secondary when the page is
|
|
@@ -187,13 +187,21 @@ const NtdSmartphone = /* @__PURE__ */ createIcon({
|
|
|
187
187
|
vivid: ({ primaryColor, secondaryColor }) => (jsxs(Fragment, { children: [jsx("rect", { x: "5", y: "2", width: "14", height: "20", rx: "2", fill: primaryColor }), jsx("rect", { x: "5", y: "2", width: "14", height: "20", rx: "2", fill: "white", opacity: "0.1" }), jsx("line", { x1: "12", y1: "18", x2: "12.01", y2: "18", stroke: secondaryColor, strokeWidth: "1.8" })] })),
|
|
188
188
|
},
|
|
189
189
|
});
|
|
190
|
+
// NtdMonitor: the neck and the base are twice the stroke width in every variant but `outline`, and
|
|
191
|
+
// the base is 30% wider — 13 across with its caps (it was 10); it sits at 21.5 so the heavier line
|
|
192
|
+
// stays in the box. Vivid: the stand secondary (it had a fixed #3B82F6 neck).
|
|
193
|
+
const MONITOR_SCREEN = { x: 2, y: 3, width: 20, height: 14, rx: 2 };
|
|
194
|
+
/** Neck and base for a line twice the stroke width: base 9 long + 2 × 2 of cap = 13. */
|
|
195
|
+
const MONITOR_STAND = 'M12 17v4.5M7.5 21.5h9';
|
|
196
|
+
/** The outline's neck and base, at the stroke width: base 11 long + 2 × 1 of cap = 13. */
|
|
197
|
+
const MONITOR_STAND_LINE = 'M12 17v4M6.5 21h11';
|
|
190
198
|
const NtdMonitor = /* @__PURE__ */ createIcon({
|
|
191
199
|
displayName: 'NtdMonitor',
|
|
192
200
|
paths: {
|
|
193
|
-
solid: ({ primaryColor, strokeWidth }) => (jsxs(Fragment, { children: [jsx("rect", {
|
|
194
|
-
outline: ({ primaryColor, strokeWidth }) => (jsxs(Fragment, { children: [jsx("rect", {
|
|
195
|
-
duotone: ({ primaryColor, secondaryColor, secondaryOpacity, strokeWidth }) => (jsxs(Fragment, { children: [jsx("rect", {
|
|
196
|
-
vivid: ({ primaryColor, secondaryColor }) => (jsxs(Fragment, { children: [jsx("rect", {
|
|
201
|
+
solid: ({ primaryColor, strokeWidth }) => (jsxs(Fragment, { children: [jsx("rect", { ...MONITOR_SCREEN, fill: primaryColor }), jsx("path", { d: MONITOR_STAND, stroke: primaryColor, strokeWidth: strokeWidth * 2 })] })),
|
|
202
|
+
outline: ({ primaryColor, strokeWidth }) => (jsxs(Fragment, { children: [jsx("rect", { ...MONITOR_SCREEN, stroke: primaryColor, strokeWidth: strokeWidth, fill: "none" }), jsx("path", { d: MONITOR_STAND_LINE, stroke: primaryColor, strokeWidth: strokeWidth })] })),
|
|
203
|
+
duotone: ({ primaryColor, secondaryColor, secondaryOpacity, strokeWidth }) => (jsxs(Fragment, { children: [jsx("rect", { ...MONITOR_SCREEN, fill: secondaryColor, opacity: secondaryOpacity }), jsx("rect", { ...MONITOR_SCREEN, stroke: primaryColor, strokeWidth: strokeWidth, fill: "none" }), jsx("path", { d: MONITOR_STAND, stroke: primaryColor, strokeWidth: strokeWidth * 2 })] })),
|
|
204
|
+
vivid: ({ primaryColor, secondaryColor, strokeWidth }) => (jsxs(Fragment, { children: [jsx("rect", { ...MONITOR_SCREEN, fill: primaryColor }), jsx("path", { d: MONITOR_STAND, stroke: secondaryColor, strokeWidth: strokeWidth * 2 })] })),
|
|
197
205
|
},
|
|
198
206
|
});
|
|
199
207
|
// NtdCpu: filled, the body and its pins primary and the die in the accent colour (the body was a
|
|
@@ -289,13 +297,22 @@ const NtdCreditCard = /* @__PURE__ */ createIcon({
|
|
|
289
297
|
vivid: ({ primaryColor, accentColor, accentOpacity, uid }) => (jsxs(Fragment, { children: [jsx("rect", { ...CARD_BODY, fill: primaryColor }), jsx("rect", { ...CARD_BODY, fill: "white", opacity: "0.1" }), within(uid, 'stripe', jsx("rect", { ...CARD_BODY }), jsx("rect", { ...CARD_STRIPE, fill: "black", opacity: "0.35" })), jsx("rect", { ...CARD_SIGNATURE, fill: accentColor, opacity: accentOpacity }), jsx("rect", { ...CARD_CVV, fill: accentColor, opacity: accentOpacity })] })),
|
|
290
298
|
},
|
|
291
299
|
});
|
|
300
|
+
// NtdPieChart: filled, two sectors of one pie (r 10) pulled 0.7 apart along the small one's
|
|
301
|
+
// diagonal — a gap between them. The larger is the three-quarter sector from the centre; it was a
|
|
302
|
+
// segment cut off by a chord, which read as an odd shape. The outline keeps its open arc and the
|
|
303
|
+
// slice. Duotone, fills only: the larger sector secondary, the slice primary; vivid the other way.
|
|
304
|
+
const PIE_REST = 'M11.3 12.7V2.7A10 10 0 1 0 21.3 12.7Z';
|
|
305
|
+
const PIE_SLICE = 'M12.7 11.3V1.3A10 10 0 0 1 22.7 11.3Z';
|
|
306
|
+
function pieFilled(rest, slice) {
|
|
307
|
+
return (jsxs(Fragment, { children: [jsx("path", { d: PIE_REST, fill: rest }), jsx("path", { d: PIE_SLICE, fill: slice })] }));
|
|
308
|
+
}
|
|
292
309
|
const NtdPieChart = /* @__PURE__ */ createIcon({
|
|
293
310
|
displayName: 'NtdPieChart',
|
|
294
311
|
paths: {
|
|
295
|
-
solid: ({ primaryColor
|
|
312
|
+
solid: ({ primaryColor }) => pieFilled(primaryColor, primaryColor),
|
|
296
313
|
outline: ({ primaryColor, strokeWidth }) => (jsxs(Fragment, { children: [jsx("path", { d: "M21.21 15.89A10 10 0 118 2.83", stroke: primaryColor, strokeWidth: strokeWidth, fill: "none" }), jsx("path", { d: "M22 12A10 10 0 0012 2v10h10z", stroke: primaryColor, strokeWidth: strokeWidth, fill: "none" })] })),
|
|
297
|
-
duotone: ({ primaryColor, secondaryColor
|
|
298
|
-
vivid: ({ primaryColor, secondaryColor }) => (
|
|
314
|
+
duotone: ({ primaryColor, secondaryColor }) => pieFilled(secondaryColor, primaryColor),
|
|
315
|
+
vivid: ({ primaryColor, secondaryColor }) => pieFilled(primaryColor, secondaryColor),
|
|
299
316
|
},
|
|
300
317
|
});
|
|
301
318
|
const NtdBarChart = /* @__PURE__ */ createIcon({
|
package/dist/esm/icons/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export { NtdArrowDown, NtdArrowLeft, NtdArrowRight, NtdArrowUp, NtdChevronDown, NtdChevronLeft, NtdChevronRight, NtdChevronUp, NtdClose, NtdExternalLink, NtdMenu, NtdMoreHorizontal, NtdMoreVertical, NtdRefresh } from './navigation.js';
|
|
2
2
|
export { NtdCheck, NtdClipboard, NtdCopy, NtdDownload, NtdEdit, NtdEditDetail, NtdFilter, NtdGroup, NtdLink, NtdLock, NtdLogIn, NtdLogOut, NtdMinus, NtdPlus, NtdPrint, NtdRedo, NtdReply, NtdSave, NtdSearch, NtdSettings, NtdShare, NtdSort, NtdTrash, NtdUndo, NtdUngroup, NtdUnlock, NtdUpload, NtdZoomIn, NtdZoomOut } from './actions.js';
|
|
3
3
|
export { NtdAdmin, NtdBackspace, NtdBell, NtdBookmark, NtdCalendar, NtdClock, NtdCursor, NtdError, NtdEye, NtdEyeOff, NtdFlag, NtdGlobe, NtdHeart, NtdHelp, NtdHome, NtdHourglass, NtdInfo, NtdMap, NtdMoon, NtdPin, NtdShield, NtdStar, NtdSuccess, NtdSun, NtdTag, NtdThumbDown, NtdThumbUp, NtdUser, NtdUsers, NtdWarning, NtdWireframe } from './ui.js';
|
|
4
|
-
export { NtdBiodegradable, NtdCarbonFootprint, NtdCo2, NtdCompost, NtdEcoFriendly, NtdEvCharger,
|
|
4
|
+
export { NtdBiodegradable, NtdCarbonFootprint, NtdCo2, NtdCompost, NtdEcoFriendly, NtdEvCharger, NtdNetZero, NtdOrganic, NtdPlantTree, NtdRecycle, NtdSolarPanel, NtdTrashSort, NtdWildlife, NtdWindTurbine, sustainabilityIcons } from './sustainability.js';
|
|
5
5
|
export { NtdAccessibility, NtdAssistiveTech, NtdAudioDescription, NtdBlind, NtdBraille, NtdClosedCaptions, NtdDeaf, NtdDyslexia, NtdEasyRead, NtdHearingAid, NtdScreenReader, NtdSignLanguage, NtdWheelchair, accessibilityIcons } from './accessibility.js';
|
|
6
6
|
export { NtdAudit, NtdCcpa, NtdCertified, NtdCompliance, NtdContract, NtdCookieConsent, NtdCopyright, NtdGdpr, NtdLegalDocument, NtdPatent, NtdPrivacyPolicy, NtdTermsOfService, NtdTrademark, legalIcons } from './legal.js';
|
|
7
7
|
export { NtdBluetooth, NtdBrush, NtdCamera, NtdChat, NtdImage, NtdInbox, NtdMail, NtdMicrophone, NtdMicrophoneOff, NtdMusic, NtdNotification, NtdPalette, NtdPause, NtdPenTool, NtdPhone, NtdPlay, NtdSend, NtdSkipBack, NtdSkipForward, NtdSpline, NtdStop, NtdVideo, NtdVolume, NtdVolumeMute, NtdWifi } from './media.js';
|
|
8
8
|
export { NtdActivity, NtdArchive, NtdAward, NtdBarChart, NtdCart, NtdCloud, NtdCloudDownload, NtdCloudUpload, NtdCode, NtdCoffee, NtdCpu, NtdCreditCard, NtdDatabase, NtdFile, NtdFileText, NtdFolder, NtdFolderOpen, NtdGit, NtdGrid, NtdKey, NtdLayers, NtdList, NtdMonitor, NtdPackage, NtdPieChart, NtdShoppingCart, NtdSmartphone, NtdTable, NtdTarget, NtdTerminal, NtdTruck } from './files.js';
|
|
9
9
|
export { NtdCrown, NtdDice, NtdDumpsterFire, NtdGamepadOldschool, NtdGhost, NtdLightning, NtdPartyPopper, NtdPuzzle, NtdRocket, NtdSad, NtdSkull, NtdSmile, NtdSmiley, NtdTrophy, NtdZap } from './fun.js';
|
|
10
|
-
export { NtdAnchor, NtdBug, NtdCompass, NtdDroplet, NtdFeather, NtdFire, NtdFlower, NtdLeaf, NtdMountain, NtdRain, NtdSnow, NtdSnowflake, NtdSunrise, NtdSunset, NtdThermometer, NtdThunderstorm, NtdTree, NtdUmbrella, NtdWave, NtdWind } from './weather.js';
|
|
11
|
-
export { NtdAngleBisector, NtdArrowDownCircle, NtdArrowLeftCircle, NtdArrowRightCircle, NtdArrowUpCircle, NtdCircle, NtdCornerDownLeft, NtdCornerDownRight, NtdCornerUpLeft, NtdCornerUpRight, NtdCross, NtdDiamond, NtdHexagon, NtdMaximize, NtdMidpoint, NtdMinimize, NtdMove, NtdOctagon, NtdParallel, NtdPentagon, NtdPerpendicular, NtdPoint, NtdRepeat, NtdSegment, NtdShuffle, NtdSquare,
|
|
10
|
+
export { NtdAnchor, NtdBug, NtdCompass, NtdDroplet, NtdFeather, NtdFire, NtdFlower, NtdHydropower, NtdLeaf, NtdMountain, NtdRain, NtdSnow, NtdSnowflake, NtdSunrise, NtdSunset, NtdThermometer, NtdThunderstorm, NtdTree, NtdUmbrella, NtdWave, NtdWind } from './weather.js';
|
|
11
|
+
export { NtdAngleBisector, NtdArrowDownCircle, NtdArrowLeftCircle, NtdArrowRightCircle, NtdArrowUpCircle, NtdCircle, NtdCornerDownLeft, NtdCornerDownRight, NtdCornerUpLeft, NtdCornerUpRight, NtdCross, NtdDiamond, NtdHexagon, NtdMaximize, NtdMidpoint, NtdMinimize, NtdMove, NtdOctagon, NtdParallel, NtdPentagon, NtdPerpendicular, NtdPoint, NtdRepeat, NtdSegment, NtdShuffle, NtdSquare, NtdTriangle } from './shapes.js';
|
|
12
12
|
export { NtdBank, NtdBarcode, NtdBriefcase, NtdCalculator, NtdClipboardCheck, NtdCoins, NtdDollar, NtdInvoice, NtdInvoiceDoc, NtdKanban, NtdMilestone, NtdPercent, NtdPiggyBank, NtdPresentation, NtdReceipt, NtdStore, NtdTrendDown, NtdTrendUp, NtdWallet } from './business.js';
|
|
13
13
|
export { NtdAtSign, NtdBellRing, NtdBubble, NtdMegaphone, NtdPhoneOff, NtdQrCode, NtdThumbsDown, NtdThumbsUp } from './social.js';
|
|
14
14
|
export { NtdAIBrain, NtdAstroLogo, NtdBattery, NtdBlueprint, NtdBrackets, NtdBugDev, NtdBunLogo, NtdComponent, NtdDataMesh, NtdDenoLogo, NtdDeploy, NtdFeatureFlag, NtdFlow, NtdForge, NtdGateway, NtdGitBranch, NtdGitCommit, NtdGitMerge, NtdHash, NtdNeural, NtdNextJsLogo, NtdNodes, NtdPipeline, NtdPrototype, NtdQwikLogo, NtdServer, NtdSlash, NtdSolidJsLogo, NtdSvelteLogo, NtdTauriLogo, NtdViteLogo } from './devtech.js';
|
|
@@ -19,7 +19,7 @@ export { NtdDoorbell, NtdMotionSensor, NtdRouter, NtdSmartBulb, NtdSmartCamera,
|
|
|
19
19
|
export { NtdApple, NtdBandaid, NtdCake, NtdDna, NtdEgg, NtdGlass, NtdHamburger, NtdHeartPulse, NtdPill, NtdPizza, NtdStethoscope, NtdSyringe, NtdWeight } from './health.js';
|
|
20
20
|
export { NtdNiceToDev, NtdOmniVerk, NtdOmniVerkAnimated, NtdOmniVerkBadge, NtdOmniVerkLogo, NtdOmniVerkSpinner, NtdOmniVerkWatermark } from './brand.js';
|
|
21
21
|
export { NtdDice as NtdDiceGaming, NtdDiscord, NtdGamepad, NtdGamepadController, NtdHealthBar, NtdJoystick, NtdLeaderboard, NtdPotion, NtdShield as NtdShieldGaming, NtdStar as NtdStarGaming, NtdSword, NtdTrophy as NtdTrophyGaming, NtdTwitch, NtdVrHeadset, NtdXpBar, NtdYoutubeLive, gamingIcons } from './gaming.js';
|
|
22
|
-
export { NtdVoiceAssistant as NtdAIAssistant, NtdBrain, NtdChatbot, NtdDataset, NtdDeepLearning, NtdGradient, NtdInference, NtdMagicWand, NtdModel, NtdNeuralNetwork, NtdPrompt, NtdRobot, NtdSparkle, NtdTensor, NtdTraining, aiIcons } from './ai.js';
|
|
22
|
+
export { NtdVoiceAssistant as NtdAIAssistant, NtdBrain, NtdChatbot, NtdDataset, NtdDeepLearning, NtdGradient, NtdInference, NtdMagicWand, NtdModel, NtdNeuralNetwork, NtdPrompt, NtdRobot, NtdSparkle, NtdStar4, NtdTensor, NtdTraining, aiIcons } from './ai.js';
|
|
23
23
|
export { NtdBackpack, NtdBook, NtdBookBookmark, NtdCalculator as NtdCalculatorEdu, NtdCertificate, NtdDiploma, NtdExam, NtdFlashcard, NtdGraduationCap, NtdNotebook, NtdOnlineCourse, NtdOpenBook, NtdPen, NtdPencil, NtdQuiz, NtdSchool, NtdUniversity, NtdWebinar, educationIcons } from './education.js';
|
|
24
24
|
export { NtdAtom, NtdBeaker, NtdDna as NtdDnaScience, NtdExperiment, NtdFlask, NtdHypothesis, NtdMagnet, NtdMicroscope, NtdMolecule, NtdPeriodictable, NtdPetriDish, NtdPlanet, NtdResearch, NtdRocket as NtdRocketScience, NtdTelescope, NtdTestTube, scienceIcons } from './science.js';
|
|
25
25
|
export { NtdApartment, NtdBathroom, NtdBedroom, NtdCondo, NtdFloorPlan, NtdForRent, NtdForSale, NtdGarage, NtdHouse as NtdHouseRealEstate, NtdKey as NtdKeyRealEstate, NtdMortgage, NtdOfficeBuilding, NtdPool, NtdSold, NtdSquareMeters, NtdVilla, NtdWarehouse, realestateIcons } from './realestate.js';
|
package/dist/esm/icons/media.js
CHANGED
package/dist/esm/icons/shapes.js
CHANGED
|
@@ -65,6 +65,8 @@ const TRIANGLE_LINE = 'M12 4.24L20.38 21H3.62Z';
|
|
|
65
65
|
const TRIANGLE_ROUND = 'M9.76 6.47A2.5 2.5 0 0 1 14.24 6.47L20.19 18.38A2.5 2.5 0 0 1 17.95 22L6.05 22A2.5 2.5 0 0 1 3.81 18.38Z';
|
|
66
66
|
const NtdTriangle = /* @__PURE__ */ createIcon({
|
|
67
67
|
displayName: 'NtdTriangle',
|
|
68
|
+
// text children centre on the centroid, low in the box (stacking, 1.3.5)
|
|
69
|
+
textCenter: [12, 15.3],
|
|
68
70
|
paths: {
|
|
69
71
|
solid: ({ primaryColor }) => jsx("polygon", { points: "12,2 22,22 2,22", fill: primaryColor }),
|
|
70
72
|
rounded: ({ primaryColor }) => jsx("path", { d: TRIANGLE_ROUND, fill: primaryColor }),
|
|
@@ -124,15 +126,6 @@ const NtdCross = /* @__PURE__ */ createIcon({
|
|
|
124
126
|
rounded: ({ primaryColor }) => (jsx("path", { d: "M10.5 2h3a1.5 1.5 0 011.5 1.5V8a1 1 0 001 1h4.5a1.5 1.5 0 011.5 1.5v3a1.5 1.5 0 01-1.5 1.5H16a1 1 0 00-1 1v4.5a1.5 1.5 0 01-1.5 1.5h-3A1.5 1.5 0 019 20.5V16a1 1 0 00-1-1H3.5A1.5 1.5 0 012 13.5v-3A1.5 1.5 0 013.5 9H8a1 1 0 001-1V3.5A1.5 1.5 0 0110.5 2z", fill: primaryColor })),
|
|
125
127
|
},
|
|
126
128
|
});
|
|
127
|
-
const NtdStar4 = /* @__PURE__ */ createIcon({
|
|
128
|
-
displayName: 'NtdStar4',
|
|
129
|
-
paths: {
|
|
130
|
-
solid: ({ primaryColor, strokeWidth: _strokeWidth }) => (jsx("path", { d: "M12 2l2.5 7.5L22 12l-7.5 2.5L12 22l-2.5-7.5L2 12l7.5-2.5z", fill: primaryColor })),
|
|
131
|
-
outline: ({ primaryColor, strokeWidth }) => (jsx("path", { d: "M12 2l2.5 7.5L22 12l-7.5 2.5L12 22l-2.5-7.5L2 12l7.5-2.5z", stroke: primaryColor, strokeWidth: strokeWidth, fill: "none" })),
|
|
132
|
-
duotone: ({ primaryColor, secondaryColor, secondaryOpacity, strokeWidth }) => (jsxs(Fragment, { children: [jsx("path", { d: "M12 2l2.5 7.5L22 12l-7.5 2.5L12 22l-2.5-7.5L2 12l7.5-2.5z", fill: secondaryColor, opacity: secondaryOpacity }), jsx("path", { d: "M12 2l2.5 7.5L22 12l-7.5 2.5L12 22l-2.5-7.5L2 12l7.5-2.5z", stroke: primaryColor, strokeWidth: strokeWidth, fill: "none" })] })),
|
|
133
|
-
vivid: ({ primaryColor, secondaryColor: _secondaryColor }) => (jsxs(Fragment, { children: [jsx("path", { d: "M12 2l2.5 7.5L22 12l-7.5 2.5L12 22l-2.5-7.5L2 12l7.5-2.5z", fill: primaryColor }), jsx("path", { d: "M12 2l2.5 7.5L22 12l-7.5 2.5L12 22l-2.5-7.5L2 12l7.5-2.5z", fill: "white", opacity: "0.1" })] })),
|
|
134
|
-
},
|
|
135
|
-
});
|
|
136
129
|
// The four corner arrows: the tail's level run sits at the height of the arrowhead's tip, so the
|
|
137
130
|
// two meet (it ran 2 units off the tip and the head looked stuck on beside the tail). It stops 2
|
|
138
131
|
// short of the tip: with the square caps of `sharp` it stuck out of the point. The filled variants
|
|
@@ -330,4 +323,4 @@ const NtdAngleBisector = /* @__PURE__ */ createIcon({
|
|
|
330
323
|
},
|
|
331
324
|
});
|
|
332
325
|
|
|
333
|
-
export { NtdAngleBisector, NtdArrowDownCircle, NtdArrowLeftCircle, NtdArrowRightCircle, NtdArrowUpCircle, NtdCircle, NtdCornerDownLeft, NtdCornerDownRight, NtdCornerUpLeft, NtdCornerUpRight, NtdCross, NtdDiamond, NtdHexagon, NtdMaximize, NtdMidpoint, NtdMinimize, NtdMove, NtdOctagon, NtdParallel, NtdPentagon, NtdPerpendicular, NtdPoint, NtdRepeat, NtdSegment, NtdShuffle, NtdSquare,
|
|
326
|
+
export { NtdAngleBisector, NtdArrowDownCircle, NtdArrowLeftCircle, NtdArrowRightCircle, NtdArrowUpCircle, NtdCircle, NtdCornerDownLeft, NtdCornerDownRight, NtdCornerUpLeft, NtdCornerUpRight, NtdCross, NtdDiamond, NtdHexagon, NtdMaximize, NtdMidpoint, NtdMinimize, NtdMove, NtdOctagon, NtdParallel, NtdPentagon, NtdPerpendicular, NtdPoint, NtdRepeat, NtdSegment, NtdShuffle, NtdSquare, NtdTriangle };
|