@meetreeve/ui 0.33.0 → 0.36.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.
package/README.md CHANGED
@@ -108,6 +108,31 @@ A folded group's row opens a horizontal flyout on hover (desktop) or click (keyb
108
108
 
109
109
  A ladder group can carry its own page (`href`, DEV-19583; an app path starting with one `/`, zod-checked). The row then splits in two: the label is a link through `linkComponent` (click or Enter navigates, hover still opens the panel) and a chevron button beside it is the disclosure (Enter/Space/click, focus to the first child, Esc back to the chevron). The group is also active on its own href. On the collapsed icon rail the row stays one button and the panel's first row links to the group's page. Without `href` the row is the single button it always was.
110
110
 
111
+ ## Settings list: SettingsSection / SettingsRow (DEV-19017)
112
+
113
+ Server-safe, on `@meetreeve/ui/console`, built on the console `Panel`:
114
+
115
+ ```tsx
116
+ import { SettingsSection, SettingsRow, SettingsStatus } from "@meetreeve/ui/console";
117
+ import { InfoTip, RowActions } from "@meetreeve/ui";
118
+
119
+ <SettingsSection title="Ad accounts" info={<InfoTip label="About ad accounts">Shared with everyone who can use Company data.</InfoTip>}>
120
+ <SettingsRow
121
+ logo={<img src="/integrations/meta.svg" alt="" />}
122
+ name="Meta Ads"
123
+ info={<InfoTip label="Meta Ads details">Account act_123 · checked 10:02</InfoTip>}
124
+ status={<SettingsStatus tone="ok" label="Connected" />}
125
+ action={<RowActions items={[{ id: "disconnect", label: "Disconnect", destructive: true, onSelect: disconnect }]} />}
126
+ />
127
+ </SettingsSection>
128
+ ```
129
+
130
+ - One fact per row, one action (a quiet ⋯ may sit beside it). IDs, timestamps
131
+ and how-it-works go in the `info` InfoTip; errors, broken-connection alerts
132
+ and forms go in `children`, under the row, never in a hover.
133
+ - The section grid and the status word are container queries, so the host's
134
+ Tailwind must scan this package's dist (see ResponsiveHeader below).
135
+
111
136
  ## ResponsiveHeader
112
137
 
