@meetreeve/ui 0.20.0 → 0.21.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
@@ -257,6 +257,40 @@ import { StageRail, StageCardShell, StageConnector, StageRailMini } from "@meetr
257
257
  back into `zoom`. It can only zoom out; to fit a rail that already fits, jump
258
258
  to 1, re-measure, and correct down.
259
259
 
260
+ ## LockedValue / LockedBlock / UnlockCta (DEV-17025)
261
+
262
+ The "numbers blurred behind a lock, unlock with a free account" paywall
263
+ pattern, for any tenant that shows data it gates.
264
+
265
+ ```tsx
266
+ import { LockedBlock, LockedValue, UnlockCta } from "@meetreeve/ui";
267
+
268
+ <LockedBlock label="Mortgages" cta={<UnlockCta href="/auth/login?screen_hint=signup" />}>
269
+ <div className="flex justify-between py-2">
270
+ <span>Balance</span>
271
+ <LockedValue mask="$#,###,###" seed={`${bbl}:mortgage:0`} label="Mortgage balance" hideIcon />
272
+ </div>
273
+ </LockedBlock>
274
+ ```
275
+
276
+ **Never blur a real value.** `LockedValue` takes a `mask` (`#` = a digit, every
277
+ other character kept) and a `seed`, and it renders `placeholder(mask, seed)`: a
278
+ deterministic fake of the same shape, identical on the server and the client.
279
+ CSS blur over a real number still ships the number in the HTML and the RSC
280
+ payload, so gated data must not reach these components. Build `LockedBlock`'s
281
+ children from labels and `LockedValue`s only.
282
+
283
+ - The blur and `user-select: none` are inline styles, so they hold without
284
+ this package in your Tailwind `@source`. The scrim, CTA and layout classes
285
+ still need the `@source` line (see ResponsiveHeader).
286
+ - Screen readers hear "{label} — locked". The fake digits are `aria-hidden`,
287
+ and the blurred layer is `inert`.
288
+ - `UnlockCta` defaults to "Unlock with a free account" / "No credit card
289
+ required". `compact` renders a one-line chip, for later sections that point
290
+ back to the main CTA. Pass `onClick` for your funnel event and
291
+ `linkComponent` for router links. Both are functions, so from a Server
292
+ Component render `UnlockCta` from a client file.
293
+
260
294
  ## Tokens
261
295
 
