dawn-ui-react 1.0.0-alpha.3 → 1.0.0-alpha.4

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.
@@ -0,0 +1,21 @@
1
+ import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
2
+ import { i as t } from "./form-context-Cl2FGxOa.js";
3
+ import { t as n } from "./cn-CXogf8HW.js";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ //#region src/components/field/field-errors.tsx
6
+ var a = /* @__PURE__ */ e({ FieldErrors: () => o }), o = ({ className: e, children: a, ref: o, ...s }) => {
7
+ let c = t();
8
+ if (c.state.meta.errors.length === 0 && !a) return null;
9
+ let l = c.state.meta.errors.map((e) => typeof e == "string" ? e : e && typeof e == "object" && "message" in e && typeof e.message == "string" ? e.message : null).filter((e) => e !== null);
10
+ return l.length === 0 && !a ? null : /* @__PURE__ */ i("ul", {
11
+ className: n("space-y-3xs", e),
12
+ ref: o,
13
+ ...s,
14
+ children: [l.map((e) => /* @__PURE__ */ r("li", {
15
+ className: "flex items-center gap-2xs style-text-strong--1 text-error-default",
16
+ children: e
17
+ }, e)), a]
18
+ });
19
+ };
20
+ //#endregion
21
+ export { a as n, o as t };
@@ -1,8 +1,8 @@
1
1
  import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
2
- import { i as t } from "./form-context-DScGBFYs.js";
2
+ import { i as t } from "./form-context-Cl2FGxOa.js";
3
3
  import { t as n } from "./cn-CXogf8HW.js";
4
- import { t as r } from "./Input-CcHtcKpV.js";
5
- import { t as i } from "./input.types-DS4BNmw3.js";
4
+ import { t as r } from "./Input-OKlHdkuM.js";
5
+ import { t as i } from "./input.types-BgnT0r4F.js";
6
6
  import { useRef as a, useState as o } from "react";
7
7
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
8
8
  //#region src/components/input/input.tsx
@@ -1,6 +1,6 @@
1
- import { i as e } from "./form-context-DScGBFYs.js";
1
+ import { i as e } from "./form-context-Cl2FGxOa.js";
2
2
  import { t } from "./cn-CXogf8HW.js";
3
- import { t as n } from "./input-group-BlPsN5Zd.js";
3
+ import { t as n } from "./input-group-BGe0Ag-A.js";
4
4
  import { jsx as r } from "react/jsx-runtime";
5
5
  //#region src/components/field/field-input-group.tsx
