@wener/console
Version:
Base console UI toolkit
87 lines (86 loc) • 3.39 kB
JavaScript
function _define_property(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function _object_spread(target) {
for(var i = 1; i < arguments.length; i++){
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === "function") {
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
}));
}
ownKeys.forEach(function(key) {
_define_property(target, key, source[key]);
});
}
return target;
}
function _object_without_properties(source, excluded) {
if (source == null) return {};
var target = {}, sourceKeys, key, i;
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
sourceKeys = Reflect.ownKeys(source);
for(i = 0; i < sourceKeys.length; i++){
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
return target;
}
target = _object_without_properties_loose(source, excluded);
if (Object.getOwnPropertySymbols) {
sourceKeys = Object.getOwnPropertySymbols(source);
for(i = 0; i < sourceKeys.length; i++){
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
}
return target;
}
function _object_without_properties_loose(source, excluded) {
if (source == null) return {};
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
for(i = 0; i < sourceKeys.length; i++){
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
return target;
}
import React from 'react';
import classNames from 'clsx';
export var NonIdealState = function(_0) {
var icon = _0.icon, title = _0.title, description = _0.description, action = _0.action, children = _0.children, className = _0.className, intent = _0.intent, props = _object_without_properties(_0, [
"icon",
"title",
"description",
"action",
"children",
"className",
"intent"
]);
return /*#__PURE__*/ React.createElement("div", _object_spread({
className: classNames('NonIdealState flex h-full w-full flex-col items-center justify-center', className)
}, props), /*#__PURE__*/ React.createElement("div", {
className: classNames('text-lg opacity-75 [&>svg]:w-[4rem]', intent && "text-".concat(intent))
}, icon), title && /*#__PURE__*/ React.createElement("h4", {
className: 'pb-2 text-2xl font-bold opacity-80'
}, title), description && /*#__PURE__*/ React.createElement("div", {
className: 'pb-4 opacity-75'
}, description), action, children);
};