262
296
  ```ts
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { ReactNode, ElementType, RefObject } from 'react';
2
+ import { ReactNode, ElementType, RefObject, CSSProperties, MouseEventHandler } from 'react';
3
3
  import { z } from 'zod';
4
4
 
5
5
  /**
@@ -1009,4 +1009,75 @@ interface ConnectorPickerProps {
1009
1009
  }
1010
1010
  declare function ConnectorPicker({ client, purpose, lens, layout, onConnected, }: ConnectorPickerProps): react.JSX.Element | null;
1011
1011
 
1012
- export { type AppRungItem, AppSidebar, type AppSidebarBrand, type AppSidebarModuleDef, type AppSidebarProps, type AppSidebarTopItem, type Brand, BrandGlyph, type BrandGlyphProps, type ConnectableAccess, type ConnectableCapability, type ConnectableEntry, type ConnectableTransport, type ConnectionKind, type ConnectorConnectionHealth, type ConnectorCredentialField, type ConnectorCredentialTestResult, type ConnectorGrant, type ConnectorGrantInput, type ConnectorGranteeType, type ConnectorGuideStep, ConnectorPicker, type ConnectorPickerClient, type ConnectorPickerLens, type ConnectorPickerProps, type ConnectorRoleOption, type ConnectorSetupGuide, type ContextOrgGroup, ContextSwitcher, type ContextSwitcherItem, type ContextSwitcherProps, DEFAULT_LEGAL_LINKS, type FallbackModuleDef, Flyout, type FlyoutChild, type FlyoutProps, GLYPH_CANVAS_FILL, type GroupRungItem, HOVER_CLOSE_DELAY_MS, HOVER_SWITCH_DELAY_MS, type HeaderNavItem, InfoTip, type InfoTipProps, LOCKUP_GAP, LOCKUP_ROW, MARK_CAP_RATIO, MARK_WEIGHT, type OrgConnectPolicy, REEVE_ACCENT, ResponsiveHeader, type ResponsiveHeaderProps, type RungItem, type SidebarLadder, type SidebarLadderParsed, type SidebarRung, SiteFooter, type SiteFooterLink, type SiteFooterProps, type UseLadderRungOptions, WORDMARK_WEIGHT, accessLabel, deriveFallbackLadder, faviconUrl, groupByOrg, reconcileLadder, resolveLadder, useLadderRung, useResponsivePlaceholder, zSidebarLadder };
1012
+ interface LockedValueProps {
1013
+ /** The value's shape: `#` is a digit, everything else is kept (`"$#,###,###"`, `"##%"`). */
1014
+ mask: string;
1015
+ /** Picks the fake digits. Stable per seed, e.g. `${recordId}:${field}`. */
1016
+ seed: string;
1017
+ /** What the value is, for screen readers: announced as "{label} — locked". */
1018
+ label: string;
1019
+ /** Hide the lock glyph (e.g. inside a LockedBlock that already shows one). */
1020
+ hideIcon?: boolean;
1021
+ className?: string;
1022
+ }
1023
+ declare const LOCKED_BLUR_STYLE: CSSProperties;
1024
+ /**
1025
+ * One paywalled number, blurred, with a small lock (DEV-17025).
1026
+ *
1027
+ * It takes a mask and never a value: what gets blurred is a seeded fake of the
1028
+ * same shape. CSS blur over a real value still ships that value in the HTML,
1029
+ * where view-source, a scraper or the RSC payload reads it, so a gated number
1030
+ * must never reach this component at all.
1031
+ */
1032
+ declare function LockedValue({ mask, seed, label, hideIcon, className }: LockedValueProps): react.JSX.Element;
1033
+
1034
+ interface LockedBlockProps {
1035
+ /**
1036
+ * The locked layout: skeleton rows built from LockedValue and plain labels.
1037
+ * Layout only. Never pass real gated content here: it would ship in the HTML.
1038
+ */
1039
+ children: ReactNode;
1040
+ /** What's locked, for screen readers: announced as "{label} — locked". */
1041
+ label: string;
1042
+ /** Usually an UnlockCta. Centered over the blur; omitted, the block is just blurred. */
1043
+ cta?: ReactNode;
1044
+ className?: string;
1045
+ }
1046
+ /**
1047
+ * A blurred section with an unlock ask over it (DEV-17025). The children render
1048
+ * blurred, inert and hidden from assistive tech under a scrim that fades to the
1049
+ * page background, and `cta` sits centered on top. On phones the CTA pins to the
1050
+ * bottom of the block, where a thumb reaches it.
1051
+ */
1052
+ declare function LockedBlock({ children, label, cta, className }: LockedBlockProps): react.JSX.Element;
1053
+
1054
+ interface UnlockCtaProps {
1055
+ href: string;
1056
+ /** Defaults to "Unlock with a free account". */
1057
+ title?: string;
1058
+ /** Defaults to "No credit card required". Hidden when `compact`. */
1059
+ sub?: string;
1060
+ /** A one-line chip (e.g. for later locked sections that point back to the main CTA). */
1061
+ compact?: boolean;
1062
+ /** Fires on click before navigation, for the consumer's funnel event. */
1063
+ onClick?: MouseEventHandler<HTMLAnchorElement>;
1064
+ /** Link renderer. Defaults to a bare `"a"`; pass `next/link` for client navigation. */
1065
+ linkComponent?: ElementType;
1066
+ className?: string;
1067
+ }
1068
+ /**
1069
+ * The unlock ask that sits over locked content (DEV-17025). It styles from the
1070
+ * host's theme tokens (`primary`, `card`, `border`), so every tenant gets its
1071
+ * own brand in light and dark.
1072
+ */
1073
+ declare function UnlockCta({ href, title, sub, compact, onClick, linkComponent, className, }: UnlockCtaProps): react.JSX.Element;
1074
+
1075
+ /**
1076
+ * A fake value shaped like the real one (DEV-17025): every `#` in `mask`
1077
+ * becomes a seeded digit and every other character is kept, so
1078
+ * `placeholder("$#,###,###", seed)` reads like a dollar amount of the right
1079
+ * width. A `#` right after a non-`#` never draws 0, so no group reads "$0,…".
1080
+ */
1081
+ declare function placeholder(mask: string, seed: string): string;
1082
+
1083
+ export { type AppRungItem, AppSidebar, type AppSidebarBrand, type AppSidebarModuleDef, type AppSidebarProps, type AppSidebarTopItem, type Brand, BrandGlyph, type BrandGlyphProps, type ConnectableAccess, type ConnectableCapability, type ConnectableEntry, type ConnectableTransport, type ConnectionKind, type ConnectorConnectionHealth, type ConnectorCredentialField, type ConnectorCredentialTestResult, type ConnectorGrant, type ConnectorGrantInput, type ConnectorGranteeType, type ConnectorGuideStep, ConnectorPicker, type ConnectorPickerClient, type ConnectorPickerLens, type ConnectorPickerProps, type ConnectorRoleOption, type ConnectorSetupGuide, type ContextOrgGroup, ContextSwitcher, type ContextSwitcherItem, type ContextSwitcherProps, DEFAULT_LEGAL_LINKS, type FallbackModuleDef, Flyout, type FlyoutChild, type FlyoutProps, GLYPH_CANVAS_FILL, type GroupRungItem, HOVER_CLOSE_DELAY_MS, HOVER_SWITCH_DELAY_MS, type HeaderNavItem, InfoTip, type InfoTipProps, LOCKED_BLUR_STYLE, LOCKUP_GAP, LOCKUP_ROW, LockedBlock, type LockedBlockProps, LockedValue, type LockedValueProps, MARK_CAP_RATIO, MARK_WEIGHT, type OrgConnectPolicy, REEVE_ACCENT, ResponsiveHeader, type ResponsiveHeaderProps, type RungItem, type SidebarLadder, type SidebarLadderParsed, type SidebarRung, SiteFooter, type SiteFooterLink, type SiteFooterProps, UnlockCta, type UnlockCtaProps, type UseLadderRungOptions, WORDMARK_WEIGHT, accessLabel, deriveFallbackLadder, faviconUrl, groupByOrg, placeholder, reconcileLadder, resolveLadder, useLadderRung, useResponsivePlaceholder, zSidebarLadder };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { ReactNode, ElementType, RefObject } from 'react';
2
+ import { ReactNode, ElementType, RefObject, CSSProperties, MouseEventHandler } from 'react';
3
3
  import { z } from 'zod';
