@nr1e/qwik-ui 0.0.15 → 0.0.16

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.
@@ -3,6 +3,10 @@ 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 mdiClose_qwik = require("../qwik-icons/lib/components/icons/mdi-close.qwik.qwik.cjs");
6
+ const alertError = require("./alert-error.qwik.cjs");
7
+ const alertInfo = require("./alert-info.qwik.cjs");
8
+ const alertWarning = require("./alert-warning.qwik.cjs");
9
+ const alertSuccess = require("./alert-success.qwik.cjs");
6
10
  const Dialog = qwik.component$((props) => {
7
11
  qwik.useOnDocument("keydown", qwik.$((event) => {
8
12
  if (event.key === "Escape") {
@@ -29,14 +33,33 @@ const Dialog = qwik.component$((props) => {
29
33
  class: "text-lg font-bold",
30
34
  children: props.title
31
35
  }),
32
- /* @__PURE__ */ jsxRuntime.jsx("div", {
36
+ /* @__PURE__ */ jsxRuntime.jsxs("div", {
33
37
  class: "py-4",
34
- children: /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {})
38
+ children: [
39
+ /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {}),
40
+ props.errorMessage || props.infoMessage || props.successMessage || props.warningMessage ? /* @__PURE__ */ jsxRuntime.jsxs("div", {
41
+ class: "mt-3 space-y-2",
42
+ children: [
43
+ props.infoMessage && /* @__PURE__ */ jsxRuntime.jsx(alertInfo.AlertInfo, {
44
+ message: props.infoMessage
45
+ }),
46
+ props.warningMessage && /* @__PURE__ */ jsxRuntime.jsx(alertWarning.AlertWarning, {
47
+ message: props.warningMessage
48
+ }),
49
+ props.errorMessage && /* @__PURE__ */ jsxRuntime.jsx(alertError.AlertError, {
50
+ message: props.errorMessage
51
+ }),
52
+ props.successMessage && /* @__PURE__ */ jsxRuntime.jsx(alertSuccess.AlertSuccess, {
53
+ message: props.successMessage
54
+ })
55
+ ]
56
+ }) : ""
57
+ ]
35
58
  }),
36
59
  /* @__PURE__ */ jsxRuntime.jsx("div", {
37
60
  class: "modal-action",
38
61
  children: /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {
39
- name: "actions"
62
+ name: "action"
40
63
  })
41
64
  })
42
65
  ]
@@ -1,6 +1,10 @@
1
1
  import { jsx, jsxs } from "@builder.io/qwik/jsx-runtime";
2
2
  import { component$, useOnDocument, $, Slot } from "@builder.io/qwik";
3
3
  import { MdiClose } from "../qwik-icons/lib/components/icons/mdi-close.qwik.qwik.mjs";
4
+ import { AlertError } from "./alert-error.qwik.mjs";
5
+ import { AlertInfo } from "./alert-info.qwik.mjs";
6
+ import { AlertWarning } from "./alert-warning.qwik.mjs";
7
+ import { AlertSuccess } from "./alert-success.qwik.mjs";
4
8
  const Dialog = component$((props) => {
5
9
  useOnDocument("keydown", $((event) => {
6
10
  if (event.key === "Escape") {
@@ -27,14 +31,33 @@ const Dialog = component$((props) => {
27
31
  class: "text-lg font-bold",
28
32
  children: props.title
29
33
  }),
30
- /* @__PURE__ */ jsx("div", {
34
+ /* @__PURE__ */ jsxs("div", {
31
35
  class: "py-4",
32
- children: /* @__PURE__ */ jsx(Slot, {})
36
+ children: [
37
+ /* @__PURE__ */ jsx(Slot, {}),
38
+ props.errorMessage || props.infoMessage || props.successMessage || props.warningMessage ? /* @__PURE__ */ jsxs("div", {
39
+ class: "mt-3 space-y-2",
40
+ children: [
41
+ props.infoMessage && /* @__PURE__ */ jsx(AlertInfo, {
42
+ message: props.infoMessage
43
+ }),
44
+ props.warningMessage && /* @__PURE__ */ jsx(AlertWarning, {
45
+ message: props.warningMessage
46
+ }),
47
+ props.errorMessage && /* @__PURE__ */ jsx(AlertError, {
48
+ message: props.errorMessage
49
+ }),
50
+ props.successMessage && /* @__PURE__ */ jsx(AlertSuccess, {
51
+ message: props.successMessage
52
+ })
53
+ ]
54
+ }) : ""
55
+ ]
33
56
  }),
34
57
  /* @__PURE__ */ jsx("div", {
35
58
  class: "modal-action",
36
59
  children: /* @__PURE__ */ jsx(Slot, {
37
- name: "actions"
60
+ name: "action"
38
61
  })
39
62
  })
40
63
  ]
@@ -5,5 +5,9 @@ export interface DialogProps {
5
5
  showCloseIcon?: boolean;
6
6
  class?: string;
7
7
  title?: string;
8
+ errorMessage?: string;
9
+ infoMessage?: string;
10
+ successMessage?: string;
11
+ warningMessage?: string;
8
12
  }
9
13
  export declare const Dialog: import("@builder.io/qwik").Component<DialogProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nr1e/qwik-ui",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "description": "NR1E Qwik UI Library",
5
5
  "author": "NR1E, Inc.",
6
6
  "publishConfig": {