@incursa/ui-kit 1.6.1 → 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.
- package/NOTICE +8 -0
- package/README.md +16 -0
- package/dist/icons/index.js +371 -0
- package/dist/icons/package.json +3 -0
- package/dist/inc-design-language.css +144 -51
- package/dist/inc-design-language.css.map +1 -1
- package/dist/inc-design-language.js +1627 -1206
- package/dist/inc-design-language.min.css +1 -1
- package/dist/inc-design-language.min.css.map +1 -1
- package/dist/mcp/components/buttons.json +3 -3
- package/dist/mcp/components/cards.json +3 -3
- package/dist/mcp/components/metrics.json +3 -3
- package/dist/mcp/components/states.json +3 -3
- package/dist/mcp/components/status.json +3 -3
- package/dist/mcp/examples/data-grid-advanced.json +2 -2
- package/dist/mcp/examples/demo.json +2 -2
- package/dist/mcp/examples/overlay-workflows.json +2 -2
- package/dist/mcp/examples/reference.json +2 -2
- package/dist/mcp/examples/states.json +2 -2
- package/dist/mcp/examples/web-components.json +2 -2
- package/dist/mcp/guides/latest.json +2 -2
- package/dist/mcp/guides/package-metadata.json +2 -2
- package/dist/mcp/guides/update.json +2 -2
- package/dist/mcp/install.json +1 -1
- package/dist/mcp/patterns/data-grid-advanced.json +2 -2
- package/dist/mcp/patterns/demo.json +2 -2
- package/dist/mcp/patterns/overlay-workflows.json +2 -2
- package/dist/mcp/patterns/reference.json +2 -2
- package/dist/mcp/patterns/states.json +2 -2
- package/dist/mcp/patterns/web-components.json +2 -2
- package/dist/mcp/resources.json +83 -80
- package/dist/mcp/search-index.json +25 -25
- package/dist/mcp/update.json +2 -2
- package/dist/mcp/worker.mjs +394 -391
- package/dist/mcp/worker.mjs.map +2 -2
- package/dist/web-components/README.md +4 -0
- package/dist/web-components/components/actions.js +237 -14
- package/dist/web-components/components/feedback.js +71 -7
- package/dist/web-components/index.js +583 -21
- package/package.json +10 -3
- package/src/icons/index.js +229 -0
- package/src/icons/package.json +3 -0
- package/src/inc-design-language.js +327 -1
- package/src/inc-design-language.scss +178 -55
- package/src/web-components/README.md +4 -0
- package/src/web-components/components/actions.js +237 -14
- package/src/web-components/components/feedback.js +71 -7
|
@@ -1984,11 +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"]);
|
|
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
|
+
]);
|
|
1992
2319
|
var HostElement3 = typeof HTMLElement === "undefined" ? class {
|
|
1993
2320
|
} : HTMLElement;
|
|
1994
2321
|
var themeSubscribers = /* @__PURE__ */ new Set();
|
|
@@ -2018,6 +2345,28 @@ function toPositiveInt(value) {
|
|
|
2018
2345
|
function normalizeToken(value) {
|
|
2019
2346
|
return String(value ?? "").trim().toLowerCase();
|
|
2020
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
|
+
}
|
|
2021
2370
|
function getSystemTheme() {
|
|
2022
2371
|
if (!window.matchMedia) {
|
|
2023
2372
|
return "light";
|
|
@@ -2146,7 +2495,7 @@ function formatRemaining(totalSeconds) {
|
|
|
2146
2495
|
return `${minutes}m ${seconds}s`;
|
|
2147
2496
|
}
|
|
2148
2497
|
var IncStatePanel = class extends HostElement3 {
|
|
2149
|
-
static observedAttributes = ["tone", "variant", "title", "body", "status", "open"];
|
|
2498
|
+
static observedAttributes = ["tone", "variant", "title", "body", "status", "icon", "open"];
|
|
2150
2499
|
#fallback = null;
|
|
2151
2500
|
#appliedVariantClass = "";
|
|
2152
2501
|
connectedCallback() {
|
|
@@ -2178,6 +2527,7 @@ var IncStatePanel = class extends HostElement3 {
|
|
|
2178
2527
|
body.className = "inc-state-panel__body";
|
|
2179
2528
|
actions.className = "inc-state-panel__actions";
|
|
2180
2529
|
icon.setAttribute("part", "icon");
|
|
2530
|
+
icon.setAttribute("aria-hidden", "true");
|
|
2181
2531
|
title.setAttribute("part", "title");
|
|
2182
2532
|
body.setAttribute("part", "body");
|
|
2183
2533
|
actions.setAttribute("part", "actions");
|
|
@@ -2204,10 +2554,18 @@ var IncStatePanel = class extends HostElement3 {
|
|
|
2204
2554
|
const title = this.getAttribute("title") || "";
|
|
2205
2555
|
const body = this.getAttribute("body") || "";
|
|
2206
2556
|
const status = this.getAttribute("status") || "";
|
|
2557
|
+
const iconName = resolveStateIconName(this.getAttribute("icon"), status, nextVariant);
|
|
2207
2558
|
this.#fallback.title.textContent = title;
|
|
2208
2559
|
this.#fallback.body.textContent = body;
|
|
2209
|
-
|
|
2210
|
-
|
|
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
|
+
}
|
|
2211
2569
|
this.#fallback.actions.hidden = true;
|
|
2212
2570
|
}
|
|
2213
2571
|
#dispatchSlotChange() {
|
|
@@ -2525,6 +2883,10 @@ var IncAutoRefresh = class extends HostElement3 {
|
|
|
2525
2883
|
return;
|
|
2526
2884
|
}
|
|
2527
2885
|
this.innerHTML = `
|
|
2886
|
+
<button type="button" class="inc-auto-refresh__toggle inc-btn inc-btn--outline-secondary inc-btn--micro" part="toggle">
|
|
2887
|
+
<span class="inc-auto-refresh__toggle-icon" aria-hidden="true"></span>
|
|
2888
|
+
<span class="inc-auto-refresh__toggle-text"></span>
|
|
2889
|
+
</button>
|
|
2528
2890
|
<span class="inc-auto-refresh__countdown" part="countdown">
|
|
2529
2891
|
<span class="inc-auto-refresh__label" part="label"></span>
|
|
2530
2892
|
<span class="inc-auto-refresh__value" part="value"></span>
|
|
@@ -2532,10 +2894,6 @@ var IncAutoRefresh = class extends HostElement3 {
|
|
|
2532
2894
|
<span class="inc-auto-refresh__status" part="status" hidden>
|
|
2533
2895
|
<span class="inc-auto-refresh__status-text"></span>
|
|
2534
2896
|
</span>
|
|
2535
|
-
<button type="button" class="inc-auto-refresh__toggle inc-btn inc-btn--outline-secondary inc-btn--micro" part="toggle">
|
|
2536
|
-
<span class="inc-auto-refresh__toggle-icon" aria-hidden="true"></span>
|
|
2537
|
-
<span class="inc-auto-refresh__toggle-text"></span>
|
|
2538
|
-
</button>
|
|
2539
2897
|
`.trim();
|
|
2540
2898
|
this.#parts = this.#getParts();
|
|
2541
2899
|
}
|
|
@@ -2547,6 +2905,7 @@ var IncAutoRefresh = class extends HostElement3 {
|
|
|
2547
2905
|
status: this.querySelector(".inc-auto-refresh__status"),
|
|
2548
2906
|
statusText: this.querySelector(".inc-auto-refresh__status-text"),
|
|
2549
2907
|
toggle: this.querySelector(".inc-auto-refresh__toggle"),
|
|
2908
|
+
toggleIcon: this.querySelector(".inc-auto-refresh__toggle-icon"),
|
|
2550
2909
|
toggleText: this.querySelector(".inc-auto-refresh__toggle-text")
|
|
2551
2910
|
};
|
|
2552
2911
|
}
|
|
@@ -2669,6 +3028,9 @@ var IncAutoRefresh = class extends HostElement3 {
|
|
|
2669
3028
|
if (this.#parts.toggleText) {
|
|
2670
3029
|
this.#parts.toggleText.textContent = actionLabel;
|
|
2671
3030
|
}
|
|
3031
|
+
if (this.#parts.toggleIcon instanceof HTMLElement) {
|
|
3032
|
+
renderDecorativeIcon(this.#parts.toggleIcon, this.#isPaused ? "play" : "pause", 16);
|
|
3033
|
+
}
|
|
2672
3034
|
}
|
|
2673
3035
|
#stop() {
|
|
2674
3036
|
if (this.#timeoutId) {
|
|
@@ -3028,6 +3390,18 @@ var BUTTON_VARIANTS = /* @__PURE__ */ new Set([
|
|
|
3028
3390
|
"outline-info"
|
|
3029
3391
|
]);
|
|
3030
3392
|
var BUTTON_SIZES = /* @__PURE__ */ new Set(["sm", "lg", "micro"]);
|
|
3393
|
+
var ALERT_DEFAULT_ROLE_BY_TONE = /* @__PURE__ */ new Map([
|
|
3394
|
+
["info", "status"],
|
|
3395
|
+
["secondary", "status"]
|
|
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
|
+
]);
|
|
3031
3405
|
var HostElement4 = typeof HTMLElement === "undefined" ? class {
|
|
3032
3406
|
} : HTMLElement;
|
|
3033
3407
|
function toBoolean(value, fallback = false) {
|
|
@@ -3036,6 +3410,10 @@ function toBoolean(value, fallback = false) {
|
|
|
3036
3410
|
}
|
|
3037
3411
|
return !FALSE_TOKENS.has(String(value).toLowerCase());
|
|
3038
3412
|
}
|
|
3413
|
+
function toPositiveInt2(value) {
|
|
3414
|
+
const parsed = Number.parseInt(String(value ?? "").trim(), 10);
|
|
3415
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : null;
|
|
3416
|
+
}
|
|
3039
3417
|
function emit2(host, type, detail = {}, options = {}) {
|
|
3040
3418
|
return host.dispatchEvent(new CustomEvent(type, {
|
|
3041
3419
|
detail,
|
|
@@ -3044,6 +3422,20 @@ function emit2(host, type, detail = {}, options = {}) {
|
|
|
3044
3422
|
cancelable: options.cancelable === true
|
|
3045
3423
|
}));
|
|
3046
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
|
+
}
|
|
3047
3439
|
var IncElement = class extends HostElement4 {
|
|
3048
3440
|
emit(type, detail = {}, options = {}) {
|
|
3049
3441
|
return emit2(this, type, detail, options);
|
|
@@ -3051,7 +3443,7 @@ var IncElement = class extends HostElement4 {
|
|
|
3051
3443
|
};
|
|
3052
3444
|
var IncButtonElement = class extends IncElement {
|
|
3053
3445
|
static get observedAttributes() {
|
|
3054
|
-
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"];
|
|
3055
3447
|
}
|
|
3056
3448
|
connectedCallback() {
|
|
3057
3449
|
addClass(this, "inc-button");
|
|
@@ -3139,6 +3531,7 @@ var IncButtonElement = class extends IncElement {
|
|
|
3139
3531
|
control.removeAttribute("aria-busy");
|
|
3140
3532
|
this.removeLoadingSpinner(control);
|
|
3141
3533
|
}
|
|
3534
|
+
this.syncIcon(control);
|
|
3142
3535
|
const label = this.getAttribute("label");
|
|
3143
3536
|
if (label) {
|
|
3144
3537
|
control.setAttribute("aria-label", label);
|
|
@@ -3184,6 +3577,41 @@ var IncButtonElement = class extends IncElement {
|
|
|
3184
3577
|
}
|
|
3185
3578
|
control.querySelectorAll(":scope > [data-inc-button-spinner]").forEach((node) => node.remove());
|
|
3186
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
|
+
}
|
|
3187
3615
|
};
|
|
3188
3616
|
var IncButtonGroupElement = class extends IncElement {
|
|
3189
3617
|
static get observedAttributes() {
|
|
@@ -3251,7 +3679,6 @@ var IncCloseButtonElement = class extends IncElement {
|
|
|
3251
3679
|
return ["label", "variant"];
|
|
3252
3680
|
}
|
|
3253
3681
|
connectedCallback() {
|
|
3254
|
-
addClass(this, "inc-close-button");
|
|
3255
3682
|
this.sync();
|
|
3256
3683
|
}
|
|
3257
3684
|
attributeChangedCallback() {
|
|
@@ -3260,7 +3687,7 @@ var IncCloseButtonElement = class extends IncElement {
|
|
|
3260
3687
|
}
|
|
3261
3688
|
}
|
|
3262
3689
|
sync() {
|
|
3263
|
-
|
|
3690
|
+
this.classList.remove("inc-close-button", "inc-close-button--white");
|
|
3264
3691
|
this.setAttribute("part", "close-button");
|
|
3265
3692
|
const control = this.ensureControl();
|
|
3266
3693
|
const variant = normalizeToken2(this.getAttribute("variant"));
|
|
@@ -3271,9 +3698,7 @@ var IncCloseButtonElement = class extends IncElement {
|
|
|
3271
3698
|
}
|
|
3272
3699
|
control.type = "button";
|
|
3273
3700
|
control.setAttribute("aria-label", this.getAttribute("label") || "Close");
|
|
3274
|
-
|
|
3275
|
-
control.textContent = "\xD7";
|
|
3276
|
-
}
|
|
3701
|
+
control.textContent = "";
|
|
3277
3702
|
}
|
|
3278
3703
|
ensureControl() {
|
|
3279
3704
|
const existing = this._control || this.querySelector(":scope > button.inc-close-button");
|
|
@@ -3296,7 +3721,7 @@ var IncCloseButtonElement = class extends IncElement {
|
|
|
3296
3721
|
};
|
|
3297
3722
|
var IncAlertElement = class extends IncElement {
|
|
3298
3723
|
static get observedAttributes() {
|
|
3299
|
-
return ["tone", "variant", "dismissible", "dismiss-label"];
|
|
3724
|
+
return ["tone", "variant", "dismissible", "dismiss-label", "timeout", "icon"];
|
|
3300
3725
|
}
|
|
3301
3726
|
connectedCallback() {
|
|
3302
3727
|
addClass(this, "inc-alert");
|
|
@@ -3304,6 +3729,7 @@ var IncAlertElement = class extends IncElement {
|
|
|
3304
3729
|
this.sync();
|
|
3305
3730
|
}
|
|
3306
3731
|
disconnectedCallback() {
|
|
3732
|
+
this.stopDismissTimer();
|
|
3307
3733
|
if (this._boundClick) {
|
|
3308
3734
|
this.removeEventListener("click", this._boundClick);
|
|
3309
3735
|
}
|
|
@@ -3323,7 +3749,7 @@ var IncAlertElement = class extends IncElement {
|
|
|
3323
3749
|
return;
|
|
3324
3750
|
}
|
|
3325
3751
|
event.preventDefault();
|
|
3326
|
-
this.
|
|
3752
|
+
this.dismiss("manual");
|
|
3327
3753
|
};
|
|
3328
3754
|
this.addEventListener("click", this._boundClick);
|
|
3329
3755
|
}
|
|
@@ -3334,6 +3760,7 @@ var IncAlertElement = class extends IncElement {
|
|
|
3334
3760
|
const tone = normalizeToken2(this.getAttribute("tone") || this.getAttribute("variant")) || "info";
|
|
3335
3761
|
const resolvedTone = BADGE_TONES2.has(tone) ? tone : "info";
|
|
3336
3762
|
this.classList.add(`inc-alert--${resolvedTone}`);
|
|
3763
|
+
this.syncIcon(resolvedTone);
|
|
3337
3764
|
if (toBoolean(this.getAttribute("dismissible"))) {
|
|
3338
3765
|
this.classList.add("inc-alert--dismissible");
|
|
3339
3766
|
this.ensureDismissButton();
|
|
@@ -3341,12 +3768,24 @@ var IncAlertElement = class extends IncElement {
|
|
|
3341
3768
|
this.removeDismissButton();
|
|
3342
3769
|
}
|
|
3343
3770
|
if (!this.hasAttribute("role")) {
|
|
3344
|
-
this.setAttribute("role", resolvedTone
|
|
3771
|
+
this.setAttribute("role", ALERT_DEFAULT_ROLE_BY_TONE.get(resolvedTone) || "alert");
|
|
3345
3772
|
}
|
|
3346
3773
|
if (!this.hasAttribute("aria-live")) {
|
|
3347
3774
|
this.setAttribute("aria-live", this.getAttribute("role") === "alert" ? "assertive" : "polite");
|
|
3348
3775
|
}
|
|
3349
3776
|
this.setAttribute("aria-atomic", "true");
|
|
3777
|
+
const timeoutMs = toPositiveInt2(this.getAttribute("timeout"));
|
|
3778
|
+
if (timeoutMs) {
|
|
3779
|
+
this.ensureProgressBar();
|
|
3780
|
+
if (!this.hidden && this.getAttribute("aria-hidden") !== "true") {
|
|
3781
|
+
this.startDismissTimer(timeoutMs);
|
|
3782
|
+
} else {
|
|
3783
|
+
this.stopDismissTimer();
|
|
3784
|
+
}
|
|
3785
|
+
} else {
|
|
3786
|
+
this.stopDismissTimer();
|
|
3787
|
+
this.removeProgressBar();
|
|
3788
|
+
}
|
|
3350
3789
|
}
|
|
3351
3790
|
ensureDismissButton() {
|
|
3352
3791
|
let button = this.querySelector(":scope > [data-inc-alert-dismiss]");
|
|
@@ -3359,25 +3798,109 @@ var IncAlertElement = class extends IncElement {
|
|
|
3359
3798
|
button.className = "inc-close-button";
|
|
3360
3799
|
button.setAttribute("part", "dismiss");
|
|
3361
3800
|
button.setAttribute("aria-label", this.getAttribute("dismiss-label") || "Dismiss alert");
|
|
3362
|
-
|
|
3363
|
-
button.textContent = "\xD7";
|
|
3364
|
-
}
|
|
3801
|
+
button.textContent = "";
|
|
3365
3802
|
return button;
|
|
3366
3803
|
}
|
|
3367
3804
|
removeDismissButton() {
|
|
3368
3805
|
this.querySelectorAll(":scope > [data-inc-alert-dismiss]").forEach((node) => node.remove());
|
|
3369
3806
|
}
|
|
3370
|
-
|
|
3807
|
+
ensureProgressBar() {
|
|
3808
|
+
let progress = this.querySelector(":scope > .inc-alert__progress");
|
|
3809
|
+
if (!progress) {
|
|
3810
|
+
progress = document.createElement("div");
|
|
3811
|
+
progress.className = "inc-alert__progress";
|
|
3812
|
+
progress.setAttribute("part", "progress");
|
|
3813
|
+
progress.setAttribute("aria-hidden", "true");
|
|
3814
|
+
this.append(progress);
|
|
3815
|
+
}
|
|
3816
|
+
return progress;
|
|
3817
|
+
}
|
|
3818
|
+
removeProgressBar() {
|
|
3819
|
+
this.querySelectorAll(":scope > .inc-alert__progress").forEach((node) => node.remove());
|
|
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
|
+
}
|
|
3852
|
+
startDismissTimer(timeoutMs) {
|
|
3853
|
+
const progress = this.ensureProgressBar();
|
|
3854
|
+
this.stopDismissTimer();
|
|
3855
|
+
this._dismissTimeoutMs = timeoutMs;
|
|
3856
|
+
this._dismissStartedAt = performance.now();
|
|
3857
|
+
const tick = (now) => {
|
|
3858
|
+
if (this.hidden || this.getAttribute("aria-hidden") === "true") {
|
|
3859
|
+
this.stopDismissTimer();
|
|
3860
|
+
return;
|
|
3861
|
+
}
|
|
3862
|
+
const elapsed = Math.max(0, now - this._dismissStartedAt);
|
|
3863
|
+
const remaining = Math.max(0, timeoutMs - elapsed);
|
|
3864
|
+
const ratio = timeoutMs > 0 ? remaining / timeoutMs : 0;
|
|
3865
|
+
progress.style.transform = `scaleX(${ratio})`;
|
|
3866
|
+
if (remaining <= 0) {
|
|
3867
|
+
this.dismiss("timeout");
|
|
3868
|
+
return;
|
|
3869
|
+
}
|
|
3870
|
+
this._dismissFrame = window.requestAnimationFrame(tick);
|
|
3871
|
+
};
|
|
3872
|
+
progress.style.transform = "scaleX(1)";
|
|
3873
|
+
this._dismissFrame = window.requestAnimationFrame(tick);
|
|
3874
|
+
}
|
|
3875
|
+
stopDismissTimer() {
|
|
3876
|
+
if (this._dismissFrame) {
|
|
3877
|
+
window.cancelAnimationFrame(this._dismissFrame);
|
|
3878
|
+
this._dismissFrame = 0;
|
|
3879
|
+
}
|
|
3880
|
+
}
|
|
3881
|
+
dismiss(reason = "manual") {
|
|
3882
|
+
this.hide(reason);
|
|
3883
|
+
}
|
|
3884
|
+
hide(reason = "manual") {
|
|
3885
|
+
this.stopDismissTimer();
|
|
3371
3886
|
this.hidden = true;
|
|
3372
3887
|
this.setAttribute("aria-hidden", "true");
|
|
3373
|
-
this.emit("dismiss", { hidden: true });
|
|
3888
|
+
this.emit("dismiss", { hidden: true, reason });
|
|
3374
3889
|
}
|
|
3375
3890
|
};
|
|
3376
3891
|
var IncEmptyStateElement = class extends IncElement {
|
|
3892
|
+
static get observedAttributes() {
|
|
3893
|
+
return ["icon"];
|
|
3894
|
+
}
|
|
3377
3895
|
connectedCallback() {
|
|
3378
3896
|
addClass(this, "inc-empty-state");
|
|
3379
3897
|
this.sync();
|
|
3380
3898
|
}
|
|
3899
|
+
attributeChangedCallback() {
|
|
3900
|
+
if (this.isConnected) {
|
|
3901
|
+
this.sync();
|
|
3902
|
+
}
|
|
3903
|
+
}
|
|
3381
3904
|
sync() {
|
|
3382
3905
|
addClass(this, "inc-empty-state");
|
|
3383
3906
|
this.setAttribute("part", "empty-state content icon body actions");
|
|
@@ -3425,6 +3948,17 @@ var IncEmptyStateElement = class extends IncElement {
|
|
|
3425
3948
|
}
|
|
3426
3949
|
body.append(node);
|
|
3427
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 });
|
|
3428
3962
|
}
|
|
3429
3963
|
};
|
|
3430
3964
|
var actionDefinitions = [
|
|
@@ -4422,3 +4956,31 @@ export {
|
|
|
4422
4956
|
defineAll2 as defineAll,
|
|
4423
4957
|
registerIncWebComponents
|
|
4424
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
|
+
*/
|