@kumix/ui 0.4.4 → 0.5.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.
Files changed (89) hide show
  1. package/README.md +14 -12
  2. package/dist/components/agents/approval-card/index.js +0 -1
  3. package/dist/components/agents/approval-card/index.js.map +1 -1
  4. package/dist/components/agents/prompt-input.js +0 -1
  5. package/dist/components/agents/prompt-input.js.map +1 -1
  6. package/dist/components/charts/bar-chart/context.d.ts.map +1 -1
  7. package/dist/components/charts/line-chart/context.d.ts.map +1 -1
  8. package/dist/components/charts/returns-calendar.d.ts.map +1 -1
  9. package/dist/components/charts/treemap.d.ts.map +1 -1
  10. package/dist/components/motion/bouncy-accordion.d.ts.map +1 -1
  11. package/dist/components/motion/bouncy-accordion.js +20 -34
  12. package/dist/components/motion/bouncy-accordion.js.map +1 -1
  13. package/dist/components/motion/crash/crash-balloon.d.ts +9 -0
  14. package/dist/components/motion/crash/crash-balloon.d.ts.map +1 -0
  15. package/dist/components/motion/crash/crash-balloon.js +829 -0
  16. package/dist/components/motion/crash/crash-balloon.js.map +1 -0
  17. package/dist/components/motion/crash/crash-parts.d.ts +59 -0
  18. package/dist/components/motion/crash/crash-parts.d.ts.map +1 -0
  19. package/dist/components/motion/crash/crash-parts.js +2 -0
  20. package/dist/components/motion/crash/crash-tower.d.ts +9 -0
  21. package/dist/components/motion/crash/crash-tower.d.ts.map +1 -0
  22. package/dist/components/motion/crash/crash-tower.js +370 -0
  23. package/dist/components/motion/crash/crash-tower.js.map +1 -0
  24. package/dist/components/motion/crash.d.ts +9 -0
  25. package/dist/components/motion/crash.d.ts.map +1 -0
  26. package/dist/components/motion/crash.js +590 -0
  27. package/dist/components/motion/crash.js.map +1 -0
  28. package/dist/components/motion/feedback-widget.js +0 -1
  29. package/dist/components/motion/feedback-widget.js.map +1 -1
  30. package/dist/components/motion/liquid.js +2 -2
  31. package/dist/components/motion/liquid.js.map +1 -1
  32. package/dist/components/motion/mines.d.ts +41 -0
  33. package/dist/components/motion/mines.d.ts.map +1 -0
  34. package/dist/components/motion/mines.js +762 -0
  35. package/dist/components/motion/mines.js.map +1 -0
  36. package/dist/components/motion/plinko.d.ts +59 -0
  37. package/dist/components/motion/plinko.d.ts.map +1 -0
  38. package/dist/components/motion/plinko.js +385 -0
  39. package/dist/components/motion/plinko.js.map +1 -0
  40. package/dist/components/motion/signup-form.js +0 -1
  41. package/dist/components/motion/signup-form.js.map +1 -1
  42. package/dist/components/motion/swap.d.ts +1 -1
  43. package/dist/components/motion/tooltip.d.ts +2 -2
  44. package/dist/components/motion/tooltip.d.ts.map +1 -1
  45. package/dist/components/motion/wallet-card/index.js +0 -1
  46. package/dist/components/motion/wallet-card/index.js.map +1 -1
  47. package/dist/components/reui/alert.d.ts +1 -1
  48. package/dist/components/reui/badge.d.ts +1 -1
  49. package/dist/components/reui/code-block/code-block.d.ts +1 -0
  50. package/dist/components/reui/code-block/code-block.d.ts.map +1 -1
  51. package/dist/components/reui/data-grid/data-grid-table.d.ts +1 -1
  52. package/dist/components/reui/data-grid/data-grid-table.d.ts.map +1 -1
  53. package/dist/components/reui/frame.d.ts +1 -1
  54. package/dist/components/reui/icon-tile.d.ts +1 -1
  55. package/dist/components/reui/tree.d.ts +1 -0
  56. package/dist/components/reui/tree.d.ts.map +1 -1
  57. package/dist/components/ui/badge.d.ts +1 -1
  58. package/dist/components/ui/bubble.d.ts +1 -1
  59. package/dist/components/ui/button.d.ts +2 -2
  60. package/dist/components/ui/empty.d.ts +1 -1
  61. package/dist/components/ui/item.d.ts +1 -1
  62. package/dist/components/ui/marker.d.ts +1 -1
  63. package/dist/components/ui/tabs.d.ts +1 -1
  64. package/dist/crash-parts-CUv5gFYQ.js +1053 -0
  65. package/dist/crash-parts-CUv5gFYQ.js.map +1 -0
  66. package/dist/{ease-CHhXKlG3.d.ts → ease-DjhlGGZO.d.ts} +4 -2
  67. package/dist/ease-DjhlGGZO.d.ts.map +1 -0
  68. package/dist/hooks/use-highlighted-code.d.ts +1 -1
  69. package/dist/hooks/use-highlighted-code.d.ts.map +1 -1
  70. package/dist/lib/audio-context.d.ts +11 -0
  71. package/dist/lib/audio-context.d.ts.map +1 -0
  72. package/dist/lib/audio-context.js +37 -0
  73. package/dist/lib/audio-context.js.map +1 -0
  74. package/dist/lib/ease.d.ts +2 -2
  75. package/dist/lib/ease.js +8 -1
  76. package/dist/lib/ease.js.map +1 -1
  77. package/dist/lib/game-sounds.d.ts +18 -0
  78. package/dist/lib/game-sounds.d.ts.map +1 -0
  79. package/dist/lib/game-sounds.js +142 -0
  80. package/dist/lib/game-sounds.js.map +1 -0
  81. package/dist/lib/tick-sound.d.ts +4 -3
  82. package/dist/lib/tick-sound.d.ts.map +1 -1
  83. package/dist/lib/tick-sound.js +30 -37
  84. package/dist/lib/tick-sound.js.map +1 -1
  85. package/dist/tooltip-CNEYdIX3.d.ts.map +1 -1
  86. package/dist/use-crash-game-B3RHxFkm.d.ts +108 -0
  87. package/dist/use-crash-game-B3RHxFkm.d.ts.map +1 -0
  88. package/package.json +7 -7
  89. package/dist/ease-CHhXKlG3.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"tick-sound.js","names":[],"sources":["../../src/lib/tick-sound.ts"],"sourcesContent":["const DURATION = 0.016; // seconds, short enough to stay distinct during a fling\nconst MASTER_GAIN = 0.055;\n\nconst MODES = [\n { frequency: 980, decay: 0.0038, gain: 0.5, phase: 0 },\n { frequency: 1820, decay: 0.0024, gain: 0.3, phase: 0.65 },\n { frequency: 3160, decay: 0.00115, gain: 0.12, phase: 1.3 },\n] as const;\n\ntype AudioContextCtor = typeof AudioContext;\n\nfunction getAudioContextCtor(): AudioContextCtor | undefined {\n if (typeof window === \"undefined\") return undefined;\n return (\n window.AudioContext ??\n (window as unknown as { webkitAudioContext?: AudioContextCtor }).webkitAudioContext\n );\n}\n\n// One shared context/buffer/gain for the whole page, ref-counted across every\n// `createTickPlayer()` caller. Components like WheelPicker commonly compose\n// several side by side (a date made of month/day/year drums) — giving each\n// its own AudioContext would waste resources and risk hitting a browser's cap\n// on concurrent contexts. The context only closes once every consumer that\n// created a player has called `dispose()`.\nlet ctx: AudioContext | null = null;\nlet masterGain: GainNode | null = null;\nlet clickBuffer: AudioBuffer | null = null;\nlet consumers = 0;\n\nfunction buildClickBuffer(context: AudioContext): AudioBuffer {\n const sampleRate = context.sampleRate;\n const length = Math.ceil(DURATION * sampleRate);\n const buffer = context.createBuffer(1, length, sampleRate);\n const data = buffer.getChannelData(0);\n\n let peak = 0;\n let previousNoise = 0;\n for (let i = 0; i < length; i++) {\n const t = i / sampleRate;\n const attack = Math.min(1, t / 0.00012);\n const fadeOut = Math.min(1, (DURATION - t) / 0.001);\n let resonance = 0;\n for (const mode of MODES) {\n resonance +=\n Math.sin(2 * Math.PI * mode.frequency * t + mode.phase) *\n Math.exp(-t / mode.decay) *\n mode.gain;\n }\n\n // Differencing consecutive noise samples removes the low, papery part of\n // white noise and leaves only a tiny impact at the front of the sound.\n const noise = Math.random() * 2 - 1;\n const transient = (noise - previousNoise) * Math.exp(-t / 0.00038) * 0.035;\n previousNoise = noise;\n\n data[i] = (resonance + transient) * attack * fadeOut;\n peak = Math.max(peak, Math.abs(data[i]));\n }\n if (peak > 0) {\n const norm = 0.9 / peak;\n for (let i = 0; i < length; i++) data[i] *= norm;\n }\n\n return buffer;\n}\n\nfunction ensureContext() {\n if (ctx) return;\n const Ctor = getAudioContextCtor();\n if (!Ctor) return;\n ctx = new Ctor();\n masterGain = ctx.createGain();\n masterGain.gain.value = MASTER_GAIN;\n masterGain.connect(ctx.destination);\n clickBuffer = buildClickBuffer(ctx);\n}\n\nfunction prepareContext() {\n ensureContext();\n if (ctx?.state === \"suspended\") {\n // Browsers may reject this when it is not called from a trusted gesture.\n // Pointer, touch, wheel and keyboard entry points call `prepare()` first;\n // this repeat attempt keeps direct `play()` calls safe as well.\n void ctx.resume().catch(() => undefined);\n }\n}\n\ninterface TickPlayer {\n prepare: () => void;\n play: () => void;\n dispose: () => void;\n}\n\n/**\n * Lazily-initialized tick player. No `AudioContext` is created until the first\n * `prepare()` or `play()` call anywhere on the page. Every player shares the\n * same context/buffer, ref-counted so `dispose()` only tears it down once the\n * last consumer is gone. Safe during SSR or in browsers without Web Audio:\n * `prepare()` and `play()` become silent no-ops.\n */\nexport function createTickPlayer(): TickPlayer {\n consumers++;\n let disposed = false;\n let activeSource: AudioBufferSourceNode | null = null;\n\n return {\n prepare() {\n if (disposed) return;\n prepareContext();\n },\n play() {\n if (disposed) return;\n prepareContext();\n if (!ctx || !masterGain || !clickBuffer) return;\n // A fast fling can cross rows more quickly than the tail of a tick.\n // Cutting that tail keeps the feedback dry instead of stacking into a\n // louder metallic ring.\n activeSource?.stop();\n const source = ctx.createBufferSource();\n source.buffer = clickBuffer;\n source.connect(masterGain);\n source.onended = () => {\n source.disconnect();\n if (activeSource === source) activeSource = null;\n };\n activeSource = source;\n source.start();\n },\n dispose() {\n if (disposed) return;\n disposed = true;\n activeSource?.stop();\n activeSource = null;\n consumers = Math.max(0, consumers - 1);\n if (consumers === 0 && ctx) {\n ctx.close();\n ctx = null;\n masterGain = null;\n clickBuffer = null;\n }\n },\n };\n}\n"],"mappings":";AAAA,MAAM,WAAW;AACjB,MAAM,cAAc;AAEpB,MAAM,QAAQ;CACZ;EAAE,WAAW;EAAK,OAAO;EAAQ,MAAM;EAAK,OAAO;CAAE;CACrD;EAAE,WAAW;EAAM,OAAO;EAAQ,MAAM;EAAK,OAAO;CAAK;CACzD;EAAE,WAAW;EAAM,OAAO;EAAS,MAAM;EAAM,OAAO;CAAI;AAC5D;AAIA,SAAS,sBAAoD;CAC3D,IAAI,OAAO,WAAW,aAAa,OAAO,KAAA;CAC1C,OACE,OAAO,gBACN,OAAgE;AAErE;AAQA,IAAI,MAA2B;AAC/B,IAAI,aAA8B;AAClC,IAAI,cAAkC;AACtC,IAAI,YAAY;AAEhB,SAAS,iBAAiB,SAAoC;CAC5D,MAAM,aAAa,QAAQ;CAC3B,MAAM,SAAS,KAAK,KAAK,WAAW,UAAU;CAC9C,MAAM,SAAS,QAAQ,aAAa,GAAG,QAAQ,UAAU;CACzD,MAAM,OAAO,OAAO,eAAe,CAAC;CAEpC,IAAI,OAAO;CACX,IAAI,gBAAgB;CACpB,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,KAAK;EAC/B,MAAM,IAAI,IAAI;EACd,MAAM,SAAS,KAAK,IAAI,GAAG,IAAI,KAAO;EACtC,MAAM,UAAU,KAAK,IAAI,IAAI,WAAW,KAAK,IAAK;EAClD,IAAI,YAAY;EAChB,KAAK,MAAM,QAAQ,OACjB,aACE,KAAK,IAAI,IAAI,KAAK,KAAK,KAAK,YAAY,IAAI,KAAK,KAAK,IACtD,KAAK,IAAI,CAAC,IAAI,KAAK,KAAK,IACxB,KAAK;EAKT,MAAM,QAAQ,KAAK,OAAO,IAAI,IAAI;EAClC,MAAM,aAAa,QAAQ,iBAAiB,KAAK,IAAI,CAAC,IAAI,KAAO,IAAI;EACrE,gBAAgB;EAEhB,KAAK,MAAM,YAAY,aAAa,SAAS;EAC7C,OAAO,KAAK,IAAI,MAAM,KAAK,IAAI,KAAK,EAAE,CAAC;CACzC;CACA,IAAI,OAAO,GAAG;EACZ,MAAM,OAAO,KAAM;EACnB,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,KAAK,KAAK,MAAM;CAC9C;CAEA,OAAO;AACT;AAEA,SAAS,gBAAgB;CACvB,IAAI,KAAK;CACT,MAAM,OAAO,oBAAoB;CACjC,IAAI,CAAC,MAAM;CACX,MAAM,IAAI,KAAK;CACf,aAAa,IAAI,WAAW;CAC5B,WAAW,KAAK,QAAQ;CACxB,WAAW,QAAQ,IAAI,WAAW;CAClC,cAAc,iBAAiB,GAAG;AACpC;AAEA,SAAS,iBAAiB;CACxB,cAAc;CACd,IAAI,KAAK,UAAU,aAIjB,IAAS,OAAO,CAAC,CAAC,YAAY,KAAA,CAAS;AAE3C;;;;;;;;AAeA,SAAgB,mBAA+B;CAC7C;CACA,IAAI,WAAW;CACf,IAAI,eAA6C;CAEjD,OAAO;EACL,UAAU;GACR,IAAI,UAAU;GACd,eAAe;EACjB;EACA,OAAO;GACL,IAAI,UAAU;GACd,eAAe;GACf,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,aAAa;GAIzC,cAAc,KAAK;GACnB,MAAM,SAAS,IAAI,mBAAmB;GACtC,OAAO,SAAS;GAChB,OAAO,QAAQ,UAAU;GACzB,OAAO,gBAAgB;IACrB,OAAO,WAAW;IAClB,IAAI,iBAAiB,QAAQ,eAAe;GAC9C;GACA,eAAe;GACf,OAAO,MAAM;EACf;EACA,UAAU;GACR,IAAI,UAAU;GACd,WAAW;GACX,cAAc,KAAK;GACnB,eAAe;GACf,YAAY,KAAK,IAAI,GAAG,YAAY,CAAC;GACrC,IAAI,cAAc,KAAK,KAAK;IAC1B,IAAI,MAAM;IACV,MAAM;IACN,aAAa;IACb,cAAc;GAChB;EACF;CACF;AACF"}
