@nr1e/qwik-ui 0.0.8 → 0.0.9
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/README.md +3 -22
- package/lib/components/dialog.qwik.cjs +33 -0
- package/lib/components/dialog.qwik.mjs +33 -0
- package/lib/index.qwik.cjs +2 -0
- package/lib/index.qwik.mjs +2 -0
- package/lib/qwik-icons/lib/components/icons/mdi-close.qwik.qwik.cjs +16 -0
- package/lib/qwik-icons/lib/components/icons/mdi-close.qwik.qwik.mjs +16 -0
- package/lib-types/components/dialog.d.ts +7 -0
- package/lib-types/index.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,29 +12,10 @@ This library contains approved UI components for use in NR1E projects.
|
|
|
12
12
|
pnpm i @nr1e/qwik-ui
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
This library uses Tailwind CSS classes (with DaisyUI components). To ensure the classes are properly scanned and generated in your project, you need to import the library's styles configuration.
|
|
18
|
-
|
|
19
|
-
In your main CSS file (e.g., `src/global.css`):
|
|
15
|
+
Inside _global.css_, add the following:
|
|
20
16
|
|
|
21
17
|
```css
|
|
22
|
-
@import '
|
|
23
|
-
@import '@nr1e/qwik-ui/styles.css' source;
|
|
24
|
-
|
|
25
|
-
/* Your other styles */
|
|
18
|
+
@import '@nr1e/qwik-ui/styles.css';
|
|
26
19
|
```
|
|
27
20
|
|
|
28
|
-
This
|
|
29
|
-
|
|
30
|
-
### Alternative: Manual Configuration
|
|
31
|
-
|
|
32
|
-
If you prefer more control, you can manually add the source path in your CSS:
|
|
33
|
-
|
|
34
|
-
```css
|
|
35
|
-
@import 'tailwindcss';
|
|
36
|
-
|
|
37
|
-
@source '../src';
|
|
38
|
-
@source '../../node_modules/@nr1e/qwik-ui/lib';
|
|
39
|
-
@plugin 'daisyui';
|
|
40
|
-
```
|
|
21
|
+
This typically should appear under your _@import 'tailwindcss';_ statement.
|
|
@@ -0,0 +1,33 @@
|
|
|
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 mdiClose_qwik = require("../qwik-icons/lib/components/icons/mdi-close.qwik.qwik.cjs");
|
|
6
|
+
const Dialog = qwik.component$((props) => {
|
|
7
|
+
qwik.useOnDocument("keydown", qwik.$((event) => {
|
|
8
|
+
if (event.key === "Escape") {
|
|
9
|
+
props.open.value = false;
|
|
10
|
+
}
|
|
11
|
+
}));
|
|
12
|
+
return /* @__PURE__ */ jsxRuntime.jsx("dialog", {
|
|
13
|
+
class: "modal",
|
|
14
|
+
id: props.id,
|
|
15
|
+
open: props.open.value,
|
|
16
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
17
|
+
class: "modal-box",
|
|
18
|
+
children: [
|
|
19
|
+
props.showCloseIcon && /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
20
|
+
class: "absolute top-0 right-0 cursor-pointer",
|
|
21
|
+
onClick$: () => {
|
|
22
|
+
props.open.value = false;
|
|
23
|
+
},
|
|
24
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(mdiClose_qwik.MdiClose, {
|
|
25
|
+
size: 24
|
|
26
|
+
})
|
|
27
|
+
}),
|
|
28
|
+
/* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {})
|
|
29
|
+
]
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
exports.Dialog = Dialog;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx, jsxs } from "@builder.io/qwik/jsx-runtime";
|
|
2
|
+
import { component$, useOnDocument, $, Slot } from "@builder.io/qwik";
|
|
3
|
+
import { MdiClose } from "../qwik-icons/lib/components/icons/mdi-close.qwik.qwik.mjs";
|
|
4
|
+
const Dialog = component$((props) => {
|
|
5
|
+
useOnDocument("keydown", $((event) => {
|
|
6
|
+
if (event.key === "Escape") {
|
|
7
|
+
props.open.value = false;
|
|
8
|
+
}
|
|
9
|
+
}));
|
|
10
|
+
return /* @__PURE__ */ jsx("dialog", {
|
|
11
|
+
class: "modal",
|
|
12
|
+
id: props.id,
|
|
13
|
+
open: props.open.value,
|
|
14
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
15
|
+
class: "modal-box",
|
|
16
|
+
children: [
|
|
17
|
+
props.showCloseIcon && /* @__PURE__ */ jsx("div", {
|
|
18
|
+
class: "absolute top-0 right-0 cursor-pointer",
|
|
19
|
+
onClick$: () => {
|
|
20
|
+
props.open.value = false;
|
|
21
|
+
},
|
|
22
|
+
children: /* @__PURE__ */ jsx(MdiClose, {
|
|
23
|
+
size: 24
|
|
24
|
+
})
|
|
25
|
+
}),
|
|
26
|
+
/* @__PURE__ */ jsx(Slot, {})
|
|
27
|
+
]
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
export {
|
|
32
|
+
Dialog
|
|
33
|
+
};
|
package/lib/index.qwik.cjs
CHANGED
|
@@ -4,11 +4,13 @@ const alertError = require("./components/alert-error.qwik.cjs");
|
|
|
4
4
|
const alertInfo = require("./components/alert-info.qwik.cjs");
|
|
5
5
|
const alertSuccess = require("./components/alert-success.qwik.cjs");
|
|
6
6
|
const alertWarning = require("./components/alert-warning.qwik.cjs");
|
|
7
|
+
const dialog = require("./components/dialog.qwik.cjs");
|
|
7
8
|
const paceBar = require("./components/pace-bar.qwik.cjs");
|
|
8
9
|
const universalLayout = require("./components/universal-layout.qwik.cjs");
|
|
9
10
|
exports.AlertError = alertError.AlertError;
|
|
10
11
|
exports.AlertInfo = alertInfo.AlertInfo;
|
|
11
12
|
exports.AlertSuccess = alertSuccess.AlertSuccess;
|
|
12
13
|
exports.AlertWarning = alertWarning.AlertWarning;
|
|
14
|
+
exports.Dialog = dialog.Dialog;
|
|
13
15
|
exports.PaceBar = paceBar.PaceBar;
|
|
14
16
|
exports.UniversalLayout = universalLayout.UniversalLayout;
|
package/lib/index.qwik.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import { AlertError } from "./components/alert-error.qwik.mjs";
|
|
|
2
2
|
import { AlertInfo } from "./components/alert-info.qwik.mjs";
|
|
3
3
|
import { AlertSuccess } from "./components/alert-success.qwik.mjs";
|
|
4
4
|
import { AlertWarning } from "./components/alert-warning.qwik.mjs";
|
|
5
|
+
import { Dialog } from "./components/dialog.qwik.mjs";
|
|
5
6
|
import { PaceBar } from "./components/pace-bar.qwik.mjs";
|
|
6
7
|
import { UniversalLayout } from "./components/universal-layout.qwik.mjs";
|
|
7
8
|
export {
|
|
@@ -9,6 +10,7 @@ export {
|
|
|
9
10
|
AlertInfo,
|
|
10
11
|
AlertSuccess,
|
|
11
12
|
AlertWarning,
|
|
13
|
+
Dialog,
|
|
12
14
|
PaceBar,
|
|
13
15
|
UniversalLayout
|
|
14
16
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
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 svg_qwik = require("../svg.qwik.qwik.cjs");
|
|
6
|
+
const MdiClose = qwik.component$((props) => {
|
|
7
|
+
return /* @__PURE__ */ jsxRuntime.jsx(svg_qwik.Svg, {
|
|
8
|
+
...props,
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", {
|
|
11
|
+
fill: "currentColor",
|
|
12
|
+
d: "M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z"
|
|
13
|
+
})
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
exports.MdiClose = MdiClose;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx } from "@builder.io/qwik/jsx-runtime";
|
|
2
|
+
import { component$ } from "@builder.io/qwik";
|
|
3
|
+
import { Svg } from "../svg.qwik.qwik.mjs";
|
|
4
|
+
const MdiClose = component$((props) => {
|
|
5
|
+
return /* @__PURE__ */ jsx(Svg, {
|
|
6
|
+
...props,
|
|
7
|
+
viewBox: "0 0 24 24",
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
d: "M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z"
|
|
11
|
+
})
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
export {
|
|
15
|
+
MdiClose
|
|
16
|
+
};
|
package/lib-types/index.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ export * from './components/alert-error';
|
|
|
2
2
|
export * from './components/alert-info';
|
|
3
3
|
export * from './components/alert-success';
|
|
4
4
|
export * from './components/alert-warning';
|
|
5
|
+
export * from './components/dialog';
|
|
5
6
|
export * from './components/pace-bar';
|
|
6
7
|
export * from './components/universal-layout';
|