4
4
 
5
5
  /**
@@ -1009,4 +1009,75 @@ interface ConnectorPickerProps {
1009
1009
  }
1010
1010
  declare function ConnectorPicker({ client, purpose, lens, layout, onConnected, }: ConnectorPickerProps): react.JSX.Element | null;
1011
1011
 
1012
- export { type AppRungItem, AppSidebar, type AppSidebarBrand, type AppSidebarModuleDef, type AppSidebarProps, type AppSidebarTopItem, type Brand, BrandGlyph, type BrandGlyphProps, type ConnectableAccess, type ConnectableCapability, type ConnectableEntry, type ConnectableTransport, type ConnectionKind, type ConnectorConnectionHealth, type ConnectorCredentialField, type ConnectorCredentialTestResult, type ConnectorGrant, type ConnectorGrantInput, type ConnectorGranteeType, type ConnectorGuideStep, ConnectorPicker, type ConnectorPickerClient, type ConnectorPickerLens, type ConnectorPickerProps, type ConnectorRoleOption, type ConnectorSetupGuide, type ContextOrgGroup, ContextSwitcher, type ContextSwitcherItem, type ContextSwitcherProps, DEFAULT_LEGAL_LINKS, type FallbackModuleDef, Flyout, type FlyoutChild, type FlyoutProps, GLYPH_CANVAS_FILL, type GroupRungItem, HOVER_CLOSE_DELAY_MS, HOVER_SWITCH_DELAY_MS, type HeaderNavItem, InfoTip, type InfoTipProps, LOCKUP_GAP, LOCKUP_ROW, MARK_CAP_RATIO, MARK_WEIGHT, type OrgConnectPolicy, REEVE_ACCENT, ResponsiveHeader, type ResponsiveHeaderProps, type RungItem, type SidebarLadder, type SidebarLadderParsed, type SidebarRung, SiteFooter, type SiteFooterLink, type SiteFooterProps, type UseLadderRungOptions, WORDMARK_WEIGHT, accessLabel, deriveFallbackLadder, faviconUrl, groupByOrg, reconcileLadder, resolveLadder, useLadderRung, useResponsivePlaceholder, zSidebarLadder };
1012
+ interface LockedValueProps {
1013
+ /** The value's shape: `#` is a digit, everything else is kept (`"$#,###,###"`, `"##%"`). */
1014
+ mask: string;
1015
+ /** Picks the fake digits. Stable per seed, e.g. `${recordId}:${field}`. */
1016
+ seed: string;
1017
+ /** What the value is, for screen readers: announced as "{label} — locked". */
1018
+ label: string;
1019
+ /** Hide the lock glyph (e.g. inside a LockedBlock that already shows one). */
1020
+ hideIcon?: boolean;
1021
+ className?: string;
1022
+ }
1023
+ declare const LOCKED_BLUR_STYLE: CSSProperties;
1024
+ /**
1025
+ * One paywalled number, blurred, with a small lock (DEV-17025).
1026
+ *
1027
+ * It takes a mask and never a value: what gets blurred is a seeded fake of the
1028
+ * same shape. CSS blur over a real value still ships that value in the HTML,
1029
+ * where view-source, a scraper or the RSC payload reads it, so a gated number
1030
+ * must never reach this component at all.
1031
+ */
1032
+ declare function LockedValue({ mask, seed, label, hideIcon, className }: LockedValueProps): react.JSX.Element;
1033
+
1034
+ interface LockedBlockProps {
1035
+ /**
1036
+ * The locked layout: skeleton rows built from LockedValue and plain labels.
1037
+ * Layout only. Never pass real gated content here: it would ship in the HTML.
1038
+ */
1039
+ children: ReactNode;
1040
+ /** What's locked, for screen readers: announced as "{label} — locked". */
1041
+ label: string;
1042
+ /** Usually an UnlockCta. Centered over the blur; omitted, the block is just blurred. */
1043
+ cta?: ReactNode;
1044
+ className?: string;
1045
+ }
1046
+ /**
1047
+ * A blurred section with an unlock ask over it (DEV-17025). The children render
1048
+ * blurred, inert and hidden from assistive tech under a scrim that fades to the
1049
+ * page background, and `cta` sits centered on top. On phones the CTA pins to the
1050
+ * bottom of the block, where a thumb reaches it.
1051
+ */
1052
+ declare function LockedBlock({ children, label, cta, className }: LockedBlockProps): react.JSX.Element;
1053
+
1054
+ interface UnlockCtaProps {
1055
+ href: string;
1056
+ /** Defaults to "Unlock with a free account". */
1057
+ title?: string;
1058
+ /** Defaults to "No credit card required". Hidden when `compact`. */
1059
+ sub?: string;
1060
+ /** A one-line chip (e.g. for later locked sections that point back to the main CTA). */
1061
+ compact?: boolean;
1062
+ /** Fires on click before navigation, for the consumer's funnel event. */
1063
+ onClick?: MouseEventHandler<HTMLAnchorElement>;
1064
+ /** Link renderer. Defaults to a bare `"a"`; pass `next/link` for client navigation. */
1065
+ linkComponent?: ElementType;
1066
+ className?: string;
1067
+ }
1068
+ /**
1069
+ * The unlock ask that sits over locked content (DEV-17025). It styles from the
1070
+ * host's theme tokens (`primary`, `card`, `border`), so every tenant gets its
1071
+ * own brand in light and dark.
1072
+ */
1073
+ declare function UnlockCta({ href, title, sub, compact, onClick, linkComponent, className, }: UnlockCtaProps): react.JSX.Element;
1074
+
1075
+ /**
1076
+ * A fake value shaped like the real one (DEV-17025): every `#` in `mask`
1077
+ * becomes a seeded digit and every other character is kept, so
1078
+ * `placeholder("$#,###,###", seed)` reads like a dollar amount of the right
1079
+ * width. A `#` right after a non-`#` never draws 0, so no group reads "$0,…".
1080
+ */
1081
+ declare function placeholder(mask: string, seed: string): string;
1082
+
1083
+ export { type AppRungItem, AppSidebar, type AppSidebarBrand, type AppSidebarModuleDef, type AppSidebarProps, type AppSidebarTopItem, type Brand, BrandGlyph, type BrandGlyphProps, type ConnectableAccess, type ConnectableCapability, type ConnectableEntry, type ConnectableTransport, type ConnectionKind, type ConnectorConnectionHealth, type ConnectorCredentialField, type ConnectorCredentialTestResult, type ConnectorGrant, type ConnectorGrantInput, type ConnectorGranteeType, type ConnectorGuideStep, ConnectorPicker, type ConnectorPickerClient, type ConnectorPickerLens, type ConnectorPickerProps, type ConnectorRoleOption, type ConnectorSetupGuide, type ContextOrgGroup, ContextSwitcher, type ContextSwitcherItem, type ContextSwitcherProps, DEFAULT_LEGAL_LINKS, type FallbackModuleDef, Flyout, type FlyoutChild, type FlyoutProps, GLYPH_CANVAS_FILL, type GroupRungItem, HOVER_CLOSE_DELAY_MS, HOVER_SWITCH_DELAY_MS, type HeaderNavItem, InfoTip, type InfoTipProps, LOCKED_BLUR_STYLE, LOCKUP_GAP, LOCKUP_ROW, LockedBlock, type LockedBlockProps, LockedValue, type LockedValueProps, MARK_CAP_RATIO, MARK_WEIGHT, type OrgConnectPolicy, REEVE_ACCENT, ResponsiveHeader, type ResponsiveHeaderProps, type RungItem, type SidebarLadder, type SidebarLadderParsed, type SidebarRung, SiteFooter, type SiteFooterLink, type SiteFooterProps, UnlockCta, type UnlockCtaProps, type UseLadderRungOptions, WORDMARK_WEIGHT, accessLabel, deriveFallbackLadder, faviconUrl, groupByOrg, placeholder, reconcileLadder, resolveLadder, useLadderRung, useResponsivePlaceholder, zSidebarLadder };
package/dist/index.js CHANGED
@@ -41,18 +41,23 @@ __export(src_exports, {
41
41
  HOVER_CLOSE_DELAY_MS: () => HOVER_CLOSE_DELAY_MS,
42
42
  HOVER_SWITCH_DELAY_MS: () => HOVER_SWITCH_DELAY_MS,
43
43
  InfoTip: () => InfoTip,
44
+ LOCKED_BLUR_STYLE: () => LOCKED_BLUR_STYLE,
44
45
  LOCKUP_GAP: () => LOCKUP_GAP,
45
46
  LOCKUP_ROW: () => LOCKUP_ROW,
47
+ LockedBlock: () => LockedBlock,
48
+ LockedValue: () => LockedValue,
46
49
  MARK_CAP_RATIO: () => MARK_CAP_RATIO,
47
50
  MARK_WEIGHT: () => MARK_WEIGHT,
48
51
  REEVE_ACCENT: () => REEVE_ACCENT,
49
52
  ResponsiveHeader: () => ResponsiveHeader,
50
53
  SiteFooter: () => SiteFooter,
54
+ UnlockCta: () => UnlockCta,
51
55
  WORDMARK_WEIGHT: () => WORDMARK_WEIGHT,
52
56
  accessLabel: () => accessLabel,
53
57
  deriveFallbackLadder: () => deriveFallbackLadder,
54
58
  faviconUrl: () => faviconUrl,
55
59
  groupByOrg: () => groupByOrg,
60
+ placeholder: () => placeholder,
56
61
  reconcileLadder: () => reconcileLadder,
57
62
  resolveLadder: () => resolveLadder,
58
63
  useLadderRung: () => useLadderRung,
@@ -1608,7 +1613,7 @@ function ContextSwitcher({
1608
1613
  activeRefId,
1609
1614
  onSelect,
1610
1615
  footer,
1611
- placeholder = "Select",
1616
+ placeholder: placeholder2 = "Select",
1612
1617
  collapsed = false,
1613
1618
  side = "bottom",
1614
1619
  align = "start",
@@ -1622,8 +1627,8 @@ function ContextSwitcher({
1622
1627
  "button",
1623
1628
  {
1624
1629
  type: "button",
1625
- title: active?.name || placeholder,
1626
- "aria-label": active?.name || placeholder,
1630
+ title: active?.name || placeholder2,
1631
+ "aria-label": active?.name || placeholder2,
1627
1632
  className: "flex h-10 w-10 items-center justify-center rounded-lg text-sidebar-foreground/70 transition-colors hover:bg-sidebar-foreground/5 hover:text-sidebar-foreground",
1628
1633
  children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(BrandGlyph, { brand: toBrand(active ?? { name: "" }), size: "lg" })
1629
1634
  }
@@ -1634,7 +1639,7 @@ function ContextSwitcher({
1634
1639
  className: "group flex items-center gap-2 rounded-md border border-sidebar-border bg-sidebar-accent/60 px-2.5 py-1.5 text-sm font-medium transition-colors hover:bg-sidebar",
1635
1640
  children: [
1636
1641
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(BrandGlyph, { brand: toBrand(active ?? { name: "" }) }),
1637
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "max-w-[140px] truncate text-sidebar-accent-foreground", children: active?.name || placeholder }),
1642
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "max-w-[140px] truncate text-sidebar-accent-foreground", children: active?.name || placeholder2 }),
1638
1643
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react3.ChevronDown, { className: "h-3.5 w-3.5 text-sidebar-foreground/70 transition-transform group-data-[state=open]:rotate-180" })
1639
1644
  ]
1640
1645
  }
@@ -2817,6 +2822,131 @@ function ManageSharing({
2817
2822
  }
2818
2823
  );
2819
2824
  }
2825
+
2826
+ // src/locked/locked-value.tsx
2827
+ var import_lucide_react4 = require("lucide-react");
2828
+
2829
+ // src/locked/placeholder.ts
2830
+ function hash(seed) {
2831
+ let h = 2166136261;
2832
+ for (let i = 0; i < seed.length; i++) {
2833
+ h ^= seed.charCodeAt(i);
2834
+ h = Math.imul(h, 16777619);
2835
+ }
2836
+ return h >>> 0;
2837
+ }
2838
+ function mulberry32(a) {
2839
+ return () => {
2840
+ a = a + 1831565813 | 0;
2841
+ let t = Math.imul(a ^ a >>> 15, 1 | a);
2842
+ t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t;
2843
+ return ((t ^ t >>> 14) >>> 0) / 4294967296;
2844
+ };
2845
+ }
2846
+ function placeholder(mask, seed) {
2847
+ const next = mulberry32(hash(seed));
2848
+ let out = "";
2849
+ for (let i = 0; i < mask.length; i++) {
2850
+ const ch = mask[i];
2851
+ if (ch !== "#") {
2852
+ out += ch;
2853
+ continue;
2854
+ }
2855
+ const leads = i === 0 || mask[i - 1] !== "#";
2856
+ out += leads ? String(1 + Math.floor(next() * 9)) : String(Math.floor(next() * 10));
2857
+ }
2858
+ return out;
2859
+ }
2860
+
2861
+ // src/locked/locked-value.tsx
2862
+ var import_jsx_runtime10 = require("react/jsx-runtime");
2863
+ var LOCKED_BLUR_STYLE = {
2864
+ filter: "blur(6px)",
2865
+ userSelect: "none",
2866
+ WebkitUserSelect: "none"
2867
+ };
2868
+ function LockedValue({ mask, seed, label, hideIcon = false, className }) {
2869
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { role: "img", "aria-label": `${label} \u2014 locked`, className: cn("inline-flex items-center gap-1 whitespace-nowrap", className), children: [
2870
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { "aria-hidden": "true", style: LOCKED_BLUR_STYLE, children: placeholder(mask, seed) }),
2871
+ hideIcon ? null : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Lock, { "aria-hidden": "true", className: "shrink-0 text-muted-foreground", style: { width: "0.85em", height: "0.85em" }, strokeWidth: 2 })
2872
+ ] });
2873
+ }
2874
+
2875
+ // src/locked/locked-block.tsx
2876
+ var import_react10 = require("react");
2877
+ var import_jsx_runtime11 = (
2878
+ // With a CTA, the block is at least as tall as the card, so a one-row
2879
+ // section can't clip it.
2880
+ require("react/jsx-runtime")
2881
+ );
2882
+ var INERT = Number.parseInt(import_react10.version, 10) >= 19 ? { inert: true } : { inert: "" };
2883
+ function LockedBlock({ children, label, cta, className }) {
2884
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2885
+ "div",
2886
+ {
2887
+ role: "group",
2888
+ "aria-label": `${label} \u2014 locked`,
2889
+ className: cn("relative isolate overflow-hidden rounded-xl", cta != null && "min-h-24", className),
2890
+ children: [
2891
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { "aria-hidden": "true", ...INERT, style: { ...LOCKED_BLUR_STYLE, pointerEvents: "none" }, children }),
2892
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { "aria-hidden": "true", className: "pointer-events-none absolute inset-0 bg-gradient-to-b from-background/0 via-background/60 to-background" }),
2893
+ cta ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "absolute inset-x-0 bottom-0 flex justify-center p-3 sm:inset-0 sm:items-center sm:p-6", children: cta }) : null
2894
+ ]
2895
+ }
2896
+ );
2897
+ }
2898
+
2899
+ // src/locked/unlock-cta.tsx
2900
+ var import_lucide_react5 = require("lucide-react");
2901
+ var import_jsx_runtime12 = require("react/jsx-runtime");
2902
+ function UnlockCta({
2903
+ href,
2904
+ title = "Unlock with a free account",
2905
+ sub = "No credit card required",
2906
+ compact = false,
2907
+ onClick,
2908
+ linkComponent,
2909
+ className
2910
+ }) {
2911
+ const LinkEl = linkComponent ?? "a";
2912
+ if (compact) {
2913
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
2914
+ LinkEl,
2915
+ {
2916
+ href,
2917
+ onClick,
2918
+ style: TOUCH_TARGET_STYLE,
2919
+ className: cn(
2920
+ "inline-flex items-center gap-1.5 rounded-full border border-border bg-card px-3 text-xs font-medium text-card-foreground shadow-sm transition-colors hover:bg-accent",
2921
+ className
2922
+ ),
2923
+ children: [
2924
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react5.Lock, { "aria-hidden": "true", className: "size-3.5 text-primary", strokeWidth: 2 }),
2925
+ title
2926
+ ]
2927
+ }
2928
+ );
2929
+ }
2930
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
2931
+ LinkEl,
2932
+ {
2933
+ href,
2934
+ onClick,
2935
+ className: cn(
2936
+ "group flex w-full max-w-sm items-center gap-3 rounded-xl border border-border bg-card px-4 py-3 text-card-foreground shadow-lg transition-colors hover:border-primary/60",
2937
+ className
2938
+ ),
2939
+ children: [
2940
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "flex size-9 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react5.Lock, { "aria-hidden": "true", className: "size-4", strokeWidth: 2 }) }),
2941
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "flex min-w-0 flex-1 flex-col", children: [
2942
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-sm font-semibold", children: title }),
2943
+ sub ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-xs text-muted-foreground", children: sub }) : null
2944
+ ] }),
2945
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react5.ArrowRight, { "aria-hidden": "true", className: "size-4 shrink-0 transition-transform group-hover:translate-x-0.5", strokeWidth: 1.75 })
2946
+ ]
2947
+ }
2948
+ );
2949
+ }
2820
2950
  // Annotate the CommonJS export names for ESM import in node:
