@nr1e/qwik-ui 2.0.21 → 2.1.1

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.
@@ -2,26 +2,31 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
4
4
  const qwik = require("@builder.io/qwik");
5
+ const qwikIcons = require("@nr1e/qwik-icons");
5
6
  const Button = qwik.component$((props) => {
7
+ const { icon, iconSize, iconClass, text, processing, disabled, type, onClick$, class: className, children, ...buttonProps } = props;
8
+ const isDisabled = processing || disabled;
9
+ const displayIcon = processing ? qwikIcons.SpinnersBarsFade : icon;
10
+ const displayIconClass = processing ? "animate-spin" : iconClass;
6
11
  return /* @__PURE__ */ jsxRuntime.jsxs("button", {
7
- class: `btn props.disabled ? 'disabled' : ''} ${props.class ?? ""}`,
8
- disabled: props.disabled,
9
- id: props.id,
10
- type: props.type ?? "button",
11
- onClick$: !props.disabled && props.onClick$ ? props.onClick$ : void 0,
12
+ class: `btn ${isDisabled ? "disabled" : ""} ${className ?? ""}`,
13
+ disabled: isDisabled,
14
+ type: type ?? "button",
15
+ onClick$: !isDisabled && onClick$ ? onClick$ : void 0,
16
+ ...buttonProps,
12
17
  children: [
13
18
  /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {
14
- children: props.icon ? /* @__PURE__ */ jsxRuntime.jsx("span", {
15
- class: props.iconClass,
16
- children: /* @__PURE__ */ jsxRuntime.jsx(props.icon, {
17
- size: props.iconSize ?? 18
19
+ children: displayIcon ? /* @__PURE__ */ jsxRuntime.jsx("span", {
20
+ class: displayIconClass,
21
+ children: /* @__PURE__ */ jsxRuntime.jsx("displayIcon", {
22
+ size: iconSize ?? 18
18
23
  })
19
24
  }) : /* @__PURE__ */ jsxRuntime.jsx("span", {
20
- class: props.iconClass,
25
+ class: displayIconClass,
21
26
  "q:slot": "icon"
22
27
  })
23
28
  }),
24
- props.text ? props.text : /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {})
29
+ text ? text : /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {})
25
30
  ]
26
31
  });
27
32
  });
@@ -1,25 +1,30 @@
1
1
  import { jsxs, jsx, Fragment } from "@builder.io/qwik/jsx-runtime";
2
2
  import { component$, Slot } from "@builder.io/qwik";
3
+ import { SpinnersBarsFade } from "@nr1e/qwik-icons";
3
4
  const Button = component$((props) => {
5
+ const { icon, iconSize, iconClass, text, processing, disabled, type, onClick$, class: className, children, ...buttonProps } = props;
6
+ const isDisabled = processing || disabled;
7
+ const displayIcon = processing ? SpinnersBarsFade : icon;
8
+ const displayIconClass = processing ? "animate-spin" : iconClass;
4
9
  return /* @__PURE__ */ jsxs("button", {
5
- class: `btn props.disabled ? 'disabled' : ''} ${props.class ?? ""}`,
6
- disabled: props.disabled,
7
- id: props.id,
8
- type: props.type ?? "button",
9
- onClick$: !props.disabled && props.onClick$ ? props.onClick$ : void 0,
10
+ class: `btn ${isDisabled ? "disabled" : ""} ${className ?? ""}`,
11
+ disabled: isDisabled,
12
+ type: type ?? "button",
13
+ onClick$: !isDisabled && onClick$ ? onClick$ : void 0,
14
+ ...buttonProps,
10
15
  children: [
11
16
  /* @__PURE__ */ jsx(Fragment, {
12
- children: props.icon ? /* @__PURE__ */ jsx("span", {
13
- class: props.iconClass,
14
- children: /* @__PURE__ */ jsx(props.icon, {
15
- size: props.iconSize ?? 18
17
+ children: displayIcon ? /* @__PURE__ */ jsx("span", {
18
+ class: displayIconClass,
19
+ children: /* @__PURE__ */ jsx("displayIcon", {
20
+ size: iconSize ?? 18
16
21
  })
17
22
  }) : /* @__PURE__ */ jsx("span", {
18
- class: props.iconClass,
23
+ class: displayIconClass,
19
24
  "q:slot": "icon"
20
25
  })
21
26
  }),
22
- props.text ? props.text : /* @__PURE__ */ jsx(Slot, {})
27
+ text ? text : /* @__PURE__ */ jsx(Slot, {})
23
28
  ]
24
29
  });
25
30
  });
@@ -3,50 +3,26 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
4
4
  const qwik = require("@builder.io/qwik");
5
5
  const CheckboxField = qwik.component$((props) => {
6
- const checked = qwik.useSignal(typeof props.checked === "boolean" ? props.checked : props.checked?.value ?? false);
7
- qwik.useTask$(({ track }) => {
8
- if (props.checked && typeof props.checked !== "boolean") {
9
- track(() => checked.value);
10
- if (checked.value !== props.checked?.value) {
11
- props.checked.value = checked.value;
12
- }
13
- }
14
- });
15
- qwik.useTask$(({ track }) => {
16
- if (props.checked && typeof props.checked !== "boolean") {
17
- track(() => props.checked.value);
18
- if (props.checked && checked.value !== props.checked.value) {
19
- checked.value = props.checked.value;
20
- }
21
- }
22
- });
6
+ const { label, error, id, class: className, ...inputProps } = props;
23
7
  return /* @__PURE__ */ jsxRuntime.jsxs("div", {
24
8
  class: "fieldset",
25
9
  children: [
26
10
  /* @__PURE__ */ jsxRuntime.jsxs("label", {
27
11
  class: "label",
28
- ...props.id && {
29
- for: props.id
30
- },
12
+ for: id,
31
13
  children: [
32
14
  /* @__PURE__ */ jsxRuntime.jsx("input", {
33
15
  type: "checkbox",
34
- ...props.name && {
35
- name: props.name
36
- },
37
- ...props.id && {
38
- id: props.id
39
- },
40
- checked: checked.value,
41
- class: `checkbox ${props.error ? "checkbox-error" : ""}`,
42
- onClick$: props.onClick$
16
+ id,
17
+ class: `checkbox ${error ? "checkbox-error" : ""} ${className ?? ""}`,
18
+ ...inputProps
43
19
  }),
44
- props.label
20
+ label
45
21
  ]
46
22
  }),
47
- props.error && /* @__PURE__ */ jsxRuntime.jsx("div", {
23
+ error && /* @__PURE__ */ jsxRuntime.jsx("div", {
48
24
  class: "text-error mt-1 text-xs",
49
- children: props.error
25
+ children: error
50
26
  })
51
27
  ]
52
28
  });
@@ -1,50 +1,26 @@
1
1
  import { jsxs, jsx } from "@builder.io/qwik/jsx-runtime";
2
- import { component$, useSignal, useTask$ } from "@builder.io/qwik";
2
+ import { component$ } from "@builder.io/qwik";
3
3
  const CheckboxField = component$((props) => {
4
- const checked = useSignal(typeof props.checked === "boolean" ? props.checked : props.checked?.value ?? false);
5
- useTask$(({ track }) => {
6
- if (props.checked && typeof props.checked !== "boolean") {
7
- track(() => checked.value);
8
- if (checked.value !== props.checked?.value) {
9
- props.checked.value = checked.value;
10
- }
11
- }
12
- });
13
- useTask$(({ track }) => {
14
- if (props.checked && typeof props.checked !== "boolean") {
15
- track(() => props.checked.value);
16
- if (props.checked && checked.value !== props.checked.value) {
17
- checked.value = props.checked.value;
18
- }
19
- }
20
- });
4
+ const { label, error, id, class: className, ...inputProps } = props;
21
5
  return /* @__PURE__ */ jsxs("div", {
22
6
  class: "fieldset",
23
7
  children: [
24
8
  /* @__PURE__ */ jsxs("label", {
25
9
  class: "label",
26
- ...props.id && {
27
- for: props.id
28
- },
10
+ for: id,
29
11
  children: [
30
12
  /* @__PURE__ */ jsx("input", {
31
13
  type: "checkbox",
32
- ...props.name && {
33
- name: props.name
34
- },
35
- ...props.id && {
36
- id: props.id
37
- },
38
- checked: checked.value,
39
- class: `checkbox ${props.error ? "checkbox-error" : ""}`,
40
- onClick$: props.onClick$
14
+ id,
15
+ class: `checkbox ${error ? "checkbox-error" : ""} ${className ?? ""}`,
16
+ ...inputProps
41
17
  }),
42
- props.label
18
+ label
43
19
  ]
44
20
  }),
45
- props.error && /* @__PURE__ */ jsx("div", {
21
+ error && /* @__PURE__ */ jsx("div", {
46
22
  class: "text-error mt-1 text-xs",
47
- children: props.error
23
+ children: error
48
24
  })
49
25
  ]
50
26
  });
@@ -26,6 +26,9 @@ const Dialog = qwik.component$((props) => {
26
26
  await props.onOpen$(dialog.value);
27
27
  }
28
28
  internalOpen.value = true;
29
+ if (dialog.value) {
30
+ dialog.value.scrollTop = 0;
31
+ }
29
32
  if (props.onPostOpen$ && dialog.value) {
30
33
  await props.onPostOpen$(dialog.value);
31
34
  }
@@ -24,6 +24,9 @@ const Dialog = component$((props) => {
24
24
  await props.onOpen$(dialog.value);
25
25
  }
26
26
  internalOpen.value = true;
27
+ if (dialog.value) {
28
+ dialog.value.scrollTop = 0;
29
+ }
27
30
  if (props.onPostOpen$ && dialog.value) {
28
31
  await props.onPostOpen$(dialog.value);
29
32
  }
@@ -3,9 +3,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
4
4
  const qwik = require("@builder.io/qwik");
5
5
  const qwikIcons = require("@nr1e/qwik-icons");
6
- const processingButton = require("./processing-button.qwik.cjs");
6
+ const button = require("./button.qwik.cjs");
7
7
  const RefreshButton = qwik.component$((props) => {
8
- return /* @__PURE__ */ jsxRuntime.jsx(processingButton.ProcessingButton, {
8
+ return /* @__PURE__ */ jsxRuntime.jsx(button.Button, {
9
9
  ...props,
10
10
  class: `btn-primary ${props.class ?? ""}`,
11
11
  text: props.text || "Refresh",
@@ -1,9 +1,9 @@
1
1
  import { jsx } from "@builder.io/qwik/jsx-runtime";
2
2
  import { component$ } from "@builder.io/qwik";
3
3
  import { MdiRefresh } from "@nr1e/qwik-icons";
4
- import { ProcessingButton } from "./processing-button.qwik.mjs";
4
+ import { Button } from "./button.qwik.mjs";
5
5
  const RefreshButton = component$((props) => {
6
- return /* @__PURE__ */ jsx(ProcessingButton, {
6
+ return /* @__PURE__ */ jsx(Button, {
7
7
  ...props,
8
8
  class: `btn-primary ${props.class ?? ""}`,
9
9
  text: props.text || "Refresh",
@@ -3,54 +3,27 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
4
4
  const qwik = require("@builder.io/qwik");
5
5
  const SelectField = qwik.component$((props) => {
6
- const value = qwik.useSignal(typeof props.value === "string" ? props.value : props.value?.value);
7
- qwik.useTask$(({ track }) => {
8
- if (props.value && typeof props.value !== "string") {
9
- track(() => value.value);
10
- if (value.value !== props.value?.value) {
11
- props.value.value = value.value;
12
- }
13
- }
14
- });
15
- qwik.useTask$(({ track }) => {
16
- if (props.value && typeof props.value !== "string") {
17
- track(() => props.value.value);
18
- if (props.value.value !== value.value) {
19
- value.value = props.value.value;
20
- }
21
- }
22
- });
6
+ const { label, error, id, class: className, ...selectProps } = props;
23
7
  return /* @__PURE__ */ jsxRuntime.jsxs("div", {
24
8
  class: "fieldset",
25
9
  children: [
26
- props.label && /* @__PURE__ */ jsxRuntime.jsx("label", {
10
+ label && /* @__PURE__ */ jsxRuntime.jsx("label", {
27
11
  class: "label",
28
- ...props.id && {
29
- for: props.id
30
- },
12
+ for: id,
31
13
  children: /* @__PURE__ */ jsxRuntime.jsx("span", {
32
14
  class: "label-text",
33
- children: props.label
15
+ children: label
34
16
  })
35
17
  }),
36
18
  /* @__PURE__ */ jsxRuntime.jsx("select", {
37
- ...props.name && {
38
- name: props.name
39
- },
40
- ...props.id && {
41
- id: props.id
42
- },
43
- required: props.required,
44
- "aria-required": props.required,
45
- disabled: props.disabled,
46
- class: `select ${props.error ? "select-error" : ""}`,
47
- onChange$: props.onChange$,
48
- onBlur$: props.onBlur$,
19
+ id,
20
+ class: `select ${error ? "select-error" : ""} ${className ?? ""}`,
21
+ ...selectProps,
49
22
  children: /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {})
50
23
  }),
51
- props.error && /* @__PURE__ */ jsxRuntime.jsx("div", {
24
+ error && /* @__PURE__ */ jsxRuntime.jsx("div", {
52
25
  class: "text-error mt-1 text-xs",
53
- children: props.error
26
+ children: error
54
27
  })
55
28
  ]
56
29
  });
@@ -1,54 +1,27 @@
1
1
  import { jsxs, jsx } from "@builder.io/qwik/jsx-runtime";
2
- import { component$, useSignal, useTask$, Slot } from "@builder.io/qwik";
2
+ import { component$, Slot } from "@builder.io/qwik";
3
3
  const SelectField = component$((props) => {
4
- const value = useSignal(typeof props.value === "string" ? props.value : props.value?.value);
5
- useTask$(({ track }) => {
6
- if (props.value && typeof props.value !== "string") {
7
- track(() => value.value);
8
- if (value.value !== props.value?.value) {
9
- props.value.value = value.value;
10
- }
11
- }
12
- });
13
- useTask$(({ track }) => {
14
- if (props.value && typeof props.value !== "string") {
15
- track(() => props.value.value);
16
- if (props.value.value !== value.value) {
17
- value.value = props.value.value;
18
- }
19
- }
20
- });
4
+ const { label, error, id, class: className, ...selectProps } = props;
21
5
  return /* @__PURE__ */ jsxs("div", {
22
6
  class: "fieldset",
23
7
  children: [
24
- props.label && /* @__PURE__ */ jsx("label", {
8
+ label && /* @__PURE__ */ jsx("label", {
25
9
  class: "label",
26
- ...props.id && {
27
- for: props.id
28
- },
10
+ for: id,
29
11
  children: /* @__PURE__ */ jsx("span", {
30
12
  class: "label-text",
31
- children: props.label
13
+ children: label
32
14
  })
33
15
  }),
34
16
  /* @__PURE__ */ jsx("select", {
35
- ...props.name && {
36
- name: props.name
37
- },
38
- ...props.id && {
39
- id: props.id
40
- },
41
- required: props.required,
42
- "aria-required": props.required,
43
- disabled: props.disabled,
44
- class: `select ${props.error ? "select-error" : ""}`,
45
- onChange$: props.onChange$,
46
- onBlur$: props.onBlur$,
17
+ id,
18
+ class: `select ${error ? "select-error" : ""} ${className ?? ""}`,
19
+ ...selectProps,
47
20
  children: /* @__PURE__ */ jsx(Slot, {})
48
21
  }),
49
- props.error && /* @__PURE__ */ jsx("div", {
22
+ error && /* @__PURE__ */ jsx("div", {
50
23
  class: "text-error mt-1 text-xs",
51
- children: props.error
24
+ children: error
52
25
  })
53
26
  ]
54
27
  });
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
4
4
  const qwik = require("@builder.io/qwik");
5
- const processingButton = require("./processing-button.qwik.cjs");
5
+ const button = require("./button.qwik.cjs");
6
6
  const SubmitButton = qwik.component$((props) => {
7
- return /* @__PURE__ */ jsxRuntime.jsx(processingButton.ProcessingButton, {
7
+ return /* @__PURE__ */ jsxRuntime.jsx(button.Button, {
8
8
  ...props,
9
9
  class: `btn-primary ${props.class ?? ""}`,
10
10
  text: props.text || "Submit",
@@ -1,8 +1,8 @@
1
1
  import { jsx } from "@builder.io/qwik/jsx-runtime";
2
2
  import { component$ } from "@builder.io/qwik";
3
- import { ProcessingButton } from "./processing-button.qwik.mjs";
3
+ import { Button } from "./button.qwik.mjs";
4
4
  const SubmitButton = component$((props) => {
5
- return /* @__PURE__ */ jsx(ProcessingButton, {
5
+ return /* @__PURE__ */ jsx(Button, {
6
6
  ...props,
7
7
  class: `btn-primary ${props.class ?? ""}`,
8
8
  text: props.text || "Submit",
@@ -3,64 +3,41 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
4
4
  const qwik = require("@builder.io/qwik");
5
5
  const TextField = qwik.component$((props) => {
6
- const value = props.value;
7
- const onInputHandler = props.onInput$;
6
+ const { label, error, icon, id, class: className, children, ...inputProps } = props;
8
7
  return /* @__PURE__ */ jsxRuntime.jsxs("div", {
9
8
  class: "fieldset",
10
9
  children: [
11
- props.label && /* @__PURE__ */ jsxRuntime.jsx("label", {
10
+ label && /* @__PURE__ */ jsxRuntime.jsx("label", {
12
11
  class: "label",
13
- ...props.id && {
14
- for: props.id
15
- },
12
+ for: id,
16
13
  children: /* @__PURE__ */ jsxRuntime.jsx("span", {
17
14
  class: "label-text",
18
- children: props.label
15
+ children: label
19
16
  })
20
17
  }),
21
18
  /* @__PURE__ */ jsxRuntime.jsxs("label", {
22
- class: `input w-full ${props.error ? "input-error" : ""}`,
19
+ class: `input w-full ${error ? "input-error" : ""} ${className ?? ""}`,
23
20
  children: [
24
21
  /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {
25
22
  name: "left"
26
23
  }),
27
- props.icon && /* @__PURE__ */ jsxRuntime.jsx(props.icon, {
24
+ icon && /* @__PURE__ */ jsxRuntime.jsx("icon", {
28
25
  size: 18,
29
26
  class: "opacity-50"
30
27
  }),
31
28
  /* @__PURE__ */ jsxRuntime.jsx("input", {
32
- type: props.type || "text",
33
- ...props.id && {
34
- id: props.id
35
- },
36
- ...props.name && {
37
- name: props.name
38
- },
39
- required: props.required,
40
- "aria-required": props.required,
41
- disabled: props.disabled,
42
- maxLength: props.maxLength,
43
- value: typeof props.value === "string" ? props.value : props.value?.value,
29
+ id,
44
30
  class: "placeholder:opacity-50",
45
- placeholder: props.placeholder,
46
- onBlur$: props.onBlur$,
47
- onInput$: (event, element) => {
48
- if (value && typeof value !== "string") {
49
- value.value = element.value;
50
- }
51
- if (onInputHandler) {
52
- onInputHandler(event, element);
53
- }
54
- }
31
+ ...inputProps
55
32
  }),
56
33
  /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {
57
34
  name: "right"
58
35
  })
59
36
  ]
60
37
  }),
61
- props.error && /* @__PURE__ */ jsxRuntime.jsx("div", {
38
+ error && /* @__PURE__ */ jsxRuntime.jsx("div", {
62
39
  class: "text-error mt-1 text-xs",
63
- children: props.error
40
+ children: error
64
41
  })
65
42
  ]
66
43
  });
@@ -1,64 +1,41 @@
1
1
  import { jsxs, jsx } from "@builder.io/qwik/jsx-runtime";
2
2
  import { component$, Slot } from "@builder.io/qwik";
3
3
  const TextField = component$((props) => {
4
- const value = props.value;
5
- const onInputHandler = props.onInput$;
4
+ const { label, error, icon, id, class: className, children, ...inputProps } = props;
6
5
  return /* @__PURE__ */ jsxs("div", {
7
6
  class: "fieldset",
8
7
  children: [
9
- props.label && /* @__PURE__ */ jsx("label", {
8
+ label && /* @__PURE__ */ jsx("label", {
10
9
  class: "label",
11
- ...props.id && {
12
- for: props.id
13
- },
10
+ for: id,
14
11
  children: /* @__PURE__ */ jsx("span", {
15
12
  class: "label-text",
16
- children: props.label
13
+ children: label
17
14
  })
18
15
  }),
19
16
  /* @__PURE__ */ jsxs("label", {
20
- class: `input w-full ${props.error ? "input-error" : ""}`,
17
+ class: `input w-full ${error ? "input-error" : ""} ${className ?? ""}`,
21
18
  children: [
22
19
  /* @__PURE__ */ jsx(Slot, {
23
20
  name: "left"
24
21
  }),
25
- props.icon && /* @__PURE__ */ jsx(props.icon, {
22
+ icon && /* @__PURE__ */ jsx("icon", {
26
23
  size: 18,
27
24
  class: "opacity-50"
28
25
  }),
29
26
  /* @__PURE__ */ jsx("input", {
30
- type: props.type || "text",
31
- ...props.id && {
32
- id: props.id
33
- },
34
- ...props.name && {
35
- name: props.name
36
- },
37
- required: props.required,
38
- "aria-required": props.required,
39
- disabled: props.disabled,
40
- maxLength: props.maxLength,
41
- value: typeof props.value === "string" ? props.value : props.value?.value,
27
+ id,
42
28
  class: "placeholder:opacity-50",
43
- placeholder: props.placeholder,
44
- onBlur$: props.onBlur$,
45
- onInput$: (event, element) => {
46
- if (value && typeof value !== "string") {
47
- value.value = element.value;
48
- }
49
- if (onInputHandler) {
50
- onInputHandler(event, element);
51
- }
52
- }
29
+ ...inputProps
53
30
  }),
54
31
  /* @__PURE__ */ jsx(Slot, {
55
32
  name: "right"
56
33
  })
57
34
  ]
58
35
  }),
59
- props.error && /* @__PURE__ */ jsx("div", {
36
+ error && /* @__PURE__ */ jsx("div", {
60
37
  class: "text-error mt-1 text-xs",
61
- children: props.error
38
+ children: error
62
39
  })
63
40
  ]
64
41
  });
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
4
+ const qwik = require("@builder.io/qwik");
5
+ const TextareaField = qwik.component$((props) => {
6
+ const { label, error, id, class: className, ...textareaProps } = props;
7
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", {
8
+ class: "fieldset",
9
+ children: [
10
+ label && /* @__PURE__ */ jsxRuntime.jsx("label", {
11
+ class: "label",
12
+ for: id,
13
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", {
14
+ class: "label-text",
15
+ children: label
16
+ })
17
+ }),
18
+ /* @__PURE__ */ jsxRuntime.jsx("textarea", {
19
+ id,
20
+ class: `textarea ${error ? "textarea-error" : ""} ${className ?? ""}`,
21
+ ...textareaProps
22
+ }),
23
+ error && /* @__PURE__ */ jsxRuntime.jsx("div", {
24
+ class: "text-error mt-1 text-xs",
25
+ children: error
26
+ })
27
+ ]
28
+ });
29
+ });
30
+ exports.TextareaField = TextareaField;
@@ -0,0 +1,30 @@
1
+ import { jsxs, jsx } from "@builder.io/qwik/jsx-runtime";
2
+ import { component$ } from "@builder.io/qwik";
3
+ const TextareaField = component$((props) => {
4
+ const { label, error, id, class: className, ...textareaProps } = props;
5
+ return /* @__PURE__ */ jsxs("div", {
6
+ class: "fieldset",
7
+ children: [
8
+ label && /* @__PURE__ */ jsx("label", {
9
+ class: "label",
10
+ for: id,
11
+ children: /* @__PURE__ */ jsx("span", {
12
+ class: "label-text",
13
+ children: label
14
+ })
15
+ }),
16
+ /* @__PURE__ */ jsx("textarea", {
17
+ id,
18
+ class: `textarea ${error ? "textarea-error" : ""} ${className ?? ""}`,
19
+ ...textareaProps
20
+ }),
21
+ error && /* @__PURE__ */ jsx("div", {
22
+ class: "text-error mt-1 text-xs",
23
+ children: error
24
+ })
25
+ ]
26
+ });
27
+ });
28
+ export {
29
+ TextareaField
30
+ };
@@ -21,11 +21,11 @@ const gtm = require("./components/gtm.qwik.cjs");
21
21
  const menu = require("./components/menu.qwik.cjs");
22
22
  const microsoftSignInButton = require("./components/microsoft-sign-in-button.qwik.cjs");
23
23
  const paceBar = require("./components/pace-bar.qwik.cjs");
24
- const processingButton = require("./components/processing-button.qwik.cjs");
25
24
  const refreshButton = require("./components/refresh-button.qwik.cjs");
26
25
  const selectField = require("./components/select-field.qwik.cjs");
27
26
  const submitButton = require("./components/submit-button.qwik.cjs");
28
27
  const textField = require("./components/text-field.qwik.cjs");
28
+ const textareaField = require("./components/textarea-field.qwik.cjs");
29
29
  const themeSelector = require("./components/theme-selector.qwik.cjs");
30
30
  const timeZoneSelector = require("./components/time-zone-selector.qwik.cjs");
31
31
  const universalLayout = require("./components/universal-layout.qwik.cjs");
@@ -64,11 +64,11 @@ exports.MenuLink = menu.MenuLink;
64
64
  exports.Submenu = menu.Submenu;
65
65
  exports.MicrosoftSignInButton = microsoftSignInButton.MicrosoftSignInButton;
66
66
  exports.PaceBar = paceBar.PaceBar;
67
- exports.ProcessingButton = processingButton.ProcessingButton;
68
67
  exports.RefreshButton = refreshButton.RefreshButton;
69
68
  exports.SelectField = selectField.SelectField;
70
69
  exports.SubmitButton = submitButton.SubmitButton;
71
70
  exports.TextField = textField.TextField;
71
+ exports.TextareaField = textareaField.TextareaField;
72
72
  exports.THEMES = themeSelector.THEMES;
73
73
  exports.ThemeSelector = themeSelector.ThemeSelector;
74
74
  exports.themeToName = themeSelector.themeToName;
@@ -19,11 +19,11 @@ import { GtmBody, GtmHead } from "./components/gtm.qwik.mjs";
19
19
  import { Menu, MenuButton, MenuDivider, MenuGroup, MenuGroupSummary, MenuLink, Submenu } from "./components/menu.qwik.mjs";
20
20
  import { MicrosoftSignInButton } from "./components/microsoft-sign-in-button.qwik.mjs";
21
21
  import { PaceBar } from "./components/pace-bar.qwik.mjs";
22
- import { ProcessingButton } from "./components/processing-button.qwik.mjs";
23
22
  import { RefreshButton } from "./components/refresh-button.qwik.mjs";
24
23
  import { SelectField } from "./components/select-field.qwik.mjs";
25
24
  import { SubmitButton } from "./components/submit-button.qwik.mjs";
26
25
  import { TextField } from "./components/text-field.qwik.mjs";
26
+ import { TextareaField } from "./components/textarea-field.qwik.mjs";
27
27
  import { THEMES, ThemeSelector, themeToName } from "./components/theme-selector.qwik.mjs";
28
28
  import { TimeZoneSelector, timeZoneToName } from "./components/time-zone-selector.qwik.mjs";
29
29
  import { UniversalLayout } from "./components/universal-layout.qwik.mjs";
@@ -62,13 +62,13 @@ export {
62
62
  MenuLink,
63
63
  MicrosoftSignInButton,
64
64
  PaceBar,
65
- ProcessingButton,
66
65
  RefreshButton,
67
66
  SelectField,
68
67
  Submenu,
69
68
  SubmitButton,
70
69
  THEMES,
71
70
  TextField,
71
+ TextareaField,
72
72
  ThemeSelector,
73
73
  TimeZoneSelector,
74
74
  UniversalLayout,
@@ -1,25 +1,6 @@
1
- import { Component, QRL } from '@builder.io/qwik';
2
- import { IconProps } from '@nr1e/qwik-icons';
3
- /**
4
- * Props for the Button component.
5
- */
6
- export interface ButtonProps {
7
- /**
8
- * ID of the button.
9
- */
10
- id?: string;
11
- /**
12
- * CSS class to apply to the button.
13
- */
14
- class?: string;
15
- /**
16
- * Callback function to be called when the button is clicked.
17
- */
18
- onClick$?: QRL<(event: Event) => void | Promise<void>>;
19
- /**
20
- * Whether the button is disabled.
21
- */
22
- disabled?: boolean;
1
+ import { type Component, type JSXChildren, type PropsOf } from '@builder.io/qwik';
2
+ import type { IconProps } from '@nr1e/qwik-icons';
3
+ export interface ButtonProps extends Omit<PropsOf<'button'>, 'children'> {
23
4
  /**
24
5
  * Icon component to display next to the button text. You can alternatively use the `icon` slot.
25
6
  */
@@ -32,14 +13,15 @@ export interface ButtonProps {
32
13
  * CSS class to apply to the icon.
33
14
  */
34
15
  iconClass?: string;
35
- /**
36
- * Type of the button. Default is 'button'.
37
- */
38
- type?: 'button' | 'submit' | 'reset';
39
16
  /**
40
17
  * Text to display on the button. Alternative to the `default` slot.
41
18
  */
42
19
  text?: string;
20
+ /**
21
+ * Whether the button is processing. This will replace the icon with a rotating spinner when true.
22
+ */
23
+ processing?: boolean;
24
+ children?: JSXChildren;
43
25
  }
44
26
  /**
45
27
  * Button component.
@@ -1,10 +1,6 @@
1
- import { QRL, Signal } from '@builder.io/qwik';
2
- export interface CheckboxFieldProps {
3
- id?: string;
1
+ import type { PropsOf } from '@builder.io/qwik';
2
+ export interface CheckboxFieldProps extends PropsOf<'input'> {
4
3
  label: string;
5
- name?: string;
6
- checked?: boolean | Signal<boolean>;
7
4
  error?: string;
8
- onClick$?: QRL<(event: Event) => void>;
9
5
  }
10
6
  export declare const CheckboxField: import("@builder.io/qwik").Component<CheckboxFieldProps>;
@@ -1,13 +1,6 @@
1
- import { QRL, Signal } from '@builder.io/qwik';
2
- export interface SelectFieldProps {
3
- id?: string;
1
+ import type { PropsOf } from '@builder.io/qwik';
2
+ export interface SelectFieldProps extends Omit<PropsOf<'select'>, 'children'> {
4
3
  label?: string;
5
- name?: string;
6
- value?: string | null | Signal<string | null | undefined>;
7
4
  error?: string;
8
- required?: boolean;
9
- disabled?: boolean;
10
- onChange$?: QRL<(event: Event, element: HTMLSelectElement) => void>;
11
- onBlur$?: QRL<(event: FocusEvent, element: HTMLSelectElement) => void>;
12
5
  }
13
6
  export declare const SelectField: import("@builder.io/qwik").Component<SelectFieldProps>;
@@ -1,35 +1,10 @@
1
- import { QRL, Signal, Component } from '@builder.io/qwik';
2
- import { IconProps } from '@nr1e/qwik-icons';
3
- /**
4
- * The type of the input field.
5
- */
6
- export type TextFieldType = 'text' | 'date' | 'email' | 'number' | 'tel' | 'url' | 'password';
7
- /**
8
- * Properties for the TextField component.
9
- */
10
- export interface TextFieldProps {
11
- id?: string;
12
- type?: TextFieldType;
1
+ import { type Component, type JSXChildren } from '@builder.io/qwik';
2
+ import type { PropsOf } from '@builder.io/qwik';
3
+ import type { IconProps } from '@nr1e/qwik-icons';
4
+ export interface TextFieldProps extends Omit<PropsOf<'input'>, 'children'> {
13
5
  label?: string;
14
- name?: string;
15
- value?: string | null | Signal<string | null | undefined>;
16
- placeholder?: string;
17
6
  error?: string;
18
- maxLength?: number;
19
- required?: boolean;
20
- disabled?: boolean;
21
- /**
22
- * Called when the input loses focus.
23
- */
24
- onBlur$?: QRL<(event: FocusEvent, element: HTMLInputElement) => void>;
25
- /**
26
- * Called when the input value changes.
27
- */
28
- onInput$?: QRL<(event: InputEvent, element: HTMLInputElement) => void>;
29
7
  icon?: Component<IconProps>;
8
+ children?: JSXChildren;
30
9
  }
31
- /**
32
- * A standardized text input field meant to be used independently or with Qwik
33
- * Modular Forms.
34
- */
35
10
  export declare const TextField: Component<TextFieldProps>;
@@ -0,0 +1,6 @@
1
+ import type { PropsOf } from '@builder.io/qwik';
2
+ export interface TextareaFieldProps extends PropsOf<'textarea'> {
3
+ label?: string;
4
+ error?: string;
5
+ }
6
+ export declare const TextareaField: import("@builder.io/qwik").Component<TextareaFieldProps>;
@@ -19,11 +19,11 @@ export * from './components/gtm';
19
19
  export * from './components/menu';
20
20
  export * from './components/microsoft-sign-in-button';
21
21
  export * from './components/pace-bar';
22
- export * from './components/processing-button';
23
22
  export * from './components/refresh-button';
24
23
  export * from './components/select-field';
25
24
  export * from './components/submit-button';
26
25
  export * from './components/text-field';
26
+ export * from './components/textarea-field';
27
27
  export * from './components/theme-selector';
28
28
  export * from './components/time-zone-selector';
29
29
  export * from './components/universal-layout';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nr1e/qwik-ui",
3
- "version": "2.0.21",
3
+ "version": "2.1.1",
4
4
  "description": "NR1E Qwik UI Library",
5
5
  "author": "NR1E, Inc.",
6
6
  "publishConfig": {
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
4
- const qwik = require("@builder.io/qwik");
5
- const qwikIcons = require("@nr1e/qwik-icons");
6
- const button = require("./button.qwik.cjs");
7
- const ProcessingButton = qwik.component$((props) => {
8
- return /* @__PURE__ */ jsxRuntime.jsx(button.Button, {
9
- ...props,
10
- class: `${props.processing || props.disabled ? "disabled" : ""} ${props.class ?? ""}`,
11
- disabled: props.processing || props.disabled,
12
- icon: props.processing ? qwikIcons.SpinnersBarsFade : props.icon,
13
- iconClass: props.processing ? "animate-spin" : props.iconClass,
14
- children: /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {})
15
- });
16
- });
17
- exports.ProcessingButton = ProcessingButton;
@@ -1,17 +0,0 @@
1
- import { jsx } from "@builder.io/qwik/jsx-runtime";
2
- import { component$, Slot } from "@builder.io/qwik";
3
- import { SpinnersBarsFade } from "@nr1e/qwik-icons";
4
- import { Button } from "./button.qwik.mjs";
5
- const ProcessingButton = component$((props) => {
6
- return /* @__PURE__ */ jsx(Button, {
7
- ...props,
8
- class: `${props.processing || props.disabled ? "disabled" : ""} ${props.class ?? ""}`,
9
- disabled: props.processing || props.disabled,
10
- icon: props.processing ? SpinnersBarsFade : props.icon,
11
- iconClass: props.processing ? "animate-spin" : props.iconClass,
12
- children: /* @__PURE__ */ jsx(Slot, {})
13
- });
14
- });
15
- export {
16
- ProcessingButton
17
- };
@@ -1,15 +0,0 @@
1
- import { ButtonProps } from './button';
2
- /**
3
- * Props for the ProcessingButton component. This class will replace the icon
4
- * with a rotating spinner when clicked.
5
- */
6
- export interface ProcessingButtonProps extends ButtonProps {
7
- /**
8
- * Whether the button is processing.
9
- */
10
- processing?: boolean;
11
- }
12
- /**
13
- * ProcessingButton component.
14
- */
15
- export declare const ProcessingButton: import("@builder.io/qwik").Component<ProcessingButtonProps>;