@lundal/zed-solid 0.0.4 → 0.0.5

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/Button.d.ts CHANGED
@@ -5,6 +5,6 @@ export type ButtonProps = {
5
5
  busy?: boolean;
6
6
  type: "primary" | "secondary" | "tertiary";
7
7
  label: string;
8
- onClick: () => void;
8
+ onClick: "submit" | (() => void);
9
9
  };
10
10
  export declare function Button(props: ButtonProps): JSX.Element;
package/dist/index.js CHANGED
@@ -316,18 +316,20 @@ const _tmpl$$k = /* @__PURE__ */ template(`<button>`);
316
316
  function Button(props) {
317
317
  return (() => {
318
318
  const _el$ = _tmpl$$k();
319
- _el$.$$click = () => !props.busy && props.onClick();
319
+ _el$.$$click = () => props.onClick !== "submit" && !props.busy && props.onClick();
320
320
  insert(_el$, () => props.label);
321
321
  createRenderEffect((_p$) => {
322
- const _v$ = mergeClasses(`z-button z-button--${props.type}`, props.class), _v$2 = props.style, _v$3 = props.busy;
322
+ const _v$ = mergeClasses(`z-button z-button--${props.type}`, props.class), _v$2 = props.style, _v$3 = props.busy, _v$4 = props.onClick === "submit" ? "submit" : "button";
323
323
  _v$ !== _p$._v$ && className(_el$, _p$._v$ = _v$);
324
324
  _p$._v$2 = style(_el$, _v$2, _p$._v$2);
325
325
  _v$3 !== _p$._v$3 && setAttribute(_el$, "aria-busy", _p$._v$3 = _v$3);
326
+ _v$4 !== _p$._v$4 && setAttribute(_el$, "type", _p$._v$4 = _v$4);
326
327
  return _p$;
327
328
  }, {
328
329
  _v$: void 0,
329
330
  _v$2: void 0,
330
- _v$3: void 0
331
+ _v$3: void 0,
332
+ _v$4: void 0
331
333
  });
332
334
  return _el$;
333
335
  })();
@@ -542,7 +544,7 @@ function Field(props) {
542
544
  return _el$;
543
545
  })();
544
546
  }
545
- const _tmpl$$d = /* @__PURE__ */ template(`<div>`);
547
+ const _tmpl$$d = /* @__PURE__ */ template(`<form>`);
546
548
  function Form(props) {
547
549
  return (() => {
548
550
  const _el$ = _tmpl$$d();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lundal/zed-solid",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "license": "LGPL-3.0-or-later",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",