dawn-ui-react 1.0.0-alpha.16 → 1.0.0-alpha.18

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.
@@ -1,5 +1,5 @@
1
- import { V as e, X as t, Z as n } from "./form-context-D2zlNF0l.js";
2
- import { F as r, K as i, c as a, i as o, n as s, o as c, p as l, r as u, s as d, t as f } from "./useLabelableId-C8TWIYiH.js";
1
+ import { V as e, X as t, Z as n } from "./form-context-CB4ds-qf.js";
2
+ import { F as r, K as i, c as a, i as o, n as s, o as c, p as l, r as u, s as d, t as f } from "./useLabelableId-u8XPP_En.js";
3
3
  import * as p from "react";
4
4
  import { jsx as m } from "react/jsx-runtime";
5
5
  //#region node_modules/.pnpm/@base-ui+react@1.4.1_@types+react@19.2.14_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/field/control/FieldControl.js
@@ -1,5 +1,5 @@
1
- import { A as e, C as t, D as n, E as r, F as i, G as a, I as o, J as s, K as c, L as l, M as u, N as d, O as f, P as p, Q as m, R as h, S as g, T as _, V as v, W as y, X as b, Z as x, j as S, k as C, w, x as T, z as E } from "./form-context-D2zlNF0l.js";
2
- import { C as D, I as ee, W as O, c as k, f as A, l as j, p as M, s as N, u as te } from "./useLabelableId-C8TWIYiH.js";
1
+ import { A as e, C as t, D as n, E as r, F as i, G as a, I as o, J as s, K as c, L as l, M as u, N as d, O as f, P as p, Q as m, R as h, S as g, T as _, V as v, W as y, X as b, Z as x, j as S, k as C, w, x as T, z as E } from "./form-context-CB4ds-qf.js";
2
+ import { C as D, I as ee, W as O, c as k, f as A, l as j, p as M, s as N, u as te } from "./useLabelableId-u8XPP_En.js";
3
3
  import * as P from "react";
4
4
  import { useLayoutEffect as ne } from "react";
5
5
  import { jsx as F, jsxs as I } from "react/jsx-runtime";
@@ -1,2 +1,2 @@
1
1
  import { InputProps } from './input.types';
