@behivetech/atoms.icon 0.0.0-stage → 0.3.3

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/dist/index.js ADDED
@@ -0,0 +1,462 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __commonJS = (cb, mod) => function __require() {
8
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
+ // If the importer is in node compatibility mode or this is not an ESM
20
+ // file that has been converted to a CommonJS file using a Babel-
21
+ // compatible transform (i.e. "__esModule" has not been set), then set
22
+ // "default" to the CommonJS "module.exports" for node compatibility.
23
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
+ mod
25
+ ));
26
+
27
+ // ../../../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js
28
+ var require_classnames = __commonJS({
29
+ "../../../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js"(exports, module) {
30
+ "use strict";
31
+ (function() {
32
+ "use strict";
33
+ var hasOwn = {}.hasOwnProperty;
34
+ function classNames() {
35
+ var classes = "";
36
+ for (var i = 0; i < arguments.length; i++) {
37
+ var arg = arguments[i];
38
+ if (arg) {
39
+ classes = appendClass(classes, parseValue(arg));
40
+ }
41
+ }
42
+ return classes;
43
+ }
44
+ function parseValue(arg) {
45
+ if (typeof arg === "string" || typeof arg === "number") {
46
+ return arg;
47
+ }
48
+ if (typeof arg !== "object") {
49
+ return "";
50
+ }
51
+ if (Array.isArray(arg)) {
52
+ return classNames.apply(null, arg);
53
+ }
54
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
55
+ return arg.toString();
56
+ }
57
+ var classes = "";
58
+ for (var key in arg) {
59
+ if (hasOwn.call(arg, key) && arg[key]) {
60
+ classes = appendClass(classes, key);
61
+ }
62
+ }
63
+ return classes;
64
+ }
65
+ function appendClass(value, newClass) {
66
+ if (!newClass) {
67
+ return value;
68
+ }
69
+ if (value) {
70
+ return value + " " + newClass;
71
+ }
72
+ return value + newClass;
73
+ }
74
+ if (typeof module !== "undefined" && module.exports) {
75
+ classNames.default = classNames;
76
+ module.exports = classNames;
77
+ } else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
78
+ define("classnames", [], function() {
79
+ return classNames;
80
+ });
81
+ } else {
82
+ window.classNames = classNames;
83
+ }
84
+ })();
85
+ }
86
+ });
87
+
88
+ // ../../../../packages/registry/class-names/dist/index.js
89
+ var import_classnames = __toESM(require_classnames(), 1);
90
+ var getClassName = ({
91
+ className,
92
+ modifiers = {},
93
+ rootClass,
94
+ styles = {}
95
+ }) => {
96
+ function getModifiers() {
97
+ const updatedModifiers = {};
98
+ const modifierKeys = Object.keys(modifiers);
99
+ if (modifierKeys.length) {
100
+ modifierKeys.forEach((modKey) => {
101
+ const classKey = `${rootClass}--${modKey}`;
102
+ const newClassName = styles[classKey] || classKey;
103
+ updatedModifiers[newClassName] = modifiers[modKey] ?? false;
104
+ });
105
+ }
106
+ return updatedModifiers;
107
+ }
108
+ function getChildClass(childClassName) {
109
+ const classKey = `${rootClass}__${childClassName}`;
110
+ return styles[classKey] || classKey;
111
+ }
112
+ function getRootStyles() {
113
+ return (0, import_classnames.default)(
114
+ className,
115
+ {
116
+ ...getModifiers()
117
+ },
118
+ styles[rootClass] || rootClass
119
+ );
120
+ }
121
+ return [getRootStyles(), getChildClass];
122
+ };
123
+
124
+ // icon.module.scss
125
+ var icon_module_default = {
126
+ "BHT__Icon": "BHT__Icon",
127
+ "BHT__Icon--sm": "BHT__Icon--sm",
128
+ "BHT__Icon--md": "BHT__Icon--md",
129
+ "BHT__Icon--lg": "BHT__Icon--lg",
130
+ "BHT__Icon--xl": "BHT__Icon--xl"
131
+ };
132
+
133
+ // create-icon.tsx
134
+ import { jsx } from "react/jsx-runtime";
135
+ function createIcon(displayName, children) {
136
+ const Component = ({ size = "md", className, ...rest }) => {
137
+ const [rootClass] = getClassName({
138
+ className,
139
+ rootClass: "BHT__Icon",
140
+ modifiers: { [size]: true },
141
+ styles: icon_module_default
142
+ });
143
+ return /* @__PURE__ */ jsx(
144
+ "svg",
145
+ {
146
+ ...rest,
147
+ className: rootClass,
148
+ viewBox: "0 0 24 24",
149
+ fill: "none",
150
+ stroke: "currentColor",
151
+ strokeWidth: 2,
152
+ strokeLinecap: "round",
153
+ strokeLinejoin: "round",
154
+ "aria-hidden": "true",
155
+ children
156
+ }
157
+ );
158
+ };
159
+ Component.displayName = displayName;
160
+ return Component;
161
+ }
162
+
163
+ // icons/close.tsx
164
+ import { jsx as jsx2 } from "react/jsx-runtime";
165
+ var CloseIcon = /* @__PURE__ */ createIcon(
166
+ "CloseIcon",
167
+ /* @__PURE__ */ jsx2("path", { d: "M18 6 6 18M6 6l12 12" })
168
+ );
169
+
170
+ // icons/chevron-up.tsx
171
+ import { jsx as jsx3 } from "react/jsx-runtime";
172
+ var ChevronUpIcon = /* @__PURE__ */ createIcon(
173
+ "ChevronUpIcon",
174
+ /* @__PURE__ */ jsx3("path", { d: "M18 15l-6-6-6 6" })
175
+ );
176
+
177
+ // icons/chevron-down.tsx
178
+ import { jsx as jsx4 } from "react/jsx-runtime";
179
+ var ChevronDownIcon = /* @__PURE__ */ createIcon(
180
+ "ChevronDownIcon",
181
+ /* @__PURE__ */ jsx4("path", { d: "M6 9l6 6 6-6" })
182
+ );
183
+
184
+ // icons/pencil.tsx
185
+ import { Fragment, jsx as jsx5, jsxs } from "react/jsx-runtime";
186
+ var PencilIcon = /* @__PURE__ */ createIcon(
187
+ "PencilIcon",
188
+ /* @__PURE__ */ jsxs(Fragment, { children: [
189
+ /* @__PURE__ */ jsx5("path", { d: "M12 20h9" }),
190
+ /* @__PURE__ */ jsx5("path", { d: "M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4Z" })
191
+ ] })
192
+ );
193
+
194
+ // icons/trash.tsx
195
+ import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
196
+ var TrashIcon = /* @__PURE__ */ createIcon(
197
+ "TrashIcon",
198
+ /* @__PURE__ */ jsxs2(Fragment2, { children: [
199
+ /* @__PURE__ */ jsx6("path", { d: "M3 6h18" }),
200
+ /* @__PURE__ */ jsx6("path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }),
201
+ /* @__PURE__ */ jsx6("path", { d: "M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" }),
202
+ /* @__PURE__ */ jsx6("path", { d: "M10 11v6" }),
203
+ /* @__PURE__ */ jsx6("path", { d: "M14 11v6" })
204
+ ] })
205
+ );
206
+
207
+ // icons/box.tsx
208
+ import { Fragment as Fragment3, jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
209
+ var BoxIcon = /* @__PURE__ */ createIcon(
210
+ "BoxIcon",
211
+ /* @__PURE__ */ jsxs3(Fragment3, { children: [
212
+ /* @__PURE__ */ jsx7("path", { d: "M21 8 12 3 3 8l9 5 9-5Z" }),
213
+ /* @__PURE__ */ jsx7("path", { d: "M3 8v8l9 5 9-5V8" }),
214
+ /* @__PURE__ */ jsx7("path", { d: "M12 13v8" })
215
+ ] })
216
+ );
217
+
218
+ // icons/upload.tsx
219
+ import { Fragment as Fragment4, jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
220
+ var UploadIcon = /* @__PURE__ */ createIcon(
221
+ "UploadIcon",
222
+ /* @__PURE__ */ jsxs4(Fragment4, { children: [
223
+ /* @__PURE__ */ jsx8("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
224
+ /* @__PURE__ */ jsx8("path", { d: "M17 8l-5-5-5 5" }),
225
+ /* @__PURE__ */ jsx8("path", { d: "M12 3v12" })
226
+ ] })
227
+ );
228
+
229
+ // icons/bold.tsx
230
+ import { Fragment as Fragment5, jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
231
+ var BoldIcon = /* @__PURE__ */ createIcon(
232
+ "BoldIcon",
233
+ /* @__PURE__ */ jsxs5(Fragment5, { children: [
234
+ /* @__PURE__ */ jsx9("path", { d: "M6 4h8a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z" }),
235
+ /* @__PURE__ */ jsx9("path", { d: "M6 12h9a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z" })
236
+ ] })
237
+ );
238
+
239
+ // icons/italic.tsx
240
+ import { Fragment as Fragment6, jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
241
+ var ItalicIcon = /* @__PURE__ */ createIcon(
242
+ "ItalicIcon",
243
+ /* @__PURE__ */ jsxs6(Fragment6, { children: [
244
+ /* @__PURE__ */ jsx10("path", { d: "M19 4h-9" }),
245
+ /* @__PURE__ */ jsx10("path", { d: "M14 20H5" }),
246
+ /* @__PURE__ */ jsx10("path", { d: "M15 4 9 20" })
247
+ ] })
248
+ );
249
+
250
+ // icons/list.tsx
251
+ import { Fragment as Fragment7, jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
252
+ var ListIcon = /* @__PURE__ */ createIcon(
253
+ "ListIcon",
254
+ /* @__PURE__ */ jsxs7(Fragment7, { children: [
255
+ /* @__PURE__ */ jsx11("path", { d: "M8 6h13" }),
256
+ /* @__PURE__ */ jsx11("path", { d: "M8 12h13" }),
257
+ /* @__PURE__ */ jsx11("path", { d: "M8 18h13" }),
258
+ /* @__PURE__ */ jsx11("path", { d: "M3 6h.01" }),
259
+ /* @__PURE__ */ jsx11("path", { d: "M3 12h.01" }),
260
+ /* @__PURE__ */ jsx11("path", { d: "M3 18h.01" })
261
+ ] })
262
+ );
263
+
264
+ // icons/link.tsx
265
+ import { Fragment as Fragment8, jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
266
+ var LinkIcon = /* @__PURE__ */ createIcon(
267
+ "LinkIcon",
268
+ /* @__PURE__ */ jsxs8(Fragment8, { children: [
269
+ /* @__PURE__ */ jsx12("path", { d: "M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3" }),
270
+ /* @__PURE__ */ jsx12("path", { d: "M8 12h8" })
271
+ ] })
272
+ );
273
+
274
+ // icons/image.tsx
275
+ import { Fragment as Fragment9, jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
276
+ var ImageIcon = /* @__PURE__ */ createIcon(
277
+ "ImageIcon",
278
+ /* @__PURE__ */ jsxs9(Fragment9, { children: [
279
+ /* @__PURE__ */ jsx13("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
280
+ /* @__PURE__ */ jsx13("circle", { cx: "8.5", cy: "8.5", r: "1.5" }),
281
+ /* @__PURE__ */ jsx13("path", { d: "M21 15l-5-5L5 21" })
282
+ ] })
283
+ );
284
+
285
+ // icons/file-text.tsx
286
+ import { Fragment as Fragment10, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
287
+ var FileTextIcon = /* @__PURE__ */ createIcon(
288
+ "FileTextIcon",
289
+ /* @__PURE__ */ jsxs10(Fragment10, { children: [
290
+ /* @__PURE__ */ jsx14("path", { d: "M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2Z" }),
291
+ /* @__PURE__ */ jsx14("path", { d: "M14 2v6h6" }),
292
+ /* @__PURE__ */ jsx14("path", { d: "M16 13H8" }),
293
+ /* @__PURE__ */ jsx14("path", { d: "M16 17H8" }),
294
+ /* @__PURE__ */ jsx14("path", { d: "M10 9H8" })
295
+ ] })
296
+ );
297
+
298
+ // icons/ellipse.tsx
299
+ import { jsx as jsx15 } from "react/jsx-runtime";
300
+ var EllipseIcon = /* @__PURE__ */ createIcon(
301
+ "EllipseIcon",
302
+ /* @__PURE__ */ jsx15("ellipse", { cx: "12", cy: "12", rx: "10", ry: "7" })
303
+ );
304
+
305
+ // icons/rectangle.tsx
306
+ import { jsx as jsx16 } from "react/jsx-runtime";
307
+ var RectangleIcon = /* @__PURE__ */ createIcon(
308
+ "RectangleIcon",
309
+ /* @__PURE__ */ jsx16("rect", { x: "2", y: "5", width: "20", height: "14", rx: "1" })
310
+ );
311
+
312
+ // icons/polygon.tsx
313
+ import { jsx as jsx17 } from "react/jsx-runtime";
314
+ var PolygonIcon = /* @__PURE__ */ createIcon(
315
+ "PolygonIcon",
316
+ /* @__PURE__ */ jsx17("path", { d: "M10.83 2.38a2 2 0 0 1 2.34 0l8 5.74a2 2 0 0 1 .73 2.25l-3.04 9.26a2 2 0 0 1-1.9 1.37H7.04a2 2 0 0 1-1.9-1.37L2.1 10.37a2 2 0 0 1 .73-2.25z" })
317
+ );
318
+
319
+ // icons/cursor.tsx
320
+ import { jsx as jsx18 } from "react/jsx-runtime";
321
+ var CursorIcon = /* @__PURE__ */ createIcon(
322
+ "CursorIcon",
323
+ /* @__PURE__ */ jsx18("path", { d: "M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z" })
324
+ );
325
+
326
+ // icons/label.tsx
327
+ import { Fragment as Fragment11, jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
328
+ var LabelIcon = /* @__PURE__ */ createIcon(
329
+ "LabelIcon",
330
+ /* @__PURE__ */ jsxs11(Fragment11, { children: [
331
+ /* @__PURE__ */ jsx19("path", { d: "M12 4v16" }),
332
+ /* @__PURE__ */ jsx19("path", { d: "M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2" }),
333
+ /* @__PURE__ */ jsx19("path", { d: "M9 20h6" })
334
+ ] })
335
+ );
336
+
337
+ // icons/camp-border.tsx
338
+ import { Fragment as Fragment12, jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
339
+ var CampBorderIcon = /* @__PURE__ */ createIcon(
340
+ "CampBorderIcon",
341
+ /* @__PURE__ */ jsxs12(Fragment12, { children: [
342
+ /* @__PURE__ */ jsx20("path", { d: "M5 3a2 2 0 0 0-2 2" }),
343
+ /* @__PURE__ */ jsx20("path", { d: "M19 3a2 2 0 0 1 2 2" }),
344
+ /* @__PURE__ */ jsx20("path", { d: "M21 19a2 2 0 0 1-2 2" }),
345
+ /* @__PURE__ */ jsx20("path", { d: "M5 21a2 2 0 0 1-2-2" }),
346
+ /* @__PURE__ */ jsx20("path", { d: "M9 3h1" }),
347
+ /* @__PURE__ */ jsx20("path", { d: "M9 21h1" }),
348
+ /* @__PURE__ */ jsx20("path", { d: "M14 3h1" }),
349
+ /* @__PURE__ */ jsx20("path", { d: "M14 21h1" }),
350
+ /* @__PURE__ */ jsx20("path", { d: "M3 9v1" }),
351
+ /* @__PURE__ */ jsx20("path", { d: "M21 9v1" }),
352
+ /* @__PURE__ */ jsx20("path", { d: "M3 14v1" }),
353
+ /* @__PURE__ */ jsx20("path", { d: "M21 14v1" })
354
+ ] })
355
+ );
356
+
357
+ // icons/structure.tsx
358
+ import { Fragment as Fragment13, jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
359
+ var StructureIcon = /* @__PURE__ */ createIcon(
360
+ "StructureIcon",
361
+ /* @__PURE__ */ jsxs13(Fragment13, { children: [
362
+ /* @__PURE__ */ jsx21("path", { d: "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8" }),
363
+ /* @__PURE__ */ jsx21("path", { d: "M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" })
364
+ ] })
365
+ );
366
+
367
+ // icons/road.tsx
368
+ import { Fragment as Fragment14, jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
369
+ var RoadIcon = /* @__PURE__ */ createIcon(
370
+ "RoadIcon",
371
+ /* @__PURE__ */ jsxs14(Fragment14, { children: [
372
+ /* @__PURE__ */ jsx22("path", { d: "M4 19l4-14" }),
373
+ /* @__PURE__ */ jsx22("path", { d: "M16 5l4 14" }),
374
+ /* @__PURE__ */ jsx22("path", { d: "M12 8v-2" }),
375
+ /* @__PURE__ */ jsx22("path", { d: "M12 13v-2" }),
376
+ /* @__PURE__ */ jsx22("path", { d: "M12 18v-2" })
377
+ ] })
378
+ );
379
+
380
+ // icons/restroom.tsx
381
+ import { Fragment as Fragment15, jsx as jsx23, jsxs as jsxs15 } from "react/jsx-runtime";
382
+ var RestroomIcon = /* @__PURE__ */ createIcon(
383
+ "RestroomIcon",
384
+ /* @__PURE__ */ jsxs15(Fragment15, { children: [
385
+ /* @__PURE__ */ jsx23("circle", { cx: "6.5", cy: "4", r: "2" }),
386
+ /* @__PURE__ */ jsx23("path", { d: "M3.5 14 6.5 8l3 6z" }),
387
+ /* @__PURE__ */ jsx23("path", { d: "M5 14v7" }),
388
+ /* @__PURE__ */ jsx23("path", { d: "M8 14v7" }),
389
+ /* @__PURE__ */ jsx23("circle", { cx: "17.5", cy: "4", r: "2" }),
390
+ /* @__PURE__ */ jsx23("path", { d: "M14.5 14 17.5 8l3 6z" }),
391
+ /* @__PURE__ */ jsx23("path", { d: "M16 14v7" }),
392
+ /* @__PURE__ */ jsx23("path", { d: "M19 14v7" })
393
+ ] })
394
+ );
395
+
396
+ // icons/registry.ts
397
+ var iconRegistry = {
398
+ close: CloseIcon,
399
+ "chevron-up": ChevronUpIcon,
400
+ "chevron-down": ChevronDownIcon,
401
+ pencil: PencilIcon,
402
+ trash: TrashIcon,
403
+ box: BoxIcon,
404
+ upload: UploadIcon,
405
+ bold: BoldIcon,
406
+ italic: ItalicIcon,
407
+ list: ListIcon,
408
+ link: LinkIcon,
409
+ image: ImageIcon,
410
+ "file-text": FileTextIcon,
411
+ ellipse: EllipseIcon,
412
+ rectangle: RectangleIcon,
413
+ polygon: PolygonIcon,
414
+ cursor: CursorIcon,
415
+ label: LabelIcon,
416
+ "camp-border": CampBorderIcon,
417
+ structure: StructureIcon,
418
+ road: RoadIcon,
419
+ restroom: RestroomIcon
420
+ };
421
+
422
+ // icon.tsx
423
+ import { jsx as jsx24 } from "react/jsx-runtime";
424
+ var Icon = ({ name, ...rest }) => {
425
+ const Glyph = iconRegistry[name];
426
+ return /* @__PURE__ */ jsx24(Glyph, { ...rest });
427
+ };
428
+ export {
429
+ BoldIcon,
430
+ BoxIcon,
431
+ CampBorderIcon,
432
+ ChevronDownIcon,
433
+ ChevronUpIcon,
434
+ CloseIcon,
435
+ CursorIcon,
436
+ EllipseIcon,
437
+ FileTextIcon,
438
+ Icon,
439
+ ImageIcon,
440
+ ItalicIcon,
441
+ LabelIcon,
442
+ LinkIcon,
443
+ ListIcon,
444
+ PencilIcon,
445
+ PolygonIcon,
446
+ RectangleIcon,
447
+ RestroomIcon,
448
+ RoadIcon,
449
+ StructureIcon,
450
+ TrashIcon,
451
+ UploadIcon,
452
+ createIcon
453
+ };
454
+ /*! Bundled license information:
455
+
456
+ classnames/index.js:
457
+ (*!
458
+ Copyright (c) 2018 Jed Watson.
459
+ Licensed under the MIT License (MIT), see
460
+ http://jedwatson.github.io/classnames
461
+ *)
462
+ */
package/docs.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "$schema": "https://github.com/behivetech/bht-component-registry/docs.schema.json",
3
+ "version": 2,
4
+ "generatedAt": "2026-10-23T16:58:35.576Z",
5
+ "docs": [
6
+ {
7
+ "displayName": "Icon",
8
+ "description": "Renders any icon by name.\n\nConvenient when the icon is chosen at runtime — a toolbar built from config,\nsay — but the lookup is dynamic, so a bundler cannot know which glyphs are\nreachable and this pulls in the entire set. Import the icon you want\n(`import { BoxIcon } from \"@behivetech/atoms.icon\"`, or\n`\"@behivetech/atoms.icon/box\"`) wherever the name is known at build time.",
9
+ "extendsNative": true,
10
+ "props": [
11
+ {
12
+ "name": "name",
13
+ "type": "enum",
14
+ "required": true,
15
+ "defaultValue": null,
16
+ "description": "Which icon to render"
17
+ },
18
+ {
19
+ "name": "className",
20
+ "type": "string",
21
+ "required": false,
22
+ "defaultValue": null,
23
+ "description": "Additional class names to merge with the component root element"
24
+ },
25
+ {
26
+ "name": "size",
27
+ "type": "\"sm\" | \"md\" | \"lg\" | \"xl\"",
28
+ "required": false,
29
+ "defaultValue": null,
30
+ "description": "Controls width/height; defaults to md"
31
+ }
32
+ ]
33
+ }
34
+ ],
35
+ "functions": [
36
+ {
37
+ "name": "createIcon",
38
+ "kind": "function",
39
+ "description": "Builds a single icon component from its glyph geometry.\n\nThis is the only module that imports the stylesheet, so the per-icon modules\nstay free of side effects and a consumer importing one icon pulls in one\nglyph rather than the whole set.",
40
+ "signatures": [
41
+ {
42
+ "text": "createIcon(displayName: string, children: ReactNode): IconComponent",
43
+ "params": [
44
+ {
45
+ "name": "displayName",
46
+ "type": "string",
47
+ "optional": false,
48
+ "defaultValue": null,
49
+ "description": ""
50
+ },
51
+ {
52
+ "name": "children",
53
+ "type": "ReactNode",
54
+ "optional": false,
55
+ "defaultValue": null,
56
+ "description": ""
57
+ }
58
+ ],
59
+ "returns": {
60
+ "type": "IconComponent",
61
+ "description": ""
62
+ }
63
+ }
64
+ ],
65
+ "examples": []
66
+ }
67
+ ]
68
+ }
@@ -0,0 +1,65 @@
1
+ import { BoxIcon, Icon, TrashIcon, type IconName } from "./index.js";
2
+
3
+ const names: IconName[] = [
4
+ "close",
5
+ "chevron-up",
6
+ "chevron-down",
7
+ "pencil",
8
+ "trash",
9
+ "box",
10
+ "upload",
11
+ "bold",
12
+ "italic",
13
+ "list",
14
+ "link",
15
+ "image",
16
+ "file-text",
17
+ ];
18
+
19
+ const mapEditorNames: IconName[] = [
20
+ "ellipse",
21
+ "rectangle",
22
+ "polygon",
23
+ "cursor",
24
+ "label",
25
+ "camp-border",
26
+ "structure",
27
+ "road",
28
+ "restroom",
29
+ ];
30
+
31
+ export const AllIcons = () => (
32
+ <div style={{ display: "flex", gap: "0.75rem" }}>
33
+ {names.map((name) => (
34
+ <Icon key={name} name={name} />
35
+ ))}
36
+ </div>
37
+ );
38
+
39
+ export const MapEditorIcons = () => (
40
+ <div style={{ display: "flex", gap: "0.75rem" }}>
41
+ {mapEditorNames.map((name) => (
42
+ <Icon key={name} name={name} />
43
+ ))}
44
+ </div>
45
+ );
46
+
47
+ /** The size these are actually used at in an icon-only toolbar. */
48
+ export const MapEditorIconsAtToolbarSize = () => (
49
+ <div style={{ display: "flex", gap: "0.75rem" }}>
50
+ {mapEditorNames.map((name) => (
51
+ <Icon key={name} name={name} size="sm" />
52
+ ))}
53
+ </div>
54
+ );
55
+
56
+ export const SmallIcon = () => <Icon name="trash" size="sm" />;
57
+ export const LargeIcon = () => <Icon name="trash" size="lg" />;
58
+
59
+ /** The tree-shakeable form: import the glyph, not the set. */
60
+ export const DirectIconImports = () => (
61
+ <div style={{ display: "flex", gap: "0.75rem" }}>
62
+ <BoxIcon />
63
+ <TrashIcon size="lg" />
64
+ </div>
65
+ );
@@ -0,0 +1,24 @@
1
+ .BHT__Icon {
2
+ display: inline-block;
3
+ flex-shrink: 0;
4
+
5
+ &--sm {
6
+ width: 1rem;
7
+ height: 1rem;
8
+ }
9
+
10
+ &--md {
11
+ width: 1.25rem;
12
+ height: 1.25rem;
13
+ }
14
+
15
+ &--lg {
16
+ width: 1.5rem;
17
+ height: 1.5rem;
18
+ }
19
+
20
+ &--xl {
21
+ width: 2.5rem;
22
+ height: 2.5rem;
23
+ }
24
+ }
package/icon.tsx ADDED
@@ -0,0 +1,23 @@
1
+ import { type IconBaseProps } from "./create-icon.js";
2
+ import { iconRegistry } from "./icons/registry.js";
3
+
4
+ export type IconName = keyof typeof iconRegistry;
5
+
6
+ export interface IconProps extends Omit<IconBaseProps, "name"> {
7
+ /** Which icon to render */
8
+ name: IconName;
9
+ }
10
+
11
+ /**
12
+ * Renders any icon by name.
13
+ *
14
+ * Convenient when the icon is chosen at runtime — a toolbar built from config,
15
+ * say — but the lookup is dynamic, so a bundler cannot know which glyphs are
16
+ * reachable and this pulls in the entire set. Import the icon you want
17
+ * (`import { BoxIcon } from "@behivetech/atoms.icon"`, or
18
+ * `"@behivetech/atoms.icon/box"`) wherever the name is known at build time.
19
+ */
20
+ export const Icon = ({ name, ...rest }: IconProps) => {
21
+ const Glyph = iconRegistry[name];
22
+ return <Glyph {...rest} />;
23
+ };
package/index.ts ADDED
@@ -0,0 +1,11 @@
1
+ // Per-icon components — the tree-shakeable path. Each lives in its own module
2
+ // and is built with a /*#__PURE__*/ annotation, so importing one glyph costs
3
+ // one glyph.
4
+ export * from "./icons/index.js";
5
+
6
+ export { createIcon } from "./create-icon.js";
7
+ export type { IconBaseProps, IconComponent, IconSize } from "./create-icon.js";
8
+
9
+ // Name-keyed convenience API. Pulls in every glyph; see the note on `Icon`.
10
+ export { Icon } from "./icon.js";
11
+ export type { IconProps, IconName } from "./icon.js";