@incursa/ui-kit 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/NOTICE +8 -0
  2. package/README.md +16 -0
  3. package/dist/icons/index.js +371 -0
  4. package/dist/icons/package.json +3 -0
  5. package/dist/inc-design-language.css +34 -1
  6. package/dist/inc-design-language.css.map +1 -1
  7. package/dist/inc-design-language.js +1558 -1462
  8. package/dist/inc-design-language.min.css +1 -1
  9. package/dist/inc-design-language.min.css.map +1 -1
  10. package/dist/mcp/components/cards.json +3 -3
  11. package/dist/mcp/components/metrics.json +3 -3
  12. package/dist/mcp/components/states.json +3 -3
  13. package/dist/mcp/examples/data-grid-advanced.json +2 -2
  14. package/dist/mcp/examples/demo.json +2 -2
  15. package/dist/mcp/examples/overlay-workflows.json +2 -2
  16. package/dist/mcp/examples/reference.json +2 -2
  17. package/dist/mcp/examples/states.json +2 -2
  18. package/dist/mcp/examples/web-components.json +2 -2
  19. package/dist/mcp/guides/latest.json +2 -2
  20. package/dist/mcp/guides/package-metadata.json +2 -2
  21. package/dist/mcp/guides/update.json +2 -2
  22. package/dist/mcp/install.json +1 -1
  23. package/dist/mcp/patterns/data-grid-advanced.json +2 -2
  24. package/dist/mcp/patterns/demo.json +2 -2
  25. package/dist/mcp/patterns/overlay-workflows.json +2 -2
  26. package/dist/mcp/patterns/reference.json +2 -2
  27. package/dist/mcp/patterns/states.json +2 -2
  28. package/dist/mcp/patterns/web-components.json +2 -2
  29. package/dist/mcp/resources.json +77 -74
  30. package/dist/mcp/search-index.json +21 -21
  31. package/dist/mcp/update.json +2 -2
  32. package/dist/mcp/worker.mjs +164 -281
  33. package/dist/mcp/worker.mjs.map +2 -2
  34. package/dist/web-components/README.md +4 -0
  35. package/dist/web-components/components/actions.js +149 -2
  36. package/dist/web-components/components/feedback.js +63 -12
  37. package/dist/web-components/index.js +501 -14
  38. package/package.json +10 -3
  39. package/src/icons/index.js +229 -0
  40. package/src/icons/package.json +3 -0
  41. package/src/inc-design-language.js +12 -11
  42. package/src/inc-design-language.scss +38 -1
  43. package/src/web-components/README.md +4 -0
  44. package/src/web-components/components/actions.js +149 -2
  45. package/src/web-components/components/feedback.js +63 -12
@@ -1984,19 +1984,338 @@ if (typeof globalThis !== "undefined") {
1984
1984
  });
1985
1985
  }
1986
1986
 