2
- export declare const Input: ({ variant, size, className, ref, ...props }: InputProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const Input: ({ compact, variant, size, className, ref, ...props }: InputProps) => import("react/jsx-runtime").JSX.Element;
@@ -5,4 +5,6 @@ export declare const inputVariants: (props?: ({
5
5
  variant?: "primary" | "secondary" | null | undefined;
6
6
  size?: "small" | "large" | "medium" | null | undefined;
7
7
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
8
- export type InputProps = VariantProps<typeof inputVariants> & Omit<ComponentProps<typeof BaseInput>, 'size'>;
8
+ export type InputProps = VariantProps<typeof inputVariants> & Omit<ComponentProps<typeof BaseInput>, 'size'> & {
9
+ compact?: boolean;
10
+ };
@@ -1,2 +1,2 @@
1
1
  import { NumberFieldTypesProps } from './number-field.types';
2
- export declare const NumberField: ({ label, size, className, ref, ...props }: NumberFieldTypesProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const NumberField: ({ children, label, size, className, ref, ...props }: NumberFieldTypesProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,11 @@
1
- import { $ as e, B as t, F as n, G as r, H as i, I as a, J as o, K as s, M as c, N as l, O as u, Q as d, T as f, U as p, V as m, W as h, X as g, Y as _, Z as v, _ as y, a as b, b as x, c as S, d as C, f as w, g as T, h as E, i as D, j as O, k, l as A, m as j, n as M, o as N, p as P, q as F, r as I, s as L, t as R, u as z, v as ee, x as B, y as te } from "./form-context-D2zlNF0l.js";
2
- import { A as ne, B as re, C as V, D as H, E as ie, F as U, G as W, H as ae, K as oe, M as se, N as ce, O as le, P as ue, R as de, S as fe, T as pe, U as me, V as he, W as ge, _ as _e, a as ve, b as ye, c as be, d as xe, f as Se, g as Ce, h as we, i as Te, j as Ee, k as De, l as Oe, m as ke, n as Ae, o as je, p as G, r as Me, s as Ne, t as Pe, u as Fe, v as Ie, w as Le, x as Re, y as ze, z as Be } from "./useLabelableId-C8TWIYiH.js";
3
- import { $ as Ve, $t as He, A as Ue, At as We, B as Ge, Bt as Ke, C as qe, Ct as Je, D as Ye, Dt as Xe, E as Ze, Et as Qe, F as $e, Ft as et, G as tt, Gt as nt, H as rt, Ht as it, I as at, It as ot, J as st, Jt as ct, K as lt, Kt as ut, L as dt, Lt as ft, M as pt, Mt as mt, N as ht, Nt as gt, O as _t, Ot as vt, P as yt, Pt as bt, Q as xt, Qt as St, R as Ct, Rt as wt, S as K, St as Tt, T as q, Tt as Et, U as Dt, Ut as Ot, V as kt, Vt as At, W as jt, Wt as Mt, X as Nt, Xt as Pt, Y as Ft, Yt as It, Z as Lt, Zt as Rt, _ as zt, _t as Bt, a as Vt, an as Ht, at as Ut, b as Wt, bt as Gt, c as Kt, cn as qt, ct as Jt, d as Yt, dn as Xt, dt as Zt, en as Qt, et as $t, f as en, fn as tn, ft as nn, g as rn, gn as an, gt as on, h as sn, hn as cn, ht as ln, i as un, in as dn, it as fn, j as pn, jt as mn, k as hn, kt as gn, l as _n, ln as vn, lt as yn, m as bn, mn as xn, mt as Sn, n as Cn, nn as wn, nt as Tn, o as En, on as Dn, ot as On, p as kn, pn as An, pt as jn, q as Mn, qt as Nn, r as Pn, rn as Fn, rt as In, s as Ln, sn as Rn, st as zn, t as Bn, tn as Vn, tt as Hn, u as Un, un as Wn, ut as Gn, v as Kn, vt as qn, w as Jn, wt as Yn, x as Xn, xt as Zn, y as Qn, yt as $n, z as er, zt as tr } from "./clamp-XXDcNhZ7.js";
1
+ import { $ as e, B as t, F as n, G as r, H as i, I as a, J as o, K as s, M as c, N as l, O as u, Q as d, T as f, U as p, V as m, W as h, X as g, Y as _, Z as v, _ as y, a as b, b as x, c as S, d as C, f as w, g as T, h as E, i as D, j as O, k, l as A, m as j, n as M, o as N, p as P, q as F, r as I, s as L, t as R, u as z, v as ee, x as B, y as te } from "./form-context-CB4ds-qf.js";
2
+ import { A as ne, B as re, C as V, D as H, E as ie, F as U, G as W, H as ae, K as oe, M as se, N as ce, O as le, P as ue, R as de, S as fe, T as pe, U as me, V as he, W as ge, _ as _e, a as ve, b as ye, c as be, d as xe, f as Se, g as Ce, h as we, i as Te, j as Ee, k as De, l as Oe, m as ke, n as Ae, o as je, p as G, r as Me, s as Ne, t as Pe, u as Fe, v as Ie, w as Le, x as Re, y as ze, z as Be } from "./useLabelableId-u8XPP_En.js";
3
+ import { $ as Ve, $t as He, A as Ue, At as We, B as Ge, Bt as Ke, C as qe, Ct as Je, D as Ye, Dt as Xe, E as Ze, Et as Qe, F as $e, Ft as et, G as tt, Gt as nt, H as rt, Ht as it, I as at, It as ot, J as st, Jt as ct, K as lt, Kt as ut, L as dt, Lt as ft, M as pt, Mt as mt, N as ht, Nt as gt, O as _t, Ot as vt, P as yt, Pt as bt, Q as xt, Qt as St, R as Ct, Rt as wt, S as K, St as Tt, T as q, Tt as Et, U as Dt, Ut as Ot, V as kt, Vt as At, W as jt, Wt as Mt, X as Nt, Xt as Pt, Y as Ft, Yt as It, Z as Lt, Zt as Rt, _ as zt, _t as Bt, a as Vt, an as Ht, at as Ut, b as Wt, bt as Gt, c as Kt, cn as qt, ct as Jt, d as Yt, dn as Xt, dt as Zt, en as Qt, et as $t, f as en, fn as tn, ft as nn, g as rn, gn as an, gt as on, h as sn, hn as cn, ht as ln, i as un, in as dn, it as fn, j as pn, jt as mn, k as hn, kt as gn, l as _n, ln as vn, lt as yn, m as bn, mn as xn, mt as Sn, n as Cn, nn as wn, nt as Tn, o as En, on as Dn, ot as On, p as kn, pn as An, pt as jn, q as Mn, qt as Nn, r as Pn, rn as Fn, rt as In, s as Ln, sn as Rn, st as zn, t as Bn, tn as Vn, tt as Hn, u as Un, un as Wn, ut as Gn, v as Kn, vt as qn, w as Jn, wt as Yn, x as Xn, xt as Zn, y as Qn, yt as $n, z as er, zt as tr } from "./clamp-Dc75Pf2J.js";
4
4
  import { n as nr, t as J } from "./cn-DWnOBdrm.js";
5
- import { t as rr } from "./Input--h5J-IHe.js";
6
- import { t as ir } from "./input.types-oyKEbsbD.js";
7
- import { t as ar } from "./input-group-Ddhxk-gp.js";
8
- import { t as or } from "./input-group-input-iCeN23U6.js";
5
+ import { t as rr } from "./Input-CXejdMdw.js";
6
+ import { t as ir } from "./input.types-B721AivD.js";
7
+ import { t as ar } from "./input-group-Bla-ghcN.js";
8
+ import { t as or } from "./input-group-input-BAoqWXrN.js";
9
9
  import * as Y from "react";
10
10
  import sr, { cloneElement as cr, createContext as lr, createElement as ur, forwardRef as dr, isValidElement as fr, memo as pr, startTransition as mr, useCallback as hr, useContext as gr, useEffect as _r, useId as vr, useImperativeHandle as yr, useInsertionEffect as br, useLayoutEffect as xr, useMemo as Sr, useRef as Cr, useState as wr } from "react";
11
11
  import { Fragment as Tr, jsx as X, jsxs as Z } from "react/jsx-runtime";
@@ -28708,39 +28708,73 @@ var wW = xc, TW = ({ open: e, virtualizerRef: t, estimateSize: n = 32, overscan:
28708
28708
  children: e
28709
28709
  }, `${e}-${t}`)), t]
28710
28710
  });
28711
- }, XW = ({ variant: e, size: t, className: n, ref: r, ...i }) => {
28712
- let a = Cr(null), [o, s] = wr(i.defaultValue || "#000000");
28713
- return i.type === "color" ? /* @__PURE__ */ Z("button", {
28714
- "aria-label": "Open color picker",
28715
- className: "relative h-xl w-[calc(var(--spacing-3xl)+5rem)] items-center rounded-xl pl-xs transition-all peer-focus:outline-brand-default hover:cursor-pointer",
28716
- onClick: () => a.current?.click(),
28717
- type: "button",
28718
- children: [
28719
- /* @__PURE__ */ X("div", {
28720
- className: J("absolute top-1/2 left-[0px] aspect-square h-full -translate-y-1/2 rounded-l-xl"),
28721
- style: { backgroundColor: o }
28722
- }),
28723
- /* @__PURE__ */ X(rr, {
28724
- className: "peer pointer-events-none invisible absolute top-lg",
28725
- defaultValue: o,
28726
- onChange: (e) => s(e.currentTarget.value),
28727
- ref: a,
28711
+ }, XW = ({ compact: e, variant: t, size: n, className: r, ref: i, ...a }) => {
28712
+ let o = Cr(null), [s, c] = wr(a.defaultValue || a.value || "#000000");
28713
+ if (a.type === "color") {
28714
+ let l = a.value !== void 0, u = (l ? a.value : s) || "#000000", { onChange: d, defaultValue: f, value: p, ...m } = a, h = (e) => {
28715
+ l || c(e.currentTarget.value), d?.(e);
28716
+ }, g = (e) => {
28717
+ if (o.current = e, typeof i == "function") {
28718
+ i(e);
28719
+ return;
28720
+ }
28721
+ i && typeof i == "object" && (i.current = e);
28722
+ };
28723
+ return e ? /* @__PURE__ */ Z("button", {
28724
+ "aria-label": "Open color picker",
28725
+ className: J("relative rounded-full outline-2 outline-transparent transition-colors focus-within:outline-border hover:cursor-pointer", n === "small" && "size-lg -outline-offset-2", n === "medium" && "size-xl -outline-offset-4", n === "large" && "size-2xl -outline-offset-6", r),
28726
+ disabled: a.disabled,
28727
+ onClick: () => o.current?.click(),
28728
+ type: "button",
28729
+ children: [/* @__PURE__ */ X("div", {
28730
+ className: J("size-full rounded-full"),
28731
+ style: { backgroundColor: u }
28732
+ }), /* @__PURE__ */ X(rr, {
28733
+ className: "peer pointer-events-none invisible absolute",
28734
+ defaultValue: l ? void 0 : u,
28735
+ onChange: h,
28736
+ ref: g,
28728
28737
  type: "color",
28729
- value: o,
28730
- ...i
28731
- }),
28732
- /* @__PURE__ */ X("p", {
28733
- className: "pl-xl text-left style-text-default-0",
28734
- children: o
28735
- })
28736
- ]
28737
- }) : /* @__PURE__ */ X(rr, {
28738
+ value: l ? u : void 0,
28739
+ ...m
28740
+ })]
28741
+ }) : /* @__PURE__ */ Z("button", {
28742
+ "aria-label": "Open color picker",
28743
+ className: J("relative hover:cursor-pointer", ir({
28744
+ variant: t,
28745
+ size: n
28746
+ }), r),
28747
+ disabled: a.disabled,
28748
+ onClick: () => o.current?.click(),
28749
+ type: "button",
28750
+ children: [
28751
+ /* @__PURE__ */ X("div", {
28752
+ className: J("absolute top-1/2 left-xs aspect-square h-7/12 -translate-y-1/2 rounded-full"),
28753
+ style: { backgroundColor: u }
28754
+ }),
28755
+ /* @__PURE__ */ X(rr, {
28756
+ className: "peer pointer-events-none invisible absolute top-lg",
28757
+ defaultValue: l ? void 0 : u,
28758
+ onChange: h,
28759
+ ref: g,
28760
+ type: "color",
28761
+ value: l ? u : void 0,
28762
+ ...m
28763
+ }),
28764
+ /* @__PURE__ */ X("p", {
28765
+ className: "pl-lg text-left style-text-default-0",
28766
+ children: u
28767
+ })
28768
+ ]
28769
+ });
28770
+ }
28771
+ return /* @__PURE__ */ X(rr, {
28738
28772
  className: J(ir({
28739
- variant: e,
28740
- size: t
28741
- }), n),
28742
- ref: r,
28743
- ...i
28773
+ variant: t,
28774
+ size: n
28775
+ }), r),
28776
+ ref: i,
28777
+ ...a
28744
28778
  });
28745
28779
  }, ZW = ({ className: e, children: t, ref: n, ...r }) => {
28746
28780
  let i = D();
@@ -33334,19 +33368,19 @@ var M2 = ({ row: e, className: t, children: n, ref: r, ...i }) => /* @__PURE__ *
33334
33368
  ref: n,
33335
33369
  ...r,
33336
33370
  children: t
33337
- }), u4 = y("flex flex-col gap-3xs data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 [&_[role=\"group\"]]:rounded-full [&_[role=\"group\"]]:bg-surface [&_[role=\"group\"]]:p-3xs [&_[role=\"group\"]]:shadow-2xs [&_[role=\"group\"]]:outline [&_[role=\"group\"]]:outline-transparent [&_[role=\"group\"]]:transition-all aria-invalid:[&_[role=\"group\"]]:bg-error-container aria-invalid:[&_[role=\"group\"]]:outline-error-border aria-invalid:[&_[role=\"group\"]]:focus-within:outline-error-border-strong aria-invalid:[&_[role=\"group\"]]:not-focus-within:hover:outline-error-border data-[disabled]:[&_[role=\"group\"]]:cursor-not-allowed data-[invalid]:[&_[role=\"group\"]]:bg-error-container data-[invalid]:[&_[role=\"group\"]]:outline-error-border data-[invalid]:[&_[role=\"group\"]]:focus-within:outline-error-border-strong data-[invalid]:[&_[role=\"group\"]]:not-focus-within:hover:outline-error-border aria-invalid:[&_input]:text-error-on-container aria-invalid:[&_input]:caret-error-border-strong data-[invalid]:[&_input]:text-error-on-container data-[invalid]:[&_input]:caret-error-border-strong", {
33371
+ }), u4 = y("flex flex-col gap-3xs data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 [&_[role=\"group\"]]:rounded-full [&_[role=\"group\"]]:bg-surface [&_[role=\"group\"]]:shadow-2xs [&_[role=\"group\"]]:outline [&_[role=\"group\"]]:outline-transparent [&_[role=\"group\"]]:transition-all aria-invalid:[&_[role=\"group\"]]:bg-error-container aria-invalid:[&_[role=\"group\"]]:outline-error-border aria-invalid:[&_[role=\"group\"]]:focus-within:outline-error-border-strong aria-invalid:[&_[role=\"group\"]]:not-focus-within:hover:outline-error-border data-[disabled]:[&_[role=\"group\"]]:cursor-not-allowed data-[invalid]:[&_[role=\"group\"]]:bg-error-container data-[invalid]:[&_[role=\"group\"]]:outline-error-border data-[invalid]:[&_[role=\"group\"]]:focus-within:outline-error-border-strong data-[invalid]:[&_[role=\"group\"]]:not-focus-within:hover:outline-error-border aria-invalid:[&_input]:text-error-on-container aria-invalid:[&_input]:caret-error-border-strong data-[invalid]:[&_input]:text-error-on-container data-[invalid]:[&_input]:caret-error-border-strong", {
33338
33372
  variants: { size: {
33339
- small: "[&_input]:style-text-default-0",
33340
- medium: "[&_input]:style-text-default-1",
33341
- large: "[&_input]:style-text-default-2"
33373
+ small: "h-lg [&_input]:style-text-default--1",
33374
+ medium: "h-xl [&_input]:style-text-default-0",
33375
+ large: "h-2xl [&_input]:style-text-default-1"
33342
33376
  } },
33343
33377
  defaultVariants: { size: "medium" }
33344
- }), d4 = ({ label: e, size: t, className: n, ref: r, ...i }) => {
33345
- let a = sr.useId(), { min: o, max: s, value: c, defaultValue: l, onValueChange: u, "aria-invalid": d, ...f } = i, [p, m] = sr.useState(() => typeof l == "number" ? l : null), h = typeof c == "number" || c === null ? c : p, g = !!(d || typeof h == "number" && (typeof o == "number" && h < o || typeof s == "number" && h > s)), _ = (...e) => {
33378
+ }), d4 = ({ children: e, label: t, size: n, className: r, ref: i, ...a }) => {
33379
+ let o = sr.useId(), { min: s, max: c, value: l, defaultValue: u, onValueChange: d, "aria-invalid": f, ...p } = a, [m, h] = sr.useState(() => typeof u == "number" ? u : null), g = typeof l == "number" || l === null ? l : m, _ = !!(f || typeof g == "number" && (typeof s == "number" && g < s || typeof c == "number" && g > c)), v = (...e) => {
33346
33380
  let [t] = e;
33347
- typeof c != "number" && c !== null && m(t), u?.(...e);
33348
- }, v = () => {
33349
- switch (t) {
33381
+ typeof l != "number" && l !== null && h(t), d?.(...e);
33382
+ }, y = () => {
33383
+ switch (n) {
33350
33384
  case "small": return "iconSmall";
33351
33385
  case "medium": return "iconMedium";
33352
33386
  case "large": return "iconLarge";
@@ -33355,43 +33389,47 @@ var M2 = ({ row: e, className: t, children: n, ref: r, ...i }) => /* @__PURE__ *
33355
33389
  };
33356
33390
  return /* @__PURE__ */ Z(lp, {
33357
33391
  className: J(u4({
33358
- size: t,
33359
- className: n
33392
+ size: n,
33393
+ className: r
33360
33394
  })),
33361
- ref: r,
33362
- "aria-invalid": g,
33363
- "data-invalid": g ? "" : void 0,
33364
- defaultValue: l,
33365
- id: a,
33366
- max: s,
33367
- min: o,
33368
- onValueChange: _,
33369
- value: c,
33370
- ...f,
33395
+ ref: i,
33396
+ "aria-invalid": _,
33397
+ "data-invalid": _ ? "" : void 0,
33398
+ defaultValue: u,
33399
+ id: o,
33400
+ max: c,
33401
+ min: s,
33402
+ onValueChange: v,
33403
+ value: l,
33404
+ ...p,
33371
33405
  children: [/* @__PURE__ */ Z(Np, {
33372
33406
  className: "cursor-ew-resize",
33373
33407
  children: [/* @__PURE__ */ X("label", {
33374
33408
  className: "cursor-ew-resize style-text-default--1",
33375
- htmlFor: a,
33376
- children: e
33409
+ htmlFor: o,
33410
+ children: t
33377
33411
  }), /* @__PURE__ */ X(Pp, { children: /* @__PURE__ */ X(f4, {}) })]
33378
33412
  }), /* @__PURE__ */ Z(dp, {
33379
- className: "flex w-full items-center",
33413
+ className: "relative flex w-full items-center gap-3xs",
33380
33414
  children: [
33381
33415
  /* @__PURE__ */ X(Tp, { render: (e) => /* @__PURE__ */ X(P, {
33382
33416
  ...e,
33383
33417
  tone: "error",
33384
33418
  variant: "ghost",
33385
- size: v(),
33419
+ size: y(),
33386
33420
  className: "shrink-0",
33387
33421
  children: /* @__PURE__ */ X(Vy, { weight: "bold" })
33388
33422
  }) }),
33389
33423
  /* @__PURE__ */ X(Op, { className: "w-full text-center style-text-default-0 focus:outline-none" }),
33424
+ /* @__PURE__ */ X("div", {
33425
+ className: "absolute right-2xl style-text-default-0 text-on-surface-variant",
33426
+ children: e
33427
+ }),
33390
33428
  /* @__PURE__ */ X(wp, { render: (e) => /* @__PURE__ */ X(P, {
33391
33429
  ...e,
33392
33430
  tone: "success",
33393
33431
  variant: "ghost",
33394
- size: v(),
33432
+ size: y(),
33395
33433
  className: "shrink-0",
33396
33434
  children: /* @__PURE__ */ X(Hy, { weight: "bold" })
33397
33435
  }) })