@lundal/zed-solid 0.0.4 → 0.0.6

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/TextBox.d.ts CHANGED
@@ -5,6 +5,7 @@ export type TextBoxProps = {
5
5
  id: string;
6
6
  invalid: boolean;
7
7
  errorId: string | undefined;
8
+ autocomplete?: string;
8
9
  hidden?: boolean;
9
10
  value: string;
10
11
  onChange: (value: string) => void;
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();
@@ -920,13 +922,14 @@ function TextBox(props) {
920
922
  const _el$ = _tmpl$();
921
923
  _el$.$$input = (e) => props.onChange(e.target.value);
922
924
  createRenderEffect((_p$) => {
923
- const _v$ = mergeClasses("z-textbox", props.class), _v$2 = props.style, _v$3 = props.hidden ? "password" : "text", _v$4 = props.id, _v$5 = props.invalid, _v$6 = props.errorId;
925
+ const _v$ = mergeClasses("z-textbox", props.class), _v$2 = props.style, _v$3 = props.autocomplete ?? "off", _v$4 = props.hidden ? "password" : "text", _v$5 = props.id, _v$6 = props.invalid, _v$7 = props.errorId;
924
926
  _v$ !== _p$._v$ && className(_el$, _p$._v$ = _v$);
925
927
  _p$._v$2 = style(_el$, _v$2, _p$._v$2);
926
- _v$3 !== _p$._v$3 && setAttribute(_el$, "type", _p$._v$3 = _v$3);
927
- _v$4 !== _p$._v$4 && setAttribute(_el$, "id", _p$._v$4 = _v$4);
928
- _v$5 !== _p$._v$5 && setAttribute(_el$, "aria-invalid", _p$._v$5 = _v$5);
929
- _v$6 !== _p$._v$6 && setAttribute(_el$, "aria-errormessage", _p$._v$6 = _v$6);
928
+ _v$3 !== _p$._v$3 && setAttribute(_el$, "autocomplete", _p$._v$3 = _v$3);
929
+ _v$4 !== _p$._v$4 && setAttribute(_el$, "type", _p$._v$4 = _v$4);
930
+ _v$5 !== _p$._v$5 && setAttribute(_el$, "id", _p$._v$5 = _v$5);
931
+ _v$6 !== _p$._v$6 && setAttribute(_el$, "aria-invalid", _p$._v$6 = _v$6);
932
+ _v$7 !== _p$._v$7 && setAttribute(_el$, "aria-errormessage", _p$._v$7 = _v$7);
930
933
  return _p$;
931
934
  }, {
932
935
  _v$: void 0,
@@ -934,7 +937,8 @@ function TextBox(props) {
934
937
  _v$3: void 0,
935
938
  _v$4: void 0,
936
939
  _v$5: void 0,
937
- _v$6: void 0
940
+ _v$6: void 0,
941
+ _v$7: void 0
938
942
  });
939
943
  createRenderEffect(() => _el$.value = props.value);
940
944
  return _el$;
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.6",
4
4
  "license": "LGPL-3.0-or-later",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",