1
+ {"version":3,"file":"tick-sound.js","names":[],"sources":["../../src/lib/tick-sound.ts"],"sourcesContent":["import { getAudioContext, retainAudioContext } from \"./audio-context\";\n\nconst DURATION = 0.016; // seconds, short enough to stay distinct during a fling\nconst MASTER_GAIN = 0.055;\n\nconst MODES = [\n { frequency: 980, decay: 0.0038, gain: 0.5, phase: 0 },\n { frequency: 1820, decay: 0.0024, gain: 0.3, phase: 0.65 },\n { frequency: 3160, decay: 0.00115, gain: 0.12, phase: 1.3 },\n] as const;\n\n// The context is shared page-wide (lib/audio-context.ts). The gain and the\n// click buffer belong to it, so they are rebuilt if it was closed and\n// recreated.\nlet output: { gain: GainNode; buffer: AudioBuffer } | null = null;\n\nfunction buildClickBuffer(context: AudioContext): AudioBuffer {\n const sampleRate = context.sampleRate;\n const length = Math.ceil(DURATION * sampleRate);\n const buffer = context.createBuffer(1, length, sampleRate);\n const data = buffer.getChannelData(0);\n\n let peak = 0;\n let previousNoise = 0;\n for (let i = 0; i < length; i++) {\n const t = i / sampleRate;\n const attack = Math.min(1, t / 0.00012);\n const fadeOut = Math.min(1, (DURATION - t) / 0.001);\n let resonance = 0;\n for (const mode of MODES) {\n resonance +=\n Math.sin(2 * Math.PI * mode.frequency * t + mode.phase) *\n Math.exp(-t / mode.decay) *\n mode.gain;\n }\n\n // Differencing consecutive noise samples removes the low, papery part of\n // white noise and leaves only a tiny impact at the front of the sound.\n const noise = Math.random() * 2 - 1;\n const transient = (noise - previousNoise) * Math.exp(-t / 0.00038) * 0.035;\n previousNoise = noise;\n\n data[i] = (resonance + transient) * attack * fadeOut;\n peak = Math.max(peak, Math.abs(data[i]));\n }\n if (peak > 0) {\n const norm = 0.9 / peak;\n for (let i = 0; i < length; i++) data[i] *= norm;\n }\n\n return buffer;\n}\n\nfunction prepareOutput() {\n const ctx = getAudioContext();\n if (!ctx) return null;\n if (output?.gain.context !== ctx) {\n const gain = ctx.createGain();\n gain.gain.value = MASTER_GAIN;\n gain.connect(ctx.destination);\n output = { gain, buffer: buildClickBuffer(ctx) };\n }\n return { ctx, ...output };\n}\n\ninterface TickPlayer {\n prepare: () => void;\n /** `rate` below 1 plays a lower, longer tick; above 1 a higher, shorter one. */\n play: (rate?: number) => void;\n dispose: () => void;\n}\n\n/**\n * Lazily-initialized tick player. No `AudioContext` is created until the first\n * `prepare()` or `play()` call anywhere on the page. Every player shares the\n * same context and buffer; the context closes once the last player anywhere\n * on the page is disposed. Safe during SSR or in browsers without Web Audio:\n * `prepare()` and `play()` become silent no-ops.\n */\nexport function createTickPlayer(): TickPlayer {\n const release = retainAudioContext();\n let disposed = false;\n let activeSource: AudioBufferSourceNode | null = null;\n\n return {\n prepare() {\n if (disposed) return;\n prepareOutput();\n },\n play(rate = 1) {\n if (disposed) return;\n const ready = prepareOutput();\n if (!ready) return;\n const { ctx, gain, buffer } = ready;\n // A fast fling can cross rows more quickly than the tail of a tick.\n // Cutting that tail keeps the feedback dry instead of stacking into a\n // louder metallic ring.\n activeSource?.stop();\n const source = ctx.createBufferSource();\n source.buffer = buffer;\n source.playbackRate.value = rate;\n source.connect(gain);\n source.onended = () => {\n source.disconnect();\n if (activeSource === source) activeSource = null;\n };\n activeSource = source;\n source.start();\n },\n dispose() {\n if (disposed) return;\n disposed = true;\n activeSource?.stop();\n activeSource = null;\n release();\n },\n };\n}\n"],"mappings":";;AAEA,MAAM,WAAW;AACjB,MAAM,cAAc;AAEpB,MAAM,QAAQ;CACZ;EAAE,WAAW;EAAK,OAAO;EAAQ,MAAM;EAAK,OAAO;CAAE;CACrD;EAAE,WAAW;EAAM,OAAO;EAAQ,MAAM;EAAK,OAAO;CAAK;CACzD;EAAE,WAAW;EAAM,OAAO;EAAS,MAAM;EAAM,OAAO;CAAI;AAC5D;AAKA,IAAI,SAAyD;AAE7D,SAAS,iBAAiB,SAAoC;CAC5D,MAAM,aAAa,QAAQ;CAC3B,MAAM,SAAS,KAAK,KAAK,WAAW,UAAU;CAC9C,MAAM,SAAS,QAAQ,aAAa,GAAG,QAAQ,UAAU;CACzD,MAAM,OAAO,OAAO,eAAe,CAAC;CAEpC,IAAI,OAAO;CACX,IAAI,gBAAgB;CACpB,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,KAAK;EAC/B,MAAM,IAAI,IAAI;EACd,MAAM,SAAS,KAAK,IAAI,GAAG,IAAI,KAAO;EACtC,MAAM,UAAU,KAAK,IAAI,IAAI,WAAW,KAAK,IAAK;EAClD,IAAI,YAAY;EAChB,KAAK,MAAM,QAAQ,OACjB,aACE,KAAK,IAAI,IAAI,KAAK,KAAK,KAAK,YAAY,IAAI,KAAK,KAAK,IACtD,KAAK,IAAI,CAAC,IAAI,KAAK,KAAK,IACxB,KAAK;EAKT,MAAM,QAAQ,KAAK,OAAO,IAAI,IAAI;EAClC,MAAM,aAAa,QAAQ,iBAAiB,KAAK,IAAI,CAAC,IAAI,KAAO,IAAI;EACrE,gBAAgB;EAEhB,KAAK,MAAM,YAAY,aAAa,SAAS;EAC7C,OAAO,KAAK,IAAI,MAAM,KAAK,IAAI,KAAK,EAAE,CAAC;CACzC;CACA,IAAI,OAAO,GAAG;EACZ,MAAM,OAAO,KAAM;EACnB,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,KAAK,KAAK,MAAM;CAC9C;CAEA,OAAO;AACT;AAEA,SAAS,gBAAgB;CACvB,MAAM,MAAM,gBAAgB;CAC5B,IAAI,CAAC,KAAK,OAAO;CACjB,IAAI,QAAQ,KAAK,YAAY,KAAK;EAChC,MAAM,OAAO,IAAI,WAAW;EAC5B,KAAK,KAAK,QAAQ;EAClB,KAAK,QAAQ,IAAI,WAAW;EAC5B,SAAS;GAAE;GAAM,QAAQ,iBAAiB,GAAG;EAAE;CACjD;CACA,OAAO;EAAE;EAAK,GAAG;CAAO;AAC1B;;;;;;;;AAgBA,SAAgB,mBAA+B;CAC7C,MAAM,UAAU,mBAAmB;CACnC,IAAI,WAAW;CACf,IAAI,eAA6C;CAEjD,OAAO;EACL,UAAU;GACR,IAAI,UAAU;GACd,cAAc;EAChB;EACA,KAAK,OAAO,GAAG;GACb,IAAI,UAAU;GACd,MAAM,QAAQ,cAAc;GAC5B,IAAI,CAAC,OAAO;GACZ,MAAM,EAAE,KAAK,MAAM,WAAW;GAI9B,cAAc,KAAK;GACnB,MAAM,SAAS,IAAI,mBAAmB;GACtC,OAAO,SAAS;GAChB,OAAO,aAAa,QAAQ;GAC5B,OAAO,QAAQ,IAAI;GACnB,OAAO,gBAAgB;IACrB,OAAO,WAAW;IAClB,IAAI,iBAAiB,QAAQ,eAAe;GAC9C;GACA,eAAe;GACf,OAAO,MAAM;EACf;EACA,UAAU;GACR,IAAI,UAAU;GACd,WAAW;GACX,cAAc,KAAK;GACnB,eAAe;GACf,QAAQ;EACV;CACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip-CNEYdIX3.d.ts","names":["_$__types0.PriceHistoryPoint","_$__types0.PriceTarget"],"sources":["../src/components/charts/price-target-fan/types.ts","../src/components/charts/price-target-fan/context.ts","../src/components/charts/price-target-fan/tooltip.tsx"],"mappings":";UAEiB;EACf;EACA;EACA;;EAEA;;UAGe;EACf;EACA;;KAGU;EACN;EAAiB;;EACjB;EAAgB;;UAEL;;EAEf;;EAEA;;EAEA,UAAU,aAAa,aAAa;;EAEpC;IAAU;IAAgB;IAAc;;;EAExC,UAAU;EACV,WAAW;EACX,SAAS;EACT,gBAAgB;EAChB,kBAAkB,QAAQ;EAC1B;;iBCyNc;;;;;;;EArNW,YAAA,MAAA;;;EAgBD,UAAA;EAEC,WAAA;;E,SAlBAA;;;;;;;;;EA0DnB,IAAA;EAGU,MAAA;EACA,MAAA;;IAQC,KAAA;;;;;;;;;;;;;;;;;;;;;;;;IA2EN;MAAE;MAAe;MAAe;;;;;;;;;;;;;;;;;;;;;;;;;;EA1DxB,SAAA,GAAA,MAAM;;iBCpHX,wBACd,UACA;EAEA,WACI,cACE,MAAM,YAAY,kBAAkB,mCAAmC;EAC7E;oBACD,IAAA"}
1
+ {"version":3,"file":"tooltip-CNEYdIX3.d.ts","names":["_$__types0.PriceHistoryPoint"],"sources":["../src/components/charts/price-target-fan/types.ts","../src/components/charts/price-target-fan/context.ts","../src/components/charts/price-target-fan/tooltip.tsx"],"mappings":";UAEiB;EACf;EACA;EACA;;EAEA;;UAGe;EACf;EACA;;KAGU;EACN;EAAiB;;EACjB;EAAgB;;UAEL;;EAEf;;EAEA;;EAEA,UAAU,aAAa,aAAa;;EAEpC;IAAU;IAAgB;IAAc;;;EAExC,UAAU;EACV,WAAW;EACX,SAAS;EACT,gBAAgB;EAChB,kBAAkB,QAAQ;EAC1B;;iBCyNc;;;;;;;EArNW,YAAA,MAAA;;;EAgBD,UAAA;EAEC,WAAA;;E,SAlBAA;;;;;;;;;EA0DnB,IAAA;EAGU,MAAA;EACA,MAAA;;IAQC,KAAA;;;;;;;;;;;;;;;;;;;;;;;;IA2EN;MAAE;MAAe;MAAe;;;;;;;;;;;;;;;;;;;;;;;;;;EA1DxB,SAAA,GAAA,MAAM;;iBCpHX,wBACd,UACA;EAEA,WACI,cACE,MAAM,YAAY,kBAAkB,mCAAmC;EAC7E;oBACD,IAAA"}
@@ -0,0 +1,108 @@
1
+ interface CrashProps {
2
+ /** Multiplier to cash out at automatically (controlled), or null for manual play. Applies from the next round. */
3
+ autoCashOut?: number | null;
4
+ /** Initial auto cash-out when uncontrolled. Default null (off). */
5
+ defaultAutoCashOut?: number | null;
6
+ /** Called when the Auto menu changes between rounds. */
7
+ onAutoCashOutChange?: (autoCashOut: number | null) => void;
8
+ /**
9
+ * Decides each round's crash point, called once when the round starts.
10
+ * Return a number, or a Promise for one (a server round, a provably fair
11
+ * hash): the main button shows Starting… until it settles, and a rejection
12
+ * returns to Start. Values below 1 or not finite become 1, and values are
13
+ * floored to two decimals. Default `crashPoint()`. Ignored when `crashAt`
14
+ * is passed.
15
+ */
16
+ getCrashPoint?: () => number | Promise<number>;
17
+ /**
18
+ * Live rounds (controlled), for a server that keeps the crash point secret
19
+ * until it happens: the round `onStart` was given and its crash point once
20
+ * revealed, or null. A round flies open-ended until its own crash point
21
+ * arrives; a value for any other round is ignored, so a reveal from last
22
+ * round can't end this one. A value at or below the current multiplier
23
+ * crashes at once, at that value, and a cash out above it never happened:
24
+ * the round ends lost and `onCashOut` is not called. A value still ahead
25
+ * means the display is behind the server: the flight runs out to it
26
+ * quickly and takes no more hand cash outs (an auto target below it still
27
+ * pays). Whether a round is live is fixed when it starts; dropping
28
+ * `crashAt` mid-round ends it at the current multiplier.
29
+ */
30
+ crashAt?: CrashReveal | null;
31
+ /** Called when the player starts a round, before its crash point is known, with the round's number (unique on the page). */
32
+ onStart?: (round: number) => void;
33
+ /**
34
+ * Called when the player cashes out, by hand or automatically. In a live
35
+ * round it waits until the crash point is revealed, so it only fires for a
36
+ * cash out that stands.
37
+ */
38
+ onCashOut?: (multiplier: number) => void;
39
+ /** Called when the round crashes, with the cash-out multiplier or null if the player was still in. */
40
+ onCrash?: (crashPoint: number, cashedOut: number | null) => void;
41
+ /** Play synthesized sounds (controlled): a climbing chime at each milestone (2× to 5×, then 10×, 20×, 50×…), a cash-out arpeggio and a crash blast. */
42
+ sound?: boolean;
43
+ /** Initial sound state when uncontrolled. Default false. */
44
+ defaultSound?: boolean;
45
+ /** Called when the sound button is toggled. */
46
+ onSoundChange?: (sound: boolean) => void;
47
+ /** Accessible name for the game. Default "Crash". */
48
+ "aria-label"?: string;
49
+ className?: string;
50
+ }
51
+ type CrashPhase = "idle" | "starting" | "running" | "crashed";
52
+ /** A live round's crash point, tagged with the round `onStart` was given. */
53
+ interface CrashReveal {
54
+ round: number;
55
+ value: number;
56
+ }
57
+ /**
58
+ * A crash point from one uniform draw in [0, 1): the round reaches `m` with
59
+ * probability (1 − houseEdge) / m, floored to two decimals and capped at
60
+ * 1,000,000×. The default edge of 0 is a fair game. Pass your own `random`
61
+ * for a seeded or provably fair round, for example the first 52 bits of a
62
+ * round's HMAC-SHA256: `crashPoint(() => parseInt(hash.slice(0, 13), 16) / 2 ** 52, 0.01)`.
63
+ */
64
+ declare function crashPoint(random?: () => number, houseEdge?: number): number;
65
+ declare function useCrashGame({ autoCashOut: autoProp, defaultAutoCashOut, onAutoCashOutChange, getCrashPoint, crashAt, onStart, onCashOut, onCrash, sound, defaultSound, onSoundChange }: Omit<CrashProps, "aria-label" | "className">): {
66
+ reduce: boolean;
67
+ /** The built-in fair crash point decides the round, so "1 in m" odds hold. */
68
+ fair: boolean;
69
+ target: number | null;
70
+ ghost: number;
71
+ /** The auto target the current or last round played with. */
72
+ roundAuto: number | null;
73
+ phase: CrashPhase;
74
+ running: boolean;
75
+ starting: boolean;
76
+ crashed: boolean;
77
+ lost: boolean;
78
+ /** A skip is running the rest of the flight out; scenery that streams with t would only flicker. */
79
+ skipping: boolean;
80
+ /** Seconds into the flight, frozen at the crash. */
81
+ t: number;
82
+ multiplier: number;
83
+ cashed: number | null;
84
+ /** Seconds into the flight at the cash out, or null. */
85
+ cashedT: number | null;
86
+ round: number;
87
+ pulse: number;
88
+ history: {
89
+ id: number;
90
+ value: number;
91
+ }[];
92
+ auto: number | null;
93
+ autoOptions: number[];
94
+ setAuto: (value: string) => void;
95
+ soundOn: boolean;
96
+ toggleSound: () => void;
97
+ act: () => void;
98
+ actionLabel: string;
99
+ actionBusy: boolean;
100
+ eyebrow: string;
101
+ status: string;
102
+ announcement: string;
103
+ };
104
+ type CrashGame = ReturnType<typeof useCrashGame>;
105
+ /** A multiplier as Crash shows it: 2.50×, or shortened when large (12.5K×, 1.4e20×). */
106
+ declare function formatMultiplier(multiplier: number): string;
107
+ export { formatMultiplier as a, crashPoint as i, CrashProps as n, CrashReveal as r, CrashGame as t };
108
+ //# sourceMappingURL=use-crash-game-B3RHxFkm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-crash-game-B3RHxFkm.d.ts","names":[],"sources":["../src/components/motion/crash/use-crash-game.ts"],"mappings":"A,UAWiB;;EAEf;;EAEA;;EAEA,uBAAuB;;;;;;;;;EASvB,+BAA+B;;;;;;;;;;;;;;EAc/B,UAAU;;EAEV,WAAW;;;;;;EAMX,aAAa;;EAEb,WAAW,oBAAoB;;EAE/B;;EAEA;;EAEA,iBAAiB;;EAEjB;EACA;;KAGU;;UAGK;EACf;EACA;;;;;;;;;iBAoBc,WAAW,uBAAoC;iBAiD/C,eACd,aAAa,UACb,oBACA,qBACA,eACA,SACA,SACA,WACA,SACA,OACA,cACA,iBACC,KAAK;;;;;;;;;;;;;;;;;;;;;;;;IAgBuC;IAAe;;;;;;;;;;;;;;KA2YlD,YAAY,kBAAkB;;iBA6C1B,iBAAiB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kumix/ui",
3
- "version": "0.4.4",
3
+ "version": "0.5.0",
4
4
  "description": "Kumix React UI kit: shadcn/ui (Base UI, base-nova) + ReUI components, Tailwind tokens, and hooks. Per-file ESM exports.",
