@ansh-ui/core 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/LICENSE +21 -0
  2. package/dist/behaviours.cjs +64 -0
  3. package/dist/behaviours.cjs.map +1 -0
  4. package/dist/behaviours.d.cts +3 -0
  5. package/dist/behaviours.d.ts +3 -0
  6. package/dist/behaviours.js +7 -0
  7. package/dist/behaviours.js.map +1 -0
  8. package/dist/chunk-23GSSIMK.cjs +439 -0
  9. package/dist/chunk-23GSSIMK.cjs.map +1 -0
  10. package/dist/chunk-56NNBIAO.js +2446 -0
  11. package/dist/chunk-56NNBIAO.js.map +1 -0
  12. package/dist/chunk-6PFYGJWD.cjs +136 -0
  13. package/dist/chunk-6PFYGJWD.cjs.map +1 -0
  14. package/dist/chunk-7MEIXWPH.js +313 -0
  15. package/dist/chunk-7MEIXWPH.js.map +1 -0
  16. package/dist/chunk-7MYTSAPR.js +83 -0
  17. package/dist/chunk-7MYTSAPR.js.map +1 -0
  18. package/dist/chunk-BOQQHICI.js +1036 -0
  19. package/dist/chunk-BOQQHICI.js.map +1 -0
  20. package/dist/chunk-C6XPQO2O.js +1170 -0
  21. package/dist/chunk-C6XPQO2O.js.map +1 -0
  22. package/dist/chunk-DXJ63QAR.cjs +723 -0
  23. package/dist/chunk-DXJ63QAR.cjs.map +1 -0
  24. package/dist/chunk-FAVIEION.js +705 -0
  25. package/dist/chunk-FAVIEION.js.map +1 -0
  26. package/dist/chunk-FNR35HTL.cjs +107 -0
  27. package/dist/chunk-FNR35HTL.cjs.map +1 -0
  28. package/dist/chunk-GHBRGMSO.cjs +91 -0
  29. package/dist/chunk-GHBRGMSO.cjs.map +1 -0
  30. package/dist/chunk-GJRIHN76.cjs +359 -0
  31. package/dist/chunk-GJRIHN76.cjs.map +1 -0
  32. package/dist/chunk-ILKUL7GD.cjs +115 -0
  33. package/dist/chunk-ILKUL7GD.cjs.map +1 -0
  34. package/dist/chunk-KTUBCQC3.js +409 -0
  35. package/dist/chunk-KTUBCQC3.js.map +1 -0
  36. package/dist/chunk-KU2C6GEA.js +90 -0
  37. package/dist/chunk-KU2C6GEA.js.map +1 -0
  38. package/dist/chunk-LGA3N3YJ.cjs +413 -0
  39. package/dist/chunk-LGA3N3YJ.cjs.map +1 -0
  40. package/dist/chunk-MMO7KO53.cjs +1060 -0
  41. package/dist/chunk-MMO7KO53.cjs.map +1 -0
  42. package/dist/chunk-NSXKCJJ7.js +109 -0
  43. package/dist/chunk-NSXKCJJ7.js.map +1 -0
  44. package/dist/chunk-QALZKHWH.js +387 -0
  45. package/dist/chunk-QALZKHWH.js.map +1 -0
  46. package/dist/chunk-R7UJ7MWP.cjs +2479 -0
  47. package/dist/chunk-R7UJ7MWP.cjs.map +1 -0
  48. package/dist/chunk-UJBXY6QC.cjs +1186 -0
  49. package/dist/chunk-UJBXY6QC.cjs.map +1 -0
  50. package/dist/chunk-YFQXRC5R.js +99 -0
  51. package/dist/chunk-YFQXRC5R.js.map +1 -0
  52. package/dist/color.cjs +257 -0
  53. package/dist/color.cjs.map +1 -0
  54. package/dist/color.d.cts +303 -0
  55. package/dist/color.d.ts +303 -0
  56. package/dist/color.js +8 -0
  57. package/dist/color.js.map +1 -0
  58. package/dist/easing.cjs +189 -0
  59. package/dist/easing.cjs.map +1 -0
  60. package/dist/easing.d.cts +134 -0
  61. package/dist/easing.d.ts +134 -0
  62. package/dist/easing.js +4 -0
  63. package/dist/easing.js.map +1 -0
  64. package/dist/effects.cjs +99 -0
  65. package/dist/effects.cjs.map +1 -0
  66. package/dist/effects.d.cts +5 -0
  67. package/dist/effects.d.ts +5 -0
  68. package/dist/effects.js +10 -0
  69. package/dist/effects.js.map +1 -0
  70. package/dist/index-CCdpefMp.d.ts +967 -0
  71. package/dist/index-CQEEPu-D.d.ts +435 -0
  72. package/dist/index-DHOfsEIn.d.cts +967 -0
  73. package/dist/index-Dl8GCsya.d.cts +435 -0
  74. package/dist/index.cjs +2206 -0
  75. package/dist/index.cjs.map +1 -0
  76. package/dist/index.d.cts +1122 -0
  77. package/dist/index.d.ts +1122 -0
  78. package/dist/index.js +1182 -0
  79. package/dist/index.js.map +1 -0
  80. package/dist/math.cjs +238 -0
  81. package/dist/math.cjs.map +1 -0
  82. package/dist/math.d.cts +120 -0
  83. package/dist/math.d.ts +120 -0
  84. package/dist/math.js +5 -0
  85. package/dist/math.js.map +1 -0
  86. package/dist/noise.cjs +78 -0
  87. package/dist/noise.cjs.map +1 -0
  88. package/dist/noise.d.cts +190 -0
  89. package/dist/noise.d.ts +190 -0
  90. package/dist/noise.js +5 -0
  91. package/dist/noise.js.map +1 -0
  92. package/dist/palette-6HkVltYU.d.cts +219 -0
  93. package/dist/palette-6HkVltYU.d.ts +219 -0
  94. package/dist/random--4mSc5Lp.d.cts +75 -0
  95. package/dist/random--4mSc5Lp.d.ts +75 -0
  96. package/dist/reduced-motion-D0LUgZle.d.cts +120 -0
  97. package/dist/reduced-motion-D0LUgZle.d.ts +120 -0
  98. package/dist/types-B1FLLf3-.d.cts +21 -0
  99. package/dist/types-B1FLLf3-.d.ts +21 -0
  100. package/package.json +78 -0