113
138
  ```tsx
@@ -22,13 +22,61 @@ declare function PageHeader({ eyebrow, title, description, action, }: {
22
22
  description?: string;
23
23
  action?: ReactNode;
24
24
  }): react.JSX.Element;
25
- /** Hairline surface (no heavy card/shadow). Optional titled header row. */
26
- declare function Panel({ title, hint, children, className, }: {
25
+ /** Hairline surface (no heavy card/shadow). Optional titled header row.
26
+ * `bodyClassName` merges over the body's `p-5` (SettingsSection passes
27
+ * `p-0 divide-y` so its rows run edge to edge). */
28
+ declare function Panel({ title, hint, children, className, bodyClassName, }: {
27
29
  title?: string;
28
30
  hint?: string;
29
31
  children: ReactNode;
30
32
  className?: string;
33
+ bodyClassName?: string;
31
34
  }): react.JSX.Element;
35
+ /**
36
+ * Shopify-Settings section (DEV-19017): title and at most one short line on
37
+ * the left, one Panel of divide-y rows on the right. The 240px | rest grid is
38
+ * a container query, so the section stacks wherever it is narrow (a phone, or
39
+ * one column of a card grid), not only on a narrow viewport.
40
+ */
41
+ declare function SettingsSection({ title, description, info, children, className, id, }: {
42
+ title: string;
43
+ /** At most one short line. Caveats and how-it-works belong in `info`. */
44
+ description?: string;
45
+ /** An InfoTip (or any trigger) shown beside the title. A slot, not a
46
+ * built-in, so this entry stays server-safe. */
47
+ info?: ReactNode;
48
+ children: ReactNode;
49
+ className?: string;
50
+ id?: string;
51
+ }): react.JSX.Element;
52
+ type SettingsStatusTone = "ok" | "off" | "warn";
53
+ /**
54
+ * A row's status: an icon (check / X / alert) plus a word, never a pill. The
55
+ * word hides visually below a 24rem row (it stays the icon's accessible name),
56
+ * so a narrow row keeps its icon and its button on one line. role="status"
57
+ * makes a change (Not connected -> Connected) announce politely.
58
+ */
59
+ declare function SettingsStatus({ tone, label }: {
60
+ tone: SettingsStatusTone;
61
+ label: string;
62
+ }): react.JSX.Element;
63
+ /**
64
+ * One settings row (DEV-19017): min-h-14 px-4 py-3 gap-3, a 24px logo, the
65
+ * name (one line, truncated) with an optional InfoTip, a status and one
66
+ * action. `children` render under the row, aligned with the name: errors,
67
+ * broken-connection alerts and inline forms, which never move into a hover.
68
+ */
69
+ declare function SettingsRow({ logo, name, info, status, action, children, className, ...rest }: {
70
+ /** 24px: an <img>, a BrandGlyph, an icon. */
71
+ logo?: ReactNode;
72
+ name: ReactNode;
73
+ info?: ReactNode;
74
+ status?: ReactNode;
75
+ /** One button; a quiet RowActions ⋯ may sit beside it. */
76
+ action?: ReactNode;
77
+ children?: ReactNode;
78
+ className?: string;
79
+ } & Omit<ComponentProps<"div">, "children" | "className">): react.JSX.Element;
32
80
  declare function EmptyState({ icon: Icon, title, description, action, }: {
33
81
  icon?: LucideIcon;
34
82
  title: string;
@@ -62,4 +110,4 @@ declare function CodeBlock({ data }: {
62
110
  data: unknown;
63
111
  }): react.JSX.Element | null;
64
112
 
65
- export { Button, CodeBlock, EmptyState, ErrorNote, Field, MonoEyebrow, PageHeader, Panel, StatusNote, TextArea, TextInput, buttonVariants };
113
+ export { Button, CodeBlock, EmptyState, ErrorNote, Field, MonoEyebrow, PageHeader, Panel, SettingsRow, SettingsSection, SettingsStatus, type SettingsStatusTone, StatusNote, TextArea, TextInput, buttonVariants };
@@ -22,13 +22,61 @@ declare function PageHeader({ eyebrow, title, description, action, }: {
22
22
  description?: string;
23
23
  action?: ReactNode;
24
24
  }): react.JSX.Element;
25
- /** Hairline surface (no heavy card/shadow). Optional titled header row. */
26
- declare function Panel({ title, hint, children, className, }: {
25
+ /** Hairline surface (no heavy card/shadow). Optional titled header row.
26
+ * `bodyClassName` merges over the body's `p-5` (SettingsSection passes
27
+ * `p-0 divide-y` so its rows run edge to edge). */
28
+ declare function Panel({ title, hint, children, className, bodyClassName, }: {
27
29
  title?: string;
28
30
  hint?: string;
29
31
  children: ReactNode;
30
32
  className?: string;
33
+ bodyClassName?: string;
31
34
  }): react.JSX.Element;
35
+ /**
36
+ * Shopify-Settings section (DEV-19017): title and at most one short line on
37
+ * the left, one Panel of divide-y rows on the right. The 240px | rest grid is
38
+ * a container query, so the section stacks wherever it is narrow (a phone, or
39
+ * one column of a card grid), not only on a narrow viewport.
40
+ */
41
+ declare function SettingsSection({ title, description, info, children, className, id, }: {
42
+ title: string;
43
+ /** At most one short line. Caveats and how-it-works belong in `info`. */
44
+ description?: string;
45
+ /** An InfoTip (or any trigger) shown beside the title. A slot, not a
46
+ * built-in, so this entry stays server-safe. */
47
+ info?: ReactNode;
48
+ children: ReactNode;
49
+ className?: string;
50
+ id?: string;
51
+ }): react.JSX.Element;
52
+ type SettingsStatusTone = "ok" | "off" | "warn";
53
+ /**
54
+ * A row's status: an icon (check / X / alert) plus a word, never a pill. The
55
+ * word hides visually below a 24rem row (it stays the icon's accessible name),
56
+ * so a narrow row keeps its icon and its button on one line. role="status"
57
+ * makes a change (Not connected -> Connected) announce politely.
58
+ */
59
+ declare function SettingsStatus({ tone, label }: {
60
+ tone: SettingsStatusTone;
61
+ label: string;
62
+ }): react.JSX.Element;
63
+ /**
64
+ * One settings row (DEV-19017): min-h-14 px-4 py-3 gap-3, a 24px logo, the
65
+ * name (one line, truncated) with an optional InfoTip, a status and one
66
+ * action. `children` render under the row, aligned with the name: errors,
67
+ * broken-connection alerts and inline forms, which never move into a hover.
68
+ */
69
+ declare function SettingsRow({ logo, name, info, status, action, children, className, ...rest }: {
70
+ /** 24px: an <img>, a BrandGlyph, an icon. */
71
+ logo?: ReactNode;
72
+ name: ReactNode;
73
+ info?: ReactNode;
74
+ status?: ReactNode;
75
+ /** One button; a quiet RowActions ⋯ may sit beside it. */
76
+ action?: ReactNode;
77
+ children?: ReactNode;
78
+ className?: string;
79
+ } & Omit<ComponentProps<"div">, "children" | "className">): react.JSX.Element;
32
80
  declare function EmptyState({ icon: Icon, title, description, action, }: {
33
81
  icon?: LucideIcon;
34
82
  title: string;
@@ -62,4 +110,4 @@ declare function CodeBlock({ data }: {
62
110
  data: unknown;
63
111
  }): react.JSX.Element | null;
64
112
 
65
- export { Button, CodeBlock, EmptyState, ErrorNote, Field, MonoEyebrow, PageHeader, Panel, StatusNote, TextArea, TextInput, buttonVariants };
113
+ export { Button, CodeBlock, EmptyState, ErrorNote, Field, MonoEyebrow, PageHeader, Panel, SettingsRow, SettingsSection, SettingsStatus, type SettingsStatusTone, StatusNote, TextArea, TextInput, buttonVariants };
@@ -28,12 +28,16 @@ __export(console_exports, {
28
28
  MonoEyebrow: () => MonoEyebrow,
29
29
  PageHeader: () => PageHeader,
30
30
  Panel: () => Panel,
31
+ SettingsRow: () => SettingsRow,
32
+ SettingsSection: () => SettingsSection,
33
+ SettingsStatus: () => SettingsStatus,
31
34
  StatusNote: () => StatusNote,
32
35
  TextArea: () => TextArea,
33
36
  TextInput: () => TextInput,
34
37
  buttonVariants: () => buttonVariants
35
38
  });
36
39
  module.exports = __toCommonJS(console_exports);
40
+ var import_lucide_react = require("lucide-react");
37
41
 
38
42
  // node_modules/clsx/dist/clsx.mjs
39
43
  function r(e) {
@@ -3434,14 +3438,69 @@ function Panel({
3434
3438
  title,
3435
3439
  hint,
3436
3440
  children,
3437
- className
3441
+ className,
3442
+ bodyClassName
3438
3443
  }) {
3439
3444
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("section", { className: cn("rounded-xl border border-border bg-card/40", className), children: [
3440
3445
  title ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex items-center justify-between gap-4 border-b border-border px-5 py-3.5", children: [
3441
3446
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h2", { className: "text-sm font-medium tracking-tight", children: title }),
3442
3447
  hint ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(MonoEyebrow, { children: hint }) : null
3443
3448
  ] }) : null,
3444
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "p-5", children })
3449
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: cn("p-5", bodyClassName), children })
3450
+ ] });
3451
+ }
3452
+ function SettingsSection({
3453
+ title,
3454
+ description,
3455
+ info,
3456
+ children,
3457
+ className,
3458
+ id
3459
+ }) {
3460
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("section", { id, className: cn("@container border-t border-border py-6", className), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "grid gap-4 @3xl:grid-cols-[240px_minmax(0,1fr)] @3xl:gap-6", children: [
3461
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "min-w-0 space-y-1", children: [
3462
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("h2", { className: "flex items-center gap-1 text-sm font-medium tracking-tight", children: [
3463
+ title,
3464
+ info
3465
+ ] }),
3466
+ description ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "text-xs text-muted-foreground", children: description }) : null
3467
+ ] }),
3468
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Panel, { className: "min-w-0", bodyClassName: "divide-y divide-border p-0", children })
3469
+ ] }) });
3470
+ }
3471
+ var STATUS_TONE = {
3472
+ ok: { Icon: import_lucide_react.CircleCheck, className: "text-success" },
3473
+ off: { Icon: import_lucide_react.CircleX, className: "text-destructive" },
3474
+ warn: { Icon: import_lucide_react.CircleAlert, className: "text-warning" }
3475
+ };
3476
+ function SettingsStatus({ tone, label }) {
3477
+ const { Icon, className } = STATUS_TONE[tone];
3478
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { "data-slot": "settings-status", "data-tone": tone, role: "status", className: cn("inline-flex items-center gap-1 text-xs", className), children: [
3479
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Icon, { "aria-hidden": "true", className: "size-4 shrink-0" }),
3480
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "sr-only text-muted-foreground @sm:not-sr-only", children: label })
3481
+ ] });
3482
+ }
3483
+ function SettingsRow({
3484
+ logo,
3485
+ name,
3486
+ info,
3487
+ status,
3488
+ action,
3489
+ children,
3490
+ className,
3491
+ ...rest
3492
+ }) {
3493
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { ...rest, className: cn("@container flex min-h-14 flex-col justify-center gap-2 px-4 py-3", className), children: [
3494
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex min-w-0 items-center gap-3", children: [
3495
+ logo ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { "aria-hidden": "true", className: "flex size-6 shrink-0 items-center justify-center overflow-hidden [&>img]:size-6 [&>img]:object-contain", children: logo }) : null,
3496
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-1", children: [
3497
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "truncate text-sm font-medium", children: name }),
3498
+ info
3499
+ ] }),
3500
+ status ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "shrink-0", children: status }) : null,
3501
+ action ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "flex shrink-0 items-center gap-1", children: action }) : null
3502
+ ] }),
3503
+ children ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: cn("min-w-0 space-y-2 text-xs empty:hidden", logo ? "pl-9" : null), children }) : null
3445
3504
  ] });
3446
3505
  }
3447
3506
  function EmptyState({
@@ -3521,6 +3580,9 @@ function CodeBlock({ data }) {
3521
3580
  MonoEyebrow,
3522
3581
  PageHeader,
3523
3582
  Panel,
3583
+ SettingsRow,
3584
+ SettingsSection,
3585
+ SettingsStatus,
3524
3586
  StatusNote,
3525
3587
  TextArea,
3526
3588
  TextInput,
@@ -1,3 +1,6 @@
1
+ // src/console/index.tsx
2
+ import { CircleAlert, CircleCheck, CircleX } from "lucide-react";
3
+
1
4
  // node_modules/clsx/dist/clsx.mjs
2
5
  function r(e) {
3
6
  var t, f, n = "";
@@ -3397,14 +3400,69 @@ function Panel({
3397
3400
  title,
3398
3401
  hint,
3399
3402
  children,
3400
- className
3403
+ className,
3404
+ bodyClassName
3401
3405
  }) {
3402
3406
  return /* @__PURE__ */ jsxs("section", { className: cn("rounded-xl border border-border bg-card/40", className), children: [
3403
3407
  title ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4 border-b border-border px-5 py-3.5", children: [
3404
3408
  /* @__PURE__ */ jsx2("h2", { className: "text-sm font-medium tracking-tight", children: title }),
3405
3409
  hint ? /* @__PURE__ */ jsx2(MonoEyebrow, { children: hint }) : null
3406
3410
  ] }) : null,
3407
- /* @__PURE__ */ jsx2("div", { className: "p-5", children })
3411
+ /* @__PURE__ */ jsx2("div", { className: cn("p-5", bodyClassName), children })
3412
+ ] });
3413
+ }
3414
+ function SettingsSection({
3415
+ title,
3416
+ description,
3417
+ info,
3418
+ children,
3419
+ className,
3420
+ id
3421
+ }) {
3422
+ return /* @__PURE__ */ jsx2("section", { id, className: cn("@container border-t border-border py-6", className), children: /* @__PURE__ */ jsxs("div", { className: "grid gap-4 @3xl:grid-cols-[240px_minmax(0,1fr)] @3xl:gap-6", children: [
3423
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 space-y-1", children: [
3424
+ /* @__PURE__ */ jsxs("h2", { className: "flex items-center gap-1 text-sm font-medium tracking-tight", children: [
3425
+ title,
3426
+ info
3427
+ ] }),
3428
+ description ? /* @__PURE__ */ jsx2("p", { className: "text-xs text-muted-foreground", children: description }) : null
3429
+ ] }),
3430
+ /* @__PURE__ */ jsx2(Panel, { className: "min-w-0", bodyClassName: "divide-y divide-border p-0", children })
3431
+ ] }) });
3432
+ }
3433
+ var STATUS_TONE = {
3434
+ ok: { Icon: CircleCheck, className: "text-success" },
3435
+ off: { Icon: CircleX, className: "text-destructive" },
3436
+ warn: { Icon: CircleAlert, className: "text-warning" }
3437
+ };
3438
+ function SettingsStatus({ tone, label }) {
3439
+ const { Icon, className } = STATUS_TONE[tone];
3440
+ return /* @__PURE__ */ jsxs("span", { "data-slot": "settings-status", "data-tone": tone, role: "status", className: cn("inline-flex items-center gap-1 text-xs", className), children: [
3441
+ /* @__PURE__ */ jsx2(Icon, { "aria-hidden": "true", className: "size-4 shrink-0" }),
3442
+ /* @__PURE__ */ jsx2("span", { className: "sr-only text-muted-foreground @sm:not-sr-only", children: label })
3443
+ ] });
3444
+ }
3445
+ function SettingsRow({
3446
+ logo,
3447
+ name,
3448
+ info,
3449
+ status,
3450
+ action,
3451
+ children,
3452
+ className,
3453
+ ...rest
3454
+ }) {
3455
+ return /* @__PURE__ */ jsxs("div", { ...rest, className: cn("@container flex min-h-14 flex-col justify-center gap-2 px-4 py-3", className), children: [
3456
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-3", children: [
3457
+ logo ? /* @__PURE__ */ jsx2("span", { "aria-hidden": "true", className: "flex size-6 shrink-0 items-center justify-center overflow-hidden [&>img]:size-6 [&>img]:object-contain", children: logo }) : null,
3458
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-1", children: [
3459
+ /* @__PURE__ */ jsx2("span", { className: "truncate text-sm font-medium", children: name }),
3460
+ info
3461
+ ] }),
3462
+ status ? /* @__PURE__ */ jsx2("span", { className: "shrink-0", children: status }) : null,
3463
+ action ? /* @__PURE__ */ jsx2("div", { className: "flex shrink-0 items-center gap-1", children: action }) : null
3464
+ ] }),
3465
+ children ? /* @__PURE__ */ jsx2("div", { className: cn("min-w-0 space-y-2 text-xs empty:hidden", logo ? "pl-9" : null), children }) : null
3408
3466
  ] });
3409
3467
  }
3410
3468
  function EmptyState({
@@ -3483,6 +3541,9 @@ export {
3483
3541
  MonoEyebrow,
3484
3542
  PageHeader,
3485
3543
  Panel,
3544
+ SettingsRow,
3545
+ SettingsSection,
3546
+ SettingsStatus,
3486
3547
  StatusNote,
3487
3548
  TextArea,
3488
3549
  TextInput,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meetreeve/ui",
3
- "version": "0.33.0",
3
+ "version": "0.36.0",
4
4
  "description": "Shared brand-adaptive UI primitives for MindFortress frontends — min-size tokens, a favicon→logo→monogram BrandGlyph, a responsive header that keeps the search bar usable on mobile, AppSidebar's viewport-driven auto-collapse ladder, the StageRail flow-of-cards primitives, the tenant SiteFooter, the LockedValue/LockedBlock/UnlockCta paywall primitives, the @meetreeve/ui/charts dashboard kit (token-driven charts, KpiCard, ChartCard, DashboardGrid), and @meetreeve/ui/theme (brandTheme: one brand's inputs to contrast-checked light and dark semantic tokens, with the Reeve preset).",
5
5
  "license": "UNLICENSED",
6
6
  "main": "./dist/index.js",