@nr1e/qwik-ui 2.1.4 → 2.1.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.
@@ -4,6 +4,10 @@ const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
4
4
  const qwik = require("@builder.io/qwik");
5
5
  const SelectField = qwik.component$((props) => {
6
6
  const { label, error, id, class: className, ...selectProps } = props;
7
+ const optionsEntries = Array.isArray(props.options) ? props.options.map((opt) => [
8
+ opt,
9
+ opt
10
+ ]) : Object.entries(props.options ?? {});
7
11
  return /* @__PURE__ */ jsxRuntime.jsxs("div", {
8
12
  class: "fieldset",
9
13
  children: [
@@ -15,11 +19,23 @@ const SelectField = qwik.component$((props) => {
15
19
  children: label
16
20
  })
17
21
  }),
18
- /* @__PURE__ */ jsxRuntime.jsx("select", {
22
+ /* @__PURE__ */ jsxRuntime.jsxs("select", {
19
23
  id,
20
24
  class: `select ${error ? "select-error" : ""} ${className ?? ""}`,
21
25
  ...selectProps,
22
- children: /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {})
26
+ children: [
27
+ props.placeholder && /* @__PURE__ */ jsxRuntime.jsx("option", {
28
+ disabled: true,
29
+ selected: !props.value || props.value === "",
30
+ children: props.placeholder
31
+ }),
32
+ optionsEntries.map(([k, v]) => /* @__PURE__ */ jsxRuntime.jsx("option", {
33
+ value: v,
34
+ selected: v === props.value,
35
+ children: k
36
+ }, k)),
37
+ /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {})
38
+ ]
23
39
  }),
24
40
  error && /* @__PURE__ */ jsxRuntime.jsx("div", {
25
41
  class: "text-error mt-1 text-xs",
@@ -2,6 +2,10 @@ import { jsxs, jsx } from "@builder.io/qwik/jsx-runtime";
2
2
  import { component$, Slot } from "@builder.io/qwik";
3
3
  const SelectField = component$((props) => {
4
4
  const { label, error, id, class: className, ...selectProps } = props;
5
+ const optionsEntries = Array.isArray(props.options) ? props.options.map((opt) => [
6
+ opt,
7
+ opt
8
+ ]) : Object.entries(props.options ?? {});
5
9
  return /* @__PURE__ */ jsxs("div", {
6
10
  class: "fieldset",
7
11
  children: [
@@ -13,11 +17,23 @@ const SelectField = component$((props) => {
13
17
  children: label
14
18
  })
15
19
  }),
16
- /* @__PURE__ */ jsx("select", {
20
+ /* @__PURE__ */ jsxs("select", {
17
21
  id,
18
22
  class: `select ${error ? "select-error" : ""} ${className ?? ""}`,
19
23
  ...selectProps,
20
- children: /* @__PURE__ */ jsx(Slot, {})
24
+ children: [
25
+ props.placeholder && /* @__PURE__ */ jsx("option", {
26
+ disabled: true,
27
+ selected: !props.value || props.value === "",
28
+ children: props.placeholder
29
+ }),
30
+ optionsEntries.map(([k, v]) => /* @__PURE__ */ jsx("option", {
31
+ value: v,
32
+ selected: v === props.value,
33
+ children: k
34
+ }, k)),
35
+ /* @__PURE__ */ jsx(Slot, {})
36
+ ]
21
37
  }),
22
38
  error && /* @__PURE__ */ jsx("div", {
23
39
  class: "text-error mt-1 text-xs",
@@ -2,5 +2,7 @@ import type { PropsOf } from '@builder.io/qwik';
2
2
  export interface SelectFieldProps extends Omit<PropsOf<'select'>, 'children'> {
3
3
  label?: string;
4
4
  error?: string;
5
+ placeholder?: string;
6
+ options?: Record<string, string> | string[];
5
7
  }
6
8
  export declare const SelectField: import("@builder.io/qwik").Component<SelectFieldProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nr1e/qwik-ui",
3
- "version": "2.1.4",
3
+ "version": "2.1.5",
4
4
  "description": "NR1E Qwik UI Library",
5
5
  "author": "NR1E, Inc.",
6
6
  "publishConfig": {
@@ -36,12 +36,12 @@
36
36
  "peerDependencies": {
37
37
  "@builder.io/qwik-city": "1.19.2",
38
38
  "tailwindcss-animated": "2.0.0",
39
- "@nr1e/qwik-icons": "0.0.33"
39
+ "@nr1e/qwik-icons": "0.0.34"
40
40
  },
41
41
  "devDependencies": {
42
- "@builder.io/qwik": "1.19.1",
42
+ "@builder.io/qwik": "1.19.2",
43
43
  "@eslint/js": "^9.39.4",
44
- "@tailwindcss/vite": "^4.2.1",
44
+ "@tailwindcss/vite": "^4.2.2",
45
45
  "@types/node": "^24.10.13",
46
46
  "daisyui": "^5.5.19",
47
47
  "eslint": "9.39.4",
@@ -50,15 +50,15 @@
50
50
  "np": "^11.0.2",
51
51
  "prettier": "3.8.1",
52
52
  "prettier-plugin-tailwindcss": "^0.7.1",
53
- "tailwindcss": "^4.2.1",
53
+ "tailwindcss": "^4.2.2",
54
54
  "typescript": "5.9.3",
55
- "typescript-eslint": "8.57.0",
55
+ "typescript-eslint": "8.57.1",
56
56
  "undici": "*",
57
57
  "vite": "7.3.1",
58
58
  "vite-tsconfig-paths": "^6.1.1",
59
59
  "vitest": "4.1.0",
60
60
  "@inlang/paraglide-js": "^2.15.0",
61
- "@inlang/cli": "^3.0.0"
61
+ "@inlang/cli": "^3.1.9"
62
62
  },
63
63
  "scripts": {
64
64
  "prebuild": "prettier --check . && eslint . && pnpx @inlang/paraglide-js compile --project ./project.inlang --outdir ./src/paraglide",