@@ -0,0 +1,134 @@
1
+ import { a as EasingFn, E as EasingInput } from './types-B1FLLf3-.js';
2
+ export { b as EasingName } from './types-B1FLLf3-.js';
3
+
4
+ /**
5
+ * Build an easing function from four cubic-bézier control coordinates.
6
+ *
7
+ * @param x1 First control point's x, clamped to `[0,1]` (as CSS requires — an x outside
8
+ * that range makes the curve non-monotonic in time and thus not a valid timing
9
+ * function). y values are unconstrained, which is what allows overshoot curves
10
+ * like `easeOutBack`.
11
+ */
12
+ declare function cubicBezier(x1: number, y1: number, x2: number, y2: number): EasingFn;
13
+ /**
14
+ * A stepped (staircase) timing function, matching CSS `steps()`.
15
+ *
16
+ * @param count Number of discrete steps. Must be >= 1.
17
+ * @param position Where the jump happens within each step, matching the CSS keywords.
18
+ */
19
+ declare function steps(count: number, position?: 'start' | 'end' | 'both' | 'none'): EasingFn;
20
+
21
+ /**
22
+ * The built-in easing library.
23
+ *
24
+ * Curves follow the Penner definitions, which is what CSS, GSAP and Framer Motion all
25
+ * converged on — so `easeOutCubic` here is numerically identical to `easeOutCubic` there.
26
+ * Every function is exact at both endpoints.
27
+ */
28
+ /** Turn an "in" curve into its mirrored "out" counterpart. */
29
+ declare function reverseEasing(easeIn: EasingFn): EasingFn;
30
+ /** Compose an "in" curve into a symmetric "in-out" curve. */
31
+ declare function mirrorEasing(easeIn: EasingFn): EasingFn;
32
+ /** Raise progress to a power — the family behind quad/cubic/quart/quint. */
33
+ declare function power(exponent: number): EasingFn;
34
+ declare const easeInSine: EasingFn;
35
+ declare const easeOutSine: EasingFn;
36
+ declare const easeInOutSine: EasingFn;
37
+ declare const easeInQuad: EasingFn;
38
+ declare const easeOutQuad: EasingFn;
39
+ declare const easeInOutQuad: EasingFn;
40
+ declare const easeInCubic: EasingFn;
41
+ declare const easeOutCubic: EasingFn;
42
+ declare const easeInOutCubic: EasingFn;
43
+ declare const easeInQuart: EasingFn;
44
+ declare const easeOutQuart: EasingFn;
45
+ declare const easeInOutQuart: EasingFn;
46
+ declare const easeInQuint: EasingFn;
47
+ declare const easeOutQuint: EasingFn;
48
+ declare const easeInOutQuint: EasingFn;
49
+ declare const easeInExpo: EasingFn;
50
+ declare const easeOutExpo: EasingFn;
51
+ declare const easeInOutExpo: EasingFn;
52
+ declare const easeInCirc: EasingFn;
53
+ declare const easeOutCirc: EasingFn;
54
+ declare const easeInOutCirc: EasingFn;
55
+ declare const easeInBack: EasingFn;
56
+ declare const easeOutBack: EasingFn;
57
+ declare const easeInOutBack: EasingFn;
58
+ /**
59
+ * A brief pull-back before moving forward. Reads as "gathering intent".
60
+ *
61
+ * The second half is an exponential decay, which approaches 1 asymptotically and never reaches it —
62
+ * at `t = 1` the raw expression gives `1 - 2⁻¹¹`. The explicit endpoint keeps the curve exact, which
63
+ * the animation driver relies on to land values on their targets rather than a fraction short.
64
+ */
65
+ declare const anticipate: EasingFn;
66
+ declare const easeInElastic: EasingFn;
67
+ declare const easeOutElastic: EasingFn;
68
+ declare const easeInOutElastic: EasingFn;
69
+ declare const easeOutBounce: EasingFn;
70
+ declare const easeInBounce: EasingFn;
71
+ declare const easeInOutBounce: EasingFn;
72
+ declare const linear: EasingFn;
73
+ /**
74
+ * Named curve lookup.
75
+ *
76
+ * Kept as a mutable record so `registerEasing()` can extend it. Consumers should go through
77
+ * `resolveEasing()` rather than reading this directly.
78
+ */
79
+ declare const easings: Record<string, EasingFn>;
80
+ /**
81
+ * Signature curves used by the design system's motion hierarchy.
82
+ *
83
+ * These are the ones you should reach for by default. They are named for intent rather than
84
+ * for maths, because "what is this motion communicating" is the useful question at a call site.
85
+ */
86
+ declare const signature: {
87
+ /** Entrances. Fast out of the gate, long gentle settle. The Ansh house curve. */
88
+ emphasized: EasingFn;
89
+ /** UI state changes that should feel instant but not abrupt. */
90
+ standard: EasingFn;
91
+ /** Exits. Accelerates away — the element is leaving, don't linger on it. */
92
+ exit: EasingFn;
93
+ /** Entrances from off-screen. Decelerates in. */
94
+ enter: EasingFn;
95
+ /** A confident, slightly springy overshoot without full elastic wobble. */
96
+ overshoot: EasingFn;
97
+ /** Long, cinematic reveals — hero sections, scroll-driven scenes. */
98
+ cinematic: EasingFn;
99
+ };
100
+ /**
101
+ * Register a custom named curve, making it resolvable everywhere an easing is accepted.
102
+ *
103
+ * @throws if the name collides with a built-in, to prevent one plugin silently changing
104
+ * the meaning of `easeOutCubic` for the whole application.
105
+ */
106
+ declare function registerEasing(name: string, fn: EasingFn): void;
107
+ /** Remove a previously registered custom curve. Built-ins cannot be removed. */
108
+ declare function unregisterEasing(name: string): void;
109
+ /** Every currently resolvable easing name, built-in and custom. */
110
+ declare function listEasings(): string[];
111
+
112
+ /**
113
+ * Sample a curve into a lookup table.
114
+ *
115
+ * Useful for expensive curves evaluated per-particle per-frame, and for rendering easing
116
+ * previews in the docs site.
117
+ */
118
+ declare function sampleEasing(easing: EasingFn, resolution?: number): Float32Array;
119
+ /** Read a table produced by {@link sampleEasing}, interpolating between samples. */
120
+ declare function readEasingTable(table: Float32Array, t: number): number;
121
+
122
+ /**
123
+ * Normalise any accepted easing shape into a callable function.
124
+ *
125
+ * This is the single entry point every part of the engine uses, so authors can pass a name,
126
+ * a function, or bézier coordinates interchangeably and it always works the same way.
127
+ *
128
+ * An unknown *name* is a developer mistake worth surfacing loudly — silently falling back to
129
+ * linear would produce motion that looks subtly wrong with no explanation. We warn and fall
130
+ * back rather than throw, because a bad easing name should never take down a page in production.
131
+ */
132
+ declare function resolveEasing(input: EasingInput | undefined | null): EasingFn;
133
+
134
+ export { EasingFn, EasingInput, anticipate, cubicBezier, easeInBack, easeInBounce, easeInCirc, easeInCubic, easeInElastic, easeInExpo, easeInOutBack, easeInOutBounce, easeInOutCirc, easeInOutCubic, easeInOutElastic, easeInOutExpo, easeInOutQuad, easeInOutQuart, easeInOutQuint, easeInOutSine, easeInQuad, easeInQuart, easeInQuint, easeInSine, easeOutBack, easeOutBounce, easeOutCirc, easeOutCubic, easeOutElastic, easeOutExpo, easeOutQuad, easeOutQuart, easeOutQuint, easeOutSine, easings, linear, listEasings, mirrorEasing, power, readEasingTable, registerEasing, resolveEasing, reverseEasing, sampleEasing, signature, steps, unregisterEasing };
package/dist/easing.js ADDED
@@ -0,0 +1,4 @@
1
+ export { anticipate, cubicBezier, easeInBack, easeInBounce, easeInCirc, easeInCubic, easeInElastic, easeInExpo, easeInOutBack, easeInOutBounce, easeInOutCirc, easeInOutCubic, easeInOutElastic, easeInOutExpo, easeInOutQuad, easeInOutQuart, easeInOutQuint, easeInOutSine, easeInQuad, easeInQuart, easeInQuint, easeInSine, easeOutBack, easeOutBounce, easeOutCirc, easeOutCubic, easeOutElastic, easeOutExpo, easeOutQuad, easeOutQuart, easeOutQuint, easeOutSine, easings, linear, listEasings, mirrorEasing, power, readEasingTable, registerEasing, resolveEasing, reverseEasing, sampleEasing, signature, steps, unregisterEasing } from './chunk-7MEIXWPH.js';
2
+ import './chunk-KU2C6GEA.js';
3
+ //# sourceMappingURL=easing.js.map
4
+ //# sourceMappingURL=easing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"easing.js"}
@@ -0,0 +1,99 @@
1
+ 'use strict';
2
+
3
+ var chunkR7UJ7MWP_cjs = require('./chunk-R7UJ7MWP.cjs');
4
+ require('./chunk-23GSSIMK.cjs');
5
+ require('./chunk-DXJ63QAR.cjs');
6
+ require('./chunk-FNR35HTL.cjs');
7
+ require('./chunk-MMO7KO53.cjs');
8
+ require('./chunk-LGA3N3YJ.cjs');
9
+ require('./chunk-GJRIHN76.cjs');
10
+ require('./chunk-ILKUL7GD.cjs');
11
+
12
+
13
+
14
+ Object.defineProperty(exports, "ParticleBuffer", {
15
+ enumerable: true,
16
+ get: function () { return chunkR7UJ7MWP_cjs.ParticleBuffer; }
17
+ });
18
+ Object.defineProperty(exports, "SpatialGrid", {
19
+ enumerable: true,
20
+ get: function () { return chunkR7UJ7MWP_cjs.SpatialGrid; }
21
+ });
22
+ Object.defineProperty(exports, "ageAndCull", {
23
+ enumerable: true,
24
+ get: function () { return chunkR7UJ7MWP_cjs.ageAndCull; }
25
+ });
26
+ Object.defineProperty(exports, "animatedGradient", {
27
+ enumerable: true,
28
+ get: function () { return chunkR7UJ7MWP_cjs.animatedGradient; }
29
+ });
30
+ Object.defineProperty(exports, "aurora", {
31
+ enumerable: true,
32
+ get: function () { return chunkR7UJ7MWP_cjs.aurora; }
33
+ });
34
+ Object.defineProperty(exports, "blob", {
35
+ enumerable: true,
36
+ get: function () { return chunkR7UJ7MWP_cjs.blob; }
37
+ });
38
+ Object.defineProperty(exports, "constellation", {
39
+ enumerable: true,
40
+ get: function () { return chunkR7UJ7MWP_cjs.constellation; }
41
+ });
42
+ Object.defineProperty(exports, "defineEffect", {
43
+ enumerable: true,
44
+ get: function () { return chunkR7UJ7MWP_cjs.defineEffect; }
45
+ });
46
+ Object.defineProperty(exports, "effects", {
47
+ enumerable: true,
48
+ get: function () { return chunkR7UJ7MWP_cjs.effects; }
49
+ });
50
+ Object.defineProperty(exports, "fireflies", {
51
+ enumerable: true,
52
+ get: function () { return chunkR7UJ7MWP_cjs.fireflies; }
53
+ });
54
+ Object.defineProperty(exports, "integrate", {
55
+ enumerable: true,
56
+ get: function () { return chunkR7UJ7MWP_cjs.integrate; }
57
+ });
58
+ Object.defineProperty(exports, "meshGradient", {
59
+ enumerable: true,
60
+ get: function () { return chunkR7UJ7MWP_cjs.meshGradient; }
61
+ });
62
+ Object.defineProperty(exports, "meteors", {
63
+ enumerable: true,
64
+ get: function () { return chunkR7UJ7MWP_cjs.meteors; }
65
+ });
66
+ Object.defineProperty(exports, "mountEffect", {
67
+ enumerable: true,
68
+ get: function () { return chunkR7UJ7MWP_cjs.mountEffect; }
69
+ });
70
+ Object.defineProperty(exports, "noiseLayer", {
71
+ enumerable: true,
72
+ get: function () { return chunkR7UJ7MWP_cjs.noiseLayer; }
73
+ });
74
+ Object.defineProperty(exports, "particleField", {
75
+ enumerable: true,
76
+ get: function () { return chunkR7UJ7MWP_cjs.particleField; }
77
+ });
78
+ Object.defineProperty(exports, "rain", {
79
+ enumerable: true,
80
+ get: function () { return chunkR7UJ7MWP_cjs.rain; }
81
+ });
82
+ Object.defineProperty(exports, "snow", {
83
+ enumerable: true,
84
+ get: function () { return chunkR7UJ7MWP_cjs.snow; }
85
+ });
86
+ Object.defineProperty(exports, "spotlight", {
87
+ enumerable: true,
88
+ get: function () { return chunkR7UJ7MWP_cjs.spotlight; }
89
+ });
90
+ Object.defineProperty(exports, "waves", {
91
+ enumerable: true,
92
+ get: function () { return chunkR7UJ7MWP_cjs.waves; }
93
+ });
94
+ Object.defineProperty(exports, "wrapBounds", {
95
+ enumerable: true,
96
+ get: function () { return chunkR7UJ7MWP_cjs.wrapBounds; }
97
+ });
98
+ //# sourceMappingURL=effects.cjs.map
99
+ //# sourceMappingURL=effects.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"effects.cjs"}
@@ -0,0 +1,5 @@
1
+ export { A as AnimatedGradientOptions, a as AuroraOptions, B as BaseEffectOptions, c as BlobOptions, C as ConstellationOptions, E as EffectContext, d as EffectDefinition, e as EffectFrame, f as EffectHandle, g as EffectInstance, h as EffectName, F as FirefliesOptions, M as MeshGradientOptions, i as MeteorsOptions, N as NoiseLayerOptions, P as ParticleBuffer, j as ParticleFieldOptions, R as RainOptions, n as SnowOptions, o as SpatialGrid, p as SpotlightOptions, W as WavesOptions, s as ageAndCull, t as animatedGradient, u as aurora, v as blob, w as constellation, y as defineEffect, H as effects, I as fireflies, J as integrate, K as meshGradient, L as meteors, O as mountEffect, Q as noiseLayer, T as particleField, V as rain, Y as snow, Z as spotlight, a5 as waves, a6 as wrapBounds } from './index-DHOfsEIn.cjs';
2
+ import './reduced-motion-D0LUgZle.cjs';
3
+ import './random--4mSc5Lp.cjs';
4
+ import './noise.cjs';
5
+ import './palette-6HkVltYU.cjs';
@@ -0,0 +1,5 @@
1
+ export { A as AnimatedGradientOptions, a as AuroraOptions, B as BaseEffectOptions, c as BlobOptions, C as ConstellationOptions, E as EffectContext, d as EffectDefinition, e as EffectFrame, f as EffectHandle, g as EffectInstance, h as EffectName, F as FirefliesOptions, M as MeshGradientOptions, i as MeteorsOptions, N as NoiseLayerOptions, P as ParticleBuffer, j as ParticleFieldOptions, R as RainOptions, n as SnowOptions, o as SpatialGrid, p as SpotlightOptions, W as WavesOptions, s as ageAndCull, t as animatedGradient, u as aurora, v as blob, w as constellation, y as defineEffect, H as effects, I as fireflies, J as integrate, K as meshGradient, L as meteors, O as mountEffect, Q as noiseLayer, T as particleField, V as rain, Y as snow, Z as spotlight, a5 as waves, a6 as wrapBounds } from './index-CCdpefMp.js';
2
+ import './reduced-motion-D0LUgZle.js';
3
+ import './random--4mSc5Lp.js';
4
+ import './noise.js';
5
+ import './palette-6HkVltYU.js';
@@ -0,0 +1,10 @@
1
+ export { ParticleBuffer, SpatialGrid, ageAndCull, animatedGradient, aurora, blob, constellation, defineEffect, effects, fireflies, integrate, meshGradient, meteors, mountEffect, noiseLayer, particleField, rain, snow, spotlight, waves, wrapBounds } from './chunk-56NNBIAO.js';
2
+ import './chunk-KTUBCQC3.js';
3
+ import './chunk-FAVIEION.js';
4
+ import './chunk-YFQXRC5R.js';
5
+ import './chunk-BOQQHICI.js';
6
+ import './chunk-QALZKHWH.js';
7
+ import './chunk-7MEIXWPH.js';
8
+ import './chunk-KU2C6GEA.js';
9
+ //# sourceMappingURL=effects.js.map
10
+ //# sourceMappingURL=effects.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"effects.js"}