@geomak/ui 5.7.0 → 5.7.2

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/dist/index.d.cts CHANGED
@@ -1870,8 +1870,15 @@ interface FieldLabelProps {
1870
1870
  required?: boolean;
1871
1871
  /** Reveals an info icon + tooltip beside the label. */
1872
1872
  helperText?: React__default.ReactNode;
1873
- /** Apply horizontal-layout spacing (top margin, no-wrap, shrink). */
1873
+ /** Apply horizontal-layout spacing (no-wrap, shrink). */
1874
1874
  horizontal?: boolean;
1875
+ /**
1876
+ * Vertical alignment of the label against the control in horizontal layout.
1877
+ * `'start'` (default) nudges the label down to meet a standard ~36px input's
1878
+ * first line; `'center'` removes that offset so the label centres against a
1879
+ * short control (Switch, SegmentedControl).
1880
+ */
1881
+ align?: 'start' | 'center';
1875
1882
  style?: React__default.CSSProperties;
1876
1883
  /** Label column width in horizontal layout. */
1877
1884
  width?: string | number;
@@ -1885,7 +1892,7 @@ interface FieldLabelProps {
1885
1892
  *
1886
1893
  * Returns `null` when there's nothing to show (no label and no helperText).
1887
1894
  */
1888
- declare function FieldLabel({ label, htmlFor, required, helperText, horizontal, style, width, className, }: FieldLabelProps): react_jsx_runtime.JSX.Element;
1895
+ declare function FieldLabel({ label, htmlFor, required, helperText, horizontal, align, style, width, className, }: FieldLabelProps): react_jsx_runtime.JSX.Element;
1889
1896
  interface FieldProps {
1890
1897
  label?: React__default.ReactNode;
1891
1898
  /** `id` of the control — links the `<label htmlFor>`. */
@@ -1899,6 +1906,12 @@ interface FieldProps {
1899
1906
  required?: boolean;
1900
1907
  /** Contextual help revealed via an info icon + tooltip beside the label. */
1901
1908
  helperText?: React__default.ReactNode;
1909
+ /**
1910
+ * Label alignment against the control in horizontal layout. `'start'`
1911
+ * (default) for standard-height inputs; `'center'` for short controls
1912
+ * (Switch) so the label lines up with the control's centre.
1913
+ */
1914
+ labelAlign?: 'start' | 'center';
1902
1915
  labelStyle?: React__default.CSSProperties;
1903
1916
  /** Width of the label column in horizontal layout (CSS length). */
1904
1917
  labelWidth?: string | number;
@@ -1921,7 +1934,7 @@ interface FieldProps {
1921
1934
  * medium weight so it reads as the anchor, while the input's placeholder is
1922
1935
  * muted — establishing hierarchy without making the label tiny.
1923
1936
  */
1924
- declare function Field({ label, htmlFor, errorId, errorMessage, layout, required, helperText, labelStyle, labelWidth, className, children, }: FieldProps): react_jsx_runtime.JSX.Element;
1937
+ declare function Field({ label, htmlFor, errorId, errorMessage, layout, required, helperText, labelAlign, labelStyle, labelWidth, className, children, }: FieldProps): react_jsx_runtime.JSX.Element;
1925
1938
 
1926
1939
  interface TextInputProps {
1927
1940
  value?: string;
@@ -2110,8 +2123,9 @@ interface SearchInputProps {
2110
2123
  declare const SearchInput: React__default.ForwardRefExoticComponent<SearchInputProps & React__default.RefAttributes<HTMLInputElement>>;
2111
2124
 
2112
2125
  interface CheckboxProps {
2113
- /** Controlled checked state */
2126
+ /** Controlled checked state. */
2114
2127
  checked?: boolean;
2128
+ /** Fires `{ target: { checked, id, name } }` for form-handler compatibility. */
2115
2129
  onChange?: (e: {
2116
2130
  target: {
2117
2131
  checked: boolean;
@@ -2119,12 +2133,22 @@ interface CheckboxProps {
2119
2133
  name?: string;
2120
2134
  };
2121
2135
  }) => void;
2136
+ /** Primary label text. */
2122
2137
  label?: React__default.ReactNode;
2138
+ /** Secondary line rendered under the label (same affordance as RadioGroup options). */
2139
+ description?: React__default.ReactNode;
2140
+ /** Native form field name. */
2123
2141
  name?: string;
2124
- /** `id` for the hidden input and the `<label htmlFor>` link */
2142
+ /** `id` for the control and the `<label htmlFor>` link. */
2125
2143
  htmlFor?: string;
2144
+ /** Validation message — shown under the control; also flags the box red + `aria-invalid`. */
2126
2145
  errorMessage?: React__default.ReactNode;
2146
+ /** Contextual help revealed via an info icon + tooltip beside the label. */
2147
+ helperText?: React__default.ReactNode;
2148
+ /** Disable interaction + dim the control. */
2127
2149
  disabled?: boolean;
2150
+ /** Show a required asterisk after the label. */
2151
+ required?: boolean;
2128
2152
  /**
2129
2153
  * Box + label arrangement.
2130
2154
  * - `'horizontal'` (default): box and label on one row.
@@ -2132,34 +2156,36 @@ interface CheckboxProps {
2132
2156
  */
2133
2157
  layout?: 'horizontal' | 'vertical';
2134
2158
  /**
2135
- * Where the label sits relative to the box.
2136
- * - In horizontal: `'right'` (default) box then label; `'left'` → label then box.
2137
- * - In vertical: `'right'` (default) box then label below; `'left'` label above then box.
2159
+ * Which side of the box the label sits on.
2160
+ * - `'right'` (default): box then label.
2161
+ * - `'left'`: label then box (the description always wraps under the label).
2138
2162
  */
2139
2163
  labelPosition?: 'left' | 'right';
2140
- /** Contextual help revealed via an info icon + tooltip beside the label. */
2141
- helperText?: React__default.ReactNode;
2142
- /** Show a required asterisk after the label. */
2143
- required?: boolean;
2144
- /** @deprecated Use `checked` */
2164
+ /** @deprecated Use `checked`. Kept for API compatibility. */
2145
2165
  value?: boolean;
2146
2166
  }
2147
2167
  /**
2148
2168
  * Accessible checkbox powered by Radix Checkbox.
2149
2169
  *
2150
- * Radix handles keyboard activation, focus ring, and `role="checkbox"` ARIA.
2151
- * The check mark pops in with a spring animation on first check.
2170
+ * Radix handles keyboard activation, focus ring, and `role="checkbox"` ARIA;
2171
+ * the check mark pops in with a spring on first check. Supports a secondary
2172
+ * `description`, `helperText` tooltip, left/right label placement, and the
2173
+ * shared error treatment — so it lines up with every other input in a form.
2174
+ *
2175
+ * Emits `{ target: { checked, id, name } }` for drop-in use with existing
2176
+ * change handlers.
2152
2177
  *
2153
2178
  * @example
2154
2179
  * <Checkbox
2155
2180
  * htmlFor="agree"
2156
2181
  * label="I agree to the terms"
2182
+ * description="You can revoke consent any time in settings."
2157
2183
  * checked={form.agree}
2158
2184
  * onChange={({ target }) => setField('agree', target.checked)}
2159
2185
  * />
2160
2186
  */
2161
2187
  declare function Checkbox({ checked, value, // legacy alias
2162
- onChange, label, name, htmlFor, errorMessage, disabled, layout, labelPosition, helperText, required, }: CheckboxProps): react_jsx_runtime.JSX.Element;
2188
+ onChange, label, description, name, htmlFor, errorMessage, helperText, disabled, required, layout, labelPosition, }: CheckboxProps): react_jsx_runtime.JSX.Element;
2163
2189
 
2164
2190
  interface RadioOption {
2165
2191
  /** Stable value submitted / reported on change. */
package/dist/index.d.ts CHANGED
@@ -1870,8 +1870,15 @@ interface FieldLabelProps {
1870
1870
  required?: boolean;
1871
1871
  /** Reveals an info icon + tooltip beside the label. */
1872
1872
  helperText?: React__default.ReactNode;
1873
- /** Apply horizontal-layout spacing (top margin, no-wrap, shrink). */
1873
+ /** Apply horizontal-layout spacing (no-wrap, shrink). */
1874
1874
  horizontal?: boolean;
1875
+ /**
1876
+ * Vertical alignment of the label against the control in horizontal layout.
1877
+ * `'start'` (default) nudges the label down to meet a standard ~36px input's
1878
+ * first line; `'center'` removes that offset so the label centres against a
1879
+ * short control (Switch, SegmentedControl).
1880
+ */
1881
+ align?: 'start' | 'center';
1875
1882
  style?: React__default.CSSProperties;
1876
1883
  /** Label column width in horizontal layout. */
1877
1884
  width?: string | number;
@@ -1885,7 +1892,7 @@ interface FieldLabelProps {
1885
1892
  *
1886
1893
  * Returns `null` when there's nothing to show (no label and no helperText).
1887
1894
  */
1888
- declare function FieldLabel({ label, htmlFor, required, helperText, horizontal, style, width, className, }: FieldLabelProps): react_jsx_runtime.JSX.Element;
1895
+ declare function FieldLabel({ label, htmlFor, required, helperText, horizontal, align, style, width, className, }: FieldLabelProps): react_jsx_runtime.JSX.Element;
1889
1896
  interface FieldProps {
1890
1897
  label?: React__default.ReactNode;
1891
1898
  /** `id` of the control — links the `<label htmlFor>`. */
@@ -1899,6 +1906,12 @@ interface FieldProps {
1899
1906
  required?: boolean;
1900
1907
  /** Contextual help revealed via an info icon + tooltip beside the label. */
1901
1908
  helperText?: React__default.ReactNode;
1909
+ /**
1910
+ * Label alignment against the control in horizontal layout. `'start'`
1911
+ * (default) for standard-height inputs; `'center'` for short controls
1912
+ * (Switch) so the label lines up with the control's centre.
1913
+ */
1914
+ labelAlign?: 'start' | 'center';
1902
1915
  labelStyle?: React__default.CSSProperties;
1903
1916
  /** Width of the label column in horizontal layout (CSS length). */
1904
1917
  labelWidth?: string | number;
@@ -1921,7 +1934,7 @@ interface FieldProps {
1921
1934
  * medium weight so it reads as the anchor, while the input's placeholder is
1922
1935
  * muted — establishing hierarchy without making the label tiny.
1923
1936
  */
1924
- declare function Field({ label, htmlFor, errorId, errorMessage, layout, required, helperText, labelStyle, labelWidth, className, children, }: FieldProps): react_jsx_runtime.JSX.Element;
1937
+ declare function Field({ label, htmlFor, errorId, errorMessage, layout, required, helperText, labelAlign, labelStyle, labelWidth, className, children, }: FieldProps): react_jsx_runtime.JSX.Element;
1925
1938
 
1926
1939
  interface TextInputProps {
1927
1940
  value?: string;
@@ -2110,8 +2123,9 @@ interface SearchInputProps {
2110
2123
  declare const SearchInput: React__default.ForwardRefExoticComponent<SearchInputProps & React__default.RefAttributes<HTMLInputElement>>;
2111
2124
 
2112
2125
  interface CheckboxProps {
2113
- /** Controlled checked state */
2126
+ /** Controlled checked state. */
2114
2127
  checked?: boolean;
2128
+ /** Fires `{ target: { checked, id, name } }` for form-handler compatibility. */
2115
2129
  onChange?: (e: {
2116
2130
  target: {
2117
2131
  checked: boolean;
@@ -2119,12 +2133,22 @@ interface CheckboxProps {
2119
2133
  name?: string;
2120
2134
  };
2121
2135
  }) => void;
2136
+ /** Primary label text. */
2122
2137
  label?: React__default.ReactNode;
2138
+ /** Secondary line rendered under the label (same affordance as RadioGroup options). */
2139
+ description?: React__default.ReactNode;
2140
+ /** Native form field name. */
2123
2141
  name?: string;
2124
- /** `id` for the hidden input and the `<label htmlFor>` link */
2142
+ /** `id` for the control and the `<label htmlFor>` link. */
2125
2143
  htmlFor?: string;
2144
+ /** Validation message — shown under the control; also flags the box red + `aria-invalid`. */
2126
2145
  errorMessage?: React__default.ReactNode;
2146
+ /** Contextual help revealed via an info icon + tooltip beside the label. */
2147
+ helperText?: React__default.ReactNode;
2148
+ /** Disable interaction + dim the control. */
2127
2149
  disabled?: boolean;
2150
+ /** Show a required asterisk after the label. */
2151
+ required?: boolean;
2128
2152
  /**
2129
2153
  * Box + label arrangement.
2130
2154
  * - `'horizontal'` (default): box and label on one row.
@@ -2132,34 +2156,36 @@ interface CheckboxProps {
2132
2156
  */
2133
2157
  layout?: 'horizontal' | 'vertical';
2134
2158
  /**
2135
- * Where the label sits relative to the box.
2136
- * - In horizontal: `'right'` (default) box then label; `'left'` → label then box.
2137
- * - In vertical: `'right'` (default) box then label below; `'left'` label above then box.
2159
+ * Which side of the box the label sits on.
2160
+ * - `'right'` (default): box then label.
2161
+ * - `'left'`: label then box (the description always wraps under the label).
2138
2162
  */
2139
2163
  labelPosition?: 'left' | 'right';
2140
- /** Contextual help revealed via an info icon + tooltip beside the label. */
2141
- helperText?: React__default.ReactNode;
2142
- /** Show a required asterisk after the label. */
2143
- required?: boolean;
2144
- /** @deprecated Use `checked` */
2164
+ /** @deprecated Use `checked`. Kept for API compatibility. */
2145
2165
  value?: boolean;
2146
2166
  }
2147
2167
  /**
2148
2168
  * Accessible checkbox powered by Radix Checkbox.
2149
2169
  *
2150
- * Radix handles keyboard activation, focus ring, and `role="checkbox"` ARIA.
2151
- * The check mark pops in with a spring animation on first check.
2170
+ * Radix handles keyboard activation, focus ring, and `role="checkbox"` ARIA;
2171
+ * the check mark pops in with a spring on first check. Supports a secondary
2172
+ * `description`, `helperText` tooltip, left/right label placement, and the
2173
+ * shared error treatment — so it lines up with every other input in a form.
2174
+ *
2175
+ * Emits `{ target: { checked, id, name } }` for drop-in use with existing
2176
+ * change handlers.
2152
2177
  *
2153
2178
  * @example
2154
2179
  * <Checkbox
2155
2180
  * htmlFor="agree"
2156
2181
  * label="I agree to the terms"
2182
+ * description="You can revoke consent any time in settings."
2157
2183
  * checked={form.agree}
2158
2184
  * onChange={({ target }) => setField('agree', target.checked)}
2159
2185
  * />
2160
2186
  */
2161
2187
  declare function Checkbox({ checked, value, // legacy alias
2162
- onChange, label, name, htmlFor, errorMessage, disabled, layout, labelPosition, helperText, required, }: CheckboxProps): react_jsx_runtime.JSX.Element;
2188
+ onChange, label, description, name, htmlFor, errorMessage, helperText, disabled, required, layout, labelPosition, }: CheckboxProps): react_jsx_runtime.JSX.Element;
2163
2189
 
2164
2190
  interface RadioOption {
2165
2191
  /** Stable value submitted / reported on change. */
package/dist/index.js CHANGED
@@ -2165,6 +2165,7 @@ function FieldLabel({
2165
2165
  required,
2166
2166
  helperText,
2167
2167
  horizontal = false,
2168
+ align = "start",
2168
2169
  style,
2169
2170
  width,
2170
2171
  className = ""
@@ -2176,7 +2177,10 @@ function FieldLabel({
2176
2177
  style: { width: horizontal ? width : void 0, ...style },
2177
2178
  className: [
2178
2179
  "flex items-center gap-1",
2179
- horizontal ? "mt-2 flex-shrink-0 whitespace-nowrap" : "",
2180
+ horizontal ? "flex-shrink-0 whitespace-nowrap" : "",
2181
+ // Only the 'start' alignment needs the top nudge; 'center' relies
2182
+ // on the row's items-center to line up with a short control.
2183
+ horizontal && align === "start" ? "mt-2" : "",
2180
2184
  className
2181
2185
  ].filter(Boolean).join(" "),
2182
2186
  children: [
@@ -2197,6 +2201,7 @@ function Field({
2197
2201
  layout = "vertical",
2198
2202
  required,
2199
2203
  helperText,
2204
+ labelAlign = "start",
2200
2205
  labelStyle,
2201
2206
  labelWidth,
2202
2207
  className = "",
@@ -2209,7 +2214,7 @@ function Field({
2209
2214
  {
2210
2215
  className: [
2211
2216
  "flex",
2212
- horizontal ? "flex-row items-start gap-3" : "flex-col gap-1.5",
2217
+ horizontal ? `flex-row gap-3 ${labelAlign === "center" ? "items-center" : "items-start"}` : "flex-col gap-1.5",
2213
2218
  className
2214
2219
  ].filter(Boolean).join(" "),
2215
2220
  children: [
@@ -2221,6 +2226,7 @@ function Field({
2221
2226
  required,
2222
2227
  helperText,
2223
2228
  horizontal,
2229
+ align: labelAlign,
2224
2230
  style: labelStyle,
2225
2231
  width: labelWidth
2226
2232
  }
@@ -3679,14 +3685,15 @@ function Checkbox({
3679
3685
  // legacy alias
3680
3686
  onChange,
3681
3687
  label,
3688
+ description,
3682
3689
  name,
3683
3690
  htmlFor,
3684
3691
  errorMessage,
3692
+ helperText,
3685
3693
  disabled = false,
3694
+ required,
3686
3695
  layout = "horizontal",
3687
- labelPosition = "right",
3688
- helperText,
3689
- required
3696
+ labelPosition = "right"
3690
3697
  }) {
3691
3698
  const isChecked = checked ?? value ?? false;
3692
3699
  const labelFirst = labelPosition === "left";
@@ -3699,11 +3706,12 @@ function Checkbox({
3699
3706
  name,
3700
3707
  checked: isChecked,
3701
3708
  disabled,
3709
+ required,
3702
3710
  onCheckedChange: (c) => onChange?.({ target: { checked: !!c, id: htmlFor, name } }),
3703
3711
  className: [
3704
- "relative flex h-[18px] w-[18px] flex-shrink-0 items-center justify-center",
3712
+ "relative mt-0.5 flex h-[18px] w-[18px] flex-shrink-0 items-center justify-center",
3705
3713
  "rounded-sm border transition-colors duration-150",
3706
- "border-border-strong bg-surface",
3714
+ hasError ? "border-status-error" : "border-border-strong",
3707
3715
  "data-[state=checked]:bg-accent data-[state=checked]:border-accent",
3708
3716
  // Focus halo matches the field tokens for a consistent look.
3709
3717
  "focus:outline-none focus-visible:ring-[3px] focus-visible:ring-focus-ring",
@@ -3715,33 +3723,60 @@ function Checkbox({
3715
3723
  children: /* @__PURE__ */ jsx(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center data-[state=checked]:animate-check-pop", children: /* @__PURE__ */ jsx("svg", { width: "11", height: "9", viewBox: "0 0 11 9", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M1 4.5L4 7.5L10 1", stroke: "white", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }) }) })
3716
3724
  }
3717
3725
  );
3718
- const labelEl = label && /* @__PURE__ */ jsxs("span", { className: "text-sm text-foreground-secondary select-none leading-snug", children: [
3719
- label,
3720
- required && /* @__PURE__ */ jsx("span", { className: "text-status-error ml-0.5", "aria-hidden": "true", children: "*" })
3721
- ] });
3726
+ const labelText = label != null && /* @__PURE__ */ jsxs(
3727
+ "label",
3728
+ {
3729
+ htmlFor,
3730
+ className: ["block select-none text-sm text-foreground leading-snug", disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"].join(" "),
3731
+ children: [
3732
+ label,
3733
+ required && /* @__PURE__ */ jsx("span", { className: "text-status-error ml-0.5", "aria-hidden": "true", children: "*" })
3734
+ ]
3735
+ }
3736
+ );
3737
+ const descriptionEl = description != null && /* @__PURE__ */ jsx(
3738
+ "label",
3739
+ {
3740
+ htmlFor,
3741
+ className: `block text-xs text-foreground-secondary mt-0.5 ${disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}`,
3742
+ children: description
3743
+ }
3744
+ );
3745
+ let content;
3746
+ if (layout === "vertical") {
3747
+ content = /* @__PURE__ */ jsxs("span", { className: "flex flex-col items-start gap-1.5", children: [
3748
+ labelFirst ? /* @__PURE__ */ jsxs(Fragment, { children: [
3749
+ labelText,
3750
+ box
3751
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
3752
+ box,
3753
+ labelText
3754
+ ] }),
3755
+ descriptionEl
3756
+ ] });
3757
+ } else if (labelFirst) {
3758
+ content = /* @__PURE__ */ jsxs("span", { className: "flex flex-col", children: [
3759
+ /* @__PURE__ */ jsxs("span", { className: "flex items-start gap-2.5", children: [
3760
+ labelText,
3761
+ box
3762
+ ] }),
3763
+ descriptionEl
3764
+ ] });
3765
+ } else {
3766
+ content = /* @__PURE__ */ jsxs("span", { className: "flex items-start gap-2.5", children: [
3767
+ box,
3768
+ /* @__PURE__ */ jsxs("span", { className: "flex flex-col", children: [
3769
+ labelText,
3770
+ descriptionEl
3771
+ ] })
3772
+ ] });
3773
+ }
3722
3774
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
3723
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
3724
- /* @__PURE__ */ jsx(
3725
- "label",
3726
- {
3727
- htmlFor,
3728
- className: [
3729
- "inline-flex",
3730
- layout === "vertical" ? "flex-col items-start gap-1.5" : "flex-row items-center gap-2.5",
3731
- disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"
3732
- ].join(" "),
3733
- children: labelFirst ? /* @__PURE__ */ jsxs(Fragment, { children: [
3734
- labelEl,
3735
- box
3736
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
3737
- box,
3738
- labelEl
3739
- ] })
3740
- }
3741
- ),
3775
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-1", children: [
3776
+ content,
3742
3777
  helperText != null && /* @__PURE__ */ jsx(FieldHelpIcon, { text: helperText })
3743
3778
  ] }),
3744
- errorMessage && /* @__PURE__ */ jsx("span", { id: errorId, className: "text-xs text-status-error mt-0.5", children: errorMessage })
3779
+ hasError && /* @__PURE__ */ jsx("span", { id: errorId, className: "text-xs text-status-error mt-0.5", children: errorMessage })
3745
3780
  ] });
3746
3781
  }
3747
3782
  var DOT_SIZE = {
@@ -3817,29 +3852,35 @@ function RadioGroup({
3817
3852
  children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, { className: "flex h-full w-full items-center justify-center", children: /* @__PURE__ */ jsx("span", { className: "block h-1/2 w-1/2 rounded-full bg-accent" }) })
3818
3853
  }
3819
3854
  );
3820
- const labelEl = /* @__PURE__ */ jsxs(
3855
+ const labelClass = [
3856
+ "block select-none",
3857
+ opt.disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"
3858
+ ].join(" ");
3859
+ const labelTextEl = /* @__PURE__ */ jsx("label", { htmlFor: itemId, className: labelClass, children: /* @__PURE__ */ jsx("span", { className: `block ${TEXT_SIZE[size]} text-foreground`, children: opt.label }) });
3860
+ const descriptionEl = opt.description ? /* @__PURE__ */ jsx(
3821
3861
  "label",
3822
3862
  {
3823
3863
  htmlFor: itemId,
3824
- className: [
3825
- "select-none",
3826
- opt.disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer",
3827
- labelFirst ? "text-right" : ""
3828
- ].filter(Boolean).join(" "),
3829
- children: [
3830
- /* @__PURE__ */ jsx("span", { className: `block ${TEXT_SIZE[size]} text-foreground`, children: opt.label }),
3831
- opt.description && /* @__PURE__ */ jsx("span", { className: "block text-xs text-foreground-secondary mt-0.5", children: opt.description })
3832
- ]
3864
+ className: `block text-xs text-foreground-secondary mt-0.5 ${opt.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}`,
3865
+ children: opt.description
3833
3866
  }
3834
- );
3835
- const rowClass = labelFirst && layout === "vertical" ? "grid grid-cols-[1fr_auto] items-start gap-2.5" : "flex items-start gap-2.5";
3836
- return /* @__PURE__ */ jsx("div", { className: rowClass, children: labelFirst ? /* @__PURE__ */ jsxs(Fragment, { children: [
3837
- labelEl,
3838
- dot
3839
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
3867
+ ) : null;
3868
+ if (labelFirst) {
3869
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
3870
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2.5", children: [
3871
+ labelTextEl,
3872
+ dot
3873
+ ] }),
3874
+ descriptionEl
3875
+ ] }, opt.value);
3876
+ }
3877
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2.5", children: [
3840
3878
  dot,
3841
- labelEl
3842
- ] }) }, opt.value);
3879
+ /* @__PURE__ */ jsxs("span", { className: "flex flex-col", children: [
3880
+ labelTextEl,
3881
+ descriptionEl
3882
+ ] })
3883
+ ] }, opt.value);
3843
3884
  })
3844
3885
  }
3845
3886
  )
@@ -3887,6 +3928,7 @@ function Switch({
3887
3928
  layout,
3888
3929
  required,
3889
3930
  helperText,
3931
+ labelAlign: "center",
3890
3932
  children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2.5", children: [
3891
3933
  offLabel != null && /* @__PURE__ */ jsx("label", { htmlFor: id, className: stateLabel(!isOn), children: offLabel }),
3892
3934
  /* @__PURE__ */ jsx(
@@ -4176,19 +4218,17 @@ function TreeSelect({
4176
4218
  setOpen(false);
4177
4219
  }
4178
4220
  };
4179
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
4180
- /* @__PURE__ */ jsxs("div", { className: `flex ${layout === "vertical" ? "flex-col gap-1" : "flex-row items-center gap-2"}`, children: [
4181
- /* @__PURE__ */ jsx(
4182
- FieldLabel,
4183
- {
4184
- label,
4185
- htmlFor,
4186
- required,
4187
- helperText,
4188
- horizontal: layout === "horizontal"
4189
- }
4190
- ),
4191
- /* @__PURE__ */ jsxs(Popover.Root, { open: open && !disabled, onOpenChange: (o) => !disabled && setOpen(o), children: [
4221
+ return /* @__PURE__ */ jsx(
4222
+ Field,
4223
+ {
4224
+ label,
4225
+ htmlFor,
4226
+ errorId,
4227
+ errorMessage,
4228
+ layout,
4229
+ required,
4230
+ helperText,
4231
+ children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(Popover.Root, { open: open && !disabled, onOpenChange: (o) => !disabled && setOpen(o), children: [
4192
4232
  /* @__PURE__ */ jsx(Popover.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
4193
4233
  "button",
4194
4234
  {
@@ -4252,10 +4292,9 @@ function TreeSelect({
4252
4292
  )
4253
4293
  }
4254
4294
  ) })
4255
- ] })
4256
- ] }),
4257
- hasError && /* @__PURE__ */ jsx("div", { id: errorId, className: "text-xs text-status-error ml-1", children: errorMessage })
4258
- ] });
4295
+ ] }) })
4296
+ }
4297
+ );
4259
4298
  }
4260
4299
  function TreeNodeRow({
4261
4300
  node,