{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "features-mini-ui",
  "type": "registry:component",
  "title": "Features Mini UI",
  "description": "Four asymmetric feature cards, each holding a small working piece of the product: a spend limit slider with a meter that turns amber and red, policy switches that rewrite a sentence, a card that frosts over when frozen, and receipts you can match.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "features",
    "features",
    "interactive",
    "fintech",
    "cards",
    "controls",
    "demo"
  ],
  "docs": "https://hyperblur.dev/effects/features-mini-ui",
  "files": [
    {
      "path": "registry/hyperblur/features-mini-ui.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/features-mini-ui.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface FeaturesMiniUiTransaction {\n  merchant: string;\n  amount: number;\n  date: string;\n}\n\nexport interface FeaturesMiniUiProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  eyebrow?: string;\n  title?: string;\n  subtitle?: string;\n  spent?: number;\n  defaultLimit?: number;\n  transactions?: FeaturesMiniUiTransaction[];\n  cardholder?: string;\n  currency?: string;\n  locale?: string;\n  accent?: string;\n  onLimitChange?: (value: number) => void;\n  onFreezeChange?: (frozen: boolean) => void;\n}\n\nconst css = `\n@keyframes hb-wa5-rise { from { opacity: 0; transform: translate3d(0, 16px, 0); } to { opacity: 1; transform: none; } }\n@keyframes hb-wa5-frost { from { opacity: 0; backdrop-filter: blur(0); } to { opacity: 1; backdrop-filter: blur(3px); } }\n@keyframes hb-wa5-flake { from { transform: translateY(-8px) rotate(0); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(70px) rotate(120deg); opacity: 0; } }\n@keyframes hb-wa5-check { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }\n@keyframes hb-wa5-bump { 40% { transform: scale(1.18); } }\n.hb-wa5 {\n  --hb-wa5-accent: #34d399;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  container-type: inline-size;\n  background: #0a0a0a;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-wa5 *, .hb-wa5 *::before, .hb-wa5 *::after { box-sizing: border-box; }\n.hb-wa5 em, .hb-wa5 i { font-style: normal; }\n.hb-wa5-in { max-width: 1120px; margin: 0 auto; padding: clamp(56px, 8cqi, 104px) clamp(16px, 5cqi, 48px); }\n.hb-wa5-head { max-width: 640px; margin-bottom: clamp(26px, 4cqi, 44px); }\n.hb-wa5-eyebrow { margin: 0 0 12px; color: var(--hb-wa5-accent); font-size: 13px; font-weight: 600; }\n.hb-wa5-title { margin: 0; font-size: clamp(28px, 4.2cqi, 46px); font-weight: 600; line-height: 1.06; letter-spacing: -.035em; text-wrap: balance; }\n.hb-wa5-sub { margin: 14px 0 0; color: #8f8f8f; font-size: 15.5px; line-height: 1.6; }\n.hb-wa5-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }\n.hb-wa5-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid rgba(255, 255, 255, .08); border-radius: 20px; background: linear-gradient(180deg, #131313, #0f0f0f); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); animation: hb-wa5-rise .6s cubic-bezier(.22, 1, .36, 1) backwards; animation-delay: calc(var(--i) * 90ms); }\n.hb-wa5-card:nth-child(1) { grid-column: span 4; }\n.hb-wa5-card:nth-child(2) { grid-column: span 2; }\n.hb-wa5-card:nth-child(3) { grid-column: span 2; }\n.hb-wa5-card:nth-child(4) { grid-column: span 4; }\n.hb-wa5-ui { flex: 1; padding: 18px; }\n.hb-wa5-cap { padding: 14px 18px 18px; border-top: 1px solid rgba(255, 255, 255, .06); }\n.hb-wa5-cap h3 { margin: 0; font-size: 15px; font-weight: 600; }\n.hb-wa5-cap p { margin: 4px 0 0; color: #8f8f8f; font-size: 13px; line-height: 1.5; }\n.hb-wa5-lim { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }\n.hb-wa5-lim small { color: #8f8f8f; font-size: 12px; }\n.hb-wa5-lim strong { font-family: var(--font-grotesk, inherit); font-size: 30px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }\n.hb-wa5-meter { position: relative; height: 12px; margin: 14px 0 8px; overflow: hidden; border-radius: 6px; background: #1c1c1c; }\n.hb-wa5-meter i { position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: 6px; background: linear-gradient(90deg, color-mix(in srgb, var(--hb-wa5-tone) 50%, #111), var(--hb-wa5-tone)); transition: width .45s cubic-bezier(.22, 1, .36, 1), background .3s ease; }\n.hb-wa5-legend { display: flex; justify-content: space-between; color: #8f8f8f; font-size: 12px; font-variant-numeric: tabular-nums; }\n.hb-wa5-legend b { color: var(--hb-wa5-tone); font-weight: 600; transition: color .3s ease; }\n.hb-wa5-range { width: 100%; margin: 18px 0 0; accent-color: var(--hb-wa5-accent); cursor: pointer; }\n.hb-wa5-range:focus-visible { outline: 2px solid var(--hb-wa5-accent); outline-offset: 4px; border-radius: 4px; }\n.hb-wa5-ticks { display: flex; justify-content: space-between; color: #5f5f5f; font-size: 11px; font-family: var(--font-mono, ui-monospace, monospace); }\n.hb-wa5-rules { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }\n.hb-wa5-rule { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; color: #d4d4d4; font-size: 13px; }\n.hb-wa5-sw { position: relative; flex: none; width: 36px; height: 22px; padding: 0; border: 0; border-radius: 999px; background: #262626; cursor: pointer; transition: background .25s ease; }\n.hb-wa5-sw::after { content: \"\"; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }\n.hb-wa5-sw[aria-checked=\"true\"] { background: var(--hb-wa5-accent); }\n.hb-wa5-sw[aria-checked=\"true\"]::after { transform: translateX(14px); }\n.hb-wa5-sw:focus-visible { outline: 2px solid var(--hb-wa5-accent); outline-offset: 2px; }\n.hb-wa5-sum { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--hb-wa5-accent) 9%, #111); color: #cfcfcf; font-size: 12.5px; line-height: 1.5; }\n.hb-wa5-sum b { color: var(--hb-wa5-accent); font-weight: 600; }\n.hb-wa5-vcard { position: relative; aspect-ratio: 1.586; overflow: hidden; padding: 14px; border-radius: 14px; background: linear-gradient(135deg, #0f3d2e, #064e3b 40%, #022c22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 20px 30px -18px rgba(0, 0, 0, .9); color: #ecfdf5; display: flex; flex-direction: column; justify-content: space-between; transition: filter .5s ease; }\n.hb-wa5-vcard::before { content: \"\"; position: absolute; inset: -40% -20% auto auto; width: 80%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(52, 211, 153, .35), transparent 70%); }\n.hb-wa5-vcard[data-frozen=\"true\"] { filter: saturate(.2) brightness(.9); }\n.hb-wa5-chip { position: relative; width: 28px; height: 20px; border-radius: 5px; background: linear-gradient(135deg, #e5e7eb, #9ca3af); }\n.hb-wa5-pan { position: relative; font-family: var(--font-mono, ui-monospace, monospace); font-size: 12px; letter-spacing: .12em; }\n.hb-wa5-name { position: relative; display: flex; justify-content: space-between; font-size: 10.5px; opacity: .8; }\n.hb-wa5-frost { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(135deg, rgba(186, 230, 253, .35), rgba(224, 242, 254, .15)); animation: hb-wa5-frost .5s ease both; color: #e0f2fe; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }\n.hb-wa5-frost i { position: absolute; top: 0; width: 6px; height: 6px; border-radius: 1px; background: #e0f2fe; animation: hb-wa5-flake 2.4s linear infinite; }\n.hb-wa5-fbtn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 12px; padding: 9px 12px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 10px; background: #171717; color: #ededed; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .2s ease, border-color .2s ease; }\n.hb-wa5-fbtn:hover { background: #1f1f1f; }\n.hb-wa5-fbtn[aria-pressed=\"true\"] { border-color: rgba(125, 211, 252, .5); color: #bae6fd; }\n.hb-wa5-fbtn:focus-visible { outline: 2px solid var(--hb-wa5-accent); outline-offset: 2px; }\n.hb-wa5-tx { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }\n.hb-wa5-txr { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid rgba(255, 255, 255, .06); border-radius: 12px; background: #121212; transition: border-color .3s ease, background .3s ease; }\n.hb-wa5-txr[data-done=\"true\"] { border-color: color-mix(in srgb, var(--hb-wa5-accent) 30%, transparent); background: color-mix(in srgb, var(--hb-wa5-accent) 5%, #121212); }\n.hb-wa5-logo { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: #0a0a0a; font-size: 11px; font-weight: 800; }\n.hb-wa5-txr b { display: block; overflow: hidden; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }\n.hb-wa5-txr small { color: #6f6f6f; font-size: 11.5px; }\n.hb-wa5-amt { font-variant-numeric: tabular-nums; font-size: 13px; color: #d4d4d4; }\n.hb-wa5-match { display: inline-flex; align-items: center; gap: 6px; min-width: 92px; justify-content: center; padding: 6px 10px; border: 1px dashed rgba(255, 255, 255, .18); border-radius: 8px; background: none; color: #a1a1a1; font: inherit; font-size: 12px; cursor: pointer; transition: all .25s ease; }\n.hb-wa5-match:hover { color: #ededed; border-color: rgba(255, 255, 255, .35); }\n.hb-wa5-match:focus-visible { outline: 2px solid var(--hb-wa5-accent); outline-offset: 2px; }\n.hb-wa5-match[data-done=\"true\"] { border-style: solid; border-color: transparent; background: color-mix(in srgb, var(--hb-wa5-accent) 16%, transparent); color: var(--hb-wa5-accent); }\n.hb-wa5-match path { stroke-dasharray: 1; animation: hb-wa5-check .35s ease both; }\n.hb-wa5-txh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; color: #8f8f8f; font-size: 12.5px; }\n.hb-wa5-txh b { color: #ededed; font-variant-numeric: tabular-nums; }\n.hb-wa5-txh b[data-bump=\"true\"] { display: inline-block; animation: hb-wa5-bump .4s ease; }\n@container (max-width: 820px) {\n  .hb-wa5-card:nth-child(n) { grid-column: span 3; }\n}\n@container (max-width: 560px) {\n  .hb-wa5-grid { grid-template-columns: minmax(0, 1fr); }\n  .hb-wa5-card:nth-child(n) { grid-column: auto; }\n  .hb-wa5-txr { grid-template-columns: 30px minmax(0, 1fr) auto; }\n  .hb-wa5-amt { display: none; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-wa5 *, .hb-wa5 *::before, .hb-wa5 *::after { animation: none !important; transition: none !important; }\n}\n`;\n\nconst defaultTx: FeaturesMiniUiTransaction[] = [\n  { merchant: \"Northbeam Air\", amount: 642.18, date: \"Oct 28\" },\n  { merchant: \"Copperleaf Hotel\", amount: 389, date: \"Oct 27\" },\n  { merchant: \"Figtree Catering\", amount: 1240.5, date: \"Oct 24\" },\n];\n\nconst logoColors = [\"#a7f3d0\", \"#fde68a\", \"#fbcfe8\"];\n\nconst ruleDefs = [\n  { id: \"approvers\", label: \"Two approvers over $500\" },\n  { id: \"receipts\", label: \"Receipt required within 3 days\" },\n  { id: \"weekend\", label: \"Block weekend spend\" },\n];\n\nexport function FeaturesMiniUi({\n  eyebrow = \"Ledgerline for finance teams\",\n  title = \"Controls you can feel, not settings you forget\",\n  subtitle = \"Every card below is the real product. Drag the limit, flip a rule, freeze the card, match a receipt.\",\n  spent = 3180,\n  defaultLimit = 5000,\n  transactions = defaultTx,\n  cardholder = \"Priya Raman\",\n  currency = \"USD\",\n  locale = \"en-US\",\n  accent = \"#34d399\",\n  onLimitChange,\n  onFreezeChange,\n  className,\n  style,\n  ...rest\n}: FeaturesMiniUiProps) {\n  const [limit, setLimit] = React.useState(defaultLimit);\n  const [rules, setRules] = React.useState<Record<string, boolean>>({ approvers: true, receipts: true, weekend: false });\n  const [frozen, setFrozen] = React.useState(false);\n  const [matched, setMatched] = React.useState<boolean[]>(() => transactions.map((_, i) => i === 0));\n  const [bump, setBump] = React.useState(0);\n\n  const fmt = React.useMemo(() => new Intl.NumberFormat(locale, { style: \"currency\", currency, maximumFractionDigits: 0 }), [locale, currency]);\n  const fmt2 = React.useMemo(() => new Intl.NumberFormat(locale, { style: \"currency\", currency }), [locale, currency]);\n\n  const ratio = Math.min(1, spent / limit);\n  const tone = ratio > 0.9 ? \"#f87171\" : ratio > 0.75 ? \"#fbbf24\" : accent;\n  const active = ruleDefs.filter((r) => rules[r.id]);\n  const done = matched.filter(Boolean).length;\n\n  const summary =\n    active.length === 0 ? (\n      <>No rules on. <b>Every purchase</b> goes straight through.</>\n    ) : (\n      <>\n        <b>{active.length} of 3</b> rules on. {rules.approvers ? \"Large purchases wait for two approvals\" : \"Purchases skip approval\"}\n        {rules.weekend ? \" and weekend spend is blocked.\" : \".\"}\n      </>\n    );\n\n  return (\n    <section className={[\"hb-wa5\", className].filter(Boolean).join(\" \")} style={{ \"--hb-wa5-accent\": accent, ...style } as React.CSSProperties} {...rest}>\n      <style href=\"hb-features-mini-ui\" precedence=\"default\">{css}</style>\n      <div className=\"hb-wa5-in\">\n        <div className=\"hb-wa5-head\">\n          <p className=\"hb-wa5-eyebrow\">{eyebrow}</p>\n          <h2 className=\"hb-wa5-title\">{title}</h2>\n          <p className=\"hb-wa5-sub\">{subtitle}</p>\n        </div>\n        <div className=\"hb-wa5-grid\">\n          <article className=\"hb-wa5-card\" style={{ \"--i\": 0, \"--hb-wa5-tone\": tone } as React.CSSProperties}>\n            <div className=\"hb-wa5-ui\">\n              <div className=\"hb-wa5-lim\">\n                <small>Design team · monthly limit</small>\n                <strong>{fmt.format(limit)}</strong>\n              </div>\n              <div className=\"hb-wa5-meter\" role=\"img\" aria-label={`${fmt.format(spent)} spent of ${fmt.format(limit)}`}>\n                <i style={{ \"--w\": `${(ratio * 100).toFixed(1)}%` } as React.CSSProperties} />\n              </div>\n              <div className=\"hb-wa5-legend\">\n                <span>{fmt.format(spent)} spent</span>\n                <b>{ratio >= 1 ? \"Over limit\" : `${fmt.format(limit - spent)} left`}</b>\n              </div>\n              <input\n                className=\"hb-wa5-range\"\n                type=\"range\"\n                min={2000}\n                max={12000}\n                step={250}\n                value={limit}\n                aria-label=\"Monthly limit\"\n                onChange={(e) => {\n                  const v = Number(e.target.value);\n                  setLimit(v);\n                  onLimitChange?.(v);\n                }}\n              />\n              <div className=\"hb-wa5-ticks\">\n                <span>{fmt.format(2000)}</span>\n                <span>{fmt.format(7000)}</span>\n                <span>{fmt.format(12000)}</span>\n              </div>\n            </div>\n            <div className=\"hb-wa5-cap\">\n              <h3>Spend limits that warn early</h3>\n              <p>The bar turns amber at 75% and red at 90%, and the team lead hears about it before the card declines.</p>\n            </div>\n          </article>\n\n          <article className=\"hb-wa5-card\" style={{ \"--i\": 1 } as React.CSSProperties}>\n            <div className=\"hb-wa5-ui\">\n              <ul className=\"hb-wa5-rules\">\n                {ruleDefs.map((r) => (\n                  <li key={r.id} className=\"hb-wa5-rule\">\n                    <span id={`hb-wa5-${r.id}`}>{r.label}</span>\n                    <button\n                      type=\"button\"\n                      role=\"switch\"\n                      aria-checked={rules[r.id]}\n                      aria-labelledby={`hb-wa5-${r.id}`}\n                      className=\"hb-wa5-sw\"\n                      onClick={() => setRules((p) => ({ ...p, [r.id]: !p[r.id] }))}\n                    />\n                  </li>\n                ))}\n              </ul>\n              <p className=\"hb-wa5-sum\" aria-live=\"polite\">{summary}</p>\n            </div>\n            <div className=\"hb-wa5-cap\">\n              <h3>Policies in plain English</h3>\n              <p>Rules read like sentences, so finance and the team agree on them.</p>\n            </div>\n          </article>\n\n          <article className=\"hb-wa5-card\" style={{ \"--i\": 2 } as React.CSSProperties}>\n            <div className=\"hb-wa5-ui\">\n              <div className=\"hb-wa5-vcard\" data-frozen={frozen}>\n                <span className=\"hb-wa5-chip\" />\n                <span className=\"hb-wa5-pan\">•••• 4821</span>\n                <span className=\"hb-wa5-name\">\n                  <span>{cardholder}</span>\n                  <span>09/29</span>\n                </span>\n                {frozen && (\n                  <span className=\"hb-wa5-frost\" aria-hidden=\"true\">\n                    Frozen\n                    {[12, 30, 48, 66, 84].map((l, j) => (\n                      <i key={l} style={{ left: `${l}%`, animationDelay: `${(j * 0.45).toFixed(2)}s` }} />\n                    ))}\n                  </span>\n                )}\n              </div>\n              <button\n                type=\"button\"\n                className=\"hb-wa5-fbtn\"\n                aria-pressed={frozen}\n                onClick={() => {\n                  setFrozen((f) => !f);\n                  onFreezeChange?.(!frozen);\n                }}\n              >\n                <svg width=\"14\" height=\"14\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\"><path d=\"M8 1v14M2 4.5l12 7M14 4.5l-12 7\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" /></svg>\n                {frozen ? \"Unfreeze card\" : \"Freeze card\"}\n              </button>\n            </div>\n            <div className=\"hb-wa5-cap\">\n              <h3>Freeze in one tap</h3>\n              <p>Lost card? Freeze it and unfreeze when it turns up.</p>\n            </div>\n          </article>\n\n          <article className=\"hb-wa5-card\" style={{ \"--i\": 3 } as React.CSSProperties}>\n            <div className=\"hb-wa5-ui\">\n              <div className=\"hb-wa5-txh\">\n                <span>Receipts this week</span>\n                <span>\n                  <b key={bump} data-bump={bump > 0}>{done}</b> of {transactions.length} matched\n                </span>\n              </div>\n              <ul className=\"hb-wa5-tx\">\n                {transactions.map((t, i) => (\n                  <li key={t.merchant} className=\"hb-wa5-txr\" data-done={matched[i]}>\n                    <span className=\"hb-wa5-logo\" style={{ background: logoColors[i % logoColors.length] }}>{t.merchant.slice(0, 2).toUpperCase()}</span>\n                    <span>\n                      <b>{t.merchant}</b>\n                      <small>{t.date}</small>\n                    </span>\n                    <span className=\"hb-wa5-amt\">{fmt2.format(t.amount)}</span>\n                    <button\n                      type=\"button\"\n                      className=\"hb-wa5-match\"\n                      data-done={matched[i]}\n                      aria-pressed={matched[i]}\n                      onClick={() => {\n                        setMatched((m) => m.map((v, j) => (j === i ? !v : v)));\n                        setBump((b) => b + 1);\n                      }}\n                    >\n                      {matched[i] ? (\n                        <>\n                          <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" aria-hidden=\"true\"><path d=\"M2.5 6.2 5 8.5l4.5-5\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" pathLength={1} /></svg>\n                          Matched\n                        </>\n                      ) : (\n                        \"Match receipt\"\n                      )}\n                    </button>\n                  </li>\n                ))}\n              </ul>\n            </div>\n            <div className=\"hb-wa5-cap\">\n              <h3>Receipts that find their charge</h3>\n              <p>Forward a photo and Ledgerline matches it by amount and merchant. You just confirm.</p>\n            </div>\n          </article>\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}