1987
+ // node_modules/lucide/dist/esm/defaultAttributes.mjs
1988
+ var defaultAttributes = {
1989
+ xmlns: "http://www.w3.org/2000/svg",
1990
+ width: 24,
1991
+ height: 24,
1992
+ viewBox: "0 0 24 24",
1993
+ fill: "none",
1994
+ stroke: "currentColor",
1995
+ "stroke-width": 2,
1996
+ "stroke-linecap": "round",
1997
+ "stroke-linejoin": "round"
1998
+ };
1999
+
2000
+ // node_modules/lucide/dist/esm/createElement.mjs
2001
+ var createSVGElement = ([tag, attrs, children]) => {
2002
+ const element = document.createElementNS("http://www.w3.org/2000/svg", tag);
2003
+ Object.keys(attrs).forEach((name) => {
2004
+ element.setAttribute(name, String(attrs[name]));
2005
+ });
2006
+ if (children?.length) {
2007
+ children.forEach((child) => {
2008
+ const childElement = createSVGElement(child);
2009
+ element.appendChild(childElement);
2010
+ });
2011
+ }
2012
+ return element;
2013
+ };
2014
+ var createElement = (iconNode, customAttrs = {}) => {
2015
+ const tag = "svg";
2016
+ const attrs = {
2017
+ ...defaultAttributes,
2018
+ ...customAttrs
2019
+ };
2020
+ return createSVGElement([tag, attrs, iconNode]);
2021
+ };
2022
+
2023
+ // node_modules/lucide/dist/esm/icons/circle-check.mjs
2024
+ var CircleCheck = [
2025
+ ["circle", { cx: "12", cy: "12", r: "10" }],
2026
+ ["path", { d: "m9 12 2 2 4-4" }]
2027
+ ];
2028
+
2029
+ // node_modules/lucide/dist/esm/icons/circle-question-mark.mjs
2030
+ var CircleQuestionMark = [
2031
+ ["circle", { cx: "12", cy: "12", r: "10" }],
2032
+ ["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }],
2033
+ ["path", { d: "M12 17h.01" }]
2034
+ ];
2035
+
2036
+ // node_modules/lucide/dist/esm/icons/circle-x.mjs
2037
+ var CircleX = [
2038
+ ["circle", { cx: "12", cy: "12", r: "10" }],
2039
+ ["path", { d: "m15 9-6 6" }],
2040
+ ["path", { d: "m9 9 6 6" }]
2041
+ ];
2042
+
2043
+ // node_modules/lucide/dist/esm/icons/download.mjs
2044
+ var Download = [
2045
+ ["path", { d: "M12 15V3" }],
2046
+ ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }],
2047
+ ["path", { d: "m7 10 5 5 5-5" }]
2048
+ ];
2049
+
2050
+ // node_modules/lucide/dist/esm/icons/external-link.mjs
2051
+ var ExternalLink = [
2052
+ ["path", { d: "M15 3h6v6" }],
2053
+ ["path", { d: "M10 14 21 3" }],
2054
+ ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }]
2055
+ ];
2056
+
2057
+ // node_modules/lucide/dist/esm/icons/file-text.mjs
2058
+ var FileText = [
2059
+ [
2060
+ "path",
2061
+ {
2062
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"
2063
+ }
2064
+ ],
2065
+ ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5" }],
2066
+ ["path", { d: "M10 9H8" }],
2067
+ ["path", { d: "M16 13H8" }],
2068
+ ["path", { d: "M16 17H8" }]
2069
+ ];
2070
+
2071
+ // node_modules/lucide/dist/esm/icons/folder-plus.mjs
2072
+ var FolderPlus = [
2073
+ ["path", { d: "M12 10v6" }],
2074
+ ["path", { d: "M9 13h6" }],
2075
+ [
2076
+ "path",
2077
+ {
2078
+ d: "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"
2079
+ }
2080
+ ]
2081
+ ];
2082
+
2083
+ // node_modules/lucide/dist/esm/icons/info.mjs
2084
+ var Info = [
2085
+ ["circle", { cx: "12", cy: "12", r: "10" }],
2086
+ ["path", { d: "M12 16v-4" }],
2087
+ ["path", { d: "M12 8h.01" }]
2088
+ ];
2089
+
2090
+ // node_modules/lucide/dist/esm/icons/lock.mjs
2091
+ var Lock = [
2092
+ ["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2" }],
2093
+ ["path", { d: "M7 11V7a5 5 0 0 1 10 0v4" }]
2094
+ ];
2095
+
2096
+ // node_modules/lucide/dist/esm/icons/pause.mjs
2097
+ var Pause = [
2098
+ ["rect", { x: "14", y: "3", width: "5", height: "18", rx: "1" }],
2099
+ ["rect", { x: "5", y: "3", width: "5", height: "18", rx: "1" }]
2100
+ ];
2101
+
2102
+ // node_modules/lucide/dist/esm/icons/play.mjs
2103
+ var Play = [
2104
+ [
2105
+ "path",
2106
+ { d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z" }
2107
+ ]
2108
+ ];
2109
+
2110
+ // node_modules/lucide/dist/esm/icons/refresh-cw.mjs
2111
+ var RefreshCw = [
2112
+ ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }],
2113
+ ["path", { d: "M21 3v5h-5" }],
2114
+ ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" }],
2115
+ ["path", { d: "M8 16H3v5" }]
2116
+ ];
2117
+
2118
+ // node_modules/lucide/dist/esm/icons/search-x.mjs
2119
+ var SearchX = [
2120
+ ["path", { d: "m13.5 8.5-5 5" }],
2121
+ ["path", { d: "m8.5 8.5 5 5" }],
2122
+ ["circle", { cx: "11", cy: "11", r: "8" }],
2123
+ ["path", { d: "m21 21-4.3-4.3" }]
2124
+ ];
2125
+
2126
+ // node_modules/lucide/dist/esm/icons/settings.mjs
2127
+ var Settings = [
2128
+ [
2129
+ "path",
2130
+ {
2131
+ d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"
2132
+ }
2133
+ ],
2134
+ ["circle", { cx: "12", cy: "12", r: "3" }]
2135
+ ];
2136
+
2137
+ // node_modules/lucide/dist/esm/icons/shield-check.mjs
2138
+ var ShieldCheck = [
2139
+ [
2140
+ "path",
2141
+ {
2142
+ d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"
2143
+ }
2144
+ ],
2145
+ ["path", { d: "m9 12 2 2 4-4" }]
2146
+ ];
2147
+
2148
+ // node_modules/lucide/dist/esm/icons/triangle-alert.mjs
2149
+ var TriangleAlert = [
2150
+ ["path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }],
2151
+ ["path", { d: "M12 9v4" }],
2152
+ ["path", { d: "M12 17h.01" }]
2153
+ ];
2154
+
2155
+ // node_modules/lucide/dist/esm/icons/upload.mjs
2156
+ var Upload = [
2157
+ ["path", { d: "M12 3v12" }],
2158
+ ["path", { d: "m17 8-5-5-5 5" }],
2159
+ ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }]
2160
+ ];
2161
+
2162
+ // src/icons/index.js
2163
+ var ICON_NODES = Object.freeze({
2164
+ info: Info,
2165
+ help: CircleQuestionMark,
2166
+ success: CircleCheck,
2167
+ warning: TriangleAlert,
2168
+ error: CircleX,
2169
+ upload: Upload,
2170
+ document: FileText,
2171
+ download: Download,
2172
+ settings: Settings,
2173
+ "external-link": ExternalLink,
2174
+ empty: FolderPlus,
2175
+ "no-results": SearchX,
2176
+ loading: RefreshCw,
2177
+ lock: Lock,
2178
+ pause: Pause,
2179
+ play: Play,
2180
+ permission: ShieldCheck
2181
+ });
2182
+ var ICON_NAMES = Object.freeze(Object.keys(ICON_NODES));
2183
+ var DEFAULT_SIZE = 16;
2184
+ function getNamespace() {
2185
+ if (typeof globalThis === "undefined") {
2186
+ return null;
2187
+ }
2188
+ const root = globalThis.IncWebComponents || (globalThis.IncWebComponents = {});
2189
+ const icons = root.icons || (root.icons = {});
2190
+ if (!icons.names) {
2191
+ icons.names = ICON_NAMES;
2192
+ }
2193
+ if (!icons.defaultRenderer) {
2194
+ icons.defaultRenderer = renderDefaultIcon;
2195
+ }
2196
+ if (!icons.render) {
2197
+ icons.render = renderIncIcon;
2198
+ }
2199
+ if (!icons.setRenderer) {
2200
+ icons.setRenderer = setIconRenderer;
2201
+ }
2202
+ return icons;
2203
+ }
2204
+ function normalizeIconName(name) {
2205
+ return String(name || "").trim().toLowerCase().replace(/[_\s]+/g, "-");
2206
+ }
2207
+ function normalizeSize(value) {
2208
+ const parsed = Number.parseFloat(value);
2209
+ return Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_SIZE;
2210
+ }
2211
+ function buildIconAttributes(name, options = {}) {
2212
+ const size = normalizeSize(options.size);
2213
+ const className = options.className || "inc-icon";
2214
+ const attrs = {
2215
+ width: size,
2216
+ height: size,
2217
+ "data-inc-icon": name,
2218
+ class: className,
2219
+ focusable: "false"
2220
+ };
2221
+ if (options.decorative !== false) {
2222
+ attrs["aria-hidden"] = "true";
2223
+ } else {
2224
+ attrs.role = "img";
2225
+ attrs["aria-label"] = options.label || name;
2226
+ }
2227
+ return attrs;
2228
+ }
2229
+ function renderDefaultIcon(name, options = {}) {
2230
+ const normalizedName = normalizeIconName(name);
2231
+ const iconNode = ICON_NODES[normalizedName] || ICON_NODES.info;
2232
+ if (typeof document === "undefined") {
2233
+ return "";
2234
+ }
2235
+ return createElement(iconNode, buildIconAttributes(normalizedName, options));
2236
+ }
2237
+ function coerceIconResult(result) {
2238
+ if (!result || typeof document === "undefined") {
2239
+ return null;
2240
+ }
2241
+ if (result instanceof Node) {
2242
+ return result;
2243
+ }
2244
+ if (typeof result === "string") {
2245
+ const template = document.createElement("template");
2246
+ template.innerHTML = result.trim();
2247
+ return template.content.firstElementChild || null;
2248
+ }
2249
+ return null;
2250
+ }
2251
+ function getIconRenderer() {
2252
+ const namespace2 = getNamespace();
2253
+ return typeof namespace2?.renderer === "function" ? namespace2.renderer : renderDefaultIcon;
2254
+ }
2255
+ function setIconRenderer(renderer) {
2256
+ const namespace2 = getNamespace();
2257
+ if (!namespace2) {
2258
+ return null;
2259
+ }
2260
+ if (renderer == null) {
2261
+ delete namespace2.renderer;
2262
+ return null;
2263
+ }
2264
+ if (typeof renderer !== "function") {
2265
+ throw new TypeError("Inc icon renderer must be a function.");
2266
+ }
2267
+ namespace2.renderer = renderer;
2268
+ return renderer;
2269
+ }
2270
+ function renderIncIcon(name, options = {}) {
2271
+ const normalizedName = normalizeIconName(name) || "info";
2272
+ const renderer = getIconRenderer();
2273
+ const rendered = renderer(normalizedName, options);
2274
+ const icon = coerceIconResult(rendered) || coerceIconResult(renderDefaultIcon(normalizedName, options));
2275
+ if (icon instanceof Element && options.decorative !== false) {
2276
+ icon.setAttribute("aria-hidden", "true");
2277
+ icon.removeAttribute("aria-label");
2278
+ icon.removeAttribute("role");
2279
+ }
2280
+ return icon;
2281
+ }
2282
+ function replaceIconContents(container, name, options = {}) {
2283
+ if (!(container instanceof Element)) {
2284
+ return null;
2285
+ }
2286
+ container.replaceChildren();
2287
+ const icon = renderIncIcon(name, options);
2288
+ if (icon) {
2289
+ icon.setAttribute("data-inc-generated-icon", "true");
2290
+ icon.setAttribute("data-inc-icon-upgraded", "true");
2291
+ container.append(icon);
2292
+ }
2293
+ return icon;
2294
+ }
2295
+ getNamespace();
2296
+
1987
2297
  // src/web-components/components/feedback.js
