@yamada-ui/react
Version:
React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion
33 lines (29 loc) • 1.2 kB
JavaScript
"use client";
import { styled } from "../../core/system/factory.js";
import { createSlotComponent } from "../../core/components/create-component.js";
import { statusStyle } from "./status.style.js";
import { jsx, jsxs } from "react/jsx-runtime";
//#region src/components/status/status.tsx
const { PropsContext: StatusPropsContext, usePropsContext: useStatusPropsContext, withContext, withProvider } = createSlotComponent("status", statusStyle);
/**
* `Status` is component that indicate the status of a process or state.
*
* @see https://yamada-ui.com/docs/components/status
*/
const Status = withProvider(({ children, indicatorProps, labelProps,...rest }) => {
return /* @__PURE__ */ jsxs(styled.div, {
...rest,
children: [/* @__PURE__ */ jsx(StatusIndicator, { ...indicatorProps }), /* @__PURE__ */ jsx(StatusLabel, {
...labelProps,
children
})]
});
}, "root")(void 0, ({ colorScheme, value = "info",...rest }) => ({
colorScheme: colorScheme ?? value,
...rest
}));
const StatusIndicator = withContext("div", "indicator")();
const StatusLabel = withContext("p", "label")();
//#endregion
export { Status, StatusPropsContext, useStatusPropsContext };
//# sourceMappingURL=status.js.map