5
5
  "author": "Kumix Labs <hai@kumix.io>",
6
6
  "license": "MIT",
@@ -79,7 +79,7 @@
79
79
  "@paper-design/shaders-react": "^0.0.82",
80
80
  "@shadcn/react": "^0.3.1",
81
81
  "@tanstack/react-table": "^9.3.1",
82
- "@tanstack/react-virtual": "^3.14.24",
82
+ "@tanstack/react-virtual": "^3.14.26",
83
83
  "@types/react": "^19.3.0",
84
84
  "class-variance-authority": "^0.7.1",
85
85
  "clsx": "^2.1.1",
@@ -88,17 +88,17 @@
88
88
  "embla-carousel-react": "^8.6.0",
89
89
  "input-otp": "^1.5.0",
90
90
  "lenis": "^1.3.27",
91
- "lucide-react": "^1.66.0",
92
- "motion": "^14.9.0",
91
+ "lucide-react": "^1.70.0",
92
+ "motion": "^14.10.1",
93
93
  "next-themes": "^0.4.6",
94
94
  "react": "^19.3.1",
95
95
  "react-day-picker": "^10.0.2",
96
96
  "react-phone-number-input": "^3.4.18",
97
- "react-resizable-panels": "^4.16.0",
97
+ "react-resizable-panels": "^4.21.0",
98
98
  "recharts": "3.10.1",
99
- "shiki": "^4.5.0",
99
+ "shiki": "^4.6.0",
100
100
  "tailwind-merge": "^3.7.0",
101
- "tsdown": "^0.23.4",
101
+ "tsdown": "^0.23.7",
102
102
  "typescript": "6.0.3"
103
103
  },
104
104
  "peerDependencies": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"ease-CHhXKlG3.d.ts","names":[],"sources":["../src/lib/ease.ts"],"mappings":"A,cAAa;cACA;cACA;;cAGA;;cAGA;;;;;;;cAQA;;;;;;;cAQA;;;;;;;cAQA;;;;;;;cAQA;;;;;;;cAQA"}