1988
2298
  var THEME_MODES = ["light", "dark", "system"];
1989
2299
  var DEFAULT_THEME_STORAGE_KEY = "inc-theme-mode";
1990
2300
  var BADGE_TONES = /* @__PURE__ */ new Set(["primary", "secondary", "success", "danger", "warning", "info"]);
1991
2301
  var SPINNER_VARIANTS = /* @__PURE__ */ new Set(["border", "grow"]);
1992
- var AUTO_REFRESH_PAUSE_ICON = `
1993
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true">
1994
- <path d="M4 3h3v10H4zM9 3h3v10H9z"></path>
1995
- </svg>`.trim();
1996
- var AUTO_REFRESH_PLAY_ICON = `
1997
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true">
1998
- <path d="M4 3.5v9l8-4.5-8-4.5z"></path>
1999
- </svg>`.trim();
2302
+ var ICON_NAME_SET = new Set(ICON_NAMES);
2303
+ var STATE_ICON_BY_VARIANT = /* @__PURE__ */ new Map([
2304
+ ["empty", "empty"],
2305
+ ["results", "no-results"],
2306
+ ["loading", "loading"],
2307
+ ["error", "error"],
2308
+ ["danger", "error"],
2309
+ ["warning", "warning"],
2310
+ ["success", "success"],
2311
+ ["info", "info"]
2312
+ ]);
2313
+ var STATE_ICON_BY_STATUS = /* @__PURE__ */ new Map([
2314
+ ["+", "empty"],
2315
+ ["?", "no-results"],
2316
+ ["!", "error"],
2317
+ ["...", "loading"]
2318
+ ]);
2000
2319
  var HostElement3 = typeof HTMLElement === "undefined" ? class {
2001
2320
  } : HTMLElement;