6
6
  var i = ({ className: i, children: a, ref: o, ...s }) => {
@@ -1,6 +1,6 @@
1
- import { i as e } from "./form-context-DScGBFYs.js";
1
+ import { i as e } from "./form-context-Cl2FGxOa.js";
2
2
  import { t } from "./cn-CXogf8HW.js";
3
- import { t as n } from "./input-group-input-D-x5ovI-.js";
3
+ import { t as n } from "./input-group-input-DELPW-48.js";
4
4
  import { jsx as r } from "react/jsx-runtime";
5
5
  //#region src/components/field/field-input-group-input.tsx
6
6
  var i = ({ className: i, ref: a, ...o }) => {
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
2
- import { i as t } from "./form-context-DScGBFYs.js";
2
+ import { i as t } from "./form-context-Cl2FGxOa.js";
3
3
  import { t as n } from "./cn-CXogf8HW.js";
4
4
  import { jsx as r } from "react/jsx-runtime";
5
5
  //#region src/components/field/field-label.tsx
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
2
- import { F as t, G as n, H as r, I as i, J as a, K as o, M as s, Q as c, T as l, U as u, V as d, W as f, X as p, Z as m, _ as h, f as g, i as _, k as v, q as y, v as b } from "./form-context-DScGBFYs.js";
3
- import { F as x, G as S, K as C, P as w, W as T, c as E, h as ee, i as D, l as O, n as te, o as k, p as ne, r as A, s as j, t as re, u as M, w as ie } from "./useLabelableId-BsYhJQW7.js";
4
- import { $t as N, At as P, Bt as ae, Ct as F, D as I, Dt as oe, E as L, Et as R, Ft as z, G as B, H as V, Ht as H, I as se, J as U, Jt as ce, K as le, Lt as W, M as G, Mt as ue, Nt as K, Ot as de, P as fe, Pt as pe, Q as q, Qt as me, Rt as he, S as J, St as ge, T as Y, Tt as _e, U as ve, Ut as ye, Vt as be, W as xe, Wt as Se, X as Ce, Xt as we, Y as Te, Z as Ee, Zt as De, _ as Oe, _t as ke, a as Ae, an as X, at as je, c as Me, dn as Ne, f as Pe, fn as Fe, g as Ie, h as Le, hn as Re, i as ze, j as Be, jt as Ve, kt as He, l as Ue, ln as We, m as Ge, mn as Ke, n as qe, nn as Je, on as Ye, p as Xe, q as Ze, qt as Qe, r as $e, t as et, un as tt, vt as nt, wt as rt, x as it, yt as at, z as ot, zt as st } from "./clamp-CKgqaxcU.js";
2
+ import { F as t, G as n, H as r, I as i, J as a, K as o, M as s, Q as c, T as l, U as u, V as d, W as f, X as p, Z as m, _ as h, f as g, i as _, k as v, q as y, v as b } from "./form-context-Cl2FGxOa.js";
3
+ import { F as x, G as S, K as C, P as w, W as T, c as E, h as ee, i as D, l as O, n as te, o as k, p as ne, r as A, s as j, t as re, u as M, w as ie } from "./useLabelableId-BxNdsOlB.js";
4
+ import { $t as N, At as P, Bt as ae, Ct as F, D as I, Dt as oe, E as L, Et as R, Ft as z, G as B, H as V, Ht as H, I as se, J as U, Jt as ce, K as le, Lt as W, M as G, Mt as ue, Nt as K, Ot as de, P as fe, Pt as pe, Q as q, Qt as me, Rt as he, S as J, St as ge, T as Y, Tt as _e, U as ve, Ut as ye, Vt as be, W as xe, Wt as Se, X as Ce, Xt as we, Y as Te, Z as Ee, Zt as De, _ as Oe, _t as ke, a as Ae, an as X, at as je, c as Me, dn as Ne, f as Pe, fn as Fe, g as Ie, h as Le, hn as Re, i as ze, j as Be, jt as Ve, kt as He, l as Ue, ln as We, m as Ge, mn as Ke, n as qe, nn as Je, on as Ye, p as Xe, q as Ze, qt as Qe, r as $e, t as et, un as tt, vt as nt, wt as rt, x as it, yt as at, z as ot, zt as st } from "./clamp-DmGg4LPI.js";
5
5
  import { t as ct } from "./cn-CXogf8HW.js";
6
6
  import * as Z from "react";
7
7
  import { jsx as Q, jsxs as lt } from "react/jsx-runtime";
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
2
- import { G as t, H as n, J as r, M as i, Q as a, V as o, W as s, X as c, Y as l, Z as u, i as d, j as f, k as p, q as m } from "./form-context-DScGBFYs.js";
3
- import { F as h, H as g, K as _, N as v, O as y, S as b, T as x, U as S, V as C, c as w, d as T, f as E, i as D, l as O, m as k, n as A, o as j, p as M, r as N, s as P, t as ee, u as te, x as F } from "./useLabelableId-BsYhJQW7.js";
4
- import { C as ne, D as I, F as L, Gt as R, H as z, J as re, Jt as B, K as ie, Kt as V, M as ae, Q as H, Rt as U, T as W, Ut as oe, V as G, W as se, X as ce, Y as K, Yt as le, Z as q, a as ue, at as J, b as de, c as fe, d as pe, dt as me, et as he, f as ge, fn as _e, g as ve, gn as ye, h as be, hn as xe, i as Se, in as Ce, it as we, j as Te, l as Ee, ln as De, m as Oe, mn as ke, n as Ae, nt as je, o as Y, on as Me, ot as Ne, pn as Pe, q as Fe, r as Ie, rn as Le, rt as Re, s as ze, t as X, ut as Be, v as Ve, w as He, y as Ue } from "./clamp-CKgqaxcU.js";
2
+ import { G as t, H as n, J as r, M as i, Q as a, V as o, W as s, X as c, Y as l, Z as u, i as d, j as f, k as p, q as m } from "./form-context-Cl2FGxOa.js";
3
+ import { F as h, H as g, K as _, N as v, O as y, S as b, T as x, U as S, V as C, c as w, d as T, f as E, i as D, l as O, m as k, n as A, o as j, p as M, r as N, s as P, t as ee, u as te, x as F } from "./useLabelableId-BxNdsOlB.js";
4
+ import { C as ne, D as I, F as L, Gt as R, H as z, J as re, Jt as B, K as ie, Kt as V, M as ae, Q as H, Rt as U, T as W, Ut as oe, V as G, W as se, X as ce, Y as K, Yt as le, Z as q, a as ue, at as J, b as de, c as fe, d as pe, dt as me, et as he, f as ge, fn as _e, g as ve, gn as ye, h as be, hn as xe, i as Se, in as Ce, it as we, j as Te, l as Ee, ln as De, m as Oe, mn as ke, n as Ae, nt as je, o as Y, on as Me, ot as Ne, pn as Pe, q as Fe, r as Ie, rn as Le, rt as Re, s as ze, t as X, ut as Be, v as Ve, w as He, y as Ue } from "./clamp-DmGg4LPI.js";
5
5
  import { t as We } from "./cn-CXogf8HW.js";
6
6
  import * as Z from "react";
7
7
  import Ge from "react";
@@ -2968,11 +2968,14 @@ var Wn = ({ className: e, children: n, ref: r, ...i }) => /* @__PURE__ */ m(ir()
2968
2968
  if (!a || a.length === 0) return null;
2969
2969
  let o = [];
2970
2970
  return a.forEach((e) => {
2971
- Object.values(e).forEach((e) => {
2972
- Array.isArray(e) && e.forEach((e) => {
2973
- e?.message && o.push(e.message);
2974
- });
2975
- });
2971
+ if (typeof e == "string") o.push(e);
2972
+ else if (e?.message && typeof e.message == "string") o.push(e.message);
2973
+ else if (typeof e == "object" && e) {
2974
+ let t = (e) => {
2975
+ typeof e == "string" ? o.push(e) : Array.isArray(e) ? e.forEach(t) : typeof e == "object" && e && ("message" in e && typeof e.message == "string" ? o.push(e.message) : Object.values(e).forEach(t));
2976
+ };
2977
+ t(e);
2978
+ }
2976
2979
  }), /* @__PURE__ */ h(wt, {
2977
2980
  className: t("", e),
2978
2981
  ref: r,
@@ -3013,7 +3016,7 @@ var Wn = ({ className: e, children: n, ref: r, ...i }) => /* @__PURE__ */ m(ir()
3013
3016
  weight: "bold"
3014
3017
  }) : n
3015
3018
  })
3016
- }), qn = a(() => import("./field-description-BDRJXMS8.js").then((e) => e.n).then((e) => ({ default: e.FieldDescription }))), Jn = a(() => import("./field-errors-CA0345jw.js").then((e) => e.n).then((e) => ({ default: e.FieldErrors }))), Yn = a(() => import("./field-input-qIw9X6Ab.js").then((e) => e.n).then((e) => ({ default: e.FieldInput }))), Xn = a(() => import("./field-input-group-BhLWbbuz.js").then((e) => ({ default: e.FieldInputGroup }))), Zn = a(() => import("./field-input-group-input-E_r5HrPw.js").then((e) => ({ default: e.FieldInputGroupInput }))), Qn = a(() => import("./field-label-crBMOJm1.js").then((e) => e.n).then((e) => ({ default: e.FieldLabel }))), $n = a(() => import("./field-select-BCO8NSzS.js").then((e) => e.n).then((e) => ({ default: e.FieldSelect }))), er = a(() => import("./field-slider-BhSg1byn.js").then((e) => e.n).then((e) => ({ default: e.FieldSlider }))), { fieldContext: tr, useFieldContext: nr, formContext: rr, useFormContext: ir } = Hn(), { useAppForm: ar, withFieldGroup: or, withForm: sr, useTypedAppFormContext: cr } = Un({
3019
+ }), qn = a(() => import("./field-description-BDRJXMS8.js").then((e) => e.n).then((e) => ({ default: e.FieldDescription }))), Jn = a(() => import("./field-errors--n7vO1Q7.js").then((e) => e.n).then((e) => ({ default: e.FieldErrors }))), Yn = a(() => import("./field-input-DTMDvBjs.js").then((e) => e.n).then((e) => ({ default: e.FieldInput }))), Xn = a(() => import("./field-input-group-DJu_VEsX.js").then((e) => ({ default: e.FieldInputGroup }))), Zn = a(() => import("./field-input-group-input-ChT-sn5W.js").then((e) => ({ default: e.FieldInputGroupInput }))), Qn = a(() => import("./field-label-CwhT-9uR.js").then((e) => e.n).then((e) => ({ default: e.FieldLabel }))), $n = a(() => import("./field-select-CgVfjmOj.js").then((e) => e.n).then((e) => ({ default: e.FieldSelect }))), er = a(() => import("./field-slider-DwZvJqd0.js").then((e) => e.n).then((e) => ({ default: e.FieldSlider }))), { fieldContext: tr, useFieldContext: nr, formContext: rr, useFormContext: ir } = Hn(), { useAppForm: ar, withFieldGroup: or, withForm: sr, useTypedAppFormContext: cr } = Un({
3017
3020
  fieldContext: tr,
3018
3021
  fieldComponents: {
3019
3022
  FieldDescription: qn,
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./cn-CXogf8HW.js";
2
- import { t } from "./input.types-DS4BNmw3.js";
2
+ import { t } from "./input.types-BgnT0r4F.js";
3
3
  import { jsx as n } from "react/jsx-runtime";
4
4
  //#region src/components/input-group/input-group.tsx
5
5
  var r = ({ variant: r, className: i, children: a, ref: o, ...s }) => /* @__PURE__ */ n("div", {
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./cn-CXogf8HW.js";
2
- import { t } from "./Input-CcHtcKpV.js";
2
+ import { t } from "./Input-OKlHdkuM.js";
3
3
  import { jsx as n } from "react/jsx-runtime";
4
4
  //#region src/components/input-group/input-group-input.tsx
5
5
  var r = ({ className: r, ref: i, ...a }) => /* @__PURE__ */ n(t, {
@@ -1,4 +1,4 @@
1
- import { _ as e } from "./form-context-DScGBFYs.js";
1
+ import { _ as e } from "./form-context-Cl2FGxOa.js";
2
2
  //#region src/components/input/input.types.tsx
3
3
  var t = e("group flex w-full items-center rounded-full text-ellipsis caret-brand-border-strong outline outline-transparent transition-all placeholder:opacity-60 focus-within:outline-brand-border-strong not-focus-within:hover:outline-border-strong disabled:cursor-not-allowed aria-invalid:bg-error-container aria-invalid:text-error-on-container aria-invalid:caret-error-border-strong aria-invalid:outline-error-border aria-invalid:focus-within:outline-error-border-strong aria-invalid:not-focus-within:hover:outline-error-border data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50", {
4
4
  variants: {
@@ -1,4 +1,4 @@
1
- import { $ as e, B as t, G as n, I as r, J as i, Q as a, W as o, X as s, Z as c, j as ee } from "./form-context-DScGBFYs.js";
1
+ import { $ as e, B as t, G as n, I as r, J as i, Q as a, W as o, X as s, Z as c, j as ee } from "./form-context-Cl2FGxOa.js";
2
2
  import * as l from "react";
3
3
  //#region node_modules/.pnpm/@base-ui+utils@0.2.8_@types+react@19.2.14_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/utils/esm/useControlled.js
4
4
  function u({ controlled: t, default: n, name: r, state: i = "value" }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dawn-ui-react",
3
- "version": "1.0.0-alpha.3",
3
+ "version": "1.0.0-alpha.4",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,19 +0,0 @@
1
- import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
2
- import { i as t } from "./form-context-DScGBFYs.js";
3
- import { t as n } from "./cn-CXogf8HW.js";
4
- import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
5
- //#region src/components/field/field-errors.tsx
6
- var o = /* @__PURE__ */ e({ FieldErrors: () => s }), s = ({ className: e, children: o, ref: s, ...c }) => {
7
- let l = t();
8
- return l.state.meta.errors.length === 0 && !o ? null : /* @__PURE__ */ i(r, { children: l.state.meta.errors.length > 0 && /* @__PURE__ */ a("ul", {
9
- className: n("space-y-3xs", e),
10
- ref: s,
11
- ...c,
12
- children: [l.state.meta.errors.map((e) => /* @__PURE__ */ i("li", {
13
- className: "flex items-center gap-2xs style-text-strong--1 text-error-default",
14
- children: e.message
15
- }, e.message)), o]
16
- }) });
17
- };
18
- //#endregion
19
- export { o as n, s as t };