@twentyfirstmedia/ui-core 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ICONS-LICENSE ADDED
@@ -0,0 +1,53 @@
1
+ Icon library (src/icon-library.ts, dist/icon-library.js)
2
+
3
+ Line icons are derived from Lucide (https://lucide.dev), licensed as follows:
4
+
5
+ ISC License
6
+
7
+ Copyright (c) 2026 Lucide Icons and Contributors
8
+
9
+ Permission to use, copy, modify, and/or distribute this software for any
10
+ purpose with or without fee is hereby granted, provided that the above
11
+ copyright notice and this permission notice appear in all copies.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20
+
21
+ ---
22
+
23
+ The following Lucide icons are derived from the Feather project:
24
+
25
+ airplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out
26
+
27
+ The MIT License (MIT) (for the icons listed above)
28
+
29
+ Copyright (c) 2013-present Cole Bemis
30
+
31
+ Permission is hereby granted, free of charge, to any person obtaining a copy
32
+ of this software and associated documentation files (the "Software"), to deal
33
+ in the Software without restriction, including without limitation the rights
34
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
35
+ copies of the Software, and to permit persons to whom the Software is
36
+ furnished to do so, subject to the following conditions:
37
+
38
+ The above copyright notice and this permission notice shall be included in all
39
+ copies or substantial portions of the Software.
40
+
41
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
42
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
43
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
44
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
45
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
46
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
47
+ SOFTWARE.
48
+
49
+ ---
50
+
51
+ Brand logos (names starting with "brand") are from Simple Icons (https://simpleicons.org),
52
+ released under CC0 1.0 Universal. The logos themselves are trademarks of their respective
53
+ owners; use them according to each brand's guidelines.
package/dist/Icon.d.ts CHANGED
@@ -9,9 +9,12 @@ export interface IconProps {
9
9
  className?: string;
10
10
  style?: CSSProperties;
11
11
  }
12
- /** A line icon from the kit's set, drawn in `currentColor`. */
12
+ /**
13
+ * A line icon from the kit's set, drawn in `currentColor`. Icons from the library (or your own)
14
+ * show once registered with `registerIcons`; an unknown name draws a placeholder and warns once.
15
+ */
13
16
  export declare function Icon({ name, size, label, className, style }: IconProps): import("react").JSX.Element;
14
17
  export declare namespace Icon {
15
- var names: ("code" | "link" | "map" | "menu" | "search" | "filter" | "image" | "thumbUp" | "thumbDown" | "arrowUp" | "heart" | "tag" | "cart" | "package" | "truck" | "plus" | "minus" | "check" | "x" | "more" | "bell" | "clock" | "eye" | "edit" | "trash" | "users" | "user" | "home" | "chart" | "mail" | "grid" | "share" | "play" | "calendar" | "file" | "card" | "swap" | "send" | "download" | "book" | "chevronDown" | "chevronLeft" | "chevronRight" | "arrowUpRight" | "sparkle" | "settings" | "lock" | "paperclip" | "star" | "flag" | "trend" | "globe" | "inbox" | "logout" | "moon" | "bot" | "branch" | "terminal" | "server" | "key" | "database" | "refresh" | "pause" | "archive" | "reply" | "shield" | "help" | "cpu" | "zap" | "folder" | "pin" | "upload" | "copy" | "bed" | "ruler" | "wallet" | "ban" | "list" | "layers" | "bold" | "italic" | "underline" | "olist" | "heading" | "quote" | "undo" | "redo" | "monitor" | "phone" | "expand" | "sun" | "cookie" | "webhook")[];
18
+ var names: ("code" | "link" | "map" | "menu" | "search" | "filter" | "image" | "plus" | "minus" | "check" | "x" | "more" | "edit" | "trash" | "copy" | "download" | "upload" | "share" | "reply" | "refresh" | "undo" | "redo" | "swap" | "expand" | "eye" | "logout" | "paperclip" | "arrowUp" | "arrowUpRight" | "chevronDown" | "chevronLeft" | "chevronRight" | "home" | "grid" | "list" | "layers" | "settings" | "help" | "flag" | "ban" | "star" | "user" | "users" | "lock" | "key" | "shield" | "cookie" | "mail" | "inbox" | "send" | "bell" | "phone" | "heart" | "thumbUp" | "thumbDown" | "file" | "folder" | "archive" | "book" | "bold" | "italic" | "underline" | "olist" | "heading" | "quote" | "play" | "pause" | "monitor" | "branch" | "terminal" | "server" | "cpu" | "webhook" | "bot" | "sparkle" | "zap" | "database" | "chart" | "trend" | "calendar" | "clock" | "cart" | "tag" | "package" | "truck" | "card" | "wallet" | "pin" | "globe" | "bed" | "ruler" | "sun" | "moon")[];
16
19
  }
17
20
  //# sourceMappingURL=Icon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../src/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAA0B,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEnE,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,QAAQ,CAAC;IACf,yEAAyE;IACzE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yFAAyF;IACzF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,+DAA+D;AAC/D,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,IAAS,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,SAAS,+BAoB3E;yBApBe,IAAI"}
1
+ {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../src/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAoC,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE7E,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,QAAQ,CAAC;IACf,yEAAyE;IACzE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yFAAyF;IACzF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAID;;;GAGG;AACH,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,IAAS,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,SAAS,+BA+B3E;yBA/Be,IAAI"}
package/dist/Icon.js CHANGED
@@ -1,9 +1,22 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { cx } from "./cx.js";
3
- import { ICON_NAMES, ICON_PATHS } from "./icons.js";
4
- /** A line icon from the kit's set, drawn in `currentColor`. */
3
+ import { ICON_NAMES, ICON_PATHS, iconData } from "./icons.js";
4
+ const warned = new Set();
5
+ /**
6
+ * A line icon from the kit's set, drawn in `currentColor`. Icons from the library (or your own)
7
+ * show once registered with `registerIcons`; an unknown name draws a placeholder and warns once.
8
+ */
5
9
  export function Icon({ name, size = 16, label, className, style }) {
6
- return (_jsx("svg", { className: cx("tf-ico", className), width: size, height: size, viewBox: "0 0 24 24", fill: name === "play" ? "currentColor" : "none", stroke: "currentColor", strokeWidth: name === "more" ? 3.2 : 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": label ? undefined : true, role: label ? "img" : undefined, "aria-label": label, style: { width: size, height: size, ...style }, children: _jsx("path", { d: ICON_PATHS[name] ?? ICON_PATHS.sparkle }) }));
10
+ let data = iconData(name);
11
+ if (data === undefined) {
12
+ if (!warned.has(name)) {
13
+ warned.add(name);
14
+ console.warn(`Twentyfirst UI: no icon "${name}". Register it first: registerIcons({ ${name} }) with ${name} from "@twentyfirstmedia/halo/icons" (or /pro/icons).`);
15
+ }
16
+ data = ICON_PATHS.sparkle;
17
+ }
18
+ const filled = typeof data !== "string" || name === "play";
19
+ return (_jsx("svg", { className: cx("tf-ico", className), width: size, height: size, viewBox: "0 0 24 24", fill: filled ? "currentColor" : "none", stroke: typeof data === "string" ? "currentColor" : "none", strokeWidth: name === "more" ? 3.2 : 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": label ? undefined : true, role: label ? "img" : undefined, "aria-label": label, style: { width: size, height: size, ...style }, children: _jsx("path", { d: typeof data === "string" ? data : data.d }) }));
7
20
  }
8
21
  Icon.names = ICON_NAMES;
9
22
  //# sourceMappingURL=Icon.js.map
package/dist/Icon.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.js","sourceRoot":"","sources":["../src/Icon.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,UAAU,EAAiB,MAAM,YAAY,CAAC;AAYnE,+DAA+D;AAC/D,MAAM,UAAU,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAa;IAC1E,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,EAClC,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,IAAI,EACZ,OAAO,EAAC,WAAW,EACnB,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,EAC/C,MAAM,EAAC,cAAc,EACrB,WAAW,EAAE,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EACtC,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,iBACT,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EACrC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,gBACnB,KAAK,EACjB,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,YAE9C,eAAM,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,OAAO,GAAI,GAC/C,CACP,CAAC;AACJ,CAAC;AACD,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC"}
1
+ {"version":3,"file":"Icon.js","s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