@raketa-builder/markdown-input 0.3.0 → 0.4.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/dist/index.js CHANGED
@@ -216,11 +216,11 @@ var require_dist = __commonJS({
216
216
  var import_react3 = __toESM2(require("react"));
217
217
  var import_jsx_runtime3 = require("react/jsx-runtime");
218
218
  var Button = (_a) => {
219
- var _b = _a, { type, size, variant, className } = _b, props = __objRest2(_b, ["type", "size", "variant", "className"]);
219
+ var _b = _a, { as = "button", size, variant, className } = _b, props = __objRest2(_b, ["as", "size", "variant", "className"]);
220
+ const Component = as;
220
221
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
221
- "button",
222
+ Component,
222
223
  __spreadValues2({
223
- type,
224
224
  className: cn2(
225
225
  "r-reset",
226
226
  "r-reset-button",
@@ -391,18 +391,8 @@ var require_dist = __commonJS({
391
391
  var import_react13 = __toESM2(require("react"));
392
392
  var import_jsx_runtime13 = require("react/jsx-runtime");
393
393
  var Stack = (_a) => {
394
- var _b = _a, { h, v, g, className } = _b, props = __objRest2(_b, ["h", "v", "g", "className"]);
395
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
396
- "div",
397
- __spreadValues2({
398
- style: {
399
- justifyContent: h || "flex-start",
400
- alignItems: v || "flex-start",
401
- gap: g || "1em"
402
- },
403
- className: cn2("r-stack", className)
404
- }, props)
405
- );
394
+ var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
395
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", __spreadValues2({ className: cn2("r-stack", className) }, props));
406
396
  };
407
397
  var Stack_default = Stack;
408
398
  var import_react14 = __toESM2(require("react"));
@@ -818,9 +808,10 @@ var toHTML_default = toHTML;
818
808
  // src/MarkdownInput.js
819
809
  var import_jsx_runtime = require("react/jsx-runtime");
820
810
  var IconButton = (_a) => {
821
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
811
+ var _b = _a, { as = "button", className } = _b, props = __objRest(_b, ["as", "className"]);
812
+ const Component = as;
822
813
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
823
- "button",
814
+ Component,
824
815
  __spreadValues({
825
816
  className: (0, import_ui.cn)("r-reset-button", "r-md-icon-btn", className)
826
817
  }, props)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raketa-builder/markdown-input",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "license": "MIT",
@@ -2,12 +2,16 @@ import React from "react";
2
2
  import { FormGroup, Label, Textarea, Hint, cn } from "@raketa-builder/ui";
3
3
  import toHTML from "./toHTML";
4
4
 
5
- const IconButton = ({ className, ...props }) => (
6
- <button
7
- className={cn("r-reset-button", "r-md-icon-btn", className)}
8
- {...props}
9
- />
10
- );
5
+ const IconButton = ({ as = "button", className, ...props }) => {
6
+ const Component = as;
7
+
8
+ return (
9
+ <Component
10
+ className={cn("r-reset-button", "r-md-icon-btn", className)}
11
+ {...props}
12
+ />
13
+ );
14
+ };
11
15
 
12
16
  const TextareaWrapper = ({ className, ...props }) => (
13
17
  <div className={cn("r-reset", "r-md-textarea", className)} {...props} />