2002
2321
  var themeSubscribers = /* @__PURE__ */ new Set();
@@ -2026,6 +2345,28 @@ function toPositiveInt(value) {
2026
2345
  function normalizeToken(value) {
2027
2346
  return String(value ?? "").trim().toLowerCase();
2028
2347
  }
2348
+ function resolveStateIconName(icon, status, variant) {
2349
+ const explicitIcon = normalizeIconName(icon);
2350
+ if (explicitIcon) {
2351
+ return explicitIcon;
2352
+ }
2353
+ const normalizedStatus = normalizeIconName(status);
2354
+ if (STATE_ICON_BY_STATUS.has(String(status || "").trim())) {
2355
+ return STATE_ICON_BY_STATUS.get(String(status || "").trim());
2356
+ }
2357
+ if (ICON_NAME_SET.has(normalizedStatus)) {
2358
+ return normalizedStatus;
2359
+ }
2360
+ return STATE_ICON_BY_VARIANT.get(normalizeToken(variant)) || "info";
2361
+ }
2362
+ function renderDecorativeIcon(container, name, size = 18) {
2363
+ replaceIconContents(container, name, {
2364
+ className: "inc-icon",
2365
+ decorative: true,
2366
+ size
2367
+ });
2368
+ container.hidden = false;
2369
+ }
2029
2370
  function getSystemTheme() {
2030
2371
  if (!window.matchMedia) {
2031
2372
  return "light";
@@ -2154,7 +2495,7 @@ function formatRemaining(totalSeconds) {
2154
2495
  return `${minutes}m ${seconds}s`;
2155
2496
  }
2156
2497
  var IncStatePanel = class extends HostElement3 {
2157
- static observedAttributes = ["tone", "variant", "title", "body", "status", "open"];
2498
+ static observedAttributes = ["tone", "variant", "title", "body", "status", "icon", "open"];
2158
2499
  #fallback = null;
2159
2500
  #appliedVariantClass = "";
2160
2501
  connectedCallback() {
@@ -2186,6 +2527,7 @@ var IncStatePanel = class extends HostElement3 {
2186
2527
  body.className = "inc-state-panel__body";
2187
2528
  actions.className = "inc-state-panel__actions";
2188
2529
  icon.setAttribute("part", "icon");
2530
+ icon.setAttribute("aria-hidden", "true");
2189
2531
  title.setAttribute("part", "title");
2190
2532
  body.setAttribute("part", "body");
2191
2533
  actions.setAttribute("part", "actions");
@@ -2212,10 +2554,18 @@ var IncStatePanel = class extends HostElement3 {
2212
2554
  const title = this.getAttribute("title") || "";
2213
2555
  const body = this.getAttribute("body") || "";
2214
2556
  const status = this.getAttribute("status") || "";
2557
+ const iconName = resolveStateIconName(this.getAttribute("icon"), status, nextVariant);
2215
2558
  this.#fallback.title.textContent = title;
2216
2559
  this.#fallback.body.textContent = body;
2217
- this.#fallback.icon.textContent = status;
2218
- this.#fallback.icon.hidden = !status;
2560
+ if (iconName === "none") {
2561
+ this.#fallback.icon.replaceChildren();
2562
+ this.#fallback.icon.hidden = true;
2563
+ } else if (ICON_NAME_SET.has(iconName)) {
2564
+ renderDecorativeIcon(this.#fallback.icon, iconName, 22);
2565
+ } else {
2566
+ this.#fallback.icon.textContent = status;
2567
+ this.#fallback.icon.hidden = !status;
2568
+ }
2219
2569
  this.#fallback.actions.hidden = true;
2220
2570
  }
2221
2571
  #dispatchSlotChange() {
@@ -2679,7 +3029,7 @@ var IncAutoRefresh = class extends HostElement3 {
2679
3029
  this.#parts.toggleText.textContent = actionLabel;
2680
3030
  }
2681
3031
  if (this.#parts.toggleIcon instanceof HTMLElement) {
2682
- this.#parts.toggleIcon.innerHTML = this.#isPaused ? AUTO_REFRESH_PLAY_ICON : AUTO_REFRESH_PAUSE_ICON;
3032
+ renderDecorativeIcon(this.#parts.toggleIcon, this.#isPaused ? "play" : "pause", 16);
2683
3033
  }
2684
3034
  }
2685
3035
  #stop() {
@@ -3044,6 +3394,14 @@ var ALERT_DEFAULT_ROLE_BY_TONE = /* @__PURE__ */ new Map([
3044
3394
  ["info", "status"],
3045
3395
  ["secondary", "status"]
3046
3396
  ]);
3397
+ var ALERT_ICON_BY_TONE = /* @__PURE__ */ new Map([
3398
+ ["success", "success"],
3399
+ ["danger", "error"],
3400
+ ["warning", "warning"],
3401
+ ["info", "info"],
3402
+ ["secondary", "info"],
3403
+ ["primary", "info"]
3404
+ ]);
3047
3405
  var HostElement4 = typeof HTMLElement === "undefined" ? class {
3048
3406
  } : HTMLElement;
3049
3407
  function toBoolean(value, fallback = false) {
@@ -3064,6 +3422,20 @@ function emit2(host, type, detail = {}, options = {}) {
3064
3422
  cancelable: options.cancelable === true
3065
3423
  }));
3066
3424
  }
3425
+ function getDirectIconSlot(host) {
3426
+ return Array.from(host.children || []).find((node) => node instanceof HTMLElement && node.getAttribute("slot") === "icon") || null;
3427
+ }
3428
+ function hasConsumerIcon(container) {
3429
+ return Array.from(container.children || []).some((node) => node instanceof HTMLElement && !node.hasAttribute("data-inc-generated-icon"));
3430
+ }
3431
+ function renderDecorativeIcon2(container, name, options = {}) {
3432
+ replaceIconContents(container, name, {
3433
+ className: "inc-icon",
3434
+ decorative: true,
3435
+ size: options.size || 16
3436
+ });
3437
+ container.hidden = false;
3438
+ }
3067
3439
  var IncElement = class extends HostElement4 {
3068
3440
  emit(type, detail = {}, options = {}) {
3069
3441
  return emit2(this, type, detail, options);
@@ -3071,7 +3443,7 @@ var IncElement = class extends HostElement4 {
3071
3443
  };
3072
3444
  var IncButtonElement = class extends IncElement {
3073
3445
  static get observedAttributes() {
3074
- return ["tone", "variant", "size", "loading", "href", "type", "disabled", "label", "target", "rel", "download"];
3446
+ return ["tone", "variant", "size", "loading", "href", "type", "disabled", "label", "target", "rel", "download", "icon"];
3075
3447
  }
3076
3448
  connectedCallback() {
3077
3449
  addClass(this, "inc-button");
@@ -3159,6 +3531,7 @@ var IncButtonElement = class extends IncElement {
3159
3531
  control.removeAttribute("aria-busy");
3160
3532
  this.removeLoadingSpinner(control);
3161
3533
  }
3534
+ this.syncIcon(control);
3162
3535
  const label = this.getAttribute("label");
3163
3536
  if (label) {
3164
3537
  control.setAttribute("aria-label", label);
@@ -3204,6 +3577,41 @@ var IncButtonElement = class extends IncElement {
3204
3577
  }
3205
3578
  control.querySelectorAll(":scope > [data-inc-button-spinner]").forEach((node) => node.remove());
3206
3579
  }
3580
+ syncIcon(control) {
3581
+ if (!(control instanceof HTMLElement)) {
3582
+ return;
3583
+ }
3584
+ const explicitIcon = normalizeIconName(this.getAttribute("icon"));
3585
+ const inferredIcon = this.getAttribute("download") != null ? "download" : this.getAttribute("target") === "_blank" ? "external-link" : "";
3586
+ const iconName = explicitIcon || inferredIcon;
3587
+ let icon = control.querySelector(":scope > [data-inc-button-icon]");
3588
+ const slotted = getDirectIconSlot(control);
3589
+ if (!icon && (iconName || slotted)) {
3590
+ icon = document.createElement("span");
3591
+ icon.className = "inc-btn__icon";
3592
+ icon.setAttribute("data-inc-button-icon", "true");
3593
+ icon.setAttribute("aria-hidden", "true");
3594
+ control.prepend(icon);
3595
+ }
3596
+ if (!(icon instanceof HTMLElement)) {
3597
+ return;
3598
+ }
3599
+ if (slotted) {
3600
+ slotted.removeAttribute("slot");
3601
+ icon.replaceChildren(slotted);
3602
+ icon.hidden = false;
3603
+ return;
3604
+ }
3605
+ if (hasConsumerIcon(icon)) {
3606
+ icon.hidden = false;
3607
+ return;
3608
+ }
3609
+ if (iconName && iconName !== "none") {
3610
+ renderDecorativeIcon2(icon, iconName, { size: 16 });
3611
+ return;
3612
+ }
3613
+ icon.remove();
3614
+ }
3207
3615
  };
3208
3616
  var IncButtonGroupElement = class extends IncElement {
3209
3617
  static get observedAttributes() {
@@ -3313,7 +3721,7 @@ var IncCloseButtonElement = class extends IncElement {
3313
3721
  };
3314
3722
  var IncAlertElement = class extends IncElement {
3315
3723
  static get observedAttributes() {
3316
- return ["tone", "variant", "dismissible", "dismiss-label", "timeout"];
3724
+ return ["tone", "variant", "dismissible", "dismiss-label", "timeout", "icon"];
3317
3725
  }
3318
3726
  connectedCallback() {
3319
3727
  addClass(this, "inc-alert");
@@ -3352,6 +3760,7 @@ var IncAlertElement = class extends IncElement {
3352
3760
  const tone = normalizeToken2(this.getAttribute("tone") || this.getAttribute("variant")) || "info";
3353
3761
  const resolvedTone = BADGE_TONES2.has(tone) ? tone : "info";
3354
3762
  this.classList.add(`inc-alert--${resolvedTone}`);
3763
+ this.syncIcon(resolvedTone);
3355
3764
  if (toBoolean(this.getAttribute("dismissible"))) {
3356
3765
  this.classList.add("inc-alert--dismissible");
3357
3766
  this.ensureDismissButton();
@@ -3409,6 +3818,37 @@ var IncAlertElement = class extends IncElement {
3409
3818
  removeProgressBar() {
3410
3819
  this.querySelectorAll(":scope > .inc-alert__progress").forEach((node) => node.remove());
3411
3820
  }
3821
+ syncIcon(tone) {
3822
+ const explicitIcon = normalizeIconName(this.getAttribute("icon"));
3823
+ const iconName = explicitIcon || ALERT_ICON_BY_TONE.get(tone) || "info";
3824
+ let icon = this.querySelector(":scope > .inc-alert__icon");
3825
+ const slotted = getDirectIconSlot(this);
3826
+ if (!icon && (iconName !== "none" || slotted)) {
3827
+ icon = document.createElement("span");
3828
+ icon.className = "inc-alert__icon";
3829
+ icon.setAttribute("part", "icon");
3830
+ icon.setAttribute("aria-hidden", "true");
3831
+ this.prepend(icon);
3832
+ }
3833
+ if (!(icon instanceof HTMLElement)) {
3834
+ return;
3835
+ }
3836
+ if (slotted) {
3837
+ slotted.removeAttribute("slot");
3838
+ icon.replaceChildren(slotted);
3839
+ icon.hidden = false;
3840
+ return;
3841
+ }
3842
+ if (hasConsumerIcon(icon)) {
3843
+ icon.hidden = false;
3844
+ return;
3845
+ }
3846
+ if (iconName === "none") {
3847
+ icon.remove();
3848
+ return;
3849
+ }
3850
+ renderDecorativeIcon2(icon, iconName, { size: 18 });
3851
+ }
3412
3852
  startDismissTimer(timeoutMs) {
3413
3853
  const progress = this.ensureProgressBar();
3414
3854
  this.stopDismissTimer();
@@ -3449,10 +3889,18 @@ var IncAlertElement = class extends IncElement {
3449
3889
  }
3450
3890
  };
3451
3891
  var IncEmptyStateElement = class extends IncElement {
3892
+ static get observedAttributes() {
3893
+ return ["icon"];
3894
+ }
3452
3895
  connectedCallback() {
3453
3896
  addClass(this, "inc-empty-state");
3454
3897
  this.sync();
3455
3898
  }
3899
+ attributeChangedCallback() {
3900
+ if (this.isConnected) {
3901
+ this.sync();
3902
+ }
3903
+ }
3456
3904
  sync() {
3457
3905
  addClass(this, "inc-empty-state");
3458
3906
  this.setAttribute("part", "empty-state content icon body actions");
@@ -3500,6 +3948,17 @@ var IncEmptyStateElement = class extends IncElement {
3500
3948
  }
3501
3949
  body.append(node);
3502
3950
  });
3951
+ if (hasConsumerIcon(icon)) {
3952
+ icon.hidden = false;
3953
+ return;
3954
+ }
3955
+ const iconName = normalizeIconName(this.getAttribute("icon")) || "empty";
3956
+ if (iconName === "none") {
3957
+ icon.replaceChildren();
3958
+ icon.hidden = true;
3959
+ return;
3960
+ }
3961
+ renderDecorativeIcon2(icon, iconName, { size: 34 });
3503
3962
  }
3504
3963
  };
3505
3964
  var actionDefinitions = [
@@ -4497,3 +4956,31 @@ export {
4497
4956
  defineAll2 as defineAll,
4498
4957
  registerIncWebComponents
4499
4958
  };
4959
+ /*! Bundled license information:
4960
+
4961
+ lucide/dist/esm/defaultAttributes.mjs:
4962
+ lucide/dist/esm/createElement.mjs:
4963
+ lucide/dist/esm/icons/circle-check.mjs:
4964
+ lucide/dist/esm/icons/circle-question-mark.mjs:
4965
+ lucide/dist/esm/icons/circle-x.mjs:
4966
+ lucide/dist/esm/icons/download.mjs:
4967
+ lucide/dist/esm/icons/external-link.mjs:
4968
+ lucide/dist/esm/icons/file-text.mjs:
4969
+ lucide/dist/esm/icons/folder-plus.mjs:
4970
+ lucide/dist/esm/icons/info.mjs:
4971
+ lucide/dist/esm/icons/lock.mjs:
4972
+ lucide/dist/esm/icons/pause.mjs:
4973
+ lucide/dist/esm/icons/play.mjs:
4974
+ lucide/dist/esm/icons/refresh-cw.mjs:
4975
+ lucide/dist/esm/icons/search-x.mjs:
4976
+ lucide/dist/esm/icons/settings.mjs:
4977
+ lucide/dist/esm/icons/shield-check.mjs:
4978
+ lucide/dist/esm/icons/triangle-alert.mjs:
4979
+ lucide/dist/esm/icons/upload.mjs:
4980
+ (**
4981
+ * @license lucide v1.17.0 - ISC
4982
+ *
4983
+ * This source code is licensed under the ISC license.
4984
+ * See the LICENSE file in the root directory of this source tree.
4985
+ *)
4986
+ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@incursa/ui-kit",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "private": false,
5
5
  "description": "Reusable UI kit for data-heavy business applications.",
6
6
  "keywords": [
@@ -33,6 +33,9 @@
33
33
  "style": "./dist/web-components/style.css",
34
34
  "default": "./dist/web-components/index.js"
35
35
  },
36
+ "./icons": {
37
+ "default": "./dist/icons/index.js"
38
+ },
36
39
  "./web-components/style.css": "./dist/web-components/style.css",
37
40
  "./dist/inc-design-language.css": "./dist/inc-design-language.css",
38
41
  "./dist/inc-design-language.min.css": "./dist/inc-design-language.min.css",
@@ -52,11 +55,12 @@
52
55
  "scripts": {
53
56
  "build:css": "sass --load-path=node_modules --quiet-deps --silence-deprecation=import src/inc-design-language.scss dist/inc-design-language.css --style=expanded",
54
57
  "build:css:min": "sass --load-path=node_modules --quiet-deps --silence-deprecation=import src/inc-design-language.scss dist/inc-design-language.min.css --style=compressed",
55
- "build:js": "node -e \"require('fs').copyFileSync('src/inc-design-language.js', 'dist/inc-design-language.js')\"",
58
+ "build:icons": "node scripts/build-icons.mjs",
59
+ "build:js": "esbuild src/inc-design-language.js --bundle --format=iife --platform=browser --outfile=dist/inc-design-language.js",
56
60
  "build:wc": "node scripts/build-web-components.mjs",
57
61
  "build:mcp:manifests": "node scripts/generate-mcp.mjs",
58
62
  "build:mcp": "node scripts/build-mcp.mjs",
59
- "build": "npm run build:css && npm run build:css:min && npm run build:js && npm run build:wc && npm run build:mcp",
63
+ "build": "npm run build:icons && npm run build:css && npm run build:css:min && npm run build:js && npm run build:wc && npm run build:mcp",
60
64
  "test:browser:install": "playwright install chromium",
61
65
  "test:browser": "playwright test",
62
66
  "test:mcp": "node --test tests/mcp/transport.test.mjs tests/mcp/search.test.mjs tests/mcp/installation.test.mjs tests/mcp/markup.test.mjs tests/mcp/freshness.test.mjs",
@@ -70,6 +74,9 @@
70
74
  "pack:tarball": "npm pack",
71
75
  "package": "npm run build && npm run smoke && npm run pack:tarball"
72
76
  },
77
+ "dependencies": {
78
+ "lucide": "^1.17.0"
79
+ },
73
80
  "devDependencies": {
74
81
  "@modelcontextprotocol/sdk": "^1.29.0",
75
82
  "@playwright/test": "^1.58.2",