63 lines
2.3 KiB
JavaScript
63 lines
2.3 KiB
JavaScript
'use client'
|
|
"use strict";
|
|
var __defProp = Object.defineProperty;
|
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __export = (target, all) => {
|
|
for (var name in all)
|
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
};
|
|
var __copyProps = (to, from, except, desc) => {
|
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
for (let key of __getOwnPropNames(from))
|
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
}
|
|
return to;
|
|
};
|
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
|
|
// src/button-spinner.tsx
|
|
var button_spinner_exports = {};
|
|
__export(button_spinner_exports, {
|
|
ButtonSpinner: () => ButtonSpinner
|
|
});
|
|
module.exports = __toCommonJS(button_spinner_exports);
|
|
var import_spinner = require("@chakra-ui/spinner");
|
|
var import_system = require("@chakra-ui/system");
|
|
var import_shared_utils = require("@chakra-ui/shared-utils");
|
|
var import_react = require("react");
|
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
function ButtonSpinner(props) {
|
|
const {
|
|
label,
|
|
placement,
|
|
spacing = "0.5rem",
|
|
children = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_spinner.Spinner, { color: "currentColor", width: "1em", height: "1em" }),
|
|
className,
|
|
__css,
|
|
...rest
|
|
} = props;
|
|
const _className = (0, import_shared_utils.cx)("chakra-button__spinner", className);
|
|
const marginProp = placement === "start" ? "marginEnd" : "marginStart";
|
|
const spinnerStyles = (0, import_react.useMemo)(
|
|
() => ({
|
|
display: "flex",
|
|
alignItems: "center",
|
|
position: label ? "relative" : "absolute",
|
|
[marginProp]: label ? spacing : 0,
|
|
fontSize: "1em",
|
|
lineHeight: "normal",
|
|
...__css
|
|
}),
|
|
[__css, label, marginProp, spacing]
|
|
);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_system.chakra.div, { className: _className, ...rest, __css: spinnerStyles, children });
|
|
}
|
|
ButtonSpinner.displayName = "ButtonSpinner";
|
|
// Annotate the CommonJS export names for ESM import in node:
|
|
0 && (module.exports = {
|
|
ButtonSpinner
|
|
});
|
|
//# sourceMappingURL=button-spinner.js.map
|