@yamada-ui/react
Version:
React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion
55 lines (51 loc) • 2.64 kB
JavaScript
"use client";
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
const require_children = require('../../utils/children.cjs');
const require_factory = require('../../core/system/factory.cjs');
const require_create_component = require('../../core/components/create-component.cjs');
const require_empty_state_style = require('./empty-state.style.cjs');
let react_jsx_runtime = require("react/jsx-runtime");
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
//#region src/components/empty-state/empty-state.tsx
const { PropsContext: EmptyStatePropsContext, usePropsContext: useEmptyStatePropsContext, withContext, withProvider } = require_create_component.createSlotComponent("empty-state", require_empty_state_style.emptyState);
/**
* `EmptyState` is used to display when a resource is empty or not available.
*
* @see https://yamada-ui.com/docs/components/empty-state
*/
const EmptyStateRoot = withProvider(({ children, description, indicator, title, contentProps, descriptionProps, indicatorProps, titleProps,...rest }) => {
const [omittedChildren, customIndicator, customContent, customTitle, customDescription] = require_children.useSplitChildren(children, EmptyStateIndicator, EmptyStateContent, EmptyStateTitle, EmptyStateDescription);
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_factory.styled.div, {
...rest,
children: [
customIndicator ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EmptyStateIndicator, {
...indicatorProps,
children: indicator
}),
customContent ?? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(EmptyStateContent, {
...contentProps,
children: [customTitle ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EmptyStateTitle, {
...titleProps,
children: title
}), customDescription ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EmptyStateDescription, {
...descriptionProps,
children: description
})]
}),
omittedChildren
]
});
}, "root")();
const EmptyStateIndicator = withContext("div", "indicator")();
const EmptyStateContent = withContext("div", "content")();
const EmptyStateTitle = withContext("h3", "title")();
const EmptyStateDescription = withContext("p", "description")();
//#endregion
exports.EmptyStateContent = EmptyStateContent;
exports.EmptyStateDescription = EmptyStateDescription;
exports.EmptyStateIndicator = EmptyStateIndicator;
exports.EmptyStatePropsContext = EmptyStatePropsContext;
exports.EmptyStateRoot = EmptyStateRoot;
exports.EmptyStateTitle = EmptyStateTitle;
exports.useEmptyStatePropsContext = useEmptyStatePropsContext;
//# sourceMappingURL=empty-state.cjs.map