@ramme-io/ui 5.0.3 → 5.2.0

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,33 @@
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { useState as u, useMemo as c } from "react";
3
+ import { Select as f } from "./Select.js";
4
+ import { searchGoogleFonts as g } from "../../lib/theme/fontSearch.js";
5
+ const b = ({
6
+ value: e,
7
+ onChange: r,
8
+ label: n,
9
+ placeholder: l = "Search Google Fonts",
10
+ isClearable: a = !1,
11
+ className: m
12
+ }) => {
13
+ const [t, s] = u(""), i = c(
14
+ () => g(t).map((o) => ({ value: o.family, label: o.family })),
15
+ [t]
16
+ );
17
+ return /* @__PURE__ */ p(
18
+ f,
19
+ {
20
+ label: n,
21
+ value: e ? { value: e, label: e } : null,
22
+ options: i,
23
+ onChange: (o) => r(o ? String(o.value) : void 0),
24
+ onInputChange: s,
25
+ isClearable: a,
26
+ placeholder: l,
27
+ className: m
28
+ }
29
+ );
30
+ };
31
+ export {
32
+ b as FontSelect
33
+ };
@@ -1,9 +1,10 @@
1
- import { jsxs as I, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as C, jsx as e } from "react/jsx-runtime";
2
2
  import { useId as S } from "react";
3
3
  import k, { components as d } from "react-select";
4
4
  import { cn as p } from "../../utils/cn.js";
5
+ import { FIELD_FONT_SIZE as F } from "./fieldFontSize.js";
5
6
  import { Icon as i } from "../ui/Icon.js";