2821
2951
  0 && (module.exports = {
2822
2952
  AppSidebar,
@@ -2829,18 +2959,23 @@ function ManageSharing({
2829
2959
  HOVER_CLOSE_DELAY_MS,
2830
2960
  HOVER_SWITCH_DELAY_MS,
2831
2961
  InfoTip,
2962
+ LOCKED_BLUR_STYLE,
2832
2963
  LOCKUP_GAP,
2833
2964
  LOCKUP_ROW,
2965
+ LockedBlock,
2966
+ LockedValue,
2834
2967
  MARK_CAP_RATIO,
2835
2968
  MARK_WEIGHT,
2836
2969
  REEVE_ACCENT,
2837
2970
  ResponsiveHeader,
2838
2971
  SiteFooter,
2972
+ UnlockCta,
2839
2973
  WORDMARK_WEIGHT,
2840
2974
  accessLabel,
2841
2975
  deriveFallbackLadder,
2842
2976
  faviconUrl,
2843
2977
  groupByOrg,
2978
+ placeholder,
2844
2979
  reconcileLadder,
2845
2980
  resolveLadder,
2846
2981
  useLadderRung,
package/dist/index.mjs CHANGED
@@ -1547,7 +1547,7 @@ function ContextSwitcher({
1547
1547
  activeRefId,
1548
1548
  onSelect,
1549
1549
  footer,
1550
- placeholder = "Select",
1550
+ placeholder: placeholder2 = "Select",
1551
1551
  collapsed = false,
1552
1552
  side = "bottom",
1553
1553
  align = "start",
@@ -1561,8 +1561,8 @@ function ContextSwitcher({
1561
1561
  "button",
1562
1562
  {
1563
1563
  type: "button",
1564
- title: active?.name || placeholder,
1565
- "aria-label": active?.name || placeholder,
1564
+ title: active?.name || placeholder2,
1565
+ "aria-label": active?.name || placeholder2,
1566
1566
  className: "flex h-10 w-10 items-center justify-center rounded-lg text-sidebar-foreground/70 transition-colors hover:bg-sidebar-foreground/5 hover:text-sidebar-foreground",
1567
1567
  children: /* @__PURE__ */ jsx8(BrandGlyph, { brand: toBrand(active ?? { name: "" }), size: "lg" })
1568
1568
  }
@@ -1573,7 +1573,7 @@ function ContextSwitcher({
1573
1573
  className: "group flex items-center gap-2 rounded-md border border-sidebar-border bg-sidebar-accent/60 px-2.5 py-1.5 text-sm font-medium transition-colors hover:bg-sidebar",
1574
1574
  children: [
1575
1575
  /* @__PURE__ */ jsx8(BrandGlyph, { brand: toBrand(active ?? { name: "" }) }),
1576
- /* @__PURE__ */ jsx8("span", { className: "max-w-[140px] truncate text-sidebar-accent-foreground", children: active?.name || placeholder }),
1576
+ /* @__PURE__ */ jsx8("span", { className: "max-w-[140px] truncate text-sidebar-accent-foreground", children: active?.name || placeholder2 }),
1577
1577
  /* @__PURE__ */ jsx8(ChevronDown, { className: "h-3.5 w-3.5 text-sidebar-foreground/70 transition-transform group-data-[state=open]:rotate-180" })
1578
1578
  ]
1579
1579
  }
@@ -2756,6 +2756,131 @@ function ManageSharing({
2756
2756
  }
2757
2757
  );
2758
2758
  }
2759
+
2760
+ // src/locked/locked-value.tsx
2761
+ import { Lock } from "lucide-react";
2762
+
2763
+ // src/locked/placeholder.ts
2764
+ function hash(seed) {
2765
+ let h = 2166136261;
2766
+ for (let i = 0; i < seed.length; i++) {
2767
+ h ^= seed.charCodeAt(i);
2768
+ h = Math.imul(h, 16777619);
2769
+ }
2770
+ return h >>> 0;
2771
+ }
2772
+ function mulberry32(a) {
2773
+ return () => {
2774
+ a = a + 1831565813 | 0;
2775
+ let t = Math.imul(a ^ a >>> 15, 1 | a);
2776
+ t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t;
2777
+ return ((t ^ t >>> 14) >>> 0) / 4294967296;
2778
+ };
2779
+ }
2780
+ function placeholder(mask, seed) {
2781
+ const next = mulberry32(hash(seed));
2782
+ let out = "";
2783
+ for (let i = 0; i < mask.length; i++) {
2784
+ const ch = mask[i];
2785
+ if (ch !== "#") {
2786
+ out += ch;
2787
+ continue;
2788
+ }
2789
+ const leads = i === 0 || mask[i - 1] !== "#";
2790
+ out += leads ? String(1 + Math.floor(next() * 9)) : String(Math.floor(next() * 10));
2791
+ }
2792
+ return out;
2793
+ }
2794
+
2795
+ // src/locked/locked-value.tsx
2796
+ import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
2797
+ var LOCKED_BLUR_STYLE = {
2798
+ filter: "blur(6px)",
2799
+ userSelect: "none",
2800
+ WebkitUserSelect: "none"
2801
+ };
2802
+ function LockedValue({ mask, seed, label, hideIcon = false, className }) {
2803
+ return /* @__PURE__ */ jsxs9("span", { role: "img", "aria-label": `${label} \u2014 locked`, className: cn("inline-flex items-center gap-1 whitespace-nowrap", className), children: [
2804
+ /* @__PURE__ */ jsx10("span", { "aria-hidden": "true", style: LOCKED_BLUR_STYLE, children: placeholder(mask, seed) }),
2805
+ hideIcon ? null : /* @__PURE__ */ jsx10(Lock, { "aria-hidden": "true", className: "shrink-0 text-muted-foreground", style: { width: "0.85em", height: "0.85em" }, strokeWidth: 2 })
2806
+ ] });
2807
+ }
2808
+
2809
+ // src/locked/locked-block.tsx
2810
+ import { version } from "react";
2811
+ import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
2812
+ var INERT = Number.parseInt(version, 10) >= 19 ? { inert: true } : { inert: "" };
2813
+ function LockedBlock({ children, label, cta, className }) {
2814
+ return (
2815
+ // With a CTA, the block is at least as tall as the card, so a one-row
2816
+ // section can't clip it.
2817
+ /* @__PURE__ */ jsxs10(
2818
+ "div",
2819
+ {
2820
+ role: "group",
2821
+ "aria-label": `${label} \u2014 locked`,
2822
+ className: cn("relative isolate overflow-hidden rounded-xl", cta != null && "min-h-24", className),
2823
+ children: [
2824
+ /* @__PURE__ */ jsx11("div", { "aria-hidden": "true", ...INERT, style: { ...LOCKED_BLUR_STYLE, pointerEvents: "none" }, children }),
2825
+ /* @__PURE__ */ jsx11("div", { "aria-hidden": "true", className: "pointer-events-none absolute inset-0 bg-gradient-to-b from-background/0 via-background/60 to-background" }),
2826
+ cta ? /* @__PURE__ */ jsx11("div", { className: "absolute inset-x-0 bottom-0 flex justify-center p-3 sm:inset-0 sm:items-center sm:p-6", children: cta }) : null
2827
+ ]
2828
+ }
2829
+ )
2830
+ );
2831
+ }
2832
+
2833
+ // src/locked/unlock-cta.tsx
2834
+ import { ArrowRight, Lock as Lock2 } from "lucide-react";
2835
+ import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
2836
+ function UnlockCta({
2837
+ href,
2838
+ title = "Unlock with a free account",
2839
+ sub = "No credit card required",
2840
+ compact = false,
2841
+ onClick,
2842
+ linkComponent,
2843
+ className
2844
+ }) {
2845
+ const LinkEl = linkComponent ?? "a";
2846
+ if (compact) {
2847
+ return /* @__PURE__ */ jsxs11(
2848
+ LinkEl,
2849
+ {
2850
+ href,
2851
+ onClick,
2852
+ style: TOUCH_TARGET_STYLE,
2853
+ className: cn(
2854
+ "inline-flex items-center gap-1.5 rounded-full border border-border bg-card px-3 text-xs font-medium text-card-foreground shadow-sm transition-colors hover:bg-accent",
2855
+ className
2856
+ ),
2857
+ children: [
2858
+ /* @__PURE__ */ jsx12(Lock2, { "aria-hidden": "true", className: "size-3.5 text-primary", strokeWidth: 2 }),
2859
+ title
2860
+ ]
2861
+ }
2862
+ );
2863
+ }
2864
+ return /* @__PURE__ */ jsxs11(
2865
+ LinkEl,
2866
+ {
2867
+ href,
2868
+ onClick,
2869
+ className: cn(
2870
+ "group flex w-full max-w-sm items-center gap-3 rounded-xl border border-border bg-card px-4 py-3 text-card-foreground shadow-lg transition-colors hover:border-primary/60",
2871
+ className
2872
+ ),
2873
+ children: [
2874
+ /* @__PURE__ */ jsx12("span", { className: "flex size-9 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground", children: /* @__PURE__ */ jsx12(Lock2, { "aria-hidden": "true", className: "size-4", strokeWidth: 2 }) }),
2875
+ /* @__PURE__ */ jsxs11("span", { className: "flex min-w-0 flex-1 flex-col", children: [
2876
+ /* @__PURE__ */ jsx12("span", { className: "text-sm font-semibold", children: title }),
2877
+ sub ? /* @__PURE__ */ jsx12("span", { className: "text-xs text-muted-foreground", children: sub }) : null
2878
+ ] }),
2879
+ /* @__PURE__ */ jsx12(ArrowRight, { "aria-hidden": "true", className: "size-4 shrink-0 transition-transform group-hover:translate-x-0.5", strokeWidth: 1.75 })
2880
+ ]
2881
+ }
2882
+ );
2883
+ }
2759
2884
  export {
2760
2885
  AppSidebar,
2761
2886
  BrandGlyph,
@@ -2767,18 +2892,23 @@ export {
2767
2892
  HOVER_CLOSE_DELAY_MS,
2768
2893
  HOVER_SWITCH_DELAY_MS,
2769
2894
  InfoTip,
2895
+ LOCKED_BLUR_STYLE,
2770
2896
  LOCKUP_GAP,
2771
2897
  LOCKUP_ROW,
2898
+ LockedBlock,
2899
+ LockedValue,
2772
2900
  MARK_CAP_RATIO,
2773
2901
  MARK_WEIGHT,
2774
2902
  REEVE_ACCENT,
2775
2903
  ResponsiveHeader,
2776
2904
  SiteFooter,
2905
+ UnlockCta,
2777
2906
  WORDMARK_WEIGHT,
2778
2907
  accessLabel,
2779
2908
  deriveFallbackLadder,
2780
2909
  faviconUrl,
2781
2910
  groupByOrg,
2911
+ placeholder,
2782
2912
  reconcileLadder,
2783
2913
  resolveLadder,
2784
2914
  useLadderRung,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@meetreeve/ui",
3
- "version": "0.20.0",
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, and the StageRail flow-of-cards primitives, and the tenant SiteFooter.",
3
+ "version": "0.21.0",
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, and the StageRail flow-of-cards primitives, the tenant SiteFooter, and the LockedValue/LockedBlock/UnlockCta paywall primitives.",
5
5
  "license": "UNLICENSED",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.mjs",