6
- const R = (a) => /* @__PURE__ */ e(d.DropdownIndicator, { ...a, children: /* @__PURE__ */ e(i, { name: "chevron-down", className: "h-4 w-4 text-muted-foreground" }) }), w = (a) => /* @__PURE__ */ e(d.MultiValueRemove, { ...a, children: /* @__PURE__ */ e(i, { name: "x", className: "h-3 w-3" }) }), P = ({
7
+ const R = (a) => /* @__PURE__ */ e(d.DropdownIndicator, { ...a, children: /* @__PURE__ */ e(i, { name: "chevron-down", className: "h-4 w-4 text-muted-foreground" }) }), w = (a) => /* @__PURE__ */ e(d.MultiValueRemove, { ...a, children: /* @__PURE__ */ e(i, { name: "x", className: "h-3 w-3" }) }), _ = ({
7
8
  options: a,
8
9
  value: u,
9
10
  onChange: m,
@@ -18,11 +19,13 @@ const R = (a) => /* @__PURE__ */ e(d.DropdownIndicator, { ...a, children: /* @__
18
19
  helperText: n
19
20
  }) => {
20
21
  const t = S(), h = (r, o) => {
21
- const C = r ? Array.from(r) : null;
22
- m(C);
22
+ const I = r ? Array.from(r) : null;
23
+ m(I);
23
24
  }, y = {
24
25
  control: (r, o) => ({
25
26
  ...r,
27
+ // The floor, for the text box inside: see fieldFontSize.ts.
28
+ fontSize: F,
26
29
  backgroundColor: "rgb(var(--app-card-bg-color))",
27
30
  borderColor: l ? "rgb(var(--app-danger-color))" : o.isFocused ? "rgb(var(--app-primary-color))" : "rgb(var(--app-border-color))",
28
31
  color: "rgb(var(--app-text-color))",
@@ -82,7 +85,7 @@ const R = (a) => /* @__PURE__ */ e(d.DropdownIndicator, { ...a, children: /* @__
82
85
  zIndex: 9999
83
86
  })
84
87
  };
85
- return /* @__PURE__ */ I("div", { className: p("w-full", f), children: [
88
+ return /* @__PURE__ */ C("div", { className: p("w-full", f), children: [
86
89
  c && /* @__PURE__ */ e("label", { htmlFor: t, className: "block text-sm font-medium text-foreground mb-1.5", children: c }),
87
90
  /* @__PURE__ */ e(
88
91
  k,
@@ -108,5 +111,5 @@ const R = (a) => /* @__PURE__ */ e(d.DropdownIndicator, { ...a, children: /* @__
108
111
  ] });
109
112
  };
110
113
  export {
111
- P as MultiSelect
114
+ _ as MultiSelect
112
115
  };
@@ -13,6 +13,8 @@ export interface SelectProps {
13
13
  isLoading?: boolean;
14
14
  isClearable?: boolean;
15
15
  isSearchable?: boolean;
16
+ /** Called with the search text as the person types. */
17
+ onInputChange?: (text: string) => void;
16
18
  className?: string;
17
19
  error?: boolean;
18
20
  helperText?: string;
@@ -33,6 +35,7 @@ export interface SelectProps {
33
35
  * @param {boolean} isLoading - If true, shows a loading spinner inside the control. Defaults to false.
34
36
  * @param {boolean} isClearable - If true, displays a clear button to reset the selection. Defaults to true.
35
37
  * @param {boolean} isSearchable - If true, allows the user to type to filter options. Defaults to true.
38
+ * @param {function} onInputChange - Called with the search text as the user types. Use it to narrow a very long list yourself and pass only the matches as options, so the menu never renders thousands of rows.
36
39
  * @param {boolean} error - If true, applies destructive border styling to indicate a validation error.
37
40
  * @param {string} helperText - Supporting text rendered below the control. Appears in destructive color when error is true.
38
41
  */
@@ -1,27 +1,31 @@
1
- import { jsxs as f, jsx as e } from "react/jsx-runtime";
2
- import { useId as h } from "react";
3
- import y, { components as I } from "react-select";
4
- import { cn as n } from "../../utils/cn.js";
5
- import { Icon as C } from "../ui/Icon.js";
6
- const S = (a) => /* @__PURE__ */ e(I.DropdownIndicator, { ...a, children: /* @__PURE__ */ e(C, { name: "chevron-down", className: "h-4 w-4 text-muted-foreground" }) }), R = ({
1
+ import { jsxs as h, jsx as e } from "react/jsx-runtime";
2
+ import { useId as y } from "react";
3
+ import I, { components as S } from "react-select";
4
+ import { cn as l } from "../../utils/cn.js";
5
+ import { FIELD_FONT_SIZE as C } from "./fieldFontSize.js";
6
+ import { Icon as F } from "../ui/Icon.js";
7
+ const w = (a) => /* @__PURE__ */ e(S.DropdownIndicator, { ...a, children: /* @__PURE__ */ e(F, { name: "chevron-down", className: "h-4 w-4 text-muted-foreground" }) }), j = ({
7
8
  options: a,
8
- value: l,
9
- onChange: i,
10
- label: p,
11
- placeholder: m = "Select...",
12
- isDisabled: s = !1,
13
- isLoading: u = !1,
14
- isClearable: b = !0,
15
- isSearchable: g = !0,
16
- className: v,
17
- error: t,
18
- helperText: d
9
+ value: i,
10
+ onChange: m,
11
+ label: t,
12
+ placeholder: s = "Select...",
13
+ isDisabled: u = !1,
14
+ isLoading: b = !1,
15
+ isClearable: g = !0,
16
+ isSearchable: v = !0,
17
+ onInputChange: p,
18
+ className: x,
19
+ error: d,
20
+ helperText: n
19
21
  }) => {
20
- const c = h(), x = {
22
+ const c = y(), f = {
21
23
  control: (r, o) => ({
22
24
  ...r,
25
+ // The floor, for the text box inside: see fieldFontSize.ts.
26
+ fontSize: C,
23
27
  backgroundColor: "rgb(var(--app-card-bg-color))",
24
- borderColor: t ? "rgb(var(--app-danger-color))" : o.isFocused ? "rgb(var(--app-primary-color))" : "rgb(var(--app-border-color))",
28
+ borderColor: d ? "rgb(var(--app-danger-color))" : o.isFocused ? "rgb(var(--app-primary-color))" : "rgb(var(--app-border-color))",
25
29
  color: "rgb(var(--app-text-color))",
26
30
  borderRadius: "var(--app-border-radius-md)",
27
31
  boxShadow: o.isFocused ? "0 0 0 1px rgb(var(--app-primary-color))" : "none",
@@ -64,30 +68,31 @@ const S = (a) => /* @__PURE__ */ e(I.DropdownIndicator, { ...a, children: /* @__
64
68
  zIndex: 9999
65
69
  })
66
70
  };
67
- return /* @__PURE__ */ f("div", { className: n("w-full", v), children: [
68
- p && /* @__PURE__ */ e("label", { htmlFor: c, className: "block text-sm font-medium text-foreground mb-1.5", children: p }),
71
+ return /* @__PURE__ */ h("div", { className: l("w-full", x), children: [
72
+ t && /* @__PURE__ */ e("label", { htmlFor: c, className: "block text-sm font-medium text-foreground mb-1.5", children: t }),
69
73
  /* @__PURE__ */ e(
70
- y,
74
+ I,
71
75
  {
72
76
  instanceId: c,
73
77
  inputId: c,
74
- styles: x,
75
- components: { DropdownIndicator: S },
78
+ styles: f,
79
+ components: { DropdownIndicator: w },
76
80
  options: a,
77
- value: l,
78
- onChange: (r) => i(r),
79
- isDisabled: s,
80
- isLoading: u,
81
- isClearable: b,
82
- isSearchable: g,
83
- placeholder: m,
81
+ value: i,
82
+ onChange: (r) => m(r),
83
+ isDisabled: u,
84
+ isLoading: b,
85
+ isClearable: g,
86
+ isSearchable: v,
87
+ onInputChange: p ? (r) => p(r) : void 0,
88
+ placeholder: s,
84
89
  menuPortalTarget: typeof document < "u" ? document.body : null,
85
90
  menuPosition: "fixed"
86
91
  }
87
92
  ),
88
- d && /* @__PURE__ */ e("p", { className: n("mt-1.5 text-xs", t ? "text-destructive" : "text-muted-foreground"), children: d })
93
+ n && /* @__PURE__ */ e("p", { className: l("mt-1.5 text-xs", d ? "text-destructive" : "text-muted-foreground"), children: n })
89
94
  ] });
90
95
  };
91
96
  export {
92
- R as Select
97
+ j as Select
93
98
  };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The form-field floor from index.css, for controls the stylesheet cannot reach.
3
+ *
4
+ * react-select gives its text box `font: inherit` from an emotion class, which
5
+ * out-ranks the `html input` floor, so the box takes whatever size surrounds
6
+ * it — 14.5px inside a `text-sm` panel, and iOS zooms (2026-11-04, the Theme
7
+ * page's font pickers). Setting this on the control is what the box inherits.
8
+ * formFieldFloor.test.tsx holds it equal to the stylesheet's value.
9
+ */
10
+ export declare const FIELD_FONT_SIZE = "max(16px, var(--app-step-0))";
@@ -0,0 +1,4 @@
1
+ const p = "max(16px, var(--app-step-0))";
2
+ export {
3
+ p as FIELD_FONT_SIZE
4
+ };
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { IconName } from '../ui/Icon';
3
+ import { type ThemeMode } from '../../contexts/ThemeContext';
3
4
  /**
4
5
  * @wizard
5
6
  * @name UserNav
@@ -12,6 +13,7 @@ import { IconName } from '../ui/Icon';
12
13
  * @param {function} onSettings - Called when the user chooses settings.
13
14
  * @param {function} onProfile - Called when the user chooses profile.
14
15
  * @param {boolean} showThemeToggle - Adds a theme switcher inside the menu.
16
+ * @param {ThemeMode[]} themeOptions - The themes the switcher offers, in order. Defaults to light, dark and system; an app with its own theme names it here (the terminal: markets, light, dark, system), or a viewer who taps another can never get back to it.
15
17
  * @param {ReactNode} trigger - Replaces the default avatar trigger.
16
18
  * @param {string} align - Menu alignment against the trigger: 'start', 'center', or 'end'.
17
19
  * @param {string} side - Which side the menu opens on: 'top', 'bottom', 'left', or 'right'.
@@ -32,6 +34,8 @@ export interface UserNavProps {
32
34
  onSettings?: () => void;
33
35
  onProfile?: () => void;
34
36
  showThemeToggle?: boolean;
37
+ /** The themes the switcher offers, in order. Defaults to light, dark, system. */
38
+ themeOptions?: ThemeMode[];
35
39
  children?: React.ReactNode;
36
40
  }
37
41
  /**
@@ -1,18 +1,18 @@
1
1
  import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
- import { useState as z, useRef as E, useEffect as I } from "react";
3
- import { Avatar as L } from "../ui/Avatar.js";
4
- import { Icon as O } from "../ui/Icon.js";
2
+ import { useState as O, useRef as I, useEffect as L } from "react";
3
+ import { Avatar as z } from "../ui/Avatar.js";
4
+ import { Icon as U } from "../ui/Icon.js";
5
5
  import { cn as o } from "../../utils/cn.js";
6
6
  import { useTheme as j } from "../../contexts/ThemeContext.js";
7
- const R = () => {
8
- const { theme: t, setTheme: l } = j();
9
- return /* @__PURE__ */ e("div", { className: "flex bg-muted/50 rounded-md p-0.5 gap-0.5", children: ["light", "dark", "system"].map((r) => /* @__PURE__ */ e(
7
+ const A = ["light", "dark", "system"], M = ({ options: t }) => {
8
+ const { theme: l, setTheme: a } = j();
9
+ return /* @__PURE__ */ e("div", { className: "flex bg-muted/50 rounded-md p-0.5 gap-0.5", children: t.map((r) => /* @__PURE__ */ e(
10
10
  "button",
11
11
  {
12
- onClick: () => l(r),
12
+ onClick: () => a(r),
13
13
  className: o(
14
14
  "flex-1 text-[10px] py-1 rounded-sm capitalize font-medium transition-colors",
15
- t === r ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground hover:bg-muted/80"
15
+ l === r ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground hover:bg-muted/80"
16
16
  ),
17
17
  children: r
18
18
  },
@@ -23,7 +23,7 @@ const R = () => {
23
23
  label: l,
24
24
  onClick: a,
25
25
  variant: r = "default",
26
- className: m
26
+ className: i
27
27
  }) => /* @__PURE__ */ n(
28
28
  "button",
29
29
  {
@@ -31,30 +31,31 @@ const R = () => {
31
31
  className: o(
32
32
  "relative flex w-full cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors",
33
33
  r === "destructive" ? "text-destructive hover:bg-destructive/10" : "text-foreground hover:bg-accent hover:text-accent-foreground",
34
- m
34
+ i
35
35
  ),
36
36
  children: [
37
- /* @__PURE__ */ e(O, { name: t, className: "mr-2 h-4 w-4" }),
37
+ /* @__PURE__ */ e(U, { name: t, className: "mr-2 h-4 w-4" }),
38
38
  /* @__PURE__ */ e("span", { children: l })
39
39
  ]
40
40
  }
41
- ), D = ({
41
+ ), H = ({
42
42
  user: t,
43
43
  trigger: l,
44
44
  align: a = "end",
45
45
  side: r = "bottom",
46
- className: m,
46
+ className: i,
47
47
  onLogout: h,
48
48
  onSettings: c,
49
49
  onProfile: u,
50
50
  showThemeToggle: k = !0,
51
+ themeOptions: y = A,
51
52
  children: g
52
53
  }) => {
53
54
  var N;
54
- const [d, s] = z(!1), f = E(null);
55
- I(() => {
56
- const w = (T) => {
57
- f.current && !f.current.contains(T.target) && s(!1);
55
+ const [d, s] = O(!1), f = I(null);
56
+ L(() => {
57
+ const w = (E) => {
58
+ f.current && !f.current.contains(E.target) && s(!1);
58
59
  };
59
60
  return d && document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w);
60
61
  }, [d]);
@@ -79,15 +80,15 @@ const R = () => {
79
80
  start: "left-auto right-full top-0 mr-2",
80
81
  center: "left-auto right-full top-1/2 -translate-y-1/2 mr-2"
81
82
  }
82
- }, y = ((N = x[r]) == null ? void 0 : N[a]) || x.bottom.end, i = !!(u || c), p = !!k, v = !!g, C = !!h;
83
- return /* @__PURE__ */ n("div", { className: o("relative", m), ref: f, children: [
83
+ }, C = ((N = x[r]) == null ? void 0 : N[a]) || x.bottom.end, m = !!(u || c), p = !!k, v = !!g, T = !!h;
84
+ return /* @__PURE__ */ n("div", { className: o("relative", i), ref: f, children: [
84
85
  /* @__PURE__ */ e(
85
86
  "button",
86
87
  {
87
88
  onClick: () => s(!d),
88
89
  className: "flex min-h-11 min-w-11 w-full items-center focus:outline-none",
89
90
  children: l || /* @__PURE__ */ e(
90
- L,
91
+ z,
91
92
  {
92
93
  name: t.name,
93
94
  src: t.avatarUrl,
@@ -106,14 +107,14 @@ const R = () => {
106
107
  "backdrop-blur-md",
107
108
  // Ensures content behind doesn't make text unreadable
108
109
  "animate-in fade-in zoom-in-95 duration-100 p-1",
109
- y
110
+ C
110
111
  ),
111
112
  children: [
112
113
  /* @__PURE__ */ n("div", { className: "flex flex-col space-y-1 p-2 border-b border-border/50 bg-muted/30", children: [
113
114
  /* @__PURE__ */ e("p", { className: "text-sm font-medium leading-none text-foreground", children: t.name }),
114
115
  /* @__PURE__ */ e("p", { className: "text-xs leading-none text-muted-foreground truncate", children: t.email })
115
116
  ] }),
116
- i && /* @__PURE__ */ n("div", { className: "p-1 space-y-0.5", children: [
117
+ m && /* @__PURE__ */ n("div", { className: "p-1 space-y-0.5", children: [
117
118
  u && /* @__PURE__ */ e(b, { icon: "user", label: "Profile", onClick: () => {
118
119
  u(), s(!1);
119
120
  } }),
@@ -121,12 +122,12 @@ const R = () => {
121
122
  c(), s(!1);
122
123
  } })
123
124
  ] }),
124
- p && /* @__PURE__ */ n("div", { className: o("p-2", i && "border-t border-border/50"), children: [
125
+ p && /* @__PURE__ */ n("div", { className: o("p-2", m && "border-t border-border/50"), children: [
125
126
  /* @__PURE__ */ e("p", { className: "text-[10px] font-bold uppercase tracking-widest text-muted-foreground mb-1", children: "Theme" }),
126
- /* @__PURE__ */ e(R, {})
127
+ /* @__PURE__ */ e(M, { options: y })
127
128
  ] }),
128
- v && /* @__PURE__ */ e("div", { className: o("p-1 space-y-0.5", (i || p) && "border-t border-border/50"), children: g }),
129
- C && /* @__PURE__ */ e("div", { className: o("p-1", (i || p || v) && "border-t border-border/50"), children: /* @__PURE__ */ e(
129
+ v && /* @__PURE__ */ e("div", { className: o("p-1 space-y-0.5", (m || p) && "border-t border-border/50"), children: g }),
130
+ T && /* @__PURE__ */ e("div", { className: o("p-1", (m || p || v) && "border-t border-border/50"), children: /* @__PURE__ */ e(
130
131
  b,
131
132
  {
132
133
  icon: "log-out",
@@ -144,5 +145,5 @@ const R = () => {
144
145
  };
145
146
  export {
146
147
  b as ButtonItem,
147
- D as UserNav
148
+ H as UserNav
148
149
  };
@@ -1,78 +1,42 @@
1
- import { jsxs as r, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
2
  /* empty css */
3
- import { Label as a } from "../forms/Label.js";
4
- import { Card as g } from "../layout/Card.js";
3
+ import { Label as o } from "../forms/Label.js";
4
+ import { FontSelect as i } from "../forms/FontSelect.js";
5
+ import { Card as f } from "../layout/Card.js";
5
6
  import { Button as v } from "../ui/Button.js";
6
- import { Icon as l } from "../ui/Icon.js";
7
+ import { Icon as a } from "../ui/Icon.js";
7
8
  const S = ({
8
- headingFont: i,
9
- setHeadingFont: c,
10
- bodyFont: t,
11
- setBodyFont: s,
9
+ headingFont: m,
10
+ setHeadingFont: t,
11
+ bodyFont: s,
12
+ setBodyFont: c,
12
13
  borderRadius: d,
13
14
  setBorderRadius: u,
14
- baseFontSize: m,
15
- setBaseFontSize: p,
15
+ baseFontSize: p,
16
+ setBaseFontSize: g,
16
17
  vertical: h = !1,
17
- onApplyToApp: o
18
- }) => /* @__PURE__ */ r(g, { className: "p-6", children: [
19
- /* @__PURE__ */ r("div", { className: "flex items-center justify-between mb-4", children: [
20
- /* @__PURE__ */ r("h2", { className: "text-lg font-bold flex items-center gap-2", children: [
21
- /* @__PURE__ */ e(l, { name: "sliders", className: "text-primary" }),
18
+ onApplyToApp: l
19
+ }) => /* @__PURE__ */ n(f, { className: "p-6", children: [
20
+ /* @__PURE__ */ n("div", { className: "flex items-center justify-between mb-4", children: [
21
+ /* @__PURE__ */ n("h2", { className: "text-lg font-bold flex items-center gap-2", children: [
22
+ /* @__PURE__ */ e(a, { name: "sliders", className: "text-primary" }),
22
23
  "Fine-Tuning Controls"
23
24
  ] }),
24
- o && /* @__PURE__ */ r(v, { size: "sm", onClick: o, children: [
25
- /* @__PURE__ */ e(l, { name: "check", className: "h-3.5 w-3.5 mr-1.5" }),
25
+ l && /* @__PURE__ */ n(v, { size: "sm", onClick: l, children: [
26
+ /* @__PURE__ */ e(a, { name: "check", className: "h-3.5 w-3.5 mr-1.5" }),
26
27
  "Apply to App"
27
28
  ] })
28
29
  ] }),
29
- /* @__PURE__ */ r("div", { className: `grid gap-4 ${h ? "grid-cols-1" : "grid-cols-1 @sm:grid-cols-2 @md:grid-cols-4"}`, children: [
30
- /* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
31
- /* @__PURE__ */ e(a, { className: "text-xs opacity-70", children: "Heading Font" }),
32
- /* @__PURE__ */ r(
33
- "select",
34
- {
35
- value: i,
36
- onChange: (n) => c(n.target.value),
37
- className: "w-full border border-input bg-background rounded-md px-3 py-2 focus:ring-2 focus:ring-primary focus:outline-none",
38
- children: [
39
- /* @__PURE__ */ e("option", { value: "Inter", children: "Inter" }),
40
- /* @__PURE__ */ e("option", { value: "Orbitron", children: "Orbitron" }),
41
- /* @__PURE__ */ e("option", { value: "Sora", children: "Sora" }),
42
- /* @__PURE__ */ e("option", { value: "Fraunces", children: "Fraunces" }),
43
- /* @__PURE__ */ e("option", { value: "Plus Jakarta Sans", children: "Plus Jakarta Sans" }),
44
- /* @__PURE__ */ e("option", { value: "Manrope", children: "Manrope" }),
45
- /* @__PURE__ */ e("option", { value: "Playfair Display", children: "Playfair Display" }),
46
- /* @__PURE__ */ e("option", { value: "Space Grotesk", children: "Space Grotesk" })
47
- ]
48
- }
49
- )
50
- ] }),
51
- /* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
52
- /* @__PURE__ */ e(a, { className: "text-xs opacity-70", children: "Body Font" }),
53
- /* @__PURE__ */ r(
54
- "select",
55
- {
56
- value: t,
57
- onChange: (n) => s(n.target.value),
58
- className: "w-full border border-input bg-background rounded-md px-3 py-2 focus:ring-2 focus:ring-primary focus:outline-none",
59
- children: [
60
- /* @__PURE__ */ e("option", { value: "Inter", children: "Inter" }),
61
- /* @__PURE__ */ e("option", { value: "Rajdhani", children: "Rajdhani" }),
62
- /* @__PURE__ */ e("option", { value: "Outfit", children: "Outfit" }),
63
- /* @__PURE__ */ e("option", { value: "Manrope", children: "Manrope" }),
64
- /* @__PURE__ */ e("option", { value: "Lora", children: "Lora" })
65
- ]
66
- }
67
- )
68
- ] }),
69
- /* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
70
- /* @__PURE__ */ e(a, { className: "text-xs opacity-70", children: "Border Radius" }),
71
- /* @__PURE__ */ r(
30
+ /* @__PURE__ */ n("div", { className: `grid gap-4 ${h ? "grid-cols-1" : "grid-cols-1 @sm:grid-cols-2 @md:grid-cols-4"}`, children: [
31
+ /* @__PURE__ */ e(i, { label: "Heading Font", value: m, onChange: (r) => r && t(r) }),
32
+ /* @__PURE__ */ e(i, { label: "Body Font", value: s, onChange: (r) => r && c(r) }),
33
+ /* @__PURE__ */ n("div", { className: "space-y-1.5", children: [
34
+ /* @__PURE__ */ e(o, { className: "text-sm font-medium text-foreground", children: "Border Radius" }),
35
+ /* @__PURE__ */ n(
72
36
  "select",
73
37
  {
74
38
  value: d,
75
- onChange: (n) => u(n.target.value),
39
+ onChange: (r) => u(r.target.value),
76
40
  className: "w-full border border-input bg-background rounded-md px-3 py-2 focus:ring-2 focus:ring-primary focus:outline-none",
77
41
  children: [
78
42
  /* @__PURE__ */ e("option", { value: "0rem", children: "0rem (Sharp)" }),
@@ -85,13 +49,13 @@ const S = ({
85
49
  }
86
50
  )
87
51
  ] }),
88
- /* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
89
- /* @__PURE__ */ e(a, { className: "text-xs opacity-70", children: "Base Font Size" }),
90
- /* @__PURE__ */ r(
52
+ /* @__PURE__ */ n("div", { className: "space-y-1.5", children: [
53
+ /* @__PURE__ */ e(o, { className: "text-sm font-medium text-foreground", children: "Base Font Size" }),
54
+ /* @__PURE__ */ n(
91
55
  "select",
92
56
  {
93
- value: m,
94
- onChange: (n) => p(n.target.value),
57
+ value: p,
58
+ onChange: (r) => g(r.target.value),
95
59
  className: "w-full border border-input bg-background rounded-md px-3 py-2 focus:ring-2 focus:ring-primary focus:outline-none",
96
60
  children: [
97
61
  /* @__PURE__ */ e("option", { value: "0.875rem", children: "0.875rem (Small)" }),
@@ -1,18 +1,18 @@
1
1
  import React from 'react';
2
2
  import { type VariantProps } from 'class-variance-authority';
3
3
  declare const badgeVariants: (props?: ({
4
- variant?: "primary" | "secondary" | "danger" | "success" | "warning" | "outline" | null | undefined;
4
+ variant?: "primary" | "secondary" | "danger" | "success" | "warning" | "outline" | "gain" | "loss" | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
7
7
  }
8
8
  /**
9
9
  * @wizard
10
10
  * @name Badge
11
- * @description A small component to display a status, count, or label.
12
- * @tags ui, label, indicator
11
+ * @description A small component to display a status, count, or label. The `gain` and `loss` variants are price chips, as on a watchlist: a move up or down, in the theme's direction colours rather than success or danger, because a fall is not an error.
12
+ * @tags ui, label, indicator, price, gain, loss
13
13
  * @props
14
14
  * - name: variant
15
- * type: "'primary' | 'secondary' | 'danger' | 'success' | 'warning' | 'outline'"
15
+ * type: "'primary' | 'secondary' | 'danger' | 'success' | 'warning' | 'outline' | 'gain' | 'loss'"
16
16
  * description: The visual style of the badge.
17
17
  * - name: children
18
18
  * type: React.ReactNode
@@ -1,5 +1,5 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as a } from "react";
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { forwardRef as t } from "react";
3
3
  import { cva as s } from "class-variance-authority";
4
4
  import { cn as d } from "../../utils/cn.js";
5
5
  const i = s(
@@ -14,15 +14,18 @@ const i = s(
14
14
  // ✅ Fixed: Use semantic success token
15
15
  warning: "border-transparent bg-warning text-warning-foreground shadow hover:bg-warning/80",
16
16
  // ✅ Added: Missing variant
17
- outline: "text-foreground"
17
+ outline: "text-foreground",
18
+ // A price's direction, not a status: a fall is not an error.
19
+ gain: "border-transparent bg-gain text-gain-foreground tabular-nums shadow hover:bg-gain/80",
20
+ loss: "border-transparent bg-loss text-loss-foreground tabular-nums shadow hover:bg-loss/80"
18
21
  }
19
22
  },
20
23
  defaultVariants: {
21
24
  variant: "primary"
22
25
  }
23
26
  }
24
- ), g = a(
25
- ({ className: r, variant: e, ...o }, n) => /* @__PURE__ */ t(
27
+ ), g = t(
28
+ ({ className: r, variant: e, ...o }, n) => /* @__PURE__ */ a(
26
29
  "div",
27
30
  {
28